Browse Source

guards hate value change target

master
FatBoy-DOTC 1 year ago
parent
commit
6e255d9c75
  1. 2
      src/engine/devcmd/cmds/aiInfoCmd.java
  2. 8
      src/engine/mobileAI/MobAI.java

2
src/engine/devcmd/cmds/aiInfoCmd.java

@ -77,7 +77,7 @@ public class aiInfoCmd extends AbstractDevCmd {
output += "Players Loaded:" + newline; output += "Players Loaded:" + newline;
} }
for (Map.Entry<Integer, Boolean> entry : mob.playerAgroMap.entrySet()) { for (Map.Entry<Integer, Boolean> 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) if (mob.getCombatTarget() != null)
output += "Current Target: " + mob.getCombatTarget().getName() + newline; output += "Current Target: " + mob.getCombatTarget().getName() + newline;

8
src/engine/mobileAI/MobAI.java

@ -1073,7 +1073,13 @@ public class MobAI {
try { try {
if (!mob.npcOwner.isAlive() && mob.getCombatTarget() == null) { 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 { }else {
if (mob.npcOwner.getCombatTarget() != null) if (mob.npcOwner.getCombatTarget() != null)
mob.setCombatTarget(mob.npcOwner.getCombatTarget()); mob.setCombatTarget(mob.npcOwner.getCombatTarget());

Loading…
Cancel
Save