Potions in Arena Zone
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
- kuriku
- Posts: 65
- Joined: Sun Jan 03, 2010 7:58 am
Potions in Arena Zone
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
» 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
- LasTravel
- Posts: 888
- Joined: Tue Jan 05, 2010 12:08 am
- Location: Spain
Re: Potions in Arena Zone
Try this,
Add import:
and the code:
Add import:
Code: Select all
import com.l2jserver.gameserver.model.actor.L2Character;
Code: Select all
if (activeChar.isInsideZone(L2Character.ZONE_ARENA)){activeChar.sendMessage("You can't use potions in PvP Zone.");return;}
- kuriku
- Posts: 65
- Joined: Sun Jan 03, 2010 7:58 am
Re: Potions in Arena Zone
LasTravel wrote:Try this,
Add import:and the code:Code: Select all
import com.l2jserver.gameserver.model.actor.L2Character;
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;}
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: Potions in Arena Zone
he meant for all potions, not just mana...
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.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
- kuriku
- Posts: 65
- Joined: Sun Jan 03, 2010 7:58 am
Re: Potions in Arena Zone
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;}
I meant that if I try the variable...
Code: Select all
if (item.getItemId() == 726 && activeChar.isInsideZone(L2Character.ZONE_ARENA) != 0 )
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: Potions in Arena Zone
dude... you put the restriction in POTIONS.JAVA, which already means restriction to ALL POTIONS...



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.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
- denser
- Posts: 1392
- Joined: Wed May 30, 2007 9:13 pm
- Location: Russia
- Contact:
Re: Potions in Arena Zone
Code: Select all
if (activeChar.isInsideZone(L2Character.ZONE_ARENA)){activeChar.sendMessage("You can't use potions in PvP Zone.");return;}
Tiger, once tasted human flesh, will want to taste it again
L2J - the place where glad to see you any time!
L2J - the place where glad to see you any time!
- kuriku
- Posts: 65
- Joined: Sun Jan 03, 2010 7:58 am
Re: Potions in Arena Zone
It isn't run.
Any idea?

Any idea?

- kuriku
- Posts: 65
- Joined: Sun Jan 03, 2010 7:58 am
Re: Potions in Arena Zone
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 ?
- LasTravel
- Posts: 888
- Joined: Tue Jan 05, 2010 12:08 am
- Location: Spain
Re: Potions in Arena Zone
Yep, put it on itemskills.java 

- kuriku
- Posts: 65
- Joined: Sun Jan 03, 2010 7:58 am
Re: Potions in Arena Zone
It runs perfectly.
Thnx ppl.
Thnx ppl.