diff --git a/Server/src/main/core/game/node/entity/npc/NPCBehavior.kt b/Server/src/main/core/game/node/entity/npc/NPCBehavior.kt index 55f9b99e6..e4fa6676b 100644 --- a/Server/src/main/core/game/node/entity/npc/NPCBehavior.kt +++ b/Server/src/main/core/game/node/entity/npc/NPCBehavior.kt @@ -113,10 +113,8 @@ open class NPCBehavior(vararg val ids: Int = intArrayOf()) : ContentInterface { * @param shouldSendMessage whether the core combat code believes you should send a message e.g. "You can't attack this NPC with that weapon" * @return whether the attacker should be able to attack this NPC. */ - open fun canBeAttackedBy(self: NPC, attacker: Entity, style: CombatStyle, shouldSendMessage: Boolean) : Boolean { - if (attacker is Player && !self.definition.hasAction("attack")) - return false - return true + open fun canBeAttackedBy(self: NPC, attacker: Entity, style: CombatStyle, shouldSendMessage: Boolean): Boolean { + return !(attacker is Player && !self.definition.hasAction("attack") && !self.definition.hasAction("smash-ice")) } /** diff --git a/Server/src/main/core/game/node/entity/player/Player.java b/Server/src/main/core/game/node/entity/player/Player.java index 6b7bca07c..a322a358b 100644 --- a/Server/src/main/core/game/node/entity/player/Player.java +++ b/Server/src/main/core/game/node/entity/player/Player.java @@ -770,10 +770,14 @@ public class Player extends Entity { @Override public boolean continueAttack(Entity target, CombatStyle style, boolean message) { - if (target instanceof NPC - && !((NPC) target).getDefinition().hasAction("attack") - && !((NPC) target).isIgnoreAttackRestrictions(this)) { - return false; + if (target instanceof NPC) { + NPC npc = (NPC) target; + NPC shown = npc.getShownNPC(this); + boolean canAttack = shown.getDefinition().hasAction("attack") + || shown.getDefinition().hasAction("smash-ice"); + if (!canAttack && !npc.isIgnoreAttackRestrictions(this)) { + return false; + } } if (target instanceof Player) { Player p = (Player) target;