Project reformat.

This commit is contained in:
2024-03-24 09:42:27 -04:00
parent d0bb761344
commit 943d274e5f
53 changed files with 998 additions and 971 deletions
+21 -21
View File
@@ -323,7 +323,7 @@ public class MobAI {
if (mob.isPlayerGuard() == true) {
if(mob.agentType.equals(Enum.AIAgentType.GUARDWALLARCHER))
if (mob.agentType.equals(Enum.AIAgentType.GUARDWALLARCHER))
return false; //wall archers don't cast
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION))
contractID = mob.guardCaptain.contract.getContractID();
@@ -574,10 +574,10 @@ public class MobAI {
//no players loaded, no need to proceed unless it's a player guard
boolean bypassLoadedPlayerCheck = false;
if(mob.isPlayerGuard() || mob.isSiege()) {
if (mob.isPlayerGuard() || mob.isSiege()) {
bypassLoadedPlayerCheck = true;
if(mob.combatTarget != null && mob.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))
if(mob.combatTarget.loc.distanceSquared(mob.loc) > 10000)
if (mob.combatTarget != null && mob.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))
if (mob.combatTarget.loc.distanceSquared(mob.loc) > 10000)
mob.setCombatTarget(null);
}
@@ -845,7 +845,7 @@ public class MobAI {
try {
if (mob.getCombatTarget() != null && mob.getRange() * mob.getRange() >= MobAIThread.AI_BASE_AGGRO_RANGE * 0.5f)
if (mob.getCombatTarget() != null && mob.getRange() * mob.getRange() >= MobAIThread.AI_BASE_AGGRO_RANGE * 0.5f)
return;
if (mob.isPlayerGuard() && !mob.despawned) {
@@ -888,12 +888,12 @@ public class MobAI {
try {
if(mob.getTimestamps().containsKey("lastChase") == false)
mob.getTimestamps().put("lastChase",System.currentTimeMillis());
else if(System.currentTimeMillis() < mob.getTimestamps().get("lastChase").longValue() + (750 + ThreadLocalRandom.current().nextInt(0,500)))
return;
if (mob.getTimestamps().containsKey("lastChase") == false)
mob.getTimestamps().put("lastChase", System.currentTimeMillis());
else if (System.currentTimeMillis() < mob.getTimestamps().get("lastChase").longValue() + (750 + ThreadLocalRandom.current().nextInt(0, 500)))
return;
mob.getTimestamps().put("lastChase",System.currentTimeMillis());
mob.getTimestamps().put("lastChase", System.currentTimeMillis());
if (mob.getRange() * mob.getRange() <= mob.loc.distanceSquared(mob.combatTarget.loc)) {
if (mob.getRange() > 15) {
@@ -974,10 +974,10 @@ public class MobAI {
}
}
if(mob.behaviourType.canRoam)
if (mob.behaviourType.canRoam)
CheckMobMovement(mob);//all guards that can move check to move
if(mob.combatTarget != null)
if (mob.combatTarget != null)
CheckForAttack(mob); //only check to attack if combat target is not null
} catch (Exception e) {
@@ -1128,21 +1128,21 @@ public class MobAI {
return;
}
}
if (mob.getCombatTarget() == null) {
if (mob.getCombatTarget() == null) {
//look for siege equipment to aggro if no players found to aggro
//look for siege equipment to aggro if no players found to aggro
HashSet<AbstractWorldObject> awoList = WorldGrid.getObjectsInRangePartial(mob, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_SIEGE);
HashSet<AbstractWorldObject> awoList = WorldGrid.getObjectsInRangePartial(mob, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_SIEGE);
for (AbstractWorldObject awoMob : awoList) {
for (AbstractWorldObject awoMob : awoList) {
Mob aggroMob = (Mob) awoMob;
if(GuardCanAggro(mob,aggroMob)) {
mob.setCombatTarget(aggroMob);
return;
}
Mob aggroMob = (Mob) awoMob;
if (GuardCanAggro(mob, aggroMob)) {
mob.setCombatTarget(aggroMob);
return;
}
}
}
} catch (Exception e) {