Protect from Summoning prayer now prevents NPC aggression when active

This commit is contained in:
randy 2024-11-10 22:36:00 -07:00
parent fa808accd4
commit e5e6006212

View file

@ -9,6 +9,8 @@ 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
@ -81,6 +83,9 @@ 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;
}