From f47a9772d7d72e0d7d6f106902893919ff62ab37 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 28 Mar 2024 22:08:03 -0500 Subject: [PATCH] mob attack delay --- src/engine/mobileAI/MobAI.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 725fd9bc..53fc9832 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -50,6 +50,16 @@ public class MobAI { return; } + int delay = 3000; + if(mob.charItemManager.getEquipped().get(Enum.EquipSlotType.RHELD) != null){ + delay = (int)(mob.charItemManager.getEquipped().get(Enum.EquipSlotType.RHELD).template.item_weapon_wepspeed * 100); + } + if(mob.charItemManager.getEquipped().get(Enum.EquipSlotType.LHELD) != null && mob.charItemManager.getEquipped().get(Enum.EquipSlotType.LHELD).template.item_type.equals(Enum.ItemType.WEAPON)){ + delay += (int)(mob.charItemManager.getEquipped().get(Enum.EquipSlotType.LHELD).template.item_weapon_wepspeed * 100); + } + + + mob.lastAttackTime = System.currentTimeMillis() + delay; if (target.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && !mob.canSee((AbstractCharacter) target)) { mob.setCombatTarget(null); @@ -120,7 +130,6 @@ public class MobAI { return; CombatManager.combatCycle(mob,mob.combatTarget); - mob.lastAttackTime = System.currentTimeMillis(); } if (target.getPet() != null)