Jump to content

Recommended Posts

Posted

Alright, I'm sure you all seen Rizel's share on how to Forbid to equip some kind of items. Well don't take me wrong Rizel, it was a good share, but a certain forum user requested me to make something smarter and much faster. So I did, its a simple change, the code is pretty simple and clean - thats whats so good about it.

So here's an example of the code:

 

int _noLightlist[] = {93 ,108,101};
int _noHeavylist[] = {94 };
int _noRobeList[] = { 98 };

if(item.getItemType() == L2ArmorType.LIGHT)
		for(int i =0; i < _noLightlist.length ; i++)
		{
			if(activeChar.getActiveClass() == _noLightlist[i])
			{
				SystemMessage sm = new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED);
				sm.addItemName(item);
				getClient().getActiveChar().sendPacket(sm);
				sm = null;
				return;
			}
			continue;
		}
if(item.getItemType() == L2ArmorType.HEAVY)
		for(int i =0; i < _noLightlist.length ; i++)
		{
			if(activeChar.getActiveClass() == _noHeavytlist[i])
			{
				SystemMessage sm = new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED);
				sm.addItemName(item);
				getClient().getActiveChar().sendPacket(sm);
				sm = null;
				return;
			}
			continue;
		}
if(item.getItemType() == L2ArmorType.ROBE)
		for(int i =0; i < _noRobelist.length ; i++)
		{
			if(activeChar.getActiveClass() == _noLightlist[i])
			{
				SystemMessage sm = new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED);
				sm.addItemName(item);
				getClient().getActiveChar().sendPacket(sm);
				sm = null;
				return;
			}
			continue;
		}

 

It only requires 5 minutes of your time and works like a charm (I hope, I didn't actually test it lool).

Just insert the class's Index on the array and you're off.

 

Well Stef just suggested I made something like if a Dagger user wears a Heavy Armor, he would get a penalty (Skill Effect) and a big head.

The Skill level deppends on wether the character is above or below level 40 (to make sure that the penalty isn't too big) and the Skill ,obviously, deppends on whether the Character is a Mage or not (Different penalties for Mages & Fighters).

So here it is:

int _daggerPenalty[] = { 78 } ;

if(item.getItemType() == L2WeaponrType.DAGGER)
		for(int i =0; i < _daggerPenalty.length ; i++)
		{
			if(activeChar.getActiveClass() == _daggerPenalty[i])
			{
                                activeChar.startAbnormalEffect(L2Character.ABNORMAL_EFFECT_BIG_HEAD); // give player a Big Head
			// lets recycle the sevensigns debuffs
			int skillId;

			int skillLevel = 1;

			if (activeChar.getLevel() > 40)
				skillLevel = 2;

			if (activeChar.isMageClass())
				skillId = 4361;
			else
				skillId = 4362;

			L2Skill skill = SkillTable.getInstance().getInfo(skillId, skillLevel);

			if (activeChar.getFirstEffect(skill) == null)
			{
				skill.getEffects(activeChar, activeChar);
				SystemMessage sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
				sm.addSkillName(skill);
				activeChar.sendPacket(sm);
			}
			}
			continue;
		}

In case you haven't noticed the base is always the same, you just have to spread wings to your imagination.

Posted

loool xD

 

that's it.

 

great code mate.

thanx

Shut and start reworking ActionFailed lool.

Btw for your Oly thingie, check L2GameClient and just modify the protected void onForcedDisconnection().

Posted

Lool..

 

Tha'ts great code indeed .. Ex we can say that , TH cannot use heavy?Holy damn that sure will help ..

lool of course. Just modify it to suit your needs, you can do it with armors, weapons, jewels, accessories ,etc.

Or use it to make other restrictions such as skill using, pvp diminishing, and so on. Use your imagination.

Posted

Shut and start reworking ActionFailed lool.

LOOOOOOOL! u shut , and go code!

 

Btw for your Oly thingie, check L2GameClient and just modify the protected void onForcedDisconnection().

 

Okay Thanx.

 

 

Posted

LOOOOOOOL! u shut , and go code!

 

Okay Thanx.

 

 

Oh and I added that Penalty thing you asked.

Should work, I didn't test it but it all makes sense ^^

Posted

the first example so it resstrict all class'es masterity right? i mean who dont have light  masterity can use light? or i am wrong?

Wrong.

In the first example, you have the ability to prevent certain CLASSES (Doesn't deppend on their mastery) to use a certain type of armors.

You can use it on armors,weapons, jewels, skills ,npcs and pretty much everything that exists in the L2 World lool.

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

    • ## [1.4.0] - 2026-01-28   ### ✨ New Features - **Vote System**: Lineage 2 servers can now use our vote–reward system. Players vote on the website and claim rewards in-game (1 vote = 1 claim) - **Vote Page**: On each server’s page (`/servers/<server>`), a **“Vote for Server”** button opens a dedicated vote page with cooldown info and optional Turnstile verification - **By Votes View**: The **“By Votes”** tab on the main page shows **actual vote counts** per server - **API Documentation**: New **API Docs** page at `/docs` (and footer link) with HMAC auth, endpoints, and examples for game server integration - **Vote API (My Servers)**: Server owners can open **“Vote API”** in My Servers to manage credentials, cooldown, allowed IPs, and open the docs   ### 🔄 Improvements - **Server Pages**: Single-server data is cached and loads faster; server pages can be opened by ID or by name (e.g. `/servers/my-server-name`) - **API Root**: Visiting the API root redirects to the docs URL configured in admin (default: site docs page) - **Admin Panel**: New **“Vote System”** tab for global settings (Turnstile, API security, default cooldown, docs URL)   ### 🔐 Security & Reliability - Turnstile (CAPTCHA) support for vote submissions to reduce abuse - HMAC-protected game server API for secure vote check/claim and stats
    • "I recently purchased the account panel from this developer and wanted to leave a positive review.   The transaction was smooth, and the developer demonstrated exceptional professionalism throughout the process.   What truly sets them apart is their outstanding post-sale support. They are responsive, patient, and genuinely helpful when addressing questions or issues. It's clear they care about their customers' experience beyond just the initial sale.   I am thoroughly satisfied and grateful for the service. This is a trustworthy seller who provides real value through both a quality product and reliable support. 100% recommended."
    • Server owners, Top.MaxCheaters.com is now live and accepting Lineage 2 server listings. There is no voting, no rankings manipulation, and no paid advantages. Visibility is clean and equal, and early listings naturally appear at the top while the platform grows. If your server is active, it should already be listed. Submit here https://Top.MaxCheaters.com This platform is part of the MaxCheaters.com network and is being built as a long-term reference point for the Lineage 2 community. — MaxCheaters.com Team
    • ⚙️ General Changed “No Carrier” title to “Disconnected” to avoid confusion after abnormal DC. On-screen Clan War kill notifications will no longer appear during Sieges, Epics, or Events. Bladedancer or SwordSinger classes can now log in even when Max Clients (2) is reached, you cannot have both at the same time. The max is 3 clients. Duels will now be aborted if a monster aggros players during a duel (retail-like behavior). Players can no longer send party requests to blocked players (retail-like). Fixed Researcher Euclie NPC dialogue HTML error. Changed Clan leave/kick penalty from 12 hours to 3 hours. 🧙 Skills Adjusted Decrease Atk. Spd. & Decrease Speed land rates in Varka & FoG. Fixed augmented weapons not getting cooldown when entering Olympiad. 🎉 Events New Team vs Team map added. New Save the King map added (old TvT map). Mounts disabled during Events. Letter Collector Event enabled Monsters drop letters until Feb. 13th Louie the Cat in Giran until Feb. 16th Inventory slots +10 during event period 📜 Quests Fixed “Possessor of a Precious Soul Part 1” rare stuck issue when exceeding max quest items. Fixed Seven Signs applying Strife buff/debuff every Monday until restart. 🏆 Milestones New milestone: “Defeat 700 Monsters in Varka” 🎁 Rewards: 200 Varka’s Mane + Daily Coin 🌍 NEW EXP Bonus Zones Hot Springs added Varka Silenos added (hidden spots excluded) As always, thank you for your support! L2Elixir keeps evolving, improving, and growing every day 💙   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
  • 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..