Zones = Town

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
t102030
Posts: 24
Joined: Sun Jun 23, 2013 2:32 am

Zones = Town

Post by t102030 »

L2J Revision Number: 6086
L2JDP Revision Number: 9839

Hello! i make a code that can get characters inside a Town Zone, townId.

Code: Select all

     public static int pewpew(int bitch)    {        L2ZoneType zone = TownManager.getTown(bitch);        int i = 0;        if (zone != null)        {            for (L2Character character : zone.getCharactersInside())            {                if (character instanceof L2PcInstance)                {                    i++;                }            }            return i;        }        return -1;    } 
and after this, i can send information of the players inside the zone in one HTML code.

Giran Town(ID: 9):

Code: Select all

 tb.append("<td valign=\"top\"><font color=\"FF6600\">Players Inside: " + pewpew(9) + ".</font>"); 
Now my question:

How i can make this code to get the ZoneId ?

I need adapt this code to get the ZONE ID to send in the HTML code.

EXAMPLE:

Code: Select all

 tb.append("<td valign=\"top\"><font color=\"FF6600\">Players Inside: " + pewpew(12002) + ".</font>"); 
12002 = Zone of Baium Boss

You can find this on: data/zones/custom_boss.xml

Code: Select all

     <zone name="Baium Boss" id="12002" type="BossZone" shape="NPoly" minZ="10061" maxZ="11061">        <node X="111022" Y="16177" />        <node X="114510" Y="12623" />        <node X="118142" Y="15790" />        <node X="114773" Y="19589" />    </zone> 
...


I need this because i have created one custom boss teleport gatekeeper, and i need add the info of players inside the bosses area.

HELP ME PLEASE!
User avatar
tukune
Posts: 533
Joined: Sun Mar 29, 2009 2:35 pm
Location: Japan

Re: Zones = Town

Post by tukune »

:idea: TownManager --> ZoneManager
t102030
Posts: 24
Joined: Sun Jun 23, 2013 2:32 am

Re: Zones = Town

Post by t102030 »

but, and the .getTown() ?
t102030
Posts: 24
Joined: Sun Jun 23, 2013 2:32 am

Re: Zones = Town

Post by t102030 »

Solved.
sliproberknot
Posts: 1
Joined: Fri May 01, 2009 2:29 am

Re: Zones = Town

Post by sliproberknot »

how u solved pls share
User avatar
tukune
Posts: 533
Joined: Sun Mar 29, 2009 2:35 pm
Location: Japan

Re: Zones = Town

Post by tukune »

:idea: TownManager --> ZoneManager

Code: Select all

- L2ZoneType zone = TownManager.getTown(bitch);+ L2ZoneType zone = ZoneManager.getInstance().getZoneById(bitch);
Post Reply