Code: Select all
case TARGET_PARTY_CLAN: { if (activeChar instanceof L2Playable) { int radius = getSkillRadius(); L2PcInstance player = null; if (activeChar instanceof L2Summon) player = ((L2Summon)activeChar).getOwner(); else player = (L2PcInstance) activeChar; if (player == null) return _emptyTargetList; L2Clan clan = player.getClan(); if (player.isInOlympiadMode()) return new L2Character[] {player}; if (targetType != SkillTargetType.TARGET_CORPSE_CLAN) { if (!onlyFirst) targetList.add(player); else return new L2Character[] {player}; } if (activeChar.getPet() != null) { if ((targetType != SkillTargetType.TARGET_CORPSE_CLAN) && !(activeChar.getPet().isDead())) targetList.add(activeChar.getPet()); } if (clan != null) { // Get all visible objects in a spheric area near the L2Character // Get Clan Members for (L2ClanMember member : clan.getMembers()) { L2PcInstance newTarget = member.getPlayerInstance(); if (newTarget == null || newTarget == player) continue; //check if allow interference is allowed if player is not on event but target is on event if ((CTF._started && !Config.CTF_ALLOW_INTERFERENCE) && !player.isGM()) { if ((newTarget._inEventCTF && !player._inEventCTF) || (!newTarget._inEventCTF && player._inEventCTF)) continue; } if (player.isInDuel() && (player.getDuelId() != newTarget.getDuelId() || (player.getParty() != null && !player.getParty().getPartyMembers().contains(newTarget)))) continue; if (newTarget.getPet() != null) if (Util.checkIfInRange(radius, activeChar, newTarget.getPet(), true)) if ((targetType != SkillTargetType.TARGET_CORPSE_CLAN) && !(newTarget.getPet().isDead()) && player.checkPvpSkill(newTarget, this) && !onlyFirst) targetList.add(newTarget.getPet()); if (targetType == SkillTargetType.TARGET_CORPSE_CLAN) { if (!newTarget.isDead()) continue; if (getSkillType() == L2SkillType.RESURRECT) { // check target is not in a active siege zone if (newTarget.isInsideZone(L2Character.ZONE_SIEGE)) continue; } } if (!Util.checkIfInRange(radius, activeChar, newTarget, true)) continue; // Don't add this target if this is a Pc->Pc pvp casting and pvp condition not met if (!player.checkPvpSkill(newTarget, this)) continue; if (!onlyFirst) targetList.add(newTarget); else return new L2Character[] {newTarget}; } } } else if (activeChar instanceof L2Npc) { // for buff purposes, returns one unbuffed friendly mob nearby or mob itself? L2Npc npc = (L2Npc) activeChar; Collection<L2Object> objs = activeChar.getKnownList().getKnownObjects().values(); //synchronized (activeChar.getKnownList().getKnownObjects()) { for (L2Object newTarget : objs) { if (newTarget instanceof L2Npc && ((L2Npc) newTarget).getFactionId() == npc.getFactionId()) { if (!Util.checkIfInRange(getCastRange(), activeChar, newTarget, true)) continue; if (((L2Npc) newTarget).getFirstEffect(this) != null) { targetList.add((L2Npc) newTarget); break; } } } } if (targetList.isEmpty()) { targetList.add(activeChar); } } return targetList.toArray(new L2Character[targetList.size()]); } { if (onlyFirst) return new L2Character[]{activeChar}; targetList.add(activeChar); L2PcInstance player = null; if (activeChar instanceof L2Summon) { player = ((L2Summon)activeChar).getOwner(); targetList.add(player); } else if (activeChar instanceof L2PcInstance) { player = (L2PcInstance)activeChar; if (activeChar.getPet() != null) targetList.add(activeChar.getPet()); } if (activeChar.getParty() != null) { // Get all visible objects in a spherical area near the L2Character // Get a list of Party Members List<L2PcInstance> partyList = activeChar.getParty().getPartyMembers(); for(L2PcInstance partyMember : partyList) { if (partyMember == null) continue; if (partyMember == player) continue; //check if allow interference is allowed if player is not on event but target is on event if ((CTF._started && !Config.CTF_ALLOW_INTERFERENCE) && !player.isGM()) { if ((partyMember._inEventCTF && !player._inEventCTF) || (!partyMember._inEventCTF && player._inEventCTF)) continue; } if (!partyMember.isDead() && Util.checkIfInRange(getSkillRadius(), activeChar, partyMember, true)) { targetList.add(partyMember); if (partyMember.getPet() != null && !partyMember.getPet().isDead()) { targetList.add(partyMember.getPet()); } } } } return targetList.toArray(new L2Character[targetList.size()]); }
what wrong?
sorry for my bad english