}
final int s_energy_wave = 20;
final int s_earth_quake = 20;
final int s_group_hold = (actor.getCurrentHpPercents() > 50) ? 0 : 20;
final int s_thunderbolt = (actor.getCurrentHpPercents() > 25) ? 0 : 20;
Skill r_skill = null;
if (actor.isMovementDisabled())
{
r_skill = thunderbolt;
}
else if (!Rnd.chance(100 - s_thunderbolt - s_group_hold - s_energy_wave - s_earth_quake))
{
final Map<Skill, Integer> d_skill = new HashMap<>();
final double distance = actor.getDistance(target);
addDesiredSkill(d_skill, target, distance, energy_wave);
addDesiredSkill(d_skill, target, distance, earth_quake);
if (s_group_hold > 0)
{
addDesiredSkill(d_skill, target, distance, group_hold);
}
if (s_thunderbolt > 0)
{
addDesiredSkill(d_skill, target, distance, thunderbolt);
}
r_skill = selectTopSkill(d_skill);
}
if (r_skill == null)
{
r_skill = baium_normal_attack;
}
else if (r_skill.getTargetType() == Skill.SkillTargetType.TARGET_SELF)
{
target = actor;
}
addTaskCast(target, r_skill);
r_skill = null;