L2Character target;
if((target = prepareTarget()) == null)
{
return false;
}
L2NpcInstance actor = getActor();
if(actor == null || actor.isDead())
{
return false;
}
double distance = actor.getDistance(target);
double actor_hp_precent = actor.getCurrentHpPercents();
int rnd_per = Rnd.get(100);
if(actor_hp_precent < 15 && !_isUsedInvincible)
{
_isUsedInvincible = true;
addTaskBuff(actor, Invincible);
Functions.npcSay(actor, "Готовьтесь к смерти!!!");
return true;
}
if(rnd_per < 5 && spawnTask == null && despawnTask == null)
{
actor.broadcastPacketToOthers(new MagicSkillUse(actor, actor, 5441, 1, 3000, 0));
spawnTask = ThreadPoolManager.getInstance().scheduleGeneral(new SpawnMobsTask(), 3000);
return true;
}
if(!actor.isAMuted() && rnd_per < 75)
{
return chooseTaskAndTargets(null, target, distance);
}
return chooseTaskAndTargets(Freezing, target, distance);
}