From aaad091f6f385ee88e6d5de0b4714502b6819951 Mon Sep 17 00:00:00 2001 From: MELERIX <MELERIX@users.noreply.github.com> Date: Mon, 25 Mar 2013 00:40:48 +0000 Subject: [PATCH] BETA: AURA related targets shouldn't add caster in the list of targets, it fix the issues of Warrior/Mage Banes skills affecting caster. Reported by: d!g0 Tested by: oscard --- .../scripts/handlers/targethandlers/Aura.java | 56 ++++------------ .../handlers/targethandlers/BehindAura.java | 65 +++++-------------- .../handlers/targethandlers/FrontAura.java | 65 +++++-------------- 3 files changed, 43 insertions(+), 143 deletions(-) diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/Aura.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/Aura.java index 50d362f624..b0b3bb3c05 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/Aura.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/Aura.java @@ -26,9 +26,7 @@ import javolution.util.FastList; import com.l2jserver.gameserver.handler.ITargetTypeHandler; import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.actor.L2Character; -import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.skills.L2Skill; -import com.l2jserver.gameserver.model.skills.L2SkillType; import com.l2jserver.gameserver.model.skills.targets.L2TargetType; import com.l2jserver.gameserver.model.zone.ZoneId; @@ -42,62 +40,30 @@ public class Aura implements ITargetTypeHandler { List<L2Character> targetList = new FastList<>(); final boolean srcInArena = (activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE)); - - final L2PcInstance sourcePlayer = activeChar.getActingPlayer(); - final Collection<L2Character> objs = activeChar.getKnownList().getKnownCharactersInRadius(skill.getAffectRange()); - if (skill.getSkillType() == L2SkillType.DUMMY) + for (L2Character obj : objs) { - if (onlyFirst) - { - return new L2Character[] - { - activeChar - }; - } - - targetList.add(activeChar); - for (L2Character obj : objs) + if (obj.isL2Attackable() || obj.isPlayable()) { - if (!((obj == activeChar) || (obj == sourcePlayer) || obj.isNpc() || obj.isL2Attackable())) + if (!L2Skill.checkForAreaOffensiveSkills(activeChar, obj, skill, srcInArena)) { continue; } - if ((skill.getMaxTargets() > -1) && (targetList.size() >= skill.getMaxTargets())) + if (onlyFirst) { - break; + return new L2Character[] + { + obj + }; } - targetList.add(obj); - } - } - else - { - for (L2Character obj : objs) - { - if (obj.isL2Attackable() || obj.isPlayable()) + if ((skill.getMaxTargets() > -1) && (targetList.size() >= skill.getMaxTargets())) { - if (!L2Skill.checkForAreaOffensiveSkills(activeChar, obj, skill, srcInArena)) - { - continue; - } - - if (onlyFirst) - { - return new L2Character[] - { - obj - }; - } - - if ((skill.getMaxTargets() > -1) && (targetList.size() >= skill.getMaxTargets())) - { - break; - } - targetList.add(obj); + break; } + targetList.add(obj); } } return targetList.toArray(new L2Character[targetList.size()]); diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/BehindAura.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/BehindAura.java index 04b95c3960..10c28dd966 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/BehindAura.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/BehindAura.java @@ -26,9 +26,7 @@ import javolution.util.FastList; import com.l2jserver.gameserver.handler.ITargetTypeHandler; import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.actor.L2Character; -import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.skills.L2Skill; -import com.l2jserver.gameserver.model.skills.L2SkillType; import com.l2jserver.gameserver.model.skills.targets.L2TargetType; import com.l2jserver.gameserver.model.zone.ZoneId; @@ -42,29 +40,31 @@ public class BehindAura implements ITargetTypeHandler { List<L2Character> targetList = new FastList<>(); final boolean srcInArena = (activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE)); - - final L2PcInstance sourcePlayer = activeChar.getActingPlayer(); - final Collection<L2Character> objs = activeChar.getKnownList().getKnownCharactersInRadius(skill.getAffectRange()); - if (skill.getSkillType() == L2SkillType.DUMMY) + for (L2Character obj : objs) { - if (onlyFirst) + if (obj.isL2Attackable() || obj.isPlayable()) { - return new L2Character[] + + if (!obj.isBehind(activeChar)) { - activeChar - }; - } - - targetList.add(activeChar); - for (L2Character obj : objs) - { - if (!((obj == activeChar) || (obj == sourcePlayer) || (obj.isNpc()) || (obj.isL2Attackable()))) + continue; + } + + if (!L2Skill.checkForAreaOffensiveSkills(activeChar, obj, skill, srcInArena)) { continue; } + if (onlyFirst) + { + return new L2Character[] + { + obj + }; + } + if ((skill.getMaxTargets() > -1) && (targetList.size() >= skill.getMaxTargets())) { break; @@ -72,39 +72,6 @@ public class BehindAura implements ITargetTypeHandler targetList.add(obj); } } - else - { - for (L2Character obj : objs) - { - if (obj.isL2Attackable() || obj.isPlayable()) - { - - if (!obj.isBehind(activeChar)) - { - continue; - } - - if (!L2Skill.checkForAreaOffensiveSkills(activeChar, obj, skill, srcInArena)) - { - continue; - } - - if (onlyFirst) - { - return new L2Character[] - { - obj - }; - } - - if ((skill.getMaxTargets() > -1) && (targetList.size() >= skill.getMaxTargets())) - { - break; - } - targetList.add(obj); - } - } - } return targetList.toArray(new L2Character[targetList.size()]); } diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/FrontAura.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/FrontAura.java index 4387176a1c..021516397a 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/FrontAura.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/FrontAura.java @@ -26,9 +26,7 @@ import javolution.util.FastList; import com.l2jserver.gameserver.handler.ITargetTypeHandler; import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.actor.L2Character; -import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.skills.L2Skill; -import com.l2jserver.gameserver.model.skills.L2SkillType; import com.l2jserver.gameserver.model.skills.targets.L2TargetType; import com.l2jserver.gameserver.model.zone.ZoneId; @@ -42,29 +40,31 @@ public class FrontAura implements ITargetTypeHandler { List<L2Character> targetList = new FastList<>(); final boolean srcInArena = (activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE)); - - final L2PcInstance sourcePlayer = activeChar.getActingPlayer(); - final Collection<L2Character> objs = activeChar.getKnownList().getKnownCharactersInRadius(skill.getAffectRange()); - if (skill.getSkillType() == L2SkillType.DUMMY) + for (L2Character obj : objs) { - if (onlyFirst) + if (obj.isL2Attackable() || obj.isPlayable()) { - return new L2Character[] + + if (!obj.isInFrontOf(activeChar)) { - activeChar - }; - } - - targetList.add(activeChar); - for (L2Character obj : objs) - { - if (!((obj == activeChar) || (obj == sourcePlayer) || (obj.isNpc()) || (obj.isL2Attackable()))) + continue; + } + + if (!L2Skill.checkForAreaOffensiveSkills(activeChar, obj, skill, srcInArena)) { continue; } + if (onlyFirst) + { + return new L2Character[] + { + obj + }; + } + if ((skill.getMaxTargets() > -1) && (targetList.size() >= skill.getMaxTargets())) { break; @@ -72,39 +72,6 @@ public class FrontAura implements ITargetTypeHandler targetList.add(obj); } } - else - { - for (L2Character obj : objs) - { - if (obj.isL2Attackable() || obj.isPlayable()) - { - - if (!obj.isInFrontOf(activeChar)) - { - continue; - } - - if (!L2Skill.checkForAreaOffensiveSkills(activeChar, obj, skill, srcInArena)) - { - continue; - } - - if (onlyFirst) - { - return new L2Character[] - { - obj - }; - } - - if ((skill.getMaxTargets() > -1) && (targetList.size() >= skill.getMaxTargets())) - { - break; - } - targetList.add(obj); - } - } - } return targetList.toArray(new L2Character[targetList.size()]); } -- GitLab