Page 1 of 1

Potions in Arena Zone

Posted: Sat May 29, 2010 2:47 pm
by kuriku
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:
L2JDP Revision Number:



Hi ppl.

I want to forbid Potions, especially mana and cp pots, on Arena Zones, like Colliseum, Giran Arena...

for example, in Potion.java:

if (item.getItemId() == 726 && activeChar.getPvpZone) != 0 )
{
activeChar.sendMessage("You cant use mana potions in PvP.");
return;
}


But I am newbie in Java and I don't find the needed variable.

What would I have to do?

Thnx ppl

Re: Potions in Arena Zone

Posted: Sat May 29, 2010 4:33 pm
by LasTravel
Try this,

Add import:

Code: Select all

import com.l2jserver.gameserver.model.actor.L2Character;
and the code:

Code: Select all

if (activeChar.isInsideZone(L2Character.ZONE_ARENA)){activeChar.sendMessage("You can't use potions in PvP Zone.");return;}

Re: Potions in Arena Zone

Posted: Sat May 29, 2010 4:54 pm
by kuriku
LasTravel wrote:Try this,

Add import:

Code: Select all

import com.l2jserver.gameserver.model.actor.L2Character;
and the code:

Code: Select all

if (activeChar.isInsideZone(L2Character.ZONE_ARENA)){activeChar.sendMessage("You can't use potions in PvP Zone.");return;}


If I try this...????
id: 726 Mana Drug (only an example)

Code: Select all

 if (item.getItemId() == 726 && activeChar.isInsideZone(L2Character.ZONE_ARENA) != 0 ){activeChar.sendMessage("You can't use potions in PvP Zone.");return;}

Re: Potions in Arena Zone

Posted: Sat May 29, 2010 5:22 pm
by jurchiks
he meant for all potions, not just mana...

Re: Potions in Arena Zone

Posted: Sat May 29, 2010 6:36 pm
by kuriku
jurchiks wrote:he meant for all potions, not just mana...

But in the code that LastTravel wrote I don't see the prohibition to use Pots:

Code: Select all

if (activeChar.isInsideZone(L2Character.ZONE_ARENA)){activeChar.sendMessage("You can't use potions in PvP Zone.");return;}
Only the message "no pots in PvP zone".


I meant that if I try the variable...

Code: Select all

 if (item.getItemId() == 726 && activeChar.isInsideZone(L2Character.ZONE_ARENA) != 0 ) 
It will be valid for every potion.

Re: Potions in Arena Zone

Posted: Sat May 29, 2010 9:15 pm
by jurchiks
dude... you put the restriction in POTIONS.JAVA, which already means restriction to ALL POTIONS... :idea: :!:

Re: Potions in Arena Zone

Posted: Sun May 30, 2010 6:46 am
by denser

Code: Select all

if (activeChar.isInsideZone(L2Character.ZONE_ARENA)){activeChar.sendMessage("You can't use potions in PvP Zone.");return;}
return; - mean stop run this class...so no potions works

Re: Potions in Arena Zone

Posted: Sun May 30, 2010 7:26 pm
by kuriku
It isn't run.

Any idea?

:?

Re: Potions in Arena Zone

Posted: Sun May 30, 2010 9:38 pm
by kuriku
kuriku wrote:It isn't run.

Any idea?

:?

The same code in infoserver.java for a custom info item runs, but it ins't run in potions if I put the code in Potion.java

The code it isn't the problem, Potion.java doen'st recognize the potions.

Would I put the code in Itemskills.java ?

Re: Potions in Arena Zone

Posted: Mon May 31, 2010 1:13 am
by LasTravel
Yep, put it on itemskills.java :)

Re: Potions in Arena Zone

Posted: Mon May 31, 2010 4:29 pm
by kuriku
It runs perfectly.



Thnx ppl.