Advertisement
Sarada-L2

Ant buff e correção da class

May 13th, 2021
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.93 KB | None | 0 0
  1. diff --git a/java/net/sf/l2j/gameserver/enums/skills/L2EffectType.java b/java/net/sf/l2j/gameserver/enums/skills/L2EffectType.java
  2. index 3df0b99..4098e89 100644
  3. --- a/java/net/sf/l2j/gameserver/enums/skills/L2EffectType.java
  4. +++ b/java/net/sf/l2j/gameserver/enums/skills/L2EffectType.java
  5. @@ -2,6 +2,7 @@
  6.  
  7. public enum L2EffectType
  8. {
  9. + PREVENT_BUFF,
  10. BLOCK_BUFF,
  11. BLOCK_DEBUFF,
  12.  
  13. diff --git a/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java b/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
  14. index 0401c64..0e344d0 100644
  15. --- a/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
  16. +++ b/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
  17. @@ -71,7 +71,13 @@
  18. // Target under buff immunity.
  19. if (target.isBuffProtected() && target.getFirstEffect(L2EffectType.BLOCK_BUFF) != null)
  20. continue;
  21. -
  22. + if (activeChar instanceof Player && target != activeChar && target.isBuffProtected() && !skill.isHeroSkill() && !skill.isHeroSkill()
  23. + && (skill.getSkillType() == L2SkillType.BUFF
  24. + || skill.getSkillType() == L2SkillType.HEAL_PERCENT
  25. + || skill.getSkillType() == L2SkillType.MANAHEAL_PERCENT
  26. + || skill.getSkillType() == L2SkillType.COMBATPOINTHEAL
  27. + || skill.getSkillType() == L2SkillType.REFLECT))
  28. + continue;
  29. // Player holding a cursed weapon can't be buffed and can't buff
  30. if (!(activeChar instanceof ClanHallManagerNpc) && target != activeChar)
  31. {
  32. diff --git a/java/net/sf/l2j/gameserver/model/actor/Creature.java b/java/net/sf/l2j/gameserver/model/actor/Creature.java
  33. index 0350fcb..cbc8459 100644
  34. --- a/java/net/sf/l2j/gameserver/model/actor/Creature.java
  35. +++ b/java/net/sf/l2j/gameserver/model/actor/Creature.java
  36. @@ -104,6 +104,16 @@
  37. */
  38. public abstract class Creature extends WorldObject
  39. {
  40. + private boolean _isBuffProtected = false;
  41. + public final void setIsBuffProtected(boolean value)
  42. + {
  43. + _isBuffProtected = value;
  44. + }
  45. +
  46. + public boolean isBuffProtected()
  47. + {
  48. + return _isBuffProtected;
  49. + }
  50. private volatile boolean _isCastingNow = false;
  51. private volatile boolean _isCastingSimultaneouslyNow = false;
  52. private L2Skill _lastSkillCast;
  53. @@ -117,8 +127,7 @@
  54. protected boolean _isTeleporting = false;
  55. protected boolean _showSummonAnimation = false;
  56.  
  57. - /** The _is buff protected. */
  58. - private boolean _isBuffProtected = false; // Protect From Debuffs
  59. +
  60.  
  61. protected boolean _isInvul = false;
  62. private boolean _isMortal = true;
  63. @@ -4706,23 +4715,7 @@
  64. _isStopMov = value;
  65. }
  66.  
  67. - /**
  68. - * Sets the checks if is buff protected.
  69. - * @param value the new checks if is buff protected
  70. - */
  71. - public final void setIsBuffProtected(final boolean value)
  72. - {
  73. - _isBuffProtected = value;
  74. - }
  75. -
  76. - /**
  77. - * Checks if is buff protected.
  78. - * @return true, if is buff protected
  79. - */
  80. - public boolean isBuffProtected()
  81. - {
  82. - return _isBuffProtected;
  83. - }
  84. +
  85. protected MoveData _move1;
  86. public final boolean isOnGeodataPath()
  87. {
  88. diff --git a/java/net/sf/l2j/gameserver/model/actor/Player.java b/java/net/sf/l2j/gameserver/model/actor/Player.java
  89. index 6332090..0bbb748 100644
  90. --- a/java/net/sf/l2j/gameserver/model/actor/Player.java
  91. +++ b/java/net/sf/l2j/gameserver/model/actor/Player.java
  92. @@ -334,7 +334,7 @@
  93. private boolean _isInTradeProt = false;
  94. private boolean _isSSDisabled = false;
  95.  
  96. - private boolean _isBuffProtected = false;
  97. +
  98.  
  99.  
  100. private String _code = "";
  101. @@ -10367,16 +10367,7 @@
  102. sendPacket(new EtcStatusUpdate(this));
  103. }
  104.  
  105. - @Override
  106. - public boolean isBuffProtected()
  107. - {
  108. - return _isBuffProtected;
  109. - }
  110. -
  111. - public void setisBuffProtected(boolean value)
  112. - {
  113. - _isBuffProtected = value;
  114. - }
  115. +
  116.  
  117. private List<Integer> _ignored = new ArrayList<>();
  118.  
  119. diff --git a/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java b/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
  120. index de2cc4c..4c23145 100644
  121. --- a/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
  122. +++ b/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
  123. @@ -117,15 +117,7 @@
  124. player.setMessageRefusal(true);
  125. Menu.sendMainWindow(player);
  126. }
  127. - else if (_command.startsWith("setbuffsRefuse"))
  128. - {
  129. - if (player.isBuffProtected())
  130. - player.setisBuffProtected(false);
  131. - else
  132. - player.setisBuffProtected(true);
  133. - player.sendMessage("Buff protection.");
  134. - Menu.sendMainWindow(player);
  135. - }
  136. +
  137. else if (_command.startsWith("setxpnot"))
  138. {
  139. if (player.cantGainXP())
  140. diff --git a/java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java b/java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java
  141. index 166d263..6c4fca5 100644
  142. --- a/java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java
  143. +++ b/java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java
  144. @@ -1,33 +1,11 @@
  145. +package net.sf.l2j.gameserver.skills.effects;
  146. +
  147. +import net.sf.l2j.gameserver.enums.skills.L2EffectType;
  148. +import net.sf.l2j.gameserver.enums.skills.L2SkillType;
  149. +import net.sf.l2j.gameserver.model.L2Effect;
  150. +import net.sf.l2j.gameserver.model.L2Skill;
  151. +import net.sf.l2j.gameserver.model.actor.Creature;
  152. +
  153. +public final class EffectDeflectBuff extends L2Effect
  154. +{
  155. + public EffectDeflectBuff(EffectTemplate template, L2Skill skill, Creature effected, Creature effector)
  156. + {
  157. + super(template, skill, effected, effector);
  158. + }
  159. +
  160. + @Override
  161. + public L2EffectType getEffectType()
  162. + {
  163. + return L2EffectType.PREVENT_BUFF;
  164. + }
  165. +
  166. + @Override
  167. + public boolean onActionTime()
  168. + {
  169. + if(getSkill().getSkillType() != L2SkillType.CONT)
  170. + {
  171. + return false;
  172. + }
  173. + return true;
  174. + }
  175. +
  176. + @Override
  177. + public boolean onStart()
  178. + {
  179. + getEffected().setIsBuffProtected(true);
  180. + return true;
  181. + }
  182. +
  183. + @Override
  184. + public void onExit()
  185. + {
  186. + getEffected().setIsBuffProtected(false);
  187. + }
  188. +}
  189.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement