Skip to content
Snippets Groups Projects
Commit f177fcbf authored by Adry_85's avatar Adry_85
Browse files

BETA: Fixing Chain Heal behavior with different targets.

	Reported by: badboy29
	Tested by: badboy29
	Reviewed by: !UnAfraid
parent 5fc963ac
No related branches found
No related tags found
No related merge requests found
...@@ -49,25 +49,22 @@ public class AreaFriendly implements ITargetTypeHandler ...@@ -49,25 +49,22 @@ public class AreaFriendly implements ITargetTypeHandler
return _emptyTargetList; return _emptyTargetList;
} }
if (skill.getCastRange() >= 0) if (onlyFirst)
{ {
if (onlyFirst) return new L2Character[]
{ {
return new L2Character[] target
{ };
target }
};
} if (activeChar.getActingPlayer().isInOlympiadMode())
{
if (activeChar.getActingPlayer().isInOlympiadMode()) return new L2Character[]
{ {
return new L2Character[] activeChar
{ };
activeChar
};
}
targetList.add(target); // Add target to target list
} }
targetList.add(target); // Add target to target list
if (target != null) if (target != null)
{ {
...@@ -107,35 +104,31 @@ public class AreaFriendly implements ITargetTypeHandler ...@@ -107,35 +104,31 @@ public class AreaFriendly implements ITargetTypeHandler
return false; 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; 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; 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 (activeChar.getAllyId() == target.getAllyId());
{
return true;
}
return false;
} }
if ((target != activeChar) && (target.getActingPlayer().getPvpFlag() > 0)) if ((target != activeChar) && (target.getActingPlayer().getPvpFlag() > 0))
......
...@@ -34,7 +34,7 @@ public class One implements ITargetTypeHandler ...@@ -34,7 +34,7 @@ public class One implements ITargetTypeHandler
public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target) public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
{ {
// Check for null target or any other invalid 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); activeChar.sendPacket(SystemMessageId.TARGET_IS_INCORRECT);
return _emptyTargetList; return _emptyTargetList;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment