Browse Source

Miniond patrol on own if captain is dead.

feature-workorder
MagicBot 1 year ago
parent
commit
beb3c15eb3
  1. 19
      src/engine/mobileAI/MobAI.java

19
src/engine/mobileAI/MobAI.java

@ -713,13 +713,13 @@ public class MobAI {
if (mob.guardCaptain == null) if (mob.guardCaptain == null)
return; return;
if (!mob.playerAgroMap.containsKey(mob.guardCaptain.getObjectUUID())) { //mob no longer has its owner loaded, translate pet to owner
//mob no longer has its owner loaded, translocate pet to owner
if (!mob.playerAgroMap.containsKey(mob.guardCaptain.getObjectUUID())) {
MovementManager.translocate(mob, mob.guardCaptain.getLoc(), null); MovementManager.translocate(mob, mob.guardCaptain.getLoc(), null);
return; return;
} }
if (mob.getCombatTarget() == null) { if (mob.getCombatTarget() == null) {
//move back to owner //move back to owner
@ -734,9 +734,16 @@ public class MobAI {
break; break;
default: default:
if (mob.getCombatTarget() == null) { if (mob.getCombatTarget() == null) {
if (!mob.isMoving())
Patrol(mob); if (!mob.isMoving()) {
else
// Minions only patrol on their own if captain is dead.
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION) == false)
Patrol(mob);
else if (mob.guardCaptain.isAlive() == false)
Patrol(mob);
} else
mob.stopPatrolTime = System.currentTimeMillis(); mob.stopPatrolTime = System.currentTimeMillis();
} else { } else {
chaseTarget(mob); chaseTarget(mob);

Loading…
Cancel
Save