Fixed enchanted bolts not working against monsters that cannot be slayer tasks

This commit is contained in:
Sam Marder
2026-05-30 13:44:43 +00:00
committed by Ryan
parent 5d37bb20b0
commit 40a495fcdc
@@ -239,7 +239,7 @@ public enum BoltEffect {
// and should be considered a TODO: temporary abuse prevention measure (bolt effect on slayer monsters) // and should be considered a TODO: temporary abuse prevention measure (bolt effect on slayer monsters)
boolean rollSuccess = RandomFunction.random(13) == 5; boolean rollSuccess = RandomFunction.random(13) == 5;
if (!(state.getVictim() instanceof NPC)) return rollSuccess; if (!(state.getVictim() instanceof NPC)) return rollSuccess;
if (!(state.getAttacker() instanceof Player) && ((NPC) state.getVictim()).getTask() == null) return rollSuccess; if (!(state.getAttacker() instanceof Player) || ((NPC) state.getVictim()).getTask() == null) return rollSuccess;
if (state.getVictim().asNpc().getTask().levelReq > state.getAttacker().asPlayer().getSkills().getLevel(Skills.SLAYER)) return false; if (state.getVictim().asNpc().getTask().levelReq > state.getAttacker().asPlayer().getSkills().getLevel(Skills.SLAYER)) return false;
return rollSuccess; return rollSuccess;
} }