From 863aa4c4a951332272c1ae55b2254893fec2f690 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 28 May 2023 11:25:12 -0500 Subject: [PATCH] randomized patrol delays --- src/engine/ai/MobileFSM.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index fa36f49b..f0d9c756 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -180,7 +180,8 @@ public class MobileFSM { mob.stopPatrolTime = System.currentTimeMillis(); return; } - if (mob.stopPatrolTime + (MBServerStatics.AI_PATROL_DIVISOR * 1000) > System.currentTimeMillis()) + int patrolDelay = ThreadLocalRandom.current().nextInt((int)(MBServerStatics.AI_PATROL_DIVISOR * 0.5f)) + (int)(MBServerStatics.AI_PATROL_DIVISOR * 0.5f); + if (mob.stopPatrolTime + (patrolDelay * 1000) > System.currentTimeMillis()) //early exit while waiting to patrol again return; //guard captains inherit barracks patrol points dynamically