From 64bde9c1971f7960be13f21d060e3f8f82b0db15 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 6 May 2023 15:53:35 -0500 Subject: [PATCH] guard reverse KoS logic --- src/engine/ai/MobileFSM.java | 10 +++++++--- src/engine/ai/MobileFSMManager.java | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index c4caaedf..6147aaec 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -336,8 +336,8 @@ public class MobileFSM { rwss.setPlayer(mob); DispatchMessage.sendToAllInRange(mob, rwss); } - CheckToSendMobHome(mob); mob.updateLocation(); + CheckToSendMobHome(mob); switch (mob.BehaviourType) { case GuardCaptain: GuardCaptainLogic(mob); @@ -390,7 +390,6 @@ public class MobileFSM { } } private static void CheckMobMovement(Mob mob) { - mob.updateLocation(); if (!MovementUtilities.canMove(mob)) return; switch(mob.BehaviourType){ @@ -412,6 +411,11 @@ public class MobileFSM { case GuardMinion: if (!mob.npcOwner.isAlive() || ((Mob)mob.npcOwner).despawned) randomGuardPatrolPoint(mob); + else{ + if(mob.getCombatTarget() != null){ + chaseTarget(mob); + } + } break; default: if (mob.getCombatTarget() == null) { @@ -481,7 +485,7 @@ public class MobileFSM { AttackTarget(mob, mob.getCombatTarget()); } private static void CheckToSendMobHome(Mob mob) { - if (mob.isPlayerGuard()) { + if (mob.isPlayerGuard() && !mob.despawned) { City current = ZoneManager.getCityAtLocation(mob.getLoc()); if (current == null || current.equals(mob.getGuild().getOwnedCity()) == false || mob.playerAgroMap.isEmpty()) { PowersBase recall = PowersManager.getPowerByToken(-1994153779); diff --git a/src/engine/ai/MobileFSMManager.java b/src/engine/ai/MobileFSMManager.java index 33190ef4..f8b0fd52 100644 --- a/src/engine/ai/MobileFSMManager.java +++ b/src/engine/ai/MobileFSMManager.java @@ -91,7 +91,7 @@ public class MobileFSMManager { if (mob != null) MobileFSM.DetermineAction(mob); } catch (Exception e) { - Logger.error(e); + Logger.error("Mob: " + mob.getName() + " UUID: " + mob.getObjectUUID() + " ERROR: " + e); e.printStackTrace(); } }