Browse Source

guard reverse KoS logic

master
FatBoy-DOTC 2 years ago
parent
commit
64bde9c197
  1. 10
      src/engine/ai/MobileFSM.java
  2. 2
      src/engine/ai/MobileFSMManager.java

10
src/engine/ai/MobileFSM.java

@ -336,8 +336,8 @@ public class MobileFSM {
rwss.setPlayer(mob); rwss.setPlayer(mob);
DispatchMessage.sendToAllInRange(mob, rwss); DispatchMessage.sendToAllInRange(mob, rwss);
} }
CheckToSendMobHome(mob);
mob.updateLocation(); mob.updateLocation();
CheckToSendMobHome(mob);
switch (mob.BehaviourType) { switch (mob.BehaviourType) {
case GuardCaptain: case GuardCaptain:
GuardCaptainLogic(mob); GuardCaptainLogic(mob);
@ -390,7 +390,6 @@ public class MobileFSM {
} }
} }
private static void CheckMobMovement(Mob mob) { private static void CheckMobMovement(Mob mob) {
mob.updateLocation();
if (!MovementUtilities.canMove(mob)) if (!MovementUtilities.canMove(mob))
return; return;
switch(mob.BehaviourType){ switch(mob.BehaviourType){
@ -412,6 +411,11 @@ public class MobileFSM {
case GuardMinion: case GuardMinion:
if (!mob.npcOwner.isAlive() || ((Mob)mob.npcOwner).despawned) if (!mob.npcOwner.isAlive() || ((Mob)mob.npcOwner).despawned)
randomGuardPatrolPoint(mob); randomGuardPatrolPoint(mob);
else{
if(mob.getCombatTarget() != null){
chaseTarget(mob);
}
}
break; break;
default: default:
if (mob.getCombatTarget() == null) { if (mob.getCombatTarget() == null) {
@ -481,7 +485,7 @@ public class MobileFSM {
AttackTarget(mob, mob.getCombatTarget()); AttackTarget(mob, mob.getCombatTarget());
} }
private static void CheckToSendMobHome(Mob mob) { private static void CheckToSendMobHome(Mob mob) {
if (mob.isPlayerGuard()) { if (mob.isPlayerGuard() && !mob.despawned) {
City current = ZoneManager.getCityAtLocation(mob.getLoc()); City current = ZoneManager.getCityAtLocation(mob.getLoc());
if (current == null || current.equals(mob.getGuild().getOwnedCity()) == false || mob.playerAgroMap.isEmpty()) { if (current == null || current.equals(mob.getGuild().getOwnedCity()) == false || mob.playerAgroMap.isEmpty()) {
PowersBase recall = PowersManager.getPowerByToken(-1994153779); PowersBase recall = PowersManager.getPowerByToken(-1994153779);

2
src/engine/ai/MobileFSMManager.java

@ -91,7 +91,7 @@ public class MobileFSMManager {
if (mob != null) if (mob != null)
MobileFSM.DetermineAction(mob); MobileFSM.DetermineAction(mob);
} catch (Exception e) { } catch (Exception e) {
Logger.error(e); Logger.error("Mob: " + mob.getName() + " UUID: " + mob.getObjectUUID() + " ERROR: " + e);
e.printStackTrace(); e.printStackTrace();
} }
} }

Loading…
Cancel
Save