|
|
@ -324,10 +324,10 @@ public class MobAI { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int castRoll = ThreadLocalRandom.current().nextInt(101); |
|
|
|
//int castRoll = ThreadLocalRandom.current().nextInt(1,101);
|
|
|
|
|
|
|
|
|
|
|
|
if (castRoll <= MobAIThread.AI_POWER_DIVISOR) |
|
|
|
//if (castRoll < MobAIThread.AI_POWER_DIVISOR)
|
|
|
|
return false; |
|
|
|
// return false;
|
|
|
|
|
|
|
|
|
|
|
|
if (mob.nextCastTime == 0) |
|
|
|
if (mob.nextCastTime == 0) |
|
|
|
mob.nextCastTime = System.currentTimeMillis(); |
|
|
|
mob.nextCastTime = System.currentTimeMillis(); |
|
|
@ -349,7 +349,7 @@ public class MobAI { |
|
|
|
|
|
|
|
|
|
|
|
ArrayList<Integer> powerTokens; |
|
|
|
ArrayList<Integer> powerTokens; |
|
|
|
ArrayList<Integer> purgeTokens; |
|
|
|
ArrayList<Integer> purgeTokens; |
|
|
|
PlayerCharacter target = (PlayerCharacter) mob.getCombatTarget(); |
|
|
|
AbstractCharacter target = (AbstractCharacter) mob.getCombatTarget(); |
|
|
|
|
|
|
|
|
|
|
|
if (mob.BehaviourType.callsForHelp) |
|
|
|
if (mob.BehaviourType.callsForHelp) |
|
|
|
MobCallForHelp(mob); |
|
|
|
MobCallForHelp(mob); |
|
|
@ -410,22 +410,23 @@ public class MobAI { |
|
|
|
|
|
|
|
|
|
|
|
if (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mobPower.getRange())) { |
|
|
|
if (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mobPower.getRange())) { |
|
|
|
|
|
|
|
|
|
|
|
PowersManager.useMobPower(mob, (AbstractCharacter) mob.getCombatTarget(), mobPower, powerRank); |
|
|
|
|
|
|
|
PerformActionMsg msg; |
|
|
|
PerformActionMsg msg; |
|
|
|
|
|
|
|
|
|
|
|
if (!mobPower.isHarmful() || mobPower.targetSelf) |
|
|
|
if (!mobPower.isHarmful() || mobPower.targetSelf) { |
|
|
|
|
|
|
|
PowersManager.useMobPower(mob, mob, mobPower, powerRank); |
|
|
|
msg = PowersManager.createPowerMsg(mobPower, powerRank, mob, mob); |
|
|
|
msg = PowersManager.createPowerMsg(mobPower, powerRank, mob, mob); |
|
|
|
else |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
PowersManager.useMobPower(mob, target, mobPower, powerRank); |
|
|
|
msg = PowersManager.createPowerMsg(mobPower, powerRank, mob, target); |
|
|
|
msg = PowersManager.createPowerMsg(mobPower, powerRank, mob, target); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
msg.setUnknown04(2); |
|
|
|
msg.setUnknown04(2); |
|
|
|
|
|
|
|
|
|
|
|
PowersManager.finishUseMobPower(msg, mob, 0, 0); |
|
|
|
PowersManager.finishUseMobPower(msg, mob, 0, 0); |
|
|
|
|
|
|
|
|
|
|
|
// Default minimum seconds between cast = 10
|
|
|
|
mob.nextCastTime = System.currentTimeMillis() + (long) ((mobPower.getCooldown() + (MobAIThread.AI_POWER_DIVISOR * 1000))); |
|
|
|
|
|
|
|
|
|
|
|
float randomCooldown = (ThreadLocalRandom.current().nextInt(150) + 100) * 0.01f; |
|
|
|
|
|
|
|
mob.nextCastTime = System.currentTimeMillis() + (long) ((mobPower.getCooldown() + (MobAIThread.AI_POWER_DIVISOR * 1000)) * randomCooldown); |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|