guard minion logic work

This commit is contained in:
2023-04-30 14:55:12 -05:00
parent 0bc41323b1
commit e52b8e894b
2 changed files with 10 additions and 8 deletions
+9 -6
View File
@@ -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<Mob, Integer> 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;
+1 -2
View File
@@ -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();
}