hamlet guards + mobs aggro before going home

This commit is contained in:
2023-05-28 10:55:11 -05:00
parent 7dfd8148d5
commit d673c329b6
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -466,7 +466,7 @@ public class MobileFSM {
//checks if mob can attack based on attack timer and range
if (mob.isAlive() == false)
return;
if (MovementUtilities.inRangeDropAggro(mob, (PlayerCharacter) mob.getCombatTarget()) == false) {
if (MovementUtilities.inRangeDropAggro(mob, (AbstractCharacter)mob.getCombatTarget()) == false) {
mob.setCombatTarget(null);
if (mob.isCombat()) {
mob.setCombat(false);
@@ -486,6 +486,7 @@ public class MobileFSM {
AttackTarget(mob, mob.getCombatTarget());
}
private static void CheckToSendMobHome(Mob mob) {
CheckForAggro(mob);
if(mob.getCombatTarget() != null && CombatUtilities.inRange2D(mob,mob.getCombatTarget(),MBServerStatics.AI_BASE_AGGRO_RANGE * 0.5f)){
return;
}
@@ -98,7 +98,7 @@ public class MovementUtilities {
}
public static boolean inRangeDropAggro(Mob agent, PlayerCharacter target) {
public static boolean inRangeDropAggro(Mob agent, AbstractCharacter target) {
Vector3fImmutable sl = agent.getLoc();
Vector3fImmutable tl = target.getLoc();