Jump to content

Recommended Posts

Posted

Just looking at the old AntiBuff Shield made me -beep-ing sick,so i share you my own :).

By declaring the skilltypes in this skillhandler,buffs of Core Buffer won't be prevented.

Also,a core support has been made to let the skill work like toggle.

This shield protects you only from buffs casted by other players.You are free to use your self buffs ^^.

 

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>

 

Have fun!

Posted

u can't wait until get Boss replay or u need increase the number of posts ?

 

As a matter of fact more than 1 hour has passed.

« Reply #6 on: Today at 06:40:21 PM »

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • Looking a datapack developer for 'Essence' - needs to be good with Mobius structure,  Project is using old fork (I think base from crusader). Write Discord to PM.
    • We are not back on 2005, life in our days is harder than before, in complection with other things yes, L2 has not the same look.
    • 🌍 https://l2origins.org/ 🛡️ LINEAGE II ORIGINS — SEASON 1 🛡️ 🌑 High Five Classic | True Old-School Experience 🌑 ⚠️ Opening on March 6th at 16:00 Welcome back to the origins of Lineage II. ⚔️ ABOUT THE SERVER Lineage2 Origins is built for players who miss the true retail feeling. Classic progression, real challenges, fair competition — enhanced only with carefully selected QoL features, never breaking the original gameplay. 🌿 PHASED GEAR PROGRESSION 🟢 Month 1: Vesper max 🟢 Month 2: Vorpal unlocked 🟢 Month 3+: Top-grade & Elegia released 🚫 NO AUTO-FARM ✔️ External auto-clicker allowed (1 per client, download page only) ❌ Bots & illegal automation forbidden 🛡️ Strong anti-bot + captcha system ⚠️ AFK players will be punished — stay active or logout 📊 RATES & CORE SETTINGS 🔹 Adena: x5 🔹 Drop / Spoil: x5 🔹 Skill EXP: x15 🔹 Max Windows: 2 per PC 🔹 Subclass: Lv 85 (no quest required) 🔹 Party Level Diff: 30 (55–85) 🔹 No custom items (armors / weapons / jewelry) 🔥 FEATURES ✨ Global & Raid Teleport ✨ NPC Buffer (34 buffs) ✨ Auto Events & PvP Zones ✨ Ranking & Clan Progression ✨ GM Shop & Premium System ✨ All-In-One Community Board ✨ Party & Solo Instances ✨ Siege & Territory War Rewards ✨ RaidBoss Kill Rewards ✨ Lucky Creature Event ✨ Daily Login Rewards ✨ Advanced DDoS Protection & Backups ⚔️ ENCHANTMENTS 🔸 Safe: +3 🔸 Max: +12 (Month 2: +14 | Month 3: +16) 🔸 Blessed: 50% (Premium 65%) 🔸 Normal: 45% (Premium 60%) 🏟️ OLYMPIAD 🔹 Max Enchant: +6 🔹 Start Players: 4 🔹 Period: 1st & 15th 🏰 SIEGE & TW 🔹 Siege Time: 16:00 & 20:00 🔹 Territory War: 20:00 🔹 Max Wards: 3 per Castle 🌌 Lineage2 Origins Fair. Competitive. Nostalgic. A true return to the origins of Lineage II.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..