Project reformat.
This commit is contained in:
@@ -100,7 +100,7 @@ public class MobAI {
|
||||
public static void attackPlayer(Mob mob, PlayerCharacter target) {
|
||||
|
||||
try {
|
||||
if(target == null || !target.isAlive() || !target.isActive() ) {
|
||||
if (target == null || !target.isAlive() || !target.isActive()) {
|
||||
mob.setCombatTarget(null);
|
||||
return;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ public class MobAI {
|
||||
public static void attackMob(Mob mob, Mob target) {
|
||||
|
||||
try {
|
||||
if(mob == null || target == null)
|
||||
if (mob == null || target == null)
|
||||
return;
|
||||
|
||||
if (mob.getRange() >= 30 && mob.isMoving())
|
||||
@@ -975,36 +975,36 @@ public class MobAI {
|
||||
}
|
||||
|
||||
private static void hamletGuardAggro(Mob mob) {
|
||||
Realm realm = RealmMap.getRealmAtLocation(mob.loc);
|
||||
if(realm.getRealmName().equals("Uthgaard")){
|
||||
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.equals(mob))
|
||||
continue;
|
||||
if (!targetMob.isAlive() || targetMob.despawned)
|
||||
continue;
|
||||
if (targetMob.isPet())
|
||||
continue;
|
||||
mob.combatTarget = targetMob;
|
||||
return;
|
||||
}
|
||||
Realm realm = RealmMap.getRealmAtLocation(mob.loc);
|
||||
if (realm.getRealmName().equals("Uthgaard")) {
|
||||
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.equals(mob))
|
||||
continue;
|
||||
if (!targetMob.isAlive() || targetMob.despawned)
|
||||
continue;
|
||||
if (targetMob.isPet())
|
||||
continue;
|
||||
mob.combatTarget = targetMob;
|
||||
return;
|
||||
}
|
||||
HashSet<AbstractWorldObject> loadedPlayers = WorldGrid.getObjectsInRangePartial(mob.loc, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_PLAYER);
|
||||
for (AbstractWorldObject awo : loadedPlayers) {
|
||||
PlayerCharacter pc = (PlayerCharacter) awo;
|
||||
if (!pc.isAlive() || !pc.isActive())
|
||||
continue;
|
||||
if (pc.guild.equals(Guild.getErrantGuild())) {
|
||||
mob.combatTarget = pc;
|
||||
return;
|
||||
}
|
||||
if (pc.guild.charter.equals(mob.guild.charter))
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
HashSet<AbstractWorldObject> loadedPlayers = WorldGrid.getObjectsInRangePartial(mob.loc, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_PLAYER);
|
||||
for (AbstractWorldObject awo : loadedPlayers) {
|
||||
PlayerCharacter pc = (PlayerCharacter) awo;
|
||||
if (!pc.isAlive() || !pc.isActive())
|
||||
continue;
|
||||
if (pc.guild.equals(Guild.getErrantGuild())) {
|
||||
mob.combatTarget = pc;
|
||||
return;
|
||||
}
|
||||
if (pc.guild.charter.equals(mob.guild.charter))
|
||||
continue;
|
||||
mob.combatTarget = pc;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private static void defaultLogic(Mob mob) {
|
||||
|
||||
Reference in New Issue
Block a user