Jump to content

Recommended Posts

Posted

Whit this small modification you can disallow potions in pvp

 

go to com.l2jfree.gameserver.handler.itemhandler.potion.java

 

search for this:

 

		if (activeChar.isAllSkillsDisabled())
	{
		activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		return;
	}

 

then after that insert this:

 

		if (activeChar.getPvpFlag() != 0)
	{
		if (item.getItemId() == your itemID)
		{
		    activeChar.sendMessage("You cannot use this in pvp mode!");
		    return;
		}
	}

 

credits to crion for the base code and to me because of some correction

(with crion's code in gracia i get several error message like cannot find symbol and others)

  • 2 weeks later...
Posted

Change to code to this, easier and lessens the load.

 

	if (activeChar.getPvpFlag() != 0 && item.getItemId() == Your Item ID)
	{
		activeChar.sendMessage("You cannot use this in pvp mode!");
		return;
	}

Posted

disable potion in pvp? :P bad idea!

i dont think it's a bad idea for example disable quick heal potion in high rate server...

or if somebody want to open a low rate without mana pots but he want good play with mage he can enable the mana potion but only for exping.

  • 2 weeks later...
  • 2 months later...
Posted

Code to disable all potions:

	if (activeChar.getPvpFlag() != 0 && item.getItemType() == L2EtcItemType.POTION)
	{
		    activeChar.sendMessage("You cannot use this in pvp mode!");
		    return;
	}

You may need to import L2EtcItemType.java

import com.l2jfree.gameserver.templates.item.L2EtcItemType;

Posted

Code to disable all potions:

	if (activeChar.getPvpFlag() != 0 && item.getItemType() == L2EtcItemType.POTION)
	{
		    activeChar.sendMessage("You cannot use this in pvp mode!");
		    return;
	}

You may need to import L2EtcItemType.java

import com.l2jfree.gameserver.templates.item.L2EtcItemType;

 

You dont need imports...

just the check so its like

	if (activeChar.getPvpFlag() != 0)
	{
		    activeChar.sendMessage("You cannot use this in pvp mode!");
		    return;
	}

Posted

You dont need imports...

just the check so its like

	if (activeChar.getPvpFlag() != 0)
	{
		    activeChar.sendMessage("You cannot use this in pvp mode!");
		    return;
	}

The code i made disallows all potions. So you don't need to specify potion id.

Posted

The code i made disallows all potions. So you don't need to specify potion id.

 

Man if you write only the check i post it affects all potions :Din the first 1 the itemId is just a plus check to dont disallow all potion only 1...

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



×
×
  • 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