Ghostly Robes now also prevent NPC aggro when the full set is worn

This is shared with the Protect from Summoning prayer. In addition, the effect was improved so a hidden player cannot shield another player from aggro by standing between them and the NPC
Fixed missing animations and sounds for the Shadow Sword
This commit is contained in:
randy 2025-08-15 11:03:21 -06:00
parent a9065d763b
commit 6e91725d58
3 changed files with 24 additions and 5 deletions

View file

@ -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"
},
{

View file

@ -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.

View file

@ -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;
}