diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 6b1a7291..b2095dff 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -628,25 +628,6 @@ public class MobAI { return; } } - - if (aiAgent.getCombatTarget() == null) { - - //look for pets to aggro if no players found to aggro - - HashSet awoList = WorldGrid.getObjectsInRangePartial(aiAgent, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_PET); - - for (AbstractWorldObject awoMob : awoList) { - - // exclude self. - - if (aiAgent.equals(awoMob)) - continue; - - Mob aggroMob = (Mob) awoMob; - aiAgent.setCombatTarget(aggroMob); - return; - } - } } catch (Exception e) { Logger.error(e, aiAgent.getObjectUUID() + " " + aiAgent.getName() + " Failed At: CheckForAggro"); } @@ -876,6 +857,10 @@ public class MobAI { if (aggroMob.agentType.equals(mbEnums.AIAgentType.PET)) continue; + //don't attack siege engines + if (aggroMob.isSiege()) + continue; + if (mob.getLoc().distanceSquared2D(aggroMob.getLoc()) > sqr(50)) continue; @@ -1098,23 +1083,9 @@ public class MobAI { return; } } - if (mob.getCombatTarget() == null) { - //look for siege equipment to aggro if no players found to aggro + // guards never auto-aggro siege engines; they only respond when one damages a city building - 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.error(e, mob.getObjectUUID() + " " + mob.getName() + " Failed At: CheckForPlayerGuardAggro"); }