diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 53fc9832..210aefa3 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -59,7 +59,7 @@ public class MobAI { } - mob.lastAttackTime = System.currentTimeMillis() + delay; + mob.nextAttackTime = System.currentTimeMillis() + delay; if (target.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && !mob.canSee((AbstractCharacter) target)) { mob.setCombatTarget(null); @@ -121,7 +121,7 @@ public class MobAI { //no weapons, default mob attack speed 3 seconds. - if (System.currentTimeMillis() < mob.getLastAttackTime()) + if (System.currentTimeMillis() < mob.getNextAttackTime()) return; // ranged mobs cant attack while running. skip until they finally stop. @@ -778,7 +778,7 @@ public class MobAI { mob.setCombatTarget(null); return; } - if (System.currentTimeMillis() > mob.getLastAttackTime()) + if (System.currentTimeMillis() > mob.getNextAttackTime()) AttackTarget(mob, mob.getCombatTarget()); } catch (Exception e) { diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 97ec4492..b9a08925 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -71,7 +71,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed { public AbstractWorldObject fearedObject = null; protected int dbID; //the database ID private int currentID; - public long lastAttackTime = 0; + public long nextAttackTime = System.currentTimeMillis(); private int lastMobPowerToken = 0; private DeferredPowerJob weaponPower; private DateTime upgradeDateTime = null; @@ -1338,8 +1338,8 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed { return this.upgradeDateTime != null; } - public long getLastAttackTime() { - return lastAttackTime; + public long getNextAttackTime() { + return nextAttackTime; }