diff --git a/trunk/dist/game/data/scripts/handlers/EffectMasterHandler.java b/trunk/dist/game/data/scripts/handlers/EffectMasterHandler.java index 11264e42a9..c189e48834 100644 --- a/trunk/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/trunk/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -109,6 +109,7 @@ final class EffectMasterHandler HealOverTime.class, HealPercent.class, Hide.class, + NoTarget.class, HpByLevel.class, HpCpHeal.class, HpDrain.class, diff --git a/trunk/dist/game/data/scripts/handlers/effecthandlers/NoTarget.java b/trunk/dist/game/data/scripts/handlers/effecthandlers/NoTarget.java new file mode 100644 index 0000000000..1e8da3097c --- /dev/null +++ b/trunk/dist/game/data/scripts/handlers/effecthandlers/NoTarget.java @@ -0,0 +1,76 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program 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. + * + * This program 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 . + */ +package handlers.effecthandlers; + +import com.l2jmobius.gameserver.ai.CtrlIntention; +import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.conditions.Condition; +import com.l2jmobius.gameserver.model.effects.AbstractEffect; +import com.l2jmobius.gameserver.model.skills.BuffInfo; + +/** + * Keep enemies from targeting you. + * @author hitnar + */ +public final class NoTarget extends AbstractEffect +{ + public NoTarget(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params) + { + super(attachCond, applyCond, set, params); + } + + @Override + public void onExit(BuffInfo info) + { + if (info.getEffected().isPlayer()) + { + final L2PcInstance activeChar = info.getEffected().getActingPlayer(); + if (!activeChar.inObserverMode()) + { + activeChar.setTargetable(true); + } + } + } + + @Override + public void onStart(BuffInfo info) + { + if (info.getEffected().isPlayer()) + { + final L2PcInstance activeChar = info.getEffected().getActingPlayer(); + activeChar.setTargetable(false); + + if ((activeChar.getAI().getNextIntention() != null) && (activeChar.getAI().getNextIntention().getCtrlIntention() == CtrlIntention.AI_INTENTION_ATTACK)) + { + activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + } + + for (L2Character target : activeChar.getKnownList().getKnownCharacters()) + { + if ((target != null) && (target.getTarget() == activeChar)) + { + target.setTarget(null); + target.abortAttack(); + target.abortCast(); + target.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + } + } + } + } +} \ No newline at end of file diff --git a/trunk/dist/game/data/stats/skills/11000-11099.xml b/trunk/dist/game/data/stats/skills/11000-11099.xml index f4749a308c..eead074c04 100644 --- a/trunk/dist/game/data/stats/skills/11000-11099.xml +++ b/trunk/dist/game/data/stats/skills/11000-11099.xml @@ -1618,13 +1618,16 @@ - + + - + + + diff --git a/trunk/dist/game/data/stats/skills/11200-11299.xml b/trunk/dist/game/data/stats/skills/11200-11299.xml index ca4ab177eb..397bdc6e66 100644 --- a/trunk/dist/game/data/stats/skills/11200-11299.xml +++ b/trunk/dist/game/data/stats/skills/11200-11299.xml @@ -362,9 +362,10 @@ + - + @@ -385,9 +386,10 @@ + - + @@ -401,9 +403,10 @@ + - + @@ -417,9 +420,10 @@ + - + @@ -808,13 +812,33 @@ 78 86 94 97
+ + + + + + + + + + + + + + + + + + + +
@@ -999,6 +1023,7 @@ + @@ -1178,12 +1203,13 @@ + - + diff --git a/trunk/dist/game/data/stats/skills/11300-11399.xml b/trunk/dist/game/data/stats/skills/11300-11399.xml index b2e4b48f87..08401f624c 100644 --- a/trunk/dist/game/data/stats/skills/11300-11399.xml +++ b/trunk/dist/game/data/stats/skills/11300-11399.xml @@ -240,14 +240,14 @@ - + - + @@ -951,6 +951,7 @@ + @@ -1027,7 +1028,7 @@ - + diff --git a/trunk/dist/game/data/stats/skills/11500-11599.xml b/trunk/dist/game/data/stats/skills/11500-11599.xml index 7275d63e16..6738c31d01 100644 --- a/trunk/dist/game/data/stats/skills/11500-11599.xml +++ b/trunk/dist/game/data/stats/skills/11500-11599.xml @@ -1613,6 +1613,7 @@ + @@ -1621,6 +1622,7 @@ + diff --git a/trunk/dist/game/data/xsd/skills.xsd b/trunk/dist/game/data/xsd/skills.xsd index c5fd067c2b..4f640f257a 100644 --- a/trunk/dist/game/data/xsd/skills.xsd +++ b/trunk/dist/game/data/xsd/skills.xsd @@ -648,6 +648,7 @@ + diff --git a/trunk/java/com/l2jmobius/gameserver/model/L2Object.java b/trunk/java/com/l2jmobius/gameserver/model/L2Object.java index e5828b8d61..fef693f59b 100644 --- a/trunk/java/com/l2jmobius/gameserver/model/L2Object.java +++ b/trunk/java/com/l2jmobius/gameserver/model/L2Object.java @@ -77,6 +77,7 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab private final AtomicInteger _instanceId = new AtomicInteger(0); private boolean _isVisible; private boolean _isInvisible; + private boolean _isTargetable = true; private ObjectKnownList _knownList; public L2Object(int objectId) @@ -473,7 +474,16 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab */ public boolean isTargetable() { - return true; + return _isTargetable; + } + + /** + * Set value of Targetable (isTargetable() function) + * @param value Boolean + */ + public void setTargetable(boolean value) + { + _isTargetable = value; } /** diff --git a/trunk/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java b/trunk/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java index 5b3cfbcc57..3396a55f1c 100644 --- a/trunk/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java +++ b/trunk/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java @@ -694,9 +694,10 @@ public class L2DoorInstance extends L2Character } } - public void setTargetable(boolean b) + @Override + public void setTargetable(boolean value) { - _isTargetable = b; + _isTargetable = value; broadcastStatusUpdate(); }