diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index c607a3a1..22177141 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -119,30 +119,7 @@ public class MobAI { if (mob.isMoving() && mob.getRange() > 20) return; - // add timer for last attack. - - ItemBase mainHand = mob.getWeaponItemBase(true); - ItemBase offHand = mob.getWeaponItemBase(false); - - if (mainHand == null && offHand == null) { - CombatManager.combatCycle(mob, target); - int delay = 3000; - if (mob.isSiege()) - delay = 11000; - mob.setLastAttackTime(System.currentTimeMillis() + delay); - } else if (mob.getWeaponItemBase(true) != null) { - int delay = 3000; - if (mob.isSiege()) - delay = 11000; - CombatManager.combatCycle(mob, target); - mob.setLastAttackTime(System.currentTimeMillis() + delay); - } else if (mob.getWeaponItemBase(false) != null) { - int attackDelay = 3000; - if (mob.isSiege()) - attackDelay = 11000; - CombatManager.combatCycle(mob, target); - mob.setLastAttackTime(System.currentTimeMillis() + attackDelay); - } + CombatManager.combatCycle(mob,mob.combatTarget); } if (target.getPet() != null) @@ -175,28 +152,8 @@ public class MobAI { if (mob.isSiege()) MovementManager.sendRWSSMsg(mob); - ItemBase mainHand = mob.getWeaponItemBase(true); - ItemBase offHand = mob.getWeaponItemBase(false); - if (mainHand == null && offHand == null) { - CombatManager.combatCycle(mob, target); - int delay = 3000; - if (mob.isSiege()) - delay = 15000; - mob.setLastAttackTime(System.currentTimeMillis() + delay); - } else if (mob.getWeaponItemBase(true) != null) { - int attackDelay = 3000; - if (mob.isSiege()) - attackDelay = 15000; - CombatManager.combatCycle(mob, target); - mob.setLastAttackTime(System.currentTimeMillis() + attackDelay); - } else if (mob.getWeaponItemBase(false) != null) { - int attackDelay = 3000; - if (mob.isSiege()) - attackDelay = 15000; CombatManager.combatCycle(mob, target); - mob.setLastAttackTime(System.currentTimeMillis() + attackDelay); - } if (mob.isSiege()) { PowerProjectileMsg ppm = new PowerProjectileMsg(mob, target); @@ -218,31 +175,9 @@ public class MobAI { //no weapons, default mob attack speed 3 seconds. - ItemBase mainHand = mob.getWeaponItemBase(true); - ItemBase offHand = mob.getWeaponItemBase(false); - if (mainHand == null && offHand == null) { - CombatManager.combatCycle(mob, target); - int delay = 3000; - if (mob.isSiege()) - delay = 11000; - mob.setLastAttackTime(System.currentTimeMillis() + delay); - } else if (mob.getWeaponItemBase(true) != null) { - int attackDelay = 3000; - if (mob.isSiege()) - attackDelay = 11000; CombatManager.combatCycle(mob, target); - mob.setLastAttackTime(System.currentTimeMillis() + attackDelay); - } else if (mob.getWeaponItemBase(false) != null) { - int attackDelay = 3000; - if (mob.isSiege()) - attackDelay = 11000; - CombatManager.combatCycle(mob, target); - mob.setLastAttackTime(System.currentTimeMillis() + attackDelay); - if (target.getCombatTarget() == null) { - target.setCombatTarget(mob); - } - } + } catch (Exception e) { Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: AttackMob" + " " + e.getMessage()); }