diff --git a/Server/src/main/content/global/skill/magic/modern/TeleblockSpell.java b/Server/src/main/content/global/skill/magic/modern/TeleblockSpell.java index ab04f23a9dac7a2475b3095f619a4180bc7a5b5d..33087f6681826d6d0d670db25534fd97eee34553 100644 --- a/Server/src/main/content/global/skill/magic/modern/TeleblockSpell.java +++ b/Server/src/main/content/global/skill/magic/modern/TeleblockSpell.java @@ -91,7 +91,7 @@ public final class TeleblockSpell extends CombatSpell { entity.asPlayer().sendMessage("You and your opponent must both be in the wilderness for you to use this spell."); return false; } - if (((Player) target).isTeleBlocked()) { + if (hasTimerActive(target.asPlayer(), "teleblock")) { entity.asPlayer().sendMessage("That player is already affected by this spell."); return false; } @@ -113,13 +113,13 @@ public final class TeleblockSpell extends CombatSpell { @Override public void fireEffect(Entity entity, Entity victim, BattleState state) { - if(!victim.isTeleBlocked() && victim instanceof Player && state.getStyle().getSwingHandler().isAccurateImpact(entity, victim)){ + if(!hasTimerActive(victim, "teleblock") && victim instanceof Player && state.getStyle().getSwingHandler().isAccurateImpact(entity, victim)){ int ticks = 500; if(((Player) victim).getPrayer().get(PrayerType.PROTECT_FROM_MAGIC)){ ticks /= 2; } - registerTimer(victim, spawnTimer("teleblock", ticks)); - } else if(victim.isTeleBlocked()){ + registerTimer(victim, spawnTimer("teleblock", ticks)); + } else if(hasTimerActive(victim, "teleblock")){ entity.asPlayer().sendMessage("Your target is already blocked from teleporting."); } }