Help With Java code

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
Gudonov
Posts: 9
Joined: Thu Mar 04, 2010 1:52 pm
Location: Sweden

Help With Java code

Post 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
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Help With Java code

Post by jurchiks »

have you downloaded the source code??
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Probe
Posts: 915
Joined: Thu Sep 03, 2009 6:36 pm
Location: Israel
Contact:

Re: Help With Java code

Post by Probe »

Potions.java was moved in ItemSkills.java
maurioski
Posts: 12
Joined: Sat Jul 31, 2010 10:10 am

Re: Help With Java code

Post 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
Post Reply