Fixed revenant level check

Fixed ice smash
This commit is contained in:
dam
2026-04-04 16:03:36 +03:00
committed by Ryan
parent d1af9c212e
commit 082017b260
2 changed files with 10 additions and 8 deletions
@@ -114,9 +114,7 @@ open class NPCBehavior(vararg val ids: Int = intArrayOf()) : ContentInterface {
* @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
return !(attacker is Player && !self.definition.hasAction("attack") && !self.definition.hasAction("smash-ice"))
}
/**
@@ -770,11 +770,15 @@ 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)) {
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;
if (p.getSkullManager().isWilderness() && skullManager.isWilderness()) {