diff --git a/src/engine/devcmd/cmds/aiInfoCmd.java b/src/engine/devcmd/cmds/aiInfoCmd.java index 1caf90c9..e31060bb 100644 --- a/src/engine/devcmd/cmds/aiInfoCmd.java +++ b/src/engine/devcmd/cmds/aiInfoCmd.java @@ -77,7 +77,7 @@ public class aiInfoCmd extends AbstractDevCmd { output += "Players Loaded:" + newline; } for (Map.Entry entry : mob.playerAgroMap.entrySet()) { - output += "Player ID: " + entry.getKey() + " Hate Value: " + ((PlayerCharacter) mob.getCombatTarget()).getHateValue() + newline; + output += "Player ID: " + entry.getKey() + " Hate Value: " + (PlayerCharacter.getPlayerCharacter(entry.getKey())).getHateValue() + newline; } if (mob.getCombatTarget() != null) output += "Current Target: " + mob.getCombatTarget().getName() + newline; diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 76c143d1..6be7f853 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -1073,7 +1073,13 @@ public class MobAI { try { if (!mob.npcOwner.isAlive() && mob.getCombatTarget() == null) { - CheckForPlayerGuardAggro(mob); + if(mob.getCombatTarget() == null) { + CheckForPlayerGuardAggro(mob); + }else { + AbstractWorldObject newTarget = ChangeTargetFromHateValue(mob); + if (newTarget != null) + mob.setCombatTarget(newTarget); + } }else { if (mob.npcOwner.getCombatTarget() != null) mob.setCombatTarget(mob.npcOwner.getCombatTarget());