Merge branch 'bolts' into 'master'

Fix broad bolts on turroths and kurasks

See merge request 2009scape/2009scape!264
This commit is contained in:
Ceikry
2021-09-22 21:09:53 +00:00
3 changed files with 24 additions and 6 deletions
@@ -6,6 +6,8 @@ import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.SpellBookManager.SpellBook;
import core.game.world.map.Location;
import core.plugin.Initializable;
import org.rs09.consts.Items;
import rs09.game.node.entity.skill.slayer.SlayerUtils;
/**
* Handles the kurask npc.
@@ -41,9 +43,7 @@ public final class KuraskNPC extends AbstractNPC {
boolean effective = false;
if (state.getAttacker() instanceof Player) {
final Player player = (Player) state.getAttacker();
if ((state.getWeapon() != null && state.getWeapon().getId() == 4158) || (state.getAmmunition() != null && state.getAmmunition().getItemId() == 4160) || (state.getWeapon() != null && state.getWeapon().getId() == 13290) || (state.getSpell() != null && state.getSpell().getSpellId() == 31 && player.getSpellBookManager().getSpellBook() == SpellBook.MODERN.getInterfaceId()) || (state.getAmmunition() != null && state.getAmmunition().getItemId() == 881)) {
effective = true;
}
effective = new SlayerUtils(player).hasBroadWeaponEquipped(state);
}
if (!effective) {
state.setEstimatedHit(0);
@@ -6,6 +6,8 @@ import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.SpellBookManager.SpellBook;
import core.game.world.map.Location;
import core.plugin.Initializable;
import org.rs09.consts.Items;
import rs09.game.node.entity.skill.slayer.SlayerUtils;
/**
* Handles the turoth npc.
@@ -41,9 +43,7 @@ public final class TurothNPC extends AbstractNPC {
boolean effective = false;
if (state.getAttacker() instanceof Player) {
final Player player = (Player) state.getAttacker();
if ((state.getWeapon() != null && state.getWeapon().getId() == 4158) || (state.getAmmunition() != null && state.getAmmunition().getItemId() == 4160) || (state.getWeapon() != null && state.getWeapon().getId() == 13290) || (state.getSpell() != null && state.getSpell().getSpellId() == 31 && player.getSpellBookManager().getSpellBook() == SpellBook.MODERN.getInterfaceId())) {
effective = true;
}
effective = new SlayerUtils(player).hasBroadWeaponEquipped(state);
}
if (!effective) {
state.setEstimatedHit(0);