From 772a996b6e46c0dca353ecb868e2151799ea2128 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 25 Aug 2023 16:49:26 -0400 Subject: [PATCH] Tweak to behavior type setup. --- src/engine/objects/Mob.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index f2c80087..78609658 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -1689,11 +1689,14 @@ public class Mob extends AbstractIntelligenceAgent { else this.contract = DbManager.ContractQueries.GET_CONTRACT(this.contractUUID); - // Guard captain AI + // Setup mobile AI if (this.contract != null) { - if (NPC.ISGuardCaptain(contract.getContractID())) { + // Load AI for guard captains + + if (NPC.ISGuardCaptain(contract.getContractID()) || this.contract.getContractID() == 910) { // Guard Dog + this.behaviourType = MobBehaviourType.GuardCaptain; this.spawnTime = 60 * 15; this.isPlayerGuard = true; this.guardedCity = ZoneManager.getCityAtLocation(this.building.getLoc()); @@ -1708,14 +1711,6 @@ public class Mob extends AbstractIntelligenceAgent { this.guardedCity = ZoneManager.getCityAtLocation(this.building.getLoc()); } - // Load AI for guard dogs - - if (this.contract.getContractID() == 910) { - this.isPlayerGuard = true; - this.behaviourType = MobBehaviourType.GuardCaptain; - this.spawnTime = 900; - this.guardedCity = ZoneManager.getCityAtLocation(this.building.getLoc()); - } } // Default to the mobbase for AI if nothing is hte mob field to override. @@ -1723,6 +1718,9 @@ public class Mob extends AbstractIntelligenceAgent { if (this.behaviourType == null || this.behaviourType.equals(MobBehaviourType.None)) this.behaviourType = this.getMobBase().fsm; + if (this.behaviourType == null) + this.behaviourType = MobBehaviourType.None; + if (this.building != null) this.guild = this.building.getGuild(); else