From 480fd5723918daae408af178fbfc5046ea42e537 Mon Sep 17 00:00:00 2001 From: Adry_85 <Adrya85@hotmail.it> Date: Fri, 12 Apr 2013 14:14:54 +0000 Subject: [PATCH] BETA: Unhardcoded target one handler. Patch by: MELERIX Tested by: Adry_85 --- .../scripts/handlers/targethandlers/One.java | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/One.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/One.java index f95c7f7c57..e0902ee2a8 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/One.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/One.java @@ -21,7 +21,6 @@ package handlers.targethandlers; import com.l2jserver.gameserver.handler.ITargetTypeHandler; import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.actor.L2Character; -import com.l2jserver.gameserver.model.effects.L2EffectType; import com.l2jserver.gameserver.model.skills.L2Skill; import com.l2jserver.gameserver.model.skills.targets.L2TargetType; import com.l2jserver.gameserver.network.SystemMessageId; @@ -31,26 +30,11 @@ import com.l2jserver.gameserver.network.SystemMessageId; */ public class One implements ITargetTypeHandler { - @Override public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target) { - boolean canTargetSelf = false; - switch (skill.getSkillType()) - { - case BUFF: - case DUMMY: - canTargetSelf = true; - break; - default: - { - canTargetSelf = skill.hasEffectType(L2EffectType.CANCEL_DEBUFF, L2EffectType.NEGATE, L2EffectType.CPHEAL, L2EffectType.HEAL, L2EffectType.HEAL_PERCENT, L2EffectType.MANAHEAL_BY_LEVEL); - break; - } - } - // Check for null target or any other invalid target - if ((target == null) || target.isDead() || ((target == activeChar) && !canTargetSelf)) + if ((target == null) || target.isDead() || ((target == activeChar) && (skill.isOffensive() || skill.isPVP()))) { activeChar.sendPacket(SystemMessageId.TARGET_IS_INCORRECT); return _emptyTargetList; -- GitLab