From 2cdcba47a5782f36397aedf8c1dec73496a2e157 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 17 May 2024 19:57:18 -0500 Subject: [PATCH] noob island guard aggro --- src/engine/mobileAI/MobAI.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 209d2c6f..79e26e43 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -973,9 +973,20 @@ public class MobAI { } private static void hamletGuardAggro(Mob mob) { - City guardedCity = mob.guardedCity; - City atLocation = ZoneManager.getCityAtLocation(mob.loc); Realm realm = RealmMap.getRealmAtLocation(mob.loc); + if(realm.getRealmName().equals("Uthgaard")){ + HashSet loadedMobs = WorldGrid.getObjectsInRangePartial(mob.loc, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_MOB); + for (AbstractWorldObject awo : loadedMobs) { + Mob targetMob = (Mob) awo; + if (!targetMob.isAlive() || targetMob.despawned) + continue; + if (targetMob.isPet()) + continue; + mob.combatTarget = targetMob; + return; + } + return; + } HashSet loadedPlayers = WorldGrid.getObjectsInRangePartial(mob.loc, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_PLAYER); for (AbstractWorldObject awo : loadedPlayers) { PlayerCharacter pc = (PlayerCharacter) awo;