diff --git a/src/engine/mobileAI/MobAi2.java b/src/engine/mobileAI/MobAi2.java index 448b3334..62d2f62a 100644 --- a/src/engine/mobileAI/MobAi2.java +++ b/src/engine/mobileAI/MobAi2.java @@ -22,6 +22,19 @@ public class MobAi2 { Attacking, Dead } + + public static boolean Agressive(Mob mob){ + return mob.BehaviourType.name().contains("Aggro"); + } + + public static boolean Caster(Mob mob){ + return mob.BehaviourType.name().contains("Power"); + } + + public static boolean HelpResponder(Mob mob){ + return mob.BehaviourType.name().contains("Helpee"); + } + public static State getState(Mob mob){ if(!mob.isAlive()) @@ -108,14 +121,16 @@ public class MobAi2 { //handles patrolling and looking for potential combat targets public static void patrol(Mob mob){ - HashSet potentialTargets = WorldGrid.getObjectsInRangePartial(mob.loc, Float.parseFloat(ConfigManager.MB_AI_AGGRO_RANGE.getValue()), MBServerStatics.MASK_PLAYER); - for(AbstractWorldObject awo : potentialTargets){ - PlayerCharacter target = (PlayerCharacter) awo; - if(mob.canSee(target)) - mob.setCombatTarget(target); - if(mob.combatTarget != null) { - mob.stopMovement(mob.getMovementLoc()); - return; + if(Agressive(mob) && mob.combatTarget == null) { + HashSet potentialTargets = WorldGrid.getObjectsInRangePartial(mob.loc, 50, MBServerStatics.MASK_PLAYER); + for (AbstractWorldObject awo : potentialTargets) { + PlayerCharacter target = (PlayerCharacter) awo; + if (mob.canSee(target)) + mob.setCombatTarget(target); + if (mob.combatTarget != null) { + mob.stopMovement(mob.getMovementLoc()); + return; + } } } if(mob.isMoving() || !mob.BehaviourType.canRoam) @@ -337,7 +352,7 @@ public class MobAi2 { Zone mobCamp = mob.getParentZone(); for (Mob helper : mobCamp.zoneMobSet) { - if (helper.BehaviourType.respondsToCallForHelp && helper.BehaviourType.BehaviourHelperType.equals(mob.BehaviourType)) { + if (HelpResponder(helper)) { helper.setCombatTarget(mob.getCombatTarget()); break; }