From d506807a8fce68f579c44ac1e712e1d61fc36834 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 16 Oct 2023 14:33:09 -0500 Subject: [PATCH] 1 second delay for mobs chasing target --- src/engine/mobileAI/MobAI.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 38864cac..911bd375 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -896,6 +896,11 @@ public class MobAI { try { + if(mob.getTimestamps().containsKey("lastChase") == false) + mob.getTimestamps().put("lastChase",System.currentTimeMillis()); + else if(System.currentTimeMillis() < mob.getTimestamps().get("lastChase").longValue() + 1000) + return; + if (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mob.getRange()) == false) { if (mob.getRange() > 15) { mob.destination = mob.getCombatTarget().getLoc();