Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \ No newline at end of file
- diff --git a/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java b/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
- index bc58b28..aa3061a 100644
- --- a/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
- +++ b/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
- @@ -71,7 +71,14 @@
- // Target under buff immunity.
- if (target.getFirstEffect(L2EffectType.BLOCK_BUFF) != null)
- continue;
- -
- + // Anti-Buff Protection prevents you from getting buffs by other players
- + if (activeChar instanceof Player && target != activeChar && target.isBuffProtected() && !skill.isHeroSkill()
- + && (skill.getSkillType() == L2SkillType.BUFF
- + || skill.getSkillType() == L2SkillType.HEAL_PERCENT
- + || skill.getSkillType() == L2SkillType.MANAHEAL_PERCENT
- + || skill.getSkillType() == L2SkillType.COMBATPOINTHEAL
- + || skill.getSkillType() == L2SkillType.REFLECT))
- + continue;
- // Player holding a cursed weapon can't be buffed and can't buff
- if (!(activeChar instanceof ClanHallManagerNpc) && target != activeChar)
- {
- diff --git a/java/net/sf/l2j/gameserver/model/actor/Creature.java b/java/net/sf/l2j/gameserver/model/actor/Creature.java
- index 2227a56..58ee444 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/Creature.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/Creature.java
- @@ -102,6 +102,16 @@
- */
- public abstract class Creature extends WorldObject
- {
- + private boolean _isBuffProtected = false;
- + public final void setIsBuffProtected(boolean value)
- + {
- + _isBuffProtected = value;
- + }
- +
- + public boolean isBuffProtected()
- + {
- + return _isBuffProtected;
- + }
- private volatile boolean _isCastingNow = false;
- private volatile boolean _isCastingSimultaneouslyNow = false;
- private L2Skill _lastSkillCast;
- diff --git a/java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java b/java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java
- new file mode 100644
- index 0000000..98db9cd
- --- /dev/null
- +++ b/java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java
- @@ -0,0 +1,44 @@
- +package net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.enums.skills.L2EffectType;
- +import net.sf.l2j.gameserver.enums.skills.L2SkillType;
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.model.L2Skill;
- +import net.sf.l2j.gameserver.model.actor.Creature;
- +
- +public final class EffectDeflectBuff extends L2Effect
- +{
- + public EffectDeflectBuff(EffectTemplate template, L2Skill skill, Creature effected, Creature effector)
- + {
- + super(template, skill, effected, effector);
- + }
- +
- + @Override
- + public L2EffectType getEffectType()
- + {
- + return L2EffectType.BLOCK_BUFF;
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + if(getSkill().getSkillType() != L2SkillType.CONT)
- + {
- + return false;
- + }
- + return true;
- + }
- +
- + @Override
- + public boolean onStart()
- + {
- + getEffected().setIsBuffProtected(true);
- + return true;
- + }
- +
- + @Override
- + public void onExit()
- + {
- + getEffected().setIsBuffProtected(false);
- + }
- +}
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement