diff --git a/dist/game/data/scripts/handlers/MasterHandler.java b/dist/game/data/scripts/handlers/MasterHandler.java index 21f895ffff25226b0673415a685782e37e843123..ec5cab52034da38619005fbb1b52866af3b8e286 100644 --- a/dist/game/data/scripts/handlers/MasterHandler.java +++ b/dist/game/data/scripts/handlers/MasterHandler.java @@ -222,6 +222,7 @@ import handlers.targethandlers.AreaSummon; import handlers.targethandlers.Aura; import handlers.targethandlers.AuraCorpseMob; import handlers.targethandlers.AuraFriendly; +import handlers.targethandlers.AuraUndeadEnemy; import handlers.targethandlers.BehindArea; import handlers.targethandlers.BehindAura; import handlers.targethandlers.Clan; @@ -546,6 +547,7 @@ public class MasterHandler Aura.class, AuraCorpseMob.class, AuraFriendly.class, + AuraUndeadEnemy.class, BehindArea.class, BehindAura.class, Clan.class, diff --git a/dist/game/data/scripts/handlers/targethandlers/AuraUndeadEnemy.java b/dist/game/data/scripts/handlers/targethandlers/AuraUndeadEnemy.java new file mode 100644 index 0000000000000000000000000000000000000000..8b9be4b809e359a2b2b3c5bdb4fdad19fc27c370 --- /dev/null +++ b/dist/game/data/scripts/handlers/targethandlers/AuraUndeadEnemy.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2004-2018 L2J DataPack + * + * This file is part of L2J DataPack. + * + * L2J DataPack is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * L2J DataPack is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +package handlers.targethandlers; + +import java.util.ArrayList; +import java.util.List; + +import com.l2jserver.gameserver.handler.ITargetTypeHandler; +import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.actor.L2Character; +import com.l2jserver.gameserver.model.skills.Skill; +import com.l2jserver.gameserver.model.skills.targets.L2TargetType; + +/** + * Aura Undead Enemy target handler implementation. + * @author Adry_85 + * @since 2.6.0.0 + */ +public class AuraUndeadEnemy implements ITargetTypeHandler +{ + @Override + public L2Object[] getTargetList(Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target) + { + List<L2Character> targetList = new ArrayList<>(); + int maxTargets = skill.getAffectLimit(); + for (L2Character obj : activeChar.getKnownList().getKnownCharactersInRadius(skill.getAffectRange())) + { + if (obj.isAttackable() && obj.isUndead()) + { + if (onlyFirst) + { + return new L2Character[] + { + obj + }; + } + + if ((maxTargets > 0) && (targetList.size() >= maxTargets)) + { + break; + } + + targetList.add(obj); + } + } + return targetList.toArray(new L2Character[targetList.size()]); + } + + @Override + public Enum<L2TargetType> getTargetType() + { + return L2TargetType.AURA_UNDEAD_ENEMY; + } +} diff --git a/dist/game/data/stats/skills/00000-00099.xml b/dist/game/data/stats/skills/00000-00099.xml index 7cd5426df7937f71ba81a05f3bad41c2e9a7d4ea..92a2587d4b46e09c14326aa823859c9b1646b5cf 100644 --- a/dist/game/data/stats/skills/00000-00099.xml +++ b/dist/game/data/stats/skills/00000-00099.xml @@ -2765,16 +2765,13 @@ <set name="operateType" val="A2" /> <set name="reuseDelay" val="2000" /> <set name="rideState" val="NONE" /> - <set name="targetType" val="AREA" /> + <set name="targetType" val="AURA_UNDEAD_ENEMY" /> <enchant1 name="activateRate" val="#ench1ActivateRates" /> <enchant1 name="magicLvl" val="#enchMagicLvl" /> <enchant2 name="magicLvl" val="#enchMagicLvl" /> <enchant2 name="mpConsume2" val="#ench2Cost" /> <enchant3 name="magicLvl" val="#enchMagicLvl" /> <enchant4 name="magicLvl" val="#enchMagicLvl" /> - <cond msgId="144"> - <target race="UNDEAD" /> - </cond> <effects> <effect name="Debuff"> <mul stat="pAtk" val="0.77" /> diff --git a/dist/game/data/stats/skills/00100-00199.xml b/dist/game/data/stats/skills/00100-00199.xml index ab9569a4aefd0de351d29b47560747d4b9f88b80..ff0f1de425937c4b13518e764f73ccdd9f5a3a12 100644 --- a/dist/game/data/stats/skills/00100-00199.xml +++ b/dist/game/data/stats/skills/00100-00199.xml @@ -354,16 +354,13 @@ <set name="operateType" val="A2" /> <set name="reuseDelay" val="5000" /> <set name="rideState" val="NONE" /> - <set name="targetType" val="AREA" /> + <set name="targetType" val="AURA_UNDEAD_ENEMY" /> <set name="trait" val="HOLD" /> <enchant1 name="activateRate" val="#ench1ActivateRates" /> <enchant1 name="magicLvl" val="#enchMagicLvl" /> <enchant2 name="magicLvl" val="#enchMagicLvl" /> <enchant2 name="mpConsume2" val="#ench2MpConsume2" /> <enchant3 name="magicLvl" val="#enchMagicLvl" /> - <cond msgId="144"> - <target race="UNDEAD" /> - </cond> <effects> <effect name="Root" /> <effect name="DefenceTrait"> diff --git a/dist/game/data/stats/skills/01000-01099.xml b/dist/game/data/stats/skills/01000-01099.xml index 1c313e073cf82e8e30125cf4b6cc5c46139e1666..e747e2f384844c55ff730f00a83585360156a987 100644 --- a/dist/game/data/stats/skills/01000-01099.xml +++ b/dist/game/data/stats/skills/01000-01099.xml @@ -800,15 +800,12 @@ <set name="operateType" val="A1" /> <set name="reuseDelay" val="5000" /> <set name="rideState" val="NONE;STRIDER;WYVERN;WOLF" /> - <set name="targetType" val="AURA" /> + <set name="targetType" val="AURA_UNDEAD_ENEMY" /> <set name="trait" val="DERANGEMENT" /> <enchant1 name="magicLvl" val="#enchMagicLvl" /> <enchant2 name="magicLvl" val="#enchMagicLvl" /> <enchant2 name="mpConsume2" val="#ench2MpConsume2" /> <enchant2 name="mpConsume1" val="#ench2MpConsume1" /> - <cond msgId="144"> - <target race="UNDEAD" /> - </cond> <effects> <effect name="DeleteHate"> <param chance="40" /> @@ -1194,11 +1191,8 @@ <set name="operateType" val="A2" /> <set name="reuseDelay" val="5000" /> <set name="rideState" val="NONE;STRIDER;WYVERN;WOLF" /> - <set name="targetType" val="AREA" /> + <set name="targetType" val="AURA_UNDEAD_ENEMY" /> <set name="trait" val="DERANGEMENT" /> - <cond msgId="144"> - <target race="UNDEAD" /> - </cond> <effects> <effect name="Passive" /> </effects>