|
|
@ -278,12 +278,17 @@ public class MobAI { |
|
|
|
if (mob.lastPatrolPointIndex > mob.patrolPoints.size() - 1) |
|
|
|
if (mob.lastPatrolPointIndex > mob.patrolPoints.size() - 1) |
|
|
|
mob.lastPatrolPointIndex = 0; |
|
|
|
mob.lastPatrolPointIndex = 0; |
|
|
|
|
|
|
|
|
|
|
|
mob.destination = mob.patrolPoints.get(mob.lastPatrolPointIndex); |
|
|
|
// Minions are given marching orders by the captain if he is alive
|
|
|
|
|
|
|
|
|
|
|
|
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION)) |
|
|
|
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION) && mob.guardCaptain.isAlive()) { |
|
|
|
mob.destination = mob.destination.add(Formation.getOffset(2, mob.minions.indexOf(mob.getObjectUUID()) + 3)); |
|
|
|
Mob captain = (Mob) mob.guardCaptain; |
|
|
|
|
|
|
|
mob.destination = captain.destination.add(Formation.getOffset(2, mob.guardCaptain.minions.indexOf(mob.getObjectUUID()) + 3)); |
|
|
|
mob.lastPatrolPointIndex += 1; |
|
|
|
; |
|
|
|
|
|
|
|
mob.lastPatrolPointIndex = captain.lastPatrolPointIndex; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
mob.destination = mob.patrolPoints.get(mob.lastPatrolPointIndex); |
|
|
|
|
|
|
|
mob.lastPatrolPointIndex += 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
MovementUtilities.aiMove(mob, mob.destination, true); |
|
|
|
MovementUtilities.aiMove(mob, mob.destination, true); |
|
|
|
|
|
|
|
|
|
|
@ -731,9 +736,8 @@ public class MobAI { |
|
|
|
if (mob.getCombatTarget() == null) { |
|
|
|
if (mob.getCombatTarget() == null) { |
|
|
|
if (!mob.isMoving()) |
|
|
|
if (!mob.isMoving()) |
|
|
|
Patrol(mob); |
|
|
|
Patrol(mob); |
|
|
|
else { |
|
|
|
else |
|
|
|
mob.stopPatrolTime = System.currentTimeMillis(); |
|
|
|
mob.stopPatrolTime = System.currentTimeMillis(); |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
chaseTarget(mob); |
|
|
|
chaseTarget(mob); |
|
|
|
} |
|
|
|
} |
|
|
|