|
|
@ -8,6 +8,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
package engine.mobileAI; |
|
|
|
package engine.mobileAI; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import engine.InterestManagement.RealmMap; |
|
|
|
import engine.InterestManagement.WorldGrid; |
|
|
|
import engine.InterestManagement.WorldGrid; |
|
|
|
import engine.gameManager.*; |
|
|
|
import engine.gameManager.*; |
|
|
|
import engine.math.Vector3f; |
|
|
|
import engine.math.Vector3f; |
|
|
@ -972,21 +973,36 @@ public class MobAI { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void hamletGuardAggro(Mob mob) { |
|
|
|
private static void hamletGuardAggro(Mob mob) { |
|
|
|
HashSet<AbstractWorldObject> loadedPlayers = WorldGrid.getObjectsInRangePartial(mob.loc,MobAIThread.AI_BASE_AGGRO_RANGE,MBServerStatics.MASK_PLAYER); |
|
|
|
City city = ZoneManager.getCityAtLocation(mob.bindLoc); |
|
|
|
for(AbstractWorldObject awo : loadedPlayers){ |
|
|
|
if(city != null && city.isNoobIsle == 1){ |
|
|
|
|
|
|
|
//noob island guards only aggro to mobs
|
|
|
|
|
|
|
|
HashSet<AbstractWorldObject> 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; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
HashSet<AbstractWorldObject> loadedPlayers = WorldGrid.getObjectsInRangePartial(mob.loc, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_PLAYER); |
|
|
|
|
|
|
|
for (AbstractWorldObject awo : loadedPlayers) { |
|
|
|
PlayerCharacter pc = (PlayerCharacter) awo; |
|
|
|
PlayerCharacter pc = (PlayerCharacter) awo; |
|
|
|
if(!pc.isAlive() || !pc.isActive()) |
|
|
|
if (!pc.isAlive() || !pc.isActive()) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
if(pc.guild.equals(Guild.getErrantGuild())) { |
|
|
|
if (pc.guild.equals(Guild.getErrantGuild())) { |
|
|
|
mob.combatTarget = pc; |
|
|
|
mob.combatTarget = pc; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if(pc.guild.charter.equals(mob.guild.charter)) |
|
|
|
if (pc.guild.charter.equals(mob.guild.charter)) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
mob.combatTarget = pc; |
|
|
|
mob.combatTarget = pc; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void defaultLogic(Mob mob) { |
|
|
|
private static void defaultLogic(Mob mob) { |
|
|
|
|
|
|
|
|
|
|
|