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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...