|
|
@ -180,9 +180,7 @@ public class MobileFSM { |
|
|
|
mob.stopPatrolTime = System.currentTimeMillis(); |
|
|
|
mob.stopPatrolTime = System.currentTimeMillis(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
//wait between 10 and 15 seconds after reaching patrol point before moving
|
|
|
|
if (mob.stopPatrolTime + (MBServerStatics.AI_PATROL_DIVISOR * 1000) > System.currentTimeMillis()) |
|
|
|
int patrolDelay = ThreadLocalRandom.current().nextInt(10000) + 5000; |
|
|
|
|
|
|
|
if (mob.stopPatrolTime + patrolDelay > System.currentTimeMillis()) |
|
|
|
|
|
|
|
//early exit while waiting to patrol again
|
|
|
|
//early exit while waiting to patrol again
|
|
|
|
return; |
|
|
|
return; |
|
|
|
//guard captains inherit barracks patrol points dynamically
|
|
|
|
//guard captains inherit barracks patrol points dynamically
|
|
|
@ -228,6 +226,9 @@ public class MobileFSM { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
if (mob.mobPowers.isEmpty()) |
|
|
|
if (mob.mobPowers.isEmpty()) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
//added in cast chance for mobs, editable by MBServerStatics.AI_POWER_CHANCE
|
|
|
|
|
|
|
|
if(ThreadLocalRandom.current().nextInt(100) > MBServerStatics.AI_POWER_CHANCE) |
|
|
|
|
|
|
|
return false; |
|
|
|
if (mob.nextCastTime == 0) |
|
|
|
if (mob.nextCastTime == 0) |
|
|
|
mob.nextCastTime = System.currentTimeMillis(); |
|
|
|
mob.nextCastTime = System.currentTimeMillis(); |
|
|
|
return mob.nextCastTime <= System.currentTimeMillis(); |
|
|
|
return mob.nextCastTime <= System.currentTimeMillis(); |
|
|
@ -273,11 +274,7 @@ public class MobileFSM { |
|
|
|
msg.setUnknown04(2); |
|
|
|
msg.setUnknown04(2); |
|
|
|
PowersManager.finishUseMobPower(msg, mob, 0, 0); |
|
|
|
PowersManager.finishUseMobPower(msg, mob, 0, 0); |
|
|
|
// Default minimum seconds between cast = 10
|
|
|
|
// Default minimum seconds between cast = 10
|
|
|
|
long coolDown = mobPower.getCooldown(); |
|
|
|
mob.nextCastTime = System.currentTimeMillis() + (MBServerStatics.AI_POWER_DIVISOR * 1000); |
|
|
|
if (coolDown < 10000) |
|
|
|
|
|
|
|
mob.nextCastTime = System.currentTimeMillis() + 10000 + coolDown; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
mob.nextCastTime = System.currentTimeMillis() + coolDown; |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
return false; |
|
|
|