|
|
@ -199,7 +199,7 @@ public class MobileFSM { |
|
|
|
mob.destination = mob.patrolPoints.get(mob.lastPatrolPointIndex); |
|
|
|
mob.destination = mob.patrolPoints.get(mob.lastPatrolPointIndex); |
|
|
|
MovementUtilities.aiMove(mob, mob.destination, true); |
|
|
|
MovementUtilities.aiMove(mob, mob.destination, true); |
|
|
|
mob.lastPatrolPointIndex += 1; |
|
|
|
mob.lastPatrolPointIndex += 1; |
|
|
|
if (mob.isPlayerGuard()) { |
|
|
|
if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardCaptain.ordinal()) { |
|
|
|
for (Entry<Mob, Integer> minion : mob.siegeMinionMap.entrySet()) { |
|
|
|
for (Entry<Mob, Integer> minion : mob.siegeMinionMap.entrySet()) { |
|
|
|
//make sure mob is out of combat stance
|
|
|
|
//make sure mob is out of combat stance
|
|
|
|
if (minion.getKey().isCombat() && minion.getKey().getCombatTarget() == null) { |
|
|
|
if (minion.getKey().isCombat() && minion.getKey().getCombatTarget() == null) { |
|
|
@ -320,6 +320,12 @@ public class MobileFSM { |
|
|
|
if (mob.playerAgroMap.isEmpty()) |
|
|
|
if (mob.playerAgroMap.isEmpty()) |
|
|
|
//no players loaded, no need to proceed
|
|
|
|
//no players loaded, no need to proceed
|
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
if (mob.isCombat() && mob.getCombatTarget() == null) { |
|
|
|
|
|
|
|
mob.setCombat(false); |
|
|
|
|
|
|
|
UpdateStateMsg rwss = new UpdateStateMsg(); |
|
|
|
|
|
|
|
rwss.setPlayer(mob); |
|
|
|
|
|
|
|
DispatchMessage.sendToAllInRange(mob, rwss); |
|
|
|
|
|
|
|
} |
|
|
|
CheckToSendMobHome(mob); |
|
|
|
CheckToSendMobHome(mob); |
|
|
|
mob.updateLocation(); |
|
|
|
mob.updateLocation(); |
|
|
|
switch (mob.BehaviourType) { |
|
|
|
switch (mob.BehaviourType) { |
|
|
@ -378,6 +384,8 @@ public class MobileFSM { |
|
|
|
return; |
|
|
|
return; |
|
|
|
mob.updateLocation(); |
|
|
|
mob.updateLocation(); |
|
|
|
if (mob.BehaviourType != Enum.MobBehaviourType.Pet1) { |
|
|
|
if (mob.BehaviourType != Enum.MobBehaviourType.Pet1) { |
|
|
|
|
|
|
|
if(mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal() && ((Mob)mob.npcOwner).despawned == true) |
|
|
|
|
|
|
|
return; |
|
|
|
if (mob.getCombatTarget() == null) |
|
|
|
if (mob.getCombatTarget() == null) |
|
|
|
Patrol(mob); |
|
|
|
Patrol(mob); |
|
|
|
else |
|
|
|
else |
|
|
@ -505,11 +513,6 @@ public class MobileFSM { |
|
|
|
CheckForAttack(mob); |
|
|
|
CheckForAttack(mob); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void GuardMinionLogic(Mob mob) { |
|
|
|
public static void GuardMinionLogic(Mob mob) { |
|
|
|
if (mob.despawned || !mob.isAlive()) { |
|
|
|
|
|
|
|
if (System.currentTimeMillis() > mob.deathTime + (mob.spawnTime * 1000)) |
|
|
|
|
|
|
|
mob.respawn(); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!mob.npcOwner.isAlive() && mob.getCombatTarget() == null) { |
|
|
|
if (!mob.npcOwner.isAlive() && mob.getCombatTarget() == null) { |
|
|
|
CheckForPlayerGuardAggro(mob); |
|
|
|
CheckForPlayerGuardAggro(mob); |
|
|
|
return; |
|
|
|
return; |
|
|
|