Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- L2Effect.java
- CHARMOFCOURAGE,
- SIGNET_EFFECT,
- SIGNET_GROUND,
- + PREVENT_BUFF,
- PREVENT_MAGIC,
- TRANSFERDMG,
- CANCEL,
- WARP
- }
- L2Character.java
- private boolean _isAfraid = false; // Flee in a random direction
- + private boolean _isBuffProtected = false;
- private boolean _isConfused = false; // Attack anyone randomly
- private boolean _isFakeDeath = false; // Fake death
- private boolean _isFlying = false; //Is flying Wyvern?
- + public final void setIsBuffProtected(boolean value)
- + {
- + _isBuffProtected = value;
- + }
- +
- + public boolean isBuffProtected()
- + {
- + return _isBuffProtected;
- + }
- }
- Continuous.java
- // Walls and Door should not be buffed
- if (target instanceof L2DoorInstance && (skill.getSkillType() == L2Skill.SkillType.BUFF || skill.getSkillType() == L2Skill.SkillType.HOT))
- continue;
- + // Anti-Buff Protection prevents you from getting buffs by other players
- + if (activeChar instanceof L2PlayableInstance && target != activeChar && target.isBuffProtected() && !skill.isHeroSkill()
- + && (skill.getSkillType() == L2Skill.SkillType.BUFF
- + || skill.getSkillType() == L2Skill.SkillType.HEAL_PERCENT
- + || skill.getSkillType() == L2Skill.SkillType.FORCE_BUFF
- + || skill.getSkillType() == L2Skill.SkillType.MANAHEAL_PERCENT
- + || skill.getSkillType() == L2Skill.SkillType.COMBATPOINTHEAL
- + || skill.getSkillType() == L2Skill.SkillType.REFLECT))
- + continue;
- EffectDeflectBuff.java
- package net.sf.l2j.gameserver.skills.effects;
- import net.sf.l2j.gameserver.model.L2Effect;
- import net.sf.l2j.gameserver.model.L2Effect.EffectType;
- import net.sf.l2j.gameserver.model.L2Skill.SkillType;
- import net.sf.l2j.gameserver.network.SystemMessageId;
- import net.sf.l2j.gameserver.serverpackets.SystemMessage;
- import net.sf.l2j.gameserver.skills.Env;
- /**
- * @author Java
- */
- public final class EffectDeflectBuff extends L2Effect
- {
- /**
- * @param env
- * @param template
- */
- public EffectDeflectBuff(Env env, EffectTemplate template)
- {
- super(env, template);
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.l2j.gameserver.model.L2Effect#getEffectType()
- */
- @Override
- public EffectType getEffectType()
- {
- return EffectType.PREVENT_BUFF;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.l2j.gameserver.model.L2Effect#onActionTime()
- */
- @Override
- public boolean onActionTime()
- {
- // Only cont skills shouldn't end
- if(getSkill().getSkillType() != SkillType.CONT)
- return false;
- double manaDam = calc();
- if(manaDam > getEffected().getCurrentMp())
- {
- SystemMessage sm = new SystemMessage(SystemMessageId.SKILL_REMOVED_DUE_LACK_MP);
- getEffected().sendPacket(sm);
- return false;
- }
- getEffected().reduceCurrentMp(manaDam);
- return true;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.l2j.gameserver.model.L2Effect#onStart()
- */
- @Override
- public void onStart()
- {
- getEffected().setIsBuffProtected(true);
- return;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.l2j.gameserver.model.L2Effect#onExit()
- */
- @Override
- public void onExit()
- {
- getEffected().setIsBuffProtected(false);
- }
- }
- And this is how the skill should be in DP:
- <skill id="add the skill id here" levels="1" name="AntiBuff-Shield">
- <set name="target" val="TARGET_SELF"/>
- <set name="skillType" val="CONT"/>
- <set name="operateType" val="OP_TOGGLE"/>
- <set name="castRange" val="-1"/>
- <set name="effectRange" val="-1"/>
- <for>
- <effect count="0x7fffffff" name="DeflectBuff" time="3" val="0"/>
- </for>
- </skill>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement