Page 1 of 1

Help With Java code

Posted: Fri Apr 16, 2010 1:14 pm
by Gudonov
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:4083
L2JDP Revision Number:7268
go to com.l2jfree.gameserver.handler.itemhandler.potion.java

search for this:

Code:

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


then after that insert this:

Code:

if (activeChar.getPvpFlag() != 0)
{
if (item.getItemId() == your itemID)
{
activeChar.sendMessage("You cannot use this in pvp mode!");
return;
}
}
I want to put this code on my server, but i dont find this file, potion.java
Where i must put this code?

Thanks for help

Re: Help With Java code

Posted: Fri Apr 16, 2010 4:29 pm
by jurchiks
have you downloaded the source code??

Re: Help With Java code

Posted: Fri Apr 16, 2010 4:37 pm
by Probe
Potions.java was moved in ItemSkills.java

Re: Help With Java code

Posted: Sat Apr 02, 2011 6:26 pm
by maurioski
i fixed!!

Code: Select all

 // No Use MpPotion in PVP State (fixed by Maurioski)        if (activeChar.getPvpFlag()!= 0);        {        int itemid = item.getItemId();            if (itemid == 728)            {            activeChar.sendMessage("Can't Use MP in PVP State!!");            return;            }        } 

put in UseItem.java in line 211-220