Jump to content
  • 0

Antibuff Shield


Ta®oS™

Question

i have add this code

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/model/actor/L2Character.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/L2Character.java    (revision 16)
+++ java/net/sf/l2j/gameserver/model/actor/L2Character.java    (working copy)
@@ -136,6 +136,17 @@
*/
public abstract class L2Character extends L2Object
{
+    private boolean _isBuffProtected = false; //Protect From Debuffs
+    public final void setIsBuffProtected(boolean value)
+     {
+     _isBuffProtected = value;
+     }
+     
+     public boolean isBuffProtected()
+     {
+     return _isBuffProtected; 
+     }
+
    public static final Logger _log = Logger.getLogger(L2Character.class.getName());
    
    private Set<L2Character> _attackByList;
Index: java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java    (revision 16)
+++ java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java    (working copy)
@@ -89,6 +89,15 @@
                    if (target.getFirstEffect(L2EffectType.BLOCK_BUFF) != null)
                        continue;
                    
+                    // Anti-Buff Protection prevents you from getting buffs by other players 
+                    if (activeChar instanceof L2PcInstance && 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 L2ClanHallManagerInstance) && target != activeChar)
                    {
Index: java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java
===================================================================
--- java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java    (revision 0)
+++ java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java    (revision 0)
@@ -0,0 +1,82 @@
+package net.sf.l2j.gameserver.skills.effects;
+
+import net.sf.l2j.gameserver.model.L2Effect;
+import net.sf.l2j.gameserver.templates.skills.L2EffectType;
+import net.sf.l2j.gameserver.templates.skills.L2SkillType;
+import net.sf.l2j.gameserver.network.SystemMessageId;
+import net.sf.l2j.gameserver.network.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 L2EffectType getEffectType()
+ {
+     return L2EffectType.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() != L2SkillType.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 boolean onStart()
+ {
+     getEffected().setIsBuffProtected(true);
+     return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sf.l2j.gameserver.model.L2Effect#onExit()
+ */
+ @Override
+ public void onExit()
+ {
+     getEffected().setIsBuffProtected(false);
+ }
+}
\ No newline at end of file
Index: java/net/sf/l2j/gameserver/network/serverpackets/SystemMessage.java
===================================================================
--- java/net/sf/l2j/gameserver/network/serverpackets/SystemMessage.java    (revision 16)
+++ java/net/sf/l2j/gameserver/network/serverpackets/SystemMessage.java    (working copy)
@@ -110,7 +110,7 @@
    private SMParam[] _params;
    private int _paramIndex;
    
-    private SystemMessage(final SystemMessageId smId)
+    public SystemMessage(final SystemMessageId smId)
    {
        final int paramCount = smId.getParamCount();
        _smId = smId;
Index: java/net/sf/l2j/gameserver/templates/skills/L2EffectType.java
===================================================================
--- java/net/sf/l2j/gameserver/templates/skills/L2EffectType.java    (revision 16)
+++ java/net/sf/l2j/gameserver/templates/skills/L2EffectType.java    (working copy)
@@ -80,5 +80,6 @@
    WARP,
    
    SIGNET_GROUND,
-    SIGNET_EFFECT
+    SIGNET_EFFECT,
+    PREVENT_BUFF
}
\ No newline at end of file
#P aCis_datapack
Index: data/xml/skills/0100-0199.xml
===================================================================
--- data/xml/skills/0100-0199.xml    (revision 11)
+++ data/xml/skills/0100-0199.xml    (working copy)
@@ -949,10 +949,14 @@
            <add order="0x40" stat="cAtkAdd" val="#crit"/>
        </for>
    </skill>
-    <skill id="194" levels="1" name="Lucky">
+    <skill id="194" levels="1" name="Anti-Buff">
+     <!-- Blocks unwanted buffs. -->
        <set name="target" val="TARGET_SELF"/>
-        <set name="skillType" val="LUCK"/>
-        <set name="operateType" val="OP_PASSIVE"/>
+        <set name="skillType" val="CONT"/>
+        <set name="operateType" val="OP_TOGGLE"/>
+        <for>
+            <effect count="0x7fffffff" name="DeflectBuff" time="3" val="0"/>
+        </for>
    </skill>
    <skill id="195" levels="2" name="Boost Breath">
        <table name="#breath"> 180 300 </table>

i have delete the skill LUCKY with the same ID i have set AutoLearnSkills=True and i have this error

 

storeSkill() couldn't store new skill. It's null type.
 

and one problem dont working the oly rank's i use acis 300revision

Edited by Ta®oS™
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...