|
|
@ -299,31 +299,18 @@ public class MobileFSM { |
|
|
|
public static void DetermineAction(Mob mob) { |
|
|
|
public static void DetermineAction(Mob mob) { |
|
|
|
if (mob == null) |
|
|
|
if (mob == null) |
|
|
|
return; |
|
|
|
return; |
|
|
|
if (mob.despawned && mob.getMobBase().getLoadID() == 13171) { |
|
|
|
if(mob.despawned || !mob.isAlive()) { |
|
|
|
//trebuchet spawn handler
|
|
|
|
if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()) { |
|
|
|
CheckForRespawn(mob); |
|
|
|
if (mob.npcOwner.isAlive() == false || ((Mob) mob.npcOwner).despawned == true) { |
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (mob.despawned && mob.isPlayerGuard) { |
|
|
|
|
|
|
|
//override for guards
|
|
|
|
|
|
|
|
if(mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()){ |
|
|
|
|
|
|
|
if(mob.npcOwner.isAlive() == false || ((Mob)mob.npcOwner).despawned == true){ |
|
|
|
|
|
|
|
//minions don't respawn while guard captain is dead
|
|
|
|
//minions don't respawn while guard captain is dead
|
|
|
|
if(mob.isAlive() == false) { |
|
|
|
if (mob.isAlive() == false) { |
|
|
|
mob.deathTime = System.currentTimeMillis(); |
|
|
|
mob.deathTime = System.currentTimeMillis(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
CheckForRespawn(mob); |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
CheckForRespawn(mob); |
|
|
|
|
|
|
|
//check to send mob home for player guards to prevent exploit of dragging guards away and then teleporting
|
|
|
|
|
|
|
|
CheckToSendMobHome(mob); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!mob.isAlive()) { |
|
|
|
|
|
|
|
//no need to continue if mob is dead, check for respawn and move on
|
|
|
|
|
|
|
|
CheckForRespawn(mob); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (mob.playerAgroMap.isEmpty() && mob.isPlayerGuard == false) |
|
|
|
if (mob.playerAgroMap.isEmpty() && mob.isPlayerGuard == false) |
|
|
|
//no players loaded, no need to proceed
|
|
|
|
//no players loaded, no need to proceed
|
|
|
|