Browse Source

player guards to drop aggro once player leaves city

lakebane2
FatBoy-DOTC 3 weeks ago
parent
commit
77e6d0db75
  1. 17
      src/engine/mobileAI/MobAI.java

17
src/engine/mobileAI/MobAI.java

@ -1052,9 +1052,22 @@ public class MobAI {
} }
} }
public static void checkToDropGuardAggro(Mob mob){
City city = mob.guardedCity;
if(city == null)
return;
if(mob.combatTarget == null)
return;
if(city._playerMemory.contains(mob.combatTarget.getObjectUUID()) && mob.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))
mob.setCombatTarget(null);
}
public static void GuardCaptainLogic(Mob mob) { public static void GuardCaptainLogic(Mob mob) {
try { try {
checkToDropGuardAggro(mob);
if (mob.getCombatTarget() == null) if (mob.getCombatTarget() == null)
CheckForPlayerGuardAggro(mob); CheckForPlayerGuardAggro(mob);
@ -1079,6 +1092,8 @@ public class MobAI {
public static void GuardMinionLogic(Mob mob) { public static void GuardMinionLogic(Mob mob) {
try { try {
checkToDropGuardAggro(mob);
boolean isComanded = mob.npcOwner.isAlive(); boolean isComanded = mob.npcOwner.isAlive();
if (!isComanded) { if (!isComanded) {
GuardCaptainLogic(mob); GuardCaptainLogic(mob);
@ -1099,6 +1114,8 @@ public class MobAI {
public static void GuardWallArcherLogic(Mob mob) { public static void GuardWallArcherLogic(Mob mob) {
try { try {
checkToDropGuardAggro(mob);
if (mob.getCombatTarget() == null) if (mob.getCombatTarget() == null)
CheckForPlayerGuardAggro(mob); CheckForPlayerGuardAggro(mob);
else else

Loading…
Cancel
Save