From 92a0af8dbb9c65e3165bb07e3c3998861283c26d Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 7 May 2023 17:14:47 -0500 Subject: [PATCH] guard minion spawn timer scaling off barracks rank --- src/engine/ai/MobileFSM.java | 9 ++++++--- src/engine/objects/Mob.java | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index 80bc007c..bd32a00d 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -315,7 +315,7 @@ public class MobileFSM { if(mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()){ if(mob.npcOwner.isAlive() == false || ((Mob)mob.npcOwner).despawned == true){ //minions don't respawn while guard captain is dead - if(mob.isAlive() == false){ + if(mob.isAlive() == false) { mob.deathTime = System.currentTimeMillis(); return; } @@ -551,7 +551,6 @@ public class MobileFSM { public static void GuardMinionLogic(Mob mob) { if (!mob.npcOwner.isAlive() && mob.getCombatTarget() == null) { CheckForPlayerGuardAggro(mob); - return; } if(mob.npcOwner.getCombatTarget() != null) mob.setCombatTarget(mob.npcOwner.getCombatTarget()); @@ -643,7 +642,11 @@ public class MobileFSM { public static Boolean GuardCanAggro(Mob mob, PlayerCharacter target) { if (mob.getGuild().getNation().equals(target.getGuild().getNation())) return false; - if(mob.building.getCity().cityOutlaws.contains(target.getObjectUUID()) == true){ + if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()) { + if(((Mob)mob.npcOwner).building.getCity().cityOutlaws.contains(target.getObjectUUID()) == true){ + return true; + } + } else if(mob.building.getCity().cityOutlaws.contains(target.getObjectUUID()) == true){ return true; } //first check condemn list for aggro allowed (allies button is checked) diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 1c59e3f2..c70707d8 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -804,7 +804,7 @@ public class Mob extends AbstractIntelligenceAgent { guardCaptain.siegeMinionMap.put(mob, slot); mob.deathTime = System.currentTimeMillis(); mob.npcOwner = guardCaptain; - mob.spawnTime = (int)(-2.500 * guardCaptain.building.getRank() + 22.5); + mob.spawnTime = (int)(-2.500 * guardCaptain.building.getRank() + 22.5) * 60; mob.BehaviourType = Enum.MobBehaviourType.GuardMinion; //add mob to zone set of captain guardCaptain.getParentZone().zoneMobSet.add(mob); @@ -1305,7 +1305,7 @@ public class Mob extends AbstractIntelligenceAgent { this.timeToSpawnSiege = System.currentTimeMillis() + 60 * 15 * 1000; if(this.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()) { - this.spawnTime = (int) (-2.500 * ((Mob) this.npcOwner).building.getRank() + 22.5); + this.spawnTime = (int) (-2.500 * ((Mob) this.npcOwner).building.getRank() + 22.5) * 60; } if (this.isPet()) { @@ -1391,9 +1391,9 @@ public class Mob extends AbstractIntelligenceAgent { this.stopMovement(this.lastBindLoc); NPCManager.applyRuneSetEffects(this); this.recalculateStats(); - this.setHealth(this.healthMax); this.region = BuildingManager.GetRegion(this.building, bindLoc.x, bindLoc.y, bindLoc.z); + MovementManager.translocate(this,this.bindLoc, this.region); if (!this.isSiege && !this.isPlayerGuard && contract == null) loadInventory();