All pastes #47022 Raw Edit

L2Skill

public java v1 · immutable
#47022 ·published 2006-03-26 11:34 UTC
rendered paste body
Index: C:/Documents and Settings/Vivian/workspace/L2_GameServer_c4/java/net/sf/l2j/gameserver/model/L2Skill.java===================================================================--- C:/Documents and Settings/Vivian/workspace/L2_GameServer_c4/java/net/sf/l2j/gameserver/model/L2Skill.java	(revision 1670)+++ C:/Documents and Settings/Vivian/workspace/L2_GameServer_c4/java/net/sf/l2j/gameserver/model/L2Skill.java	(working copy)@@ -90,6 +90,7 @@         TARGET_AURA,         TARGET_CORPSE,         TARGET_UNDEAD,+        TARGET_AREA_UNDEAD,         TARGET_MULTIFACE,         TARGET_CORPSE_ALLY,         TARGET_CORPSE_CLAN,@@ -1045,6 +1046,8 @@             boolean skillUserIsL2PcInstance = (activeChar instanceof L2PcInstance);             boolean effectOriginIsL2PcInstance = (cha instanceof L2PcInstance);             boolean objIsL2PcInstance;+            boolean objIsL2PetInstance;+            boolean objIsL2Summon;             int radius = getSkillRadius();             for (L2Object obj : cha.getKnownList().getKnownObjects())             {@@ -1057,6 +1060,8 @@                         continue;                      objIsL2PcInstance = (obj instanceof L2PcInstance);+                    objIsL2PetInstance = (obj instanceof L2PetInstance);+                    objIsL2Summon = (obj instanceof L2Summon);                      if (skillUserIsL2PcInstance)                // Skill attacker is L2PcInstance, hit everything except                     {@@ -1072,11 +1077,75 @@                                                         (((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)+                                                )||            //      or not in pvp zone+                                                (+                                                !((L2PcInstance)obj).getInPvpZone()		+                                                )||            //      or not Karma <= 0+                                                (+                                                ((L2PcInstance)obj).getKarma() <= 0+                                                )                                         )                       //   )                                 )                             )                             continue;+                        if (+                                (                               // (+                                        objIsL2PetInstance &&    //   obj is L2PcInstance and+                                        (                       //   (+                                                (               //     In same clan+                                                        (((L2PcInstance)activeChar).getClan() != null && ((L2PetInstance)obj).getOwner().getClan() != null) &&+                                                        ((L2PcInstance)activeChar).getClan().getClanId() == ((L2PetInstance)obj).getOwner().getClan().getClanId()+                                                ) ||            //     or in same party+                                                (+                                                        (((L2PcInstance)activeChar).getParty() != null && ((L2PetInstance)obj).getOwner().getParty() != null) &&+                                                        ((L2PcInstance)activeChar).getParty().getPartyLeaderOID() == ((L2PetInstance)obj).getOwner().getParty().getPartyLeaderOID()+                                                ) ||            //     or not pvp with +                                                (+                                                		!((L2PcInstance)activeChar).checkPvpSkill(obj, this)+                                                ) ||            //      or not in pvp zone+                                                (+                                                		!((L2PetInstance)obj).getOwner().getInPvpZone()		+                                                ) ||            //      or not Karma <= 0+                                                (+                                                		((L2PetInstance)obj).getOwner().getKarma() <= 0+                                                ) ||+                                                (+                                                		((L2PetInstance)obj).getOwner() == (L2PcInstance)activeChar+                                                )+                                        )                       //   )+                                )+                            )+                            continue;+                        if (+                                (                               // (+                                        objIsL2Summon &&    //   obj is L2PcInstance and+                                        (                       //   (+                                                (               //     In same clan+                                                        (((L2PcInstance)activeChar).getClan() != null && ((L2Summon)obj).getOwner().getClan() != null) &&+                                                        ((L2PcInstance)activeChar).getClan().getClanId() == ((L2Summon)obj).getOwner().getClan().getClanId()+                                                ) ||            //     or in same party+                                                (+                                                        (((L2PcInstance)activeChar).getParty() != null && ((L2Summon)obj).getOwner().getParty() != null) &&+                                                        ((L2PcInstance)activeChar).getParty().getPartyLeaderOID() == ((L2Summon)obj).getOwner().getParty().getPartyLeaderOID()+                                                ) ||            //     or not pvp with +                                                (+                                                		!((L2PcInstance)activeChar).checkPvpSkill(obj, this)+                                                ) ||            //      or not in pvp zone+                                                (+                                                		!((L2Summon)obj).getOwner().getInPvpZone()		+                                                ) ||            //      or not Karma <= 0+                                                (+                                                		((L2Summon)obj).getOwner().getKarma() <= 0+                                                ) ||+                                                (+                                                		((L2Summon)obj).getOwner() == (L2PcInstance)activeChar+                                                )+                                        )                       //   )+                                )+                            )+                            continue;                     }                     else                                                // Skill user is not L2PcInstance                     {@@ -1283,6 +1352,141 @@             activeChar.sendPacket(new SystemMessage(SystemMessage.TARGET_IS_INCORRECT));             return null;         }+        case TARGET_AREA_CORPSE_MOB:+        {+        	if (!(target instanceof L2Attackable) || !target.isDead())+        	{+        		activeChar.sendPacket(new SystemMessage(SystemMessage.TARGET_IS_INCORRECT));+        		return null;+        	}+        	L2Character cha;+            if (this.getCastRange() >= 0)+            {+                cha = target;+                targetList.add((L2Character)cha); // Add target to target list+            }+            else+                cha = activeChar;++            boolean skillUserIsL2PcInstance = (activeChar instanceof L2PcInstance);+            boolean effectOriginIsL2PcInstance = (cha instanceof L2PcInstance);+            boolean objIsL2PcInstance;+            boolean objIsL2PetInstance;+            boolean objIsL2Summon;+            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);+                    objIsL2PetInstance = (obj instanceof L2PetInstance);+                    objIsL2Summon = (obj instanceof L2Summon);++                    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)+                                                ) ||            //      or not in pvp zone+                                                (+                                                		!((L2PcInstance)obj).getInPvpZone()		+                                                ) ||            //      or not Karma <= 0+                                                (+                                                		((L2PcInstance)obj).getKarma() <= 0+                                                )+                                        )                       //   )+                                )+                            )+                            continue;+                        if (+                                (                               // (+                                        objIsL2PetInstance &&    //   obj is L2PcInstance and+                                        (                       //   (+                                                (               //     In same clan+                                                        (((L2PcInstance)activeChar).getClan() != null && ((L2PetInstance)obj).getOwner().getClan() != null) &&+                                                        ((L2PcInstance)activeChar).getClan().getClanId() == ((L2PetInstance)obj).getOwner().getClan().getClanId()+                                                ) ||            //     or in same party+                                                (+                                                        (((L2PcInstance)activeChar).getParty() != null && ((L2PetInstance)obj).getOwner().getParty() != null) &&+                                                        ((L2PcInstance)activeChar).getParty().getPartyLeaderOID() == ((L2PetInstance)obj).getOwner().getParty().getPartyLeaderOID()+                                                ) ||            //     or not pvp with +                                                (+                                                		!((L2PcInstance)activeChar).checkPvpSkill(obj, this)+                                                ) ||            //      or not in pvp zone+                                                (+                                                		!((L2PetInstance)obj).getOwner().getInPvpZone()		+                                                ) ||            //      or not Karma <= 0+                                                (+                                                		((L2PetInstance)obj).getOwner().getKarma() <= 0+                                                ) ||+                                                (+                                                		((L2PetInstance)obj).getOwner() == (L2PcInstance)activeChar+                                                )+                                        )                       //   )+                                )+                            )+                            continue;+                        if (+                                (                               // (+                                        objIsL2Summon &&    //   obj is L2PcInstance and+                                        (                       //   (+                                                (               //     In same clan+                                                        (((L2PcInstance)activeChar).getClan() != null && ((L2Summon)obj).getOwner().getClan() != null) &&+                                                        ((L2PcInstance)activeChar).getClan().getClanId() == ((L2Summon)obj).getOwner().getClan().getClanId()+                                                ) ||            //     or in same party+                                                (+                                                        (((L2PcInstance)activeChar).getParty() != null && ((L2Summon)obj).getOwner().getParty() != null) &&+                                                        ((L2PcInstance)activeChar).getParty().getPartyLeaderOID() == ((L2Summon)obj).getOwner().getParty().getPartyLeaderOID()+                                                ) ||            //     or not pvp with +                                                (+                                                		!((L2PcInstance)activeChar).checkPvpSkill(obj, this)+                                                ) ||            //      or not in pvp zone+                                                (+                                                		!((L2Summon)obj).getOwner().getInPvpZone()		+                                                ) ||            //      or not Karma <= 0+                                                (+                                                		((L2Summon)obj).getOwner().getKarma() <= 0+                                                ) ||+                                                (+                                                		((L2Summon)obj).getOwner() == (L2PcInstance)activeChar+                                                )+                                        )                       //   )+                                )+                            )+                            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+                }+            }+            +            if (targetList.size() == 0)+                return null;+            return targetList.toArray(new L2Character[targetList.size()]);+        }         case TARGET_CORPSE_MOB:         {             if(!(target instanceof L2Attackable) || !target.isDead())@@ -1325,6 +1529,43 @@                 return targetList.toArray(new L2Object[targetList.size()]);             }         }+        case TARGET_AREA_UNDEAD:+        {+        	if (!(target instanceof L2Attackable) || !target.isDead())+        	{+        		activeChar.sendPacket(new SystemMessage(SystemMessage.TARGET_IS_INCORRECT));+        		return null;+        	}+        	L2Character cha;+            if (this.getCastRange() >= 0)+            {+                cha = target;+                targetList.add((L2Character)cha); // Add target to target list+            }+            else+                cha = activeChar;++            int radius = getSkillRadius();+            for (L2Object obj : cha.getKnownList().getKnownObjects())+            {+                if (!(obj instanceof L2Character)) continue;++                target = (L2Character) obj;+                if(!target.isAlikeDead())   // If target is not dead/fake death and not self+                {+                	if (!((L2PcInstance)obj).isUndead())+                		continue;+                    if (!Util.checkIfInRange(radius, cha, obj, true)) // Go to next obj if obj isn't in range+                        continue;++                    targetList.add((L2Character)obj);   // Add obj to target lists+                }+            }+            +            if (targetList.size() == 0)+                return null;+            return targetList.toArray(new L2Character[targetList.size()]);+        }         default:         {             SystemMessage sm = new SystemMessage(614);