From 58c4ece887d360c57cc99ec3f726b6510d895ed2 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 8 Feb 2023 19:38:35 -0600 Subject: [PATCH] 10 second delay min between casts & mobs no longer cast beneficial spells on players --- src/engine/ai/MobileFSM.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index 841c722b..a5835fe5 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -1660,10 +1660,19 @@ public class MobileFSM { PowersBase mobPower = PowersManager.getPowerByToken(powerToken); if (CombatUtilities.inRangeToCast2D(mob, mob.getCombatTarget(), mobPower)) { //PowersManager.useMobPower(mob,(AbstractCharacter)mob.getCombatTarget(),mobPower,powerRank); - PerformActionMsg msg = PowersManager.createPowerMsg(mobPower, powerRank, mob, target); + PerformActionMsg msg = new PerformActionMsg(); + if(mobPower.isHarmful() == false){ + msg = PowersManager.createPowerMsg(mobPower, powerRank, mob, mob); + } else { + msg = PowersManager.createPowerMsg(mobPower, powerRank, mob, target); + } msg.setUnknown04(2); PowersManager.finishUseMobPower(msg, mob, 0, 0); - mob.nextCastTime = System.currentTimeMillis() + (mobPower.getCooldown()); + if(mobPower.getCooldown() < 10000){ + mob.nextCastTime = System.currentTimeMillis() + 10000; + } else { + mob.nextCastTime = System.currentTimeMillis() + (mobPower.getCooldown()); + } return true; } }