Browse Source

BETA: Fixing Chain Heal behavior with different targets.
Reported by: badboy29
Tested by: badboy29
Reviewed by: !UnAfraid

Adry_85 12 years ago
parent
commit
f177fcbf12

+ 21 - 28
L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/AreaFriendly.java

@@ -49,25 +49,22 @@ public class AreaFriendly implements ITargetTypeHandler
 			return _emptyTargetList;
 		}
 		
-		if (skill.getCastRange() >= 0)
+		if (onlyFirst)
 		{
-			if (onlyFirst)
+			return new L2Character[]
 			{
-				return new L2Character[]
-				{
-					target
-				};
-			}
-			
-			if (activeChar.getActingPlayer().isInOlympiadMode())
+				target
+			};
+		}
+		
+		if (activeChar.getActingPlayer().isInOlympiadMode())
+		{
+			return new L2Character[]
 			{
-				return new L2Character[]
-				{
-					activeChar
-				};
-			}
-			targetList.add(target); // Add target to target list
+				activeChar
+			};
 		}
+		targetList.add(target); // Add target to target list
 		
 		if (target != null)
 		{
@@ -107,35 +104,31 @@ public class AreaFriendly implements ITargetTypeHandler
 			return false;
 		}
 		
-		if ((target == null) || target.isDead() || target.isAlikeDead() || target.isDoor() || (target instanceof L2SiegeFlagInstance) || target.isMonster())
+		if ((target == null) || target.isAlikeDead() || target.isDoor() || (target instanceof L2SiegeFlagInstance) || target.isMonster())
 		{
 			return false;
 		}
 		
-		if ((target.getActingPlayer() != null) && (target.getActingPlayer().inObserverMode() || target.getActingPlayer().isInOlympiadMode()))
+		if ((target.getActingPlayer() != null) && (target.getActingPlayer() != activeChar) && (target.getActingPlayer().inObserverMode() || target.getActingPlayer().isInOlympiadMode()))
 		{
 			return false;
 		}
 		
-		if (target.isPlayer())
+		if (target.isPlayable())
 		{
-			if ((target.getAllyId() != 0) && (activeChar.getAllyId() == target.getAllyId()))
+			if ((target != activeChar) && activeChar.isInParty() && target.isInParty())
 			{
-				return true;
+				return (activeChar.getParty().getLeader() == target.getParty().getLeader());
 			}
 			
-			if ((target.getClanId() != 0) && (activeChar.getClanId() == target.getClanId()))
+			if ((activeChar.getClanId() != 0) && (target.getClanId() != 0))
 			{
-				return true;
+				return (activeChar.getClanId() == target.getClanId());
 			}
 			
-			if ((target != activeChar) && activeChar.isInParty() && target.isInParty())
+			if ((activeChar.getAllyId() != 0) && (target.getAllyId() != 0))
 			{
-				if (activeChar.getParty().getLeader() == target.getParty().getLeader())
-				{
-					return true;
-				}
-				return false;
+				return (activeChar.getAllyId() == target.getAllyId());
 			}
 			
 			if ((target != activeChar) && (target.getActingPlayer().getPvpFlag() > 0))

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/One.java

@@ -34,7 +34,7 @@ public class One implements ITargetTypeHandler
 	public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
 	{
 		// Check for null target or any other invalid target
-		if ((target == null) || target.isDead() || ((target == activeChar) && (skill.isOffensive() || skill.isPVP())))
+		if ((target == null) || target.isDead() || ((target == activeChar) && skill.isOffensive()))
 		{
 			activeChar.sendPacket(SystemMessageId.TARGET_IS_INCORRECT);
 			return _emptyTargetList;