diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index a997f3f2..0126c4ad 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -1120,13 +1120,30 @@ public class MobAI { mob.setCombatTarget(loadedPlayer); return; } + } + if (mob.getCombatTarget() == null) { + + //look for siege equipment to aggro if no players found to aggro + + HashSet awoList = WorldGrid.getObjectsInRangePartial(mob, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_SIEGE); + + for (AbstractWorldObject awoMob : awoList) { + + + Mob aggroMob = (Mob) awoMob; + if(GuardCanAggro(mob,aggroMob)) { + mob.setCombatTarget(aggroMob); + return; + } + } + } } catch (Exception e) { Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: CheckForPlayerGuardAggro" + e.getMessage()); } } - public static Boolean GuardCanAggro(Mob mob, PlayerCharacter target) { + public static Boolean GuardCanAggro(Mob mob, AbstractCharacter target) { try { diff --git a/src/engine/objects/Building.java b/src/engine/objects/Building.java index cf2aaf2c..4bcc1086 100644 --- a/src/engine/objects/Building.java +++ b/src/engine/objects/Building.java @@ -541,8 +541,11 @@ public class Building extends AbstractWorldObject { if(playerCity != null){ if(this.getGuild().getNation().equals(playerCity.getTOL().getGuild().getNation())){ //friendly building has been attacked, add attacker to city outlaw list - if(!playerCity.cityOutlaws.contains(attacker.getObjectUUID())) + if(!playerCity.cityOutlaws.contains(attacker.getObjectUUID()) && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)) playerCity.cityOutlaws.add(attacker.getObjectUUID()); + for(Mob guard : playerCity.getParent().zoneMobSet) + if(guard.combatTarget == null) + guard.setCombatTarget(attacker); } }