|
|
|
@ -119,30 +119,7 @@ public class MobAI {
@@ -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 {
@@ -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 {
@@ -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()); |
|
|
|
|
} |
|
|
|
|