Page 1 of 1

Make a custom real town (solved)

Posted: Fri May 22, 2009 3:20 am
by Bariudol
L2J Revision Number: 3023
L2JDP Revision Number: 6087

This was posted on Datapack support, but i edited the post and reposted it here that is the corresponding place. As the title of the post says i want to know how to make a custom town but i dont want it to be only a peace zone but a real town, wen players die arround it get teleported there. I know i have to change some things in the core.
I founded the .java files that i think i should modify for making this possible, the problem is that i just don't get how does the mapregiontable works. Cause i see 17 regions on mapregiontable but i don't know what sec0 , sec1, etc; are. Could someone please post a litle example of a custom town? or explain me how to do it right? I'm thinking on doing it like this:

On Zone.xml

Code: Select all

    <zone id='ID' type='Town' shape='Cuboid' minZ='-7905' maxZ='-8000'>        <stat name='name' val='Town Name'/>        <stat name='townId' val='36'/>        <stat name='taxById' val='1'/>        <stat name='spawnX' val='-82188'/>        <stat name='spawnY' val='-220370'/>        <stat name='spawnZ' val='-7903'/>    </zone>
On zone_vertices Table on database

Code: Select all

INSERT INTO `zone_vertices` (`id`,`order`,`x`,`y`) VALUES (ID,0,-82188,-220370),(ID,1,-81598,-219786),
On MapRegionTable.java
on this part:

Code: Select all

_pointsWithKarmas = new int[21][3];
(21 = Castles? Areas?)

Code: Select all

        //Town Name        _pointsWithKarmas[36][0] = -82188;        _pointsWithKarmas[36][1] = -220370;        _pointsWithKarmas[36][2] = -7903;
on this part: get area castle
I think if i don't add a "case" for my custom town it will get like Aden castle area right?

Code: Select all

    case 36:        castle = 9;        break; //Town
The same with this i think :roll:

Code: Select all

    case 36:        nearestTown = "Town Name";        break;
On TownManager.java
Don't know how to modify this i think if i don't change something here it will send mi to floran as default :S
Get Near town

Code: Select all

case 36:                return getTown(36);//??
Get Second near town

Code: Select all

 case 35:                return getTown(36);//??
could someone help me with this? am i in the right way? what should i change? Please someone explain me how does mapregiontable works in the database. Thanks.

Re: Make a custom real town

Posted: Fri May 22, 2009 6:31 pm
by Bariudol
Finally i founded out how to do it, thanks for reading my post. I'll post a guide of how to make a custom town soon when i finish with my owns.

Re: Make a custom real town (solved)

Posted: Wed May 27, 2009 7:18 am
by Polo
nice. If you create a guide post it into the wiki :D I think it would help others

Re: Make a custom real town (solved)

Posted: Tue Jun 02, 2009 11:04 am
by plim
Hi! Could you please post the info about how to set up this custom town? I'm very interested. Thanks :mrgreen: