hellgates revised
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user