Browse Source

respawn work

master
FatBoy-DOTC 1 year ago
parent
commit
a07ee7903b
  1. 15
      src/engine/ai/MobileFSM.java

15
src/engine/ai/MobileFSM.java

@ -299,13 +299,7 @@ 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
CheckForRespawn(mob);
return;
}
if (mob.despawned && mob.isPlayerGuard) {
//override for guards
if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()) { if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()) {
if (mob.npcOwner.isAlive() == false || ((Mob) mob.npcOwner).despawned == true) { 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
@ -314,16 +308,9 @@ public class MobileFSM {
return; return;
} }
} }
}
CheckForRespawn(mob); CheckForRespawn(mob);
//check to send mob home for player guards to prevent exploit of dragging guards away and then teleporting
CheckToSendMobHome(mob);
return; 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

Loading…
Cancel
Save