From c2ea4424cf536c8d2ac54d8134803c1177338ac2 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 3 Jun 2024 20:56:25 -0500 Subject: [PATCH] attack delay catching --- src/engine/gameManager/CombatManager.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index fceb317f..49dcd971 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -126,6 +126,24 @@ public enum CombatManager { return; } + long delay = 0L; + if(attacker.getTimestamps().containsKey("Attack" + slot)){ + + if(attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)){ + if(slot.equals(mbEnums.EquipSlotType.RHELD)){ + delay = (long)(attacker.speedHandOne * 100L); + }else{ + delay = (long)(attacker.speedHandTwo * 100L); + } + } + + if(System.currentTimeMillis() < attacker.getTimestamps().get("Attack" + slot)){ + return; + } + } + + attacker.getTimestamps().put("Attack" + slot, System.currentTimeMillis() + delay); + target.combatLock.writeLock().lock(); // check if character is in range to attack target @@ -194,7 +212,7 @@ public enum CombatManager { } //get delay for the auto attack job - long delay = 5000; + delay = 5000; //if (weapon != null) {