Jump to content

Recommended Posts

Posted

This simple code will stop players from healing or buffing monsters and raids

Go at network/clientpackets/RequestMagicSkillUse

	// Check the validity of the skill
	if (skill != null)
	{
		+if (activeChar.getTarget() instanceof L2MonsterInstance)
		+{
		+	switch (skill.getSkillType())
		+	{
		+		case HEAL:
		+		case HEAL_PERCENT:
		+		case BUFF:
		+		{
		+			if (skill.getTargetType()==L2TargetType.TARGET_ONE)
		+			{
		+				return;
		+			}
		+		}
		+	}
		+}
		if ((activeChar.isTransformed() || activeChar.isInStance()) && !activeChar.containsAllowedTransformSkill(skill.getId()))

 

Credits me, thanks for your reports guys, all fixed!

for those with the previus version I recomend change asap

Posted

small note.

 

You don't do this:

		+		case HEAL:
		+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		+			return;
		+		case HEAL_PERCENT:
		+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		+			return;
		+		case CHAIN_HEAL:
		+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		+			return;
		+		case BUFF:
		+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		+			return;

 

You do

		+		case HEAL:
		+		case HEAL_PERCENT:
		+		case CHAIN_HEAL:
		+		case BUFF:
		+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		+			return;

Cases collapse and run till u tell them to break;

Also it would of been best/safer, if you did it in the Heal skill handler.

Posted

small note.

 

You don't do this:

		+		case HEAL:
		+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		+			return;
		+		case HEAL_PERCENT:
		+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		+			return;
		+		case CHAIN_HEAL:
		+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		+			return;
		+		case BUFF:
		+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		+			return;

 

You do

		+		case HEAL:
		+		case HEAL_PERCENT:
		+		case CHAIN_HEAL:
		+		case BUFF:
		+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		+			return;

Cases collapse and run till u tell them to break;

Also it would of been best/safer, if you did it in the Heal skill handler.

thanks for the info, updated

Posted

small note.

 

You don't do this:

		+		case HEAL:
		+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		+			return;
		+		case HEAL_PERCENT:
		+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		+			return;
		+		case CHAIN_HEAL:
		+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		+			return;
		+		case BUFF:
		+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		+			return;

 

You do

		+		case HEAL:
		+		case HEAL_PERCENT:
		+		case CHAIN_HEAL:
		+		case BUFF:
		+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		+			return;

Cases collapse and run till u tell them to break;

Also it would of been best/safer, if you did it in the Heal skill handler.

as you had told me to add these exceptions in skillhandlers didn't work...so it's pointless to add that to skillhandlers :)
Posted

also

from this:

if (activeChar.getTarget() instanceof L2RaidBossInstance || activeChar.getTarget() instanceof L2GrandBossInstance || activeChar.getTarget() instanceof L2MonsterInstance)

you can do this:

if (activeChar.getTarget() instanceof L2MonsterInstance)

because as far as i know, L2RaidBossInstance and L2GrandBossInstance are extending L2MonsterInstance

Posted

also

from this:

if (activeChar.getTarget() instanceof L2RaidBossInstance || activeChar.getTarget() instanceof L2GrandBossInstance || activeChar.getTarget() instanceof L2MonsterInstance)

you can do this:

if (activeChar.getTarget() instanceof L2MonsterInstance)

because as far as i know, L2RaidBossInstance and L2GrandBossInstance are extending L2MonsterInstance

 

I thougth it too, but never tested it, because L2MonsterInstance Extends L2Npc I think, its a little complicated, I will test

Posted

I thougth it too, but never tested it, because L2MonsterInstance Extends L2Npc I think, its a little complicated, I will test

After alot of tests today(becouse i like your idea)

When u get target raidboss/grandraid/monster:

u cant use group heal/chain heal/prayer/servitor heal/AI and alot of buffs which are self...

if you drop chain heal/Buff and MonsterInstance this system will be perfect for raids/epics,big deal that someone will buff him with might or shield,and only group heal and few other skills on target will not work normal.(this is my opinion ofc)

Posted

After alot of tests today(becouse i like your idea)

When u get target raidboss/grandraid/monster:

u cant use group heal/chain heal/prayer/servitor heal/AI and alot of buffs which are self...

if you drop chain heal/Buff and MonsterInstance this system will be perfect for raids/epics,big deal that someone will buff him with might or shield,and only group heal and few other skills on target will not work normal.(this is my opinion ofc)

 

Your report is usefull for me and now I will go fix it, im pretty sure I will solve this bug too, the servitor heal yes its a bug on witch im gonna work on now, but the healer(who is there to use heal and mass heals) is not the one who is supposed to target the monster, but still yes this makes the code faulty and buggy so Im gonna spend more time on this

 

PS I will only fix: SelfBuffs, SelfHeals and any other skill that casts without target

Posted

After alot of tests today(becouse i like your idea)

When u get target raidboss/grandraid/monster:

u cant use group heal/chain heal/prayer/servitor heal/AI and alot of buffs which are self...

if you drop chain heal/Buff and MonsterInstance this system will be perfect for raids/epics,big deal that someone will buff him with might or shield,and only group heal and few other skills on target will not work normal.(this is my opinion ofc)

 

Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestMagicSkillUse.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/RequestMagicSkillUse.java	(revision 2)
+++ java/net/sf/l2j/gameserver/network/clientpackets/RequestMagicSkillUse.java	(working copy)
@@ -17,7 +17,10 @@
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.model.L2Skill;
+import net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
@@ -69,6 +72,19 @@
			if (skill.isToggle() && activeChar.isMounted())
				return;

+			if (activeChar.getTarget() instanceof L2MonsterInstance)
+			{
+				switch (skill.getSkillType())
+				{
+					case BUFF:
+						return;
+					case HEAL:
+						return;
+					case HEAL_PERCENT:
+						return;
+				}
+			}
+			
			activeChar.useMagic(skill, _ctrlPressed, _shiftPressed);
		}
		else

Posted

Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestMagicSkillUse.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/RequestMagicSkillUse.java	(revision 2)
+++ java/net/sf/l2j/gameserver/network/clientpackets/RequestMagicSkillUse.java	(working copy)
@@ -17,7 +17,10 @@
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.model.L2Skill;
+import net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
@@ -69,6 +72,19 @@
			if (skill.isToggle() && activeChar.is-beep-ted())
				return;

+			if (activeChar.getTarget() instanceof L2MonsterInstance)
+			{
+				switch (skill.getSkillType())
+				{
+					case BUFF:
+						return;
+					case HEAL:
+						return;
+					case HEAL_PERCENT:
+						return;
+				}
+			}
+			
			activeChar.useMagic(skill, _ctrlPressed, _shiftPressed);
		}
		else

I cant see any diffrence tho

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

    • 🔥 L2Ext Custom Interlude VANG – 2026 Release High-End Extender for Lineage 2 Interlude by L2Devs   🎯 About L2Devs L2Devs is a production-ready custom extender for Lineage 2 Interlude, designed for stable long-term servers that require performance, security, balance and flexibility. Developed and battle-tested for more than 6 years on live servers, the 2026 Release represents a major evolution, focusing not only on new features but also on stability, configurability and abuse prevention. This extender is aimed at serious server owners, not experimental or low-quality projects.   🚀 What’s New in 2026 Temporary Fake Hero System Fully configurable (duration, visuals, effects) Visual Weapons System Client-side visual weapons without stat impact Visual Armor by Zone System Fully configurable per zone Advanced Balance System Fully configurable per class, skill and scenario Armor Enchant Bonus System Extra bonuses at +7 / +8 / +9 (fully configurable) Enchant Stats System Full control of stats per enchant level Damage Cap System Fully configurable damage limits Champion System with Rewards Custom champions with configurable rewards Item Percentage Steal by Zone Fully configurable zone-based system Raid Boss HP Percentage Announce Last Hit Announce System (Raid / Boss) Pet Sales via Multisell Auto Farm System ✔️ 100% functional ✔️ Fully configurable (zones, skills, behavior) Auto Potion System Configurable by Item ID, HP/MP %, reuse delay New Captcha Mod v4 (2026) Improved bot detection & automation prevention New Event Modes TvT – Last Man Standing (LMS) KTB – Kill The Boss Fully configurable ⚙️ Core Features General Systems Cached Extended IOBuffer (8192kb) Hair2Slot Cache Item Bid Auctioner for Clan Halls Offline Shops & Buffers restore after restart (fixed location) Offline Buffer System ALT+B Augmentation House Shift+Click Drop/Spoil List Auto Learn Skills Scheme Buffer Global Trade Chat Global Vote Reward System Achievements System Custom Subclass (Accumulative) Change Name Color / Title Color Change Gender / Change Race (Skin) VIP Systems (chat, autoloot, features) Command .menu fully configurable Command .hero enable/disable aura PvP / PK / War PvP Auto Announce System (rebuilt, configurable) PvP Reward / PK Reward / War Reward Epic Items Rank Raid Boss Points Rank Global PvP Rankings Anti abuse validations Olympiad Olympiad Season Rank Pages Restore Stats on Fight Start Olympiad Second Time System Last 10 Minutes Entry Third Class Summons Control Castle / Siege Castle Announce Time Castle Standby Time Siege-related optimizations Disable SSQ System after Castle Siege Drops & Enchants Fully configurable drop system (min/max level, all mobs, RBs, individual mobs) Spellbook Drop enable/disable Custom Cancel Effects (min/max) Blessed Enchant Rates (armor & weapons) Enchant restrictions & protections Quality of Life Fix Spiritshot Delay Fast NPC loading fix Show Mob Level Show NPC Clan Flag Use Any Dyes No Drop on Death (configurable) No Sell / No Private Buy Items Min Level Trade Soulshot no system message Spawn Protection System 🎮 Events Engine Team vs Team Capture The Flag Death Match Last Man Standing Destroy The Base Korean Style Events Castle Siege Events Happy Hour Event (reworked) AFK Time Control Reset Reuse Skills Reset Buffs on Finish Firework Effects Win/Loss Rewards Custom Team Titles & Colors Kill Counter in Title Open Door / Wall System Balance Bishops Disconnect Recovery Validation 🔁 Reload Systems (Live Reload) EnterWorld HTML Donate Shop Offline Buffer Champion NPC AntiBot VIP System Auction System AutoLoot Castle Siege Manager Character Lock Clan PvP Status Auto Learn Clan Reputation Rank Clan Systems Skill Data Door Data Deco Data Multisell Drop List Custom Config Files 🛡️ Security & Stability Anti-Bot & Captcha v4 Anti-Exploit & Anti-Abuse protections Safe enchant & item handling Crash-safe routines Tested on live servers for 3+ years 📊 Performance Optimized thread usage Reduced database load Improved packet handling Designed for high concurrency environments 💼 License & Support Price: 450 USDT per IP / initial installation License: One server / one IP / 30 USDT monthly Payments: Crypto only Included Support Extender installation Extender configuration support Not Included Script configuration (consult separately) Custom MOD development (available on request) Source code not included, please inquire for pricing 📩 Contact Telegram: @L2Devs Discord: .unknownsoldier Website: https://l2devs.com
    • Prices added, sorry for the inconvenience.   Greetings!!
    • There is a big difference when somebody ''use some brand names'' with a role of his discord to ensure that people will trust him. Here is MXC and not  your friends discord. Read the rules before you post, and read the rules before you buy.
  • 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..