Advertisement
Sarada-L2

Anti Buff Acis 384 Yo: Sarada

May 10th, 2021 (edited)
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. \ No newline at end of file
  2. diff --git a/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java b/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
  3. index bc58b28..aa3061a 100644
  4. --- a/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
  5. +++ b/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
  6. @@ -71,7 +71,14 @@
  7. // Target under buff immunity.
  8. if (target.getFirstEffect(L2EffectType.BLOCK_BUFF) != null)
  9. continue;
  10. -
  11. + // Anti-Buff Protection prevents you from getting buffs by other players
  12. + if (activeChar instanceof Player && target != activeChar && target.isBuffProtected() && !skill.isHeroSkill()
  13. + && (skill.getSkillType() == L2SkillType.BUFF
  14. + || skill.getSkillType() == L2SkillType.HEAL_PERCENT
  15. + || skill.getSkillType() == L2SkillType.MANAHEAL_PERCENT
  16. + || skill.getSkillType() == L2SkillType.COMBATPOINTHEAL
  17. + || skill.getSkillType() == L2SkillType.REFLECT))
  18. + continue;
  19. // Player holding a cursed weapon can't be buffed and can't buff
  20. if (!(activeChar instanceof ClanHallManagerNpc) && target != activeChar)
  21. {
  22. diff --git a/java/net/sf/l2j/gameserver/model/actor/Creature.java b/java/net/sf/l2j/gameserver/model/actor/Creature.java
  23. index 2227a56..58ee444 100644
  24. --- a/java/net/sf/l2j/gameserver/model/actor/Creature.java
  25. +++ b/java/net/sf/l2j/gameserver/model/actor/Creature.java
  26. @@ -102,6 +102,16 @@
  27. */
  28. public abstract class Creature extends WorldObject
  29. {
  30. + private boolean _isBuffProtected = false;
  31. + public final void setIsBuffProtected(boolean value)
  32. + {
  33. + _isBuffProtected = value;
  34. + }
  35. +
  36. + public boolean isBuffProtected()
  37. + {
  38. + return _isBuffProtected;
  39. + }
  40. private volatile boolean _isCastingNow = false;
  41. private volatile boolean _isCastingSimultaneouslyNow = false;
  42. private L2Skill _lastSkillCast;
  43. diff --git a/java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java b/java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java
  44. new file mode 100644
  45. index 0000000..98db9cd
  46. --- /dev/null
  47. +++ b/java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java
  48. @@ -0,0 +1,44 @@
  49. +package net.sf.l2j.gameserver.skills.effects;
  50. +
  51. +import net.sf.l2j.gameserver.enums.skills.L2EffectType;
  52. +import net.sf.l2j.gameserver.enums.skills.L2SkillType;
  53. +import net.sf.l2j.gameserver.model.L2Effect;
  54. +import net.sf.l2j.gameserver.model.L2Skill;
  55. +import net.sf.l2j.gameserver.model.actor.Creature;
  56. +
  57. +public final class EffectDeflectBuff extends L2Effect
  58. +{
  59. + public EffectDeflectBuff(EffectTemplate template, L2Skill skill, Creature effected, Creature effector)
  60. + {
  61. + super(template, skill, effected, effector);
  62. + }
  63. +
  64. + @Override
  65. + public L2EffectType getEffectType()
  66. + {
  67. + return L2EffectType.BLOCK_BUFF;
  68. + }
  69. +
  70. + @Override
  71. + public boolean onActionTime()
  72. + {
  73. + if(getSkill().getSkillType() != L2SkillType.CONT)
  74. + {
  75. + return false;
  76. + }
  77. + return true;
  78. + }
  79. +
  80. + @Override
  81. + public boolean onStart()
  82. + {
  83. + getEffected().setIsBuffProtected(true);
  84. + return true;
  85. + }
  86. +
  87. + @Override
  88. + public void onExit()
  89. + {
  90. + getEffected().setIsBuffProtected(false);
  91. + }
  92. +}
  93. \ No newline at end of file
  94.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement