case TARGET_AREA_CORPSE_MOB:
{
L2PcInstance player = null;
player = (L2PcInstance)activeChar;
player.sendMessage("Target area corpse mob");
if(!(target instanceof L2Attackable) || !target.isDead())
{
activeChar.sendPacket(new SystemMessage(SystemMessage.TARGET_IS_INCORRECT));
return null;
}
L2Character cha;
cha = target;
targetList.add((L2Character)obj); //just for test,
boolean skillUserIsL2PcInstance = (activeChar instanceof L2PcInstance);
boolean effectOriginIsL2PcInstance = (cha instanceof L2PcInstance);
boolean objIsL2PcInstance;
int radius = getSkillRadius();
for (L2Object obj : cha.getKnownList().getKnownObjects())
{
if (!(obj instanceof L2Character)) continue;
target = (L2Character) obj;
if(!target.isAlikeDead() && target != activeChar) // If target is not dead/fake death and not self
{
if (!Util.checkIfInRange(radius, cha, obj, true)) // Go to next obj if obj isn't in range
continue;
objIsL2PcInstance = (obj instanceof L2PcInstance);
if (skillUserIsL2PcInstance) // Skill attacker is L2PcInstance, hit everything except
{
if (
( // (
objIsL2PcInstance && // obj is L2PcInstance and
( // (
( // In same clan
(((L2PcInstance)activeChar).getClan() != null && ((L2PcInstance)obj).getClan() != null) &&
((L2PcInstance)activeChar).getClan().getClanId() == ((L2PcInstance)obj).getClan().getClanId()
) || // or in same party
(
(((L2PcInstance)activeChar).getParty() != null && ((L2PcInstance)obj).getParty() != null) &&
((L2PcInstance)activeChar).getParty().getPartyLeaderOID() == ((L2PcInstance)obj).getParty().getPartyLeaderOID()
) || // or not pvp with
!((L2PcInstance)activeChar).checkPvpSkill(obj, this)
) // )
)
)
continue;
}
else // Skill user is not L2PcInstance
{
if (effectOriginIsL2PcInstance && // If effect starts at L2PcInstance and
!objIsL2PcInstance) // Object is not L2PcInstance
continue;
}
targetList.add((L2Character)obj); // Add obj to target lists
}
}
System.out.println("Ammount of targets: "+targetList.size());
player.sendMessage("Ilosc celi: "+targetList.size());
if (targetList.size() == 0)
return null;
return targetList.toArray(new L2Character[targetList.size()]);
}