Page 1 of 1

Zones = Town

Posted: Sat Jun 29, 2013 9:00 pm
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!

Re: Zones = Town

Posted: Sun Jun 30, 2013 2:47 am
by tukune
:idea: TownManager --> ZoneManager

Re: Zones = Town

Posted: Sun Jun 30, 2013 2:40 pm
by t102030
but, and the .getTown() ?

Re: Zones = Town

Posted: Mon Jul 01, 2013 3:05 am
by t102030
Solved.

Re: Zones = Town

Posted: Sun Sep 01, 2013 9:39 pm
by sliproberknot
how u solved pls share

Re: Zones = Town

Posted: Mon Sep 02, 2013 10:42 am
by tukune
:idea: TownManager --> ZoneManager

Code: Select all

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