ソースを参照

Support for TARGET_PARTY_CLAN target type and fix for #4053

_DS_ 16 年 前
コミット
6e5d52dea2

+ 13 - 14
L2_GameServer/java/net/sf/l2j/gameserver/model/L2Skill.java

@@ -1505,8 +1505,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
 
                 if (getCastRange() >= 0)
                 {
-                	if (!Util.checkIfInRange(getCastRange(), activeChar, target, true)
-        					|| !checkForAreaOffensiveSkills(activeChar, target, this, srcInArena))
+                	if (!checkForAreaOffensiveSkills(activeChar, target, this, srcInArena))
                 		return _emptyTargetList;
 
                 	if(onlyFirst)
@@ -1613,7 +1612,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
                     	targetList.add(player.getPet());
                 }
 
-				if (activeChar.getParty() != null)
+				if (activeChar.isInParty())
 				{
 					// Get a list of Party Members
 					for(L2PcInstance partyMember : activeChar.getParty().getPartyMembers())
@@ -1635,8 +1634,8 @@ public abstract class L2Skill implements IChanceSkillTrigger
 				if ((target != null
 						&& target == activeChar)
 					|| (target != null
-							&& activeChar.getParty() != null
-							&& target.getParty() != null
+							&& activeChar.isInParty()
+							&& target.isInParty()
 							&& activeChar.getParty().getPartyLeaderOID() == target.getParty().getPartyLeaderOID())
 					|| (target != null
 							&& activeChar instanceof L2PcInstance
@@ -1664,7 +1663,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
 			case TARGET_PARTY_OTHER:
             {
                 if (target != null && target != activeChar
-                        && activeChar.getParty() != null && target.getParty() != null
+                        && activeChar.isInParty() && target.isInParty()
                         && activeChar.getParty().getPartyLeaderOID() == target.getParty().getPartyLeaderOID())
                 {
                     if (!target.isDead())
@@ -1743,7 +1742,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
 								{
 									if (player.getDuelId() != obj.getDuelId())
 										continue;
-									if (player.getParty() != null && !player.getParty().getPartyMembers().contains(obj))
+									if (player.isInParty() && obj.isInParty() && player.getParty().getPartyLeaderOID() != obj.getParty().getPartyLeaderOID())
 										continue;
 								}
 
@@ -1825,7 +1824,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
 							{
 								if (player.getDuelId() != obj.getDuelId())
 									continue;
-								if (player.getParty() != null && !player.getParty().getPartyMembers().contains(obj))
+								if (player.isInParty() && obj.isInParty() && player.getParty().getPartyLeaderOID() != obj.getParty().getPartyLeaderOID())
 									continue;
 							}
 
@@ -1903,13 +1902,13 @@ public abstract class L2Skill implements IChanceSkillTrigger
 
                 final int radius = getSkillRadius();
                 final boolean hasClan = player.getClan() != null;
-                final boolean hasParty = player.getParty() != null;
+                final boolean hasParty = player.isInParty();
 
                 if (addSummon(activeChar, player, radius, false))
                 	targetList.add(player.getPet());
 
                 // if player in olympiad mode or not in clan and not in party
-                if (player.isInOlympiadMode() || (!hasClan && !hasParty))
+                if (player.isInOlympiadMode() || !(hasClan || hasParty))
                     return targetList.toArray(new L2Character[targetList.size()]);
 
                 // Get all visible objects in a spherical area near the L2Character
@@ -1926,12 +1925,12 @@ public abstract class L2Skill implements IChanceSkillTrigger
 							if (player.getDuelId() != obj.getDuelId())
 								continue;
 
-							if (hasParty && !player.getParty().getPartyMembers().contains(obj))
+							if (hasParty && obj.isInParty() && player.getParty().getPartyLeaderOID() != obj.getParty().getPartyLeaderOID())
 								continue;
 						}
 
-						if ((hasClan && obj.getClanId() != player.getClanId())
-								|| (hasParty && !player.getParty().getPartyMembers().contains(obj)))
+						if (!((hasClan && obj.getClanId() == player.getClanId())
+								|| (hasParty && obj.isInParty() && player.getParty().getPartyLeaderOID() == obj.getParty().getPartyLeaderOID())))
 							continue;
 
 						// Don't add this target if this is a Pc->Pc pvp
@@ -2264,7 +2263,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
     			if (target.isInsideZone(L2Character.ZONE_PEACE))
     				return false;
 
-    			if ((player.getParty() != null && targetPlayer.getParty() != null)
+    			if ((player.isInParty() && targetPlayer.isInParty())
     			        && player.getParty().getPartyLeaderOID() == targetPlayer.getParty().getPartyLeaderOID())
     				return false;
 

+ 1 - 0
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/L2Character.java

@@ -1483,6 +1483,7 @@ public abstract class L2Character extends L2Object
 			case TARGET_SUMMON:
 			case TARGET_PARTY:
 			case TARGET_CLAN:
+			case TARGET_PARTY_CLAN:
 			case TARGET_ALLY:
         		doit = true;
         	default:

+ 4 - 0
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java

@@ -8527,6 +8527,7 @@ public final class L2PcInstance extends L2Playable
         	case TARGET_PARTY:
         	case TARGET_ALLY:
         	case TARGET_CLAN:
+        	case TARGET_PARTY_CLAN:
         	case TARGET_GROUND:
         	case TARGET_SELF:
         		target = this;
@@ -8682,6 +8683,7 @@ public final class L2PcInstance extends L2Playable
 					case TARGET_FRONT_AURA:
 					case TARGET_BEHIND_AURA:
 					case TARGET_CLAN:
+					case TARGET_PARTY_CLAN:
 					case TARGET_ALLY:
 					case TARGET_PARTY:
 					case TARGET_SELF:
@@ -8761,6 +8763,7 @@ public final class L2PcInstance extends L2Playable
 				case TARGET_FRONT_AURA:
 				case TARGET_BEHIND_AURA:
 				case TARGET_CLAN:
+				case TARGET_PARTY_CLAN:
 				case TARGET_SELF:
 				case TARGET_PARTY:
 				case TARGET_ALLY:
@@ -8848,6 +8851,7 @@ public final class L2PcInstance extends L2Playable
 			case TARGET_PARTY:
 			case TARGET_ALLY:   // For such skills, checkPvpSkill() is called from L2Skill.getTargetList()
 			case TARGET_CLAN:   // For such skills, checkPvpSkill() is called from L2Skill.getTargetList()
+			case TARGET_PARTY_CLAN:   // For such skills, checkPvpSkill() is called from L2Skill.getTargetList()
 			case TARGET_AURA:
 			case TARGET_FRONT_AURA:
 			case TARGET_BEHIND_AURA: