for (int index = 0; index < targetList.length; index++)
{
if (!(targetList[index] instanceof L2MonsterInstance))
continue;
L2MonsterInstance target = (L2MonsterInstance) targetList[index];
if (target.isSpoil()) {
activeChar.sendPacket(new SystemMessage(SystemMessageId.ALREDAY_SPOILED));
continue;
}
// SPOIL SYSTEM by Lbaldi
boolean spoil = false;
if ( target.isDead() == false )
{
spoil = Formulas.getInstance().calcMagicSuccess(activeChar, (L2Character)targetList[index], skill);
if (spoil)
{
target.setSpoil(true);
target.setIsSpoiledBy(activeChar.getObjectId());
activeChar.sendPacket(new SystemMessage(SystemMessageId.SPOIL_SUCCESS));
}
else
{
SystemMessage sm = new SystemMessage(SystemMessageId.S1_WAS_UNAFFECTED_BY_S2);
sm.addString(target.getName());
sm.addSkillName(skill.getDisplayId());
activeChar.sendPacket(sm);
}
target.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, activeChar);
}
}
}