|
|
@ -59,7 +59,7 @@ public class MobAI { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mob.lastAttackTime = System.currentTimeMillis() + delay; |
|
|
|
mob.nextAttackTime = System.currentTimeMillis() + delay; |
|
|
|
if (target.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && |
|
|
|
if (target.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && |
|
|
|
!mob.canSee((AbstractCharacter) target)) { |
|
|
|
!mob.canSee((AbstractCharacter) target)) { |
|
|
|
mob.setCombatTarget(null); |
|
|
|
mob.setCombatTarget(null); |
|
|
@ -121,7 +121,7 @@ public class MobAI { |
|
|
|
|
|
|
|
|
|
|
|
//no weapons, default mob attack speed 3 seconds.
|
|
|
|
//no weapons, default mob attack speed 3 seconds.
|
|
|
|
|
|
|
|
|
|
|
|
if (System.currentTimeMillis() < mob.getLastAttackTime()) |
|
|
|
if (System.currentTimeMillis() < mob.getNextAttackTime()) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
// ranged mobs cant attack while running. skip until they finally stop.
|
|
|
|
// ranged mobs cant attack while running. skip until they finally stop.
|
|
|
@ -778,7 +778,7 @@ public class MobAI { |
|
|
|
mob.setCombatTarget(null); |
|
|
|
mob.setCombatTarget(null); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (System.currentTimeMillis() > mob.getLastAttackTime()) |
|
|
|
if (System.currentTimeMillis() > mob.getNextAttackTime()) |
|
|
|
AttackTarget(mob, mob.getCombatTarget()); |
|
|
|
AttackTarget(mob, mob.getCombatTarget()); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|