|
|
@ -119,30 +119,7 @@ public class MobAI { |
|
|
|
if (mob.isMoving() && mob.getRange() > 20) |
|
|
|
if (mob.isMoving() && mob.getRange() > 20) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
// add timer for last attack.
|
|
|
|
CombatManager.combatCycle(mob,mob.combatTarget); |
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (target.getPet() != null) |
|
|
|
if (target.getPet() != null) |
|
|
@ -175,28 +152,8 @@ public class MobAI { |
|
|
|
if (mob.isSiege()) |
|
|
|
if (mob.isSiege()) |
|
|
|
MovementManager.sendRWSSMsg(mob); |
|
|
|
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); |
|
|
|
CombatManager.combatCycle(mob, target); |
|
|
|
mob.setLastAttackTime(System.currentTimeMillis() + attackDelay); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mob.isSiege()) { |
|
|
|
if (mob.isSiege()) { |
|
|
|
PowerProjectileMsg ppm = new PowerProjectileMsg(mob, target); |
|
|
|
PowerProjectileMsg ppm = new PowerProjectileMsg(mob, target); |
|
|
@ -218,31 +175,9 @@ public class MobAI { |
|
|
|
|
|
|
|
|
|
|
|
//no weapons, default mob attack speed 3 seconds.
|
|
|
|
//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); |
|
|
|
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) { |
|
|
|
} catch (Exception e) { |
|
|
|
Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: AttackMob" + " " + e.getMessage()); |
|
|
|
Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: AttackMob" + " " + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|