last minute cleanup, added cast chance to mobs

This commit is contained in:
2023-07-15 07:59:07 -05:00
parent 761adca2ef
commit 9f162e9ed0
6 changed files with 6 additions and 174 deletions
+6 -1
View File
@@ -225,6 +225,10 @@ public class MobileFSM {
mob.setCombatTarget(null);
return false;
}
int castRoll = ThreadLocalRandom.current().nextInt(101);
if(castRoll <= MobileFSMManager.AI_POWER_DIVISOR){
return false;
}
if (mob.nextCastTime == 0)
mob.nextCastTime = System.currentTimeMillis();
return mob.nextCastTime <= System.currentTimeMillis();
@@ -286,7 +290,8 @@ public class MobileFSM {
msg.setUnknown04(2);
PowersManager.finishUseMobPower(msg, mob, 0, 0);
// Default minimum seconds between cast = 10
mob.nextCastTime = System.currentTimeMillis() + mobPower.getCooldown() + (MobileFSMManager.AI_POWER_DIVISOR * 1000);
float randomCooldown = (ThreadLocalRandom.current().nextInt(150) + 100) * 0.01f;
mob.nextCastTime = System.currentTimeMillis() + (long)((mobPower.getCooldown() + (MobileFSMManager.AI_POWER_DIVISOR * 1000)) * randomCooldown);
return true;
}
return false;
-2
View File
@@ -33,10 +33,8 @@ public class MobileFSMManager {
public static int AI_DROP_AGGRO_RANGE = 60;
public static int AI_RECALL_RANGE = 400;
public static int AI_PULSE_MOB_THRESHOLD = 200;
public static int AI_THREAD_SLEEP = 1000;
public static int AI_PATROL_DIVISOR = 15;
public static int AI_POWER_DIVISOR = 20;
public static float AI_MAX_ANGLE = 10f;
private MobileFSMManager() {