|
|
|
@ -616,10 +616,8 @@ public class MobAI {
@@ -616,10 +616,8 @@ public class MobAI {
|
|
|
|
|
switch (mob.behaviourType) { |
|
|
|
|
case GuardCaptain: |
|
|
|
|
case GuardMinion: |
|
|
|
|
GuardLogic(mob); |
|
|
|
|
break; |
|
|
|
|
case GuardWallArcher: |
|
|
|
|
GuardWallArcherLogic(mob); |
|
|
|
|
GuardLogic(mob); |
|
|
|
|
break; |
|
|
|
|
case Pet1: |
|
|
|
|
case SiegeEngine: |
|
|
|
@ -953,9 +951,10 @@ public class MobAI {
@@ -953,9 +951,10 @@ public class MobAI {
|
|
|
|
|
public static void GuardLogic(Mob mob) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
if (mob.getCombatTarget() == null) |
|
|
|
|
if (mob.getCombatTarget() == null) { |
|
|
|
|
CheckForPlayerGuardAggro(mob); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
//do not need to look to change target if target is already null
|
|
|
|
|
AbstractWorldObject newTarget = ChangeTargetFromHateValue(mob); |
|
|
|
|
|
|
|
|
|
if (newTarget != null) { |
|
|
|
@ -965,25 +964,17 @@ public class MobAI {
@@ -965,25 +964,17 @@ public class MobAI {
|
|
|
|
|
mob.setCombatTarget(newTarget); |
|
|
|
|
} else |
|
|
|
|
mob.setCombatTarget(newTarget); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
CheckMobMovement(mob); |
|
|
|
|
CheckForAttack(mob); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: GuardLogic" + " " + e.getMessage()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void GuardWallArcherLogic(Mob mob) { |
|
|
|
|
if(mob.behaviourType.canRoam) |
|
|
|
|
CheckMobMovement(mob);//all guards that can move check to move
|
|
|
|
|
|
|
|
|
|
if(mob.combatTarget != null) |
|
|
|
|
CheckForAttack(mob); //only check to attack if combat target is not null
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
if (mob.getCombatTarget() == null) |
|
|
|
|
CheckForPlayerGuardAggro(mob); |
|
|
|
|
else |
|
|
|
|
CheckForAttack(mob); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: GuardWallArcherLogic" + " " + e.getMessage()); |
|
|
|
|
Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: GuardLogic" + " " + e.getMessage()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|