{
if(_template._counter <= 1)
{
return false;
}
L2Character effector = getEffector();
L2Skill skill = getSkill().getFirstAddedSkill();
L2NpcInstance symbol = _symbol;
double mpConsume = getSkill().getMpConsume();
if(effector == null || skill == null || symbol == null)
{
return false;
}
if(mpConsume > effector.getCurrentMp())
{
effector.sendPacket(Msg.NOT_ENOUGH_MP);
return false;
}
effector.reduceCurrentMp(mpConsume, effector);
// Использовать разрешено только скиллы типа TARGET_ONE
for(L2Character cha : L2World.getAroundCharacters(symbol, getSkill().getSkillRadius(), 200))
{
if(cha.getEffectList().getEffectsBySkill(skill) == null && skill.checkTarget(effector, cha, cha, false, false) == null)
{
if(skill.isOffensive() && !GeoEngine.canSeeTarget(symbol, cha, false))
{
continue;
}
GArray<L2Character> targets = new GArray<L2Character>(1);
targets.add(cha);
effector.callSkill(skill, targets, false);
effector.broadcastPacket(new MagicSkillLaunched(_symbol.getObjectId(), getSkill().getDisplayId(), getSkill().getDisplayLevel(), cha, true));
cha.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, effector, 1);
}
}
return true;
}