diff --git a/Server/data/configs/item_configs.json b/Server/data/configs/item_configs.json index 982b254a1..3c29faaa8 100644 --- a/Server/data/configs/item_configs.json +++ b/Server/data/configs/item_configs.json @@ -93782,6 +93782,9 @@ "archery_ticket_price": "0", "id": "10858", "stand_turn_anim": "7040", + "defence_anim": "7050", + "attack_anims": "7041,7041,7048,7049", + "attack_audios": "2503,0,2504,0", "bonuses": "-4,27,21,4,0,0,0,0,4,-1,0,26,0,0,0" }, { diff --git a/Server/src/main/core/game/node/entity/npc/agg/AggressiveBehavior.java b/Server/src/main/core/game/node/entity/npc/agg/AggressiveBehavior.java index 50f93be3f..ae740b8f4 100644 --- a/Server/src/main/core/game/node/entity/npc/agg/AggressiveBehavior.java +++ b/Server/src/main/core/game/node/entity/npc/agg/AggressiveBehavior.java @@ -10,6 +10,9 @@ import core.game.world.map.RegionManager; import java.util.ArrayList; import java.util.List; +import core.game.node.entity.player.link.prayer.PrayerType; +import static core.api.ContentAPIKt.allInEquipment; + /** * Handles an NPC's aggressive behaviour. * @author Emperor @@ -41,6 +44,9 @@ public class AggressiveBehavior { return false; } if (target instanceof Player) { + if (ignorePlayer((Player) target)) { + return false; + } return ((Player) target).getSkullManager().isWilderness(); } return true; @@ -70,6 +76,9 @@ public class AggressiveBehavior { return false; } if (entity instanceof NPC && target instanceof Player) { + if (ignorePlayer((Player) target)) { + return false; + } NPC npc = (NPC) entity; if (npc.getAggressiveHandler() != null && npc.getAggressiveHandler().isAllowTolerance() && !WildernessZone.isInZone(npc)) { if (RegionManager.forId(regionId).isTolerated(target.asPlayer())) { @@ -88,6 +97,18 @@ public class AggressiveBehavior { return false; } + //Snowscape: allow players to hide from aggressive mobs with the protect from summoning prayer, or full ghostly robe set + public boolean ignorePlayer(Player player) { + if (player.getPrayer().get(PrayerType.PROTECT_FROM_SUMMONING)) { + return true; + } + //Check if player is wearing full ghostly robe set + if (allInEquipment(player, 6106, 6107, 6108, 6109, 6110, 6111)) { + return true; + } + return false; + } + /** * Gets the priority flag. * @param target The target. diff --git a/Server/src/main/core/game/node/entity/npc/agg/AggressiveHandler.java b/Server/src/main/core/game/node/entity/npc/agg/AggressiveHandler.java index 5ee281bb4..c2a49842d 100644 --- a/Server/src/main/core/game/node/entity/npc/agg/AggressiveHandler.java +++ b/Server/src/main/core/game/node/entity/npc/agg/AggressiveHandler.java @@ -9,8 +9,6 @@ import core.game.node.entity.player.info.Rights; import core.game.world.GameWorld; import core.tools.RandomFunction; -import core.game.node.entity.player.link.prayer.PrayerType; - /** * Used to handle entity aggressiveness. * @author Emperor @@ -83,9 +81,6 @@ public final class AggressiveHandler { } Entity target = behavior.getLogicalTarget(entity, behavior.getPossibleTargets(entity, radius)); if (target instanceof Player) { - if (((Player) target).getPrayer().get(PrayerType.PROTECT_FROM_SUMMONING)) { - return false; - } if (target.getAttribute("ignore_aggression", false)) { return false; }