diff --git a/src/engine/gameManager/HellgateManager.java b/src/engine/gameManager/HellgateManager.java index 844ad0d8..7f8d399e 100644 --- a/src/engine/gameManager/HellgateManager.java +++ b/src/engine/gameManager/HellgateManager.java @@ -1,5 +1,8 @@ package engine.gameManager; +import engine.mobileAI.MobAI; +import engine.mobileAI.utilities.CombatUtilities; +import engine.mobileAI.utilities.MovementUtilities; import engine.objects.Mob; import engine.objects.Resists; import engine.objects.Zone; @@ -118,4 +121,26 @@ public class HellgateManager { hellgate_boss.setHealth(hellgate_boss.healthMax); } + public static void SpecialMobAIHandler(Mob mob){ + + if(mob.playerAgroMap.isEmpty()) + return; + + if(!mob.isAlive()) + return; + + if(mob.combatTarget == null) + MobAI.NewAggroMechanic(mob); + + if(MovementUtilities.canMove(mob) && mob.combatTarget != null && !CombatUtilities.inRangeToAttack(mob,mob.combatTarget)) + MobAI.chaseTarget(mob); + + if(mob.combatTarget != null) + MobAI.CheckForAttack(mob); + + if(mob.combatTarget == null && mob.loc.distanceSquared(mob.bindLoc) > 100) + mob.teleport(mob.bindLoc); + + } + } diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 4fa897b9..40bff4a8 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -622,6 +622,19 @@ public class MobAI { try { + if (HellgateManager.hellgate_mobs != null && HellgateManager.hellgate_mobs.contains(mob)) { + HellgateManager.SpecialMobAIHandler(mob); + return; + } + + if (HellgateManager.hellgate_mini_bosses != null && HellgateManager.hellgate_mini_bosses.contains(mob)) { + HellgateManager.SpecialMobAIHandler(mob); + return; + } + if(HellgateManager.hellgate_boss != null && mob.equals(HellgateManager.hellgate_boss)){ + HellgateManager.SpecialMobAIHandler(mob); + return; + } //boolean override = true; //switch (mob.BehaviourType) { @@ -1035,7 +1048,7 @@ public class MobAI { } } - private static void chaseTarget(Mob mob) { + public static void chaseTarget(Mob mob) { try {