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

    • Tell a Škoda 1.4 driver that a Škoda 1.8 is faster — and suddenly, you’re riding a mini race car. On the way, they might share random stories — gas prices, the perfect BBQ recipe, or how passengers once called them “just for a minute.” Maybe even how someone left a suitcase full of money in their car once.     The important part? You’ll get there on time, no delays.     Vibe SMS works just as fast — messages fly like that driver who just heard their 1.8 isn’t the fastest.     🌐 https://vibe-sms.net/ 📲 https://t.me/vibe_sms  
    • ⚔️ The Grand Opening Has Arrived! ⚔️ In just a few hours the gate to the eternal battlefield will be open and the war between Order and Chaos will be set once again ! Its time to claim your destiny 🔥 👉 Register now and join the fight today! 🌐 https://l2ovc.com register now : https://l2ovc.com The gates are open the war between Order and Chaos has officially started! 🔥 Join the battlefield NOW and claim your destiny in Order vs Chaos! 💥 Don’t fall behind your faction needs you. ➡️ https://l2ovc.com  
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock