Potions in Arena Zone

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
User avatar
kuriku
Posts: 65
Joined: Sun Jan 03, 2010 7:58 am

Potions in Arena Zone

Post 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
User avatar
LasTravel
Posts: 888
Joined: Tue Jan 05, 2010 12:08 am
Location: Spain

Re: Potions in Arena Zone

Post 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;}
User avatar
kuriku
Posts: 65
Joined: Sun Jan 03, 2010 7:58 am

Re: Potions in Arena Zone

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

Re: Potions in Arena Zone

Post by jurchiks »

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.
User avatar
kuriku
Posts: 65
Joined: Sun Jan 03, 2010 7:58 am

Re: Potions in Arena Zone

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

Re: Potions in Arena Zone

Post by jurchiks »

dude... you put the restriction in POTIONS.JAVA, which already means restriction to ALL POTIONS... :idea: :!:
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.
User avatar
denser
Posts: 1392
Joined: Wed May 30, 2007 9:13 pm
Location: Russia
Contact:

Re: Potions in Arena Zone

Post 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
Tiger, once tasted human flesh, will want to taste it again
L2J - the place where glad to see you any time!
User avatar
kuriku
Posts: 65
Joined: Sun Jan 03, 2010 7:58 am

Re: Potions in Arena Zone

Post by kuriku »

It isn't run.

Any idea?

:?
User avatar
kuriku
Posts: 65
Joined: Sun Jan 03, 2010 7:58 am

Re: Potions in Arena Zone

Post 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 ?
User avatar
LasTravel
Posts: 888
Joined: Tue Jan 05, 2010 12:08 am
Location: Spain

Re: Potions in Arena Zone

Post by LasTravel »

Yep, put it on itemskills.java :)
User avatar
kuriku
Posts: 65
Joined: Sun Jan 03, 2010 7:58 am

Re: Potions in Arena Zone

Post by kuriku »

It runs perfectly.



Thnx ppl.
Post Reply