diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index 6023032e..68404682 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -199,7 +199,7 @@ public class MobileFSM { mob.destination = mob.patrolPoints.get(mob.lastPatrolPointIndex); MovementUtilities.aiMove(mob, mob.destination, true); mob.lastPatrolPointIndex += 1; - if (mob.isPlayerGuard()) { + if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardCaptain.ordinal()) { for (Entry minion : mob.siegeMinionMap.entrySet()) { //make sure mob is out of combat stance if (minion.getKey().isCombat() && minion.getKey().getCombatTarget() == null) { @@ -320,6 +320,12 @@ public class MobileFSM { if (mob.playerAgroMap.isEmpty()) //no players loaded, no need to proceed return; + if (mob.isCombat() && mob.getCombatTarget() == null) { + mob.setCombat(false); + UpdateStateMsg rwss = new UpdateStateMsg(); + rwss.setPlayer(mob); + DispatchMessage.sendToAllInRange(mob, rwss); + } CheckToSendMobHome(mob); mob.updateLocation(); switch (mob.BehaviourType) { @@ -378,6 +384,8 @@ public class MobileFSM { return; mob.updateLocation(); if (mob.BehaviourType != Enum.MobBehaviourType.Pet1) { + if(mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal() && ((Mob)mob.npcOwner).despawned == true) + return; if (mob.getCombatTarget() == null) Patrol(mob); else @@ -505,11 +513,6 @@ public class MobileFSM { CheckForAttack(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) { CheckForPlayerGuardAggro(mob); return; diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 2d2aed6d..b731bb49 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -1285,7 +1285,6 @@ public class Mob extends AbstractIntelligenceAgent { public void respawn() { //Commenting out Mob ID rotation. - this.despawned = false; this.playerAgroMap.clear(); this.setCombatTarget(null); @@ -1304,7 +1303,7 @@ public class Mob extends AbstractIntelligenceAgent { this.recalculateStats(); this.setHealth(this.healthMax); - + this.region = BuildingManager.GetRegion(this.building, bindLoc.x, bindLoc.y, bindLoc.z); if (!this.isSiege && !this.isPlayerGuard && contract == null) loadInventory(); }