simplified mob aI

This commit is contained in:
2025-03-03 19:56:05 -06:00
parent 1c5d78d566
commit bfc0c57dd8
2 changed files with 8 additions and 3 deletions
@@ -20,13 +20,17 @@ public class StandardMob {
return;
}
HashSet<AbstractWorldObject> inRange = WorldGrid.getObjectsInRangePartial(mob.loc, MBServerStatics.CHARACTER_LOAD_RANGE, MBServerStatics.MASK_PLAYER);
if(inRange.isEmpty())
return;
if (mob.isMoving()) {
mob.setLoc(mob.getMovementLoc());
mob.updateLocation();
}
if(mob.combatTarget == null) {
HashSet<AbstractWorldObject> inRange = WorldGrid.getObjectsInRangePartial(mob.loc, MBServerStatics.CHARACTER_LOAD_RANGE, MBServerStatics.MASK_PLAYER);
if (!inRange.isEmpty()) {
CheckForAggro(mob);
return;
@@ -34,7 +38,6 @@ public class StandardMob {
}else{
CheckToDropCombatTarget(mob);
if(mob.combatTarget == null){
HashSet<AbstractWorldObject> inRange = WorldGrid.getObjectsInRangePartial(mob.loc, MBServerStatics.CHARACTER_LOAD_RANGE, MBServerStatics.MASK_PLAYER);
CheckForAggro(mob);
return;
}
+3 -1
View File
@@ -633,8 +633,10 @@ public class MobAI {
break;
}
if(override){
if(!mob.isSiege())
if(!mob.isSiege()) {
StandardMob.run(mob);
return;
}
}
//always check the respawn que, respawn 1 mob max per second to not flood the client