Advertisement
Sarada-L2

Anti Buff Acis 399 Yo: Sarada Adpt

Jun 11th, 2021
562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.93 KB | None | 0 0
  1. diff --git a/java/net/sf/l2j/gameserver/enums/skills/EffectType.java b/java/net/sf/l2j/gameserver/enums/skills/EffectType.java
  2. index 89d25a5..88484b4 100644
  3. --- a/java/net/sf/l2j/gameserver/enums/skills/EffectType.java
  4. +++ b/java/net/sf/l2j/gameserver/enums/skills/EffectType.java
  5. @@ -4,7 +4,7 @@
  6. {
  7. BLOCK_BUFF,
  8. BLOCK_DEBUFF,
  9. -
  10. + PREVENT_BUFF,
  11. BUFF,
  12. DEBUFF,
  13.  
  14. diff --git a/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java b/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
  15. index ba43c88..967a29e 100644
  16. --- a/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
  17. +++ b/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
  18. @@ -72,7 +72,14 @@
  19. // Target under buff immunity.
  20. if (target.getFirstEffect(EffectType.BLOCK_BUFF) != null)
  21. continue;
  22. -
  23. + // Anti-Buff Protection prevents you from getting buffs by other players
  24. + if (activeChar instanceof Player && target != activeChar && target.isBuffProtected() && !skill.isHeroSkill()
  25. + && (skill.getSkillType() == SkillType.BUFF
  26. + || skill.getSkillType() == SkillType.HEAL_PERCENT
  27. + || skill.getSkillType() == SkillType.MANAHEAL_PERCENT
  28. + || skill.getSkillType() == SkillType.COMBATPOINTHEAL
  29. + || skill.getSkillType() == SkillType.REFLECT))
  30. + continue;
  31. // Player holding a cursed weapon can't be buffed and can't buff
  32. if (!(activeChar instanceof ClanHallManagerNpc) && target != activeChar)
  33. {
  34. diff --git a/java/net/sf/l2j/gameserver/model/actor/Creature.java b/java/net/sf/l2j/gameserver/model/actor/Creature.java
  35. index 776522a..07e206a 100644
  36. --- a/java/net/sf/l2j/gameserver/model/actor/Creature.java
  37. +++ b/java/net/sf/l2j/gameserver/model/actor/Creature.java
  38. @@ -81,6 +81,16 @@
  39. */
  40. public abstract class Creature extends WorldObject
  41. {
  42. + private boolean _isBuffProtected = false;
  43. + public final void setIsBuffProtected(boolean value)
  44. + {
  45. + _isBuffProtected = value;
  46. + }
  47. +
  48. + public boolean isBuffProtected()
  49. + {
  50. + return _isBuffProtected;
  51. + }
  52. protected String _title;
  53.  
  54. protected volatile CreatureAI _ai;
  55. diff --git a/java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java b/java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java
  56. new file mode 100644
  57. index 0000000..a6adb01
  58. --- /dev/null
  59. +++ b/java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java
  60. @@ -0,0 +1,43 @@
  61. +package net.sf.l2j.gameserver.skills.effects;
  62. +
  63. +import net.sf.l2j.gameserver.enums.skills.EffectType;
  64. +import net.sf.l2j.gameserver.enums.skills.SkillType;
  65. +import net.sf.l2j.gameserver.model.actor.Creature;
  66. +import net.sf.l2j.gameserver.skills.AbstractEffect;
  67. +import net.sf.l2j.gameserver.skills.L2Skill;
  68. +
  69. +public final class EffectDeflectBuff extends AbstractEffect
  70. +{
  71. + public EffectDeflectBuff(EffectTemplate template, L2Skill skill, Creature effected, Creature effector)
  72. + {
  73. + super(template, skill, effected, effector);
  74. + }
  75. +
  76. + @Override
  77. + public EffectType getEffectType()
  78. + {
  79. + return EffectType.PREVENT_BUFF;
  80. + }
  81. +
  82. + @Override
  83. + public boolean onActionTime()
  84. + {
  85. + if (getSkill().getSkillType() != SkillType.CONT)
  86. + return false;
  87. + return true;
  88. +
  89. + }
  90. +
  91. + @Override
  92. + public boolean onStart()
  93. + {
  94. + getEffected().setIsBuffProtected(true);
  95. + return true;
  96. + }
  97. +
  98. + @Override
  99. + public void onExit()
  100. + {
  101. + getEffected().setIsBuffProtected(false);
  102. + }
  103. +}
  104.  
  105. diff --git a/data/xml/skills/AntiBuff.xml b/data/xml/skills/AntiBuff.xml
  106. new file mode 100644
  107. index 0000000..b5c8f2d
  108. --- /dev/null
  109. +++ b/data/xml/skills/AntiBuff.xml
  110. @@ -0,0 +1,11 @@
  111. +<?xml version="1.0" encoding="UTF-8"?>
  112. +<list>
  113. + <skill id="8000" levels="1" name="AntiBuff">
  114. + <set name="target" val="SELF"/>
  115. + <set name="skillType" val="CONT"/>
  116. + <set name="operateType" val="TOGGLE"/>
  117. + <for>
  118. + <effect count="0x7fffffff" name="DeflectBuff" time="5" val="0"/>
  119. + </for>
  120. + </skill>
  121. +</list>
  122. \ No newline at end of file
  123.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement