Skip to content

L2Homage; Making L2 Modding Accessible

Featured Replies

  • Author

Progress update:

Delete functionality is just too boring to focus on right now. I felt like I was falling asleep, and I thought "You know what? I don't have to do something this boring right now". So I moved on to the spawning system. I'm looking at the npcpos file now, figuring out the structure. I think I'll have some questions about a few of the variables. That's for later though.

 

The Item/npc add/editing functionality works now, from what I can tell. It exports it correctly too, though I still need a server to test on. I'll get to that when I'm done with the spawning system.

 

The initial spawning editor looks like this:

GmE09bq.png

 

The different lists will contain the following info:

 

Maps: ID of each block in the world (for instance 20_21 for Cruma). I think I'll parse them with easier names to recognise instead of numbers, since there's not that many. Selecting a map loads spawn areas.

 

Spawn areas: List of each spawn zone in the selected map. Selecting a spawn area will draw a polygon on the map, representing the area.

 

NPCs: Shows which NPCs are set to spawn in the selected spawn area.

Properties: Exposes the different variables for the selected NPC, for easy editing.

 

Map 0 - Map 6: Sometimes each map has several layers - at most 7. There are no identifiers for the terrain zones, so if the polygon doesn't make any sense, switch to another map to see the overlay on another layer instead.

 

Add Npc / Remove Npc: Self explanatory.

 

I'm off for today!

 

-B

  • Author

Progress update:

Spawn areas are parsing and loading correctly now.

 

I'm working on the different variables for each npc spawn. I'm curious what information is stored for NPCs on the database, and I was hoping someone in here could help me out.

Here's an example:

npc_ex_begin	[raid_boss_von_helman]	pos={{59331;-42403;-3003;0;20%};{59709;-42310;-3003;0;20%};{59717;-41974;-3003;0;20%};{59333;-41858;-3003;0;20%};{59047;-42165;-3003;0;20%}}	total=1	respawn=3hour	respawn_rand=1hour	dbname=[raid_boss_von_helman]	boss_respawn_set=yes	npc_ex_end

'raid_boss_von_helman' is the ID.

Then comes the position, following pos={.

But why does this one suddenly have a percentage in his coordinates? What does the 20% mean?

 

after that comes the total number of spawns alive at any time, which is obviously set to 1.

 

Then respawn time, self-explanatory.

 

Then comes respawn_rand. Is that amount of time it can deviate from respawn time? So this guy can spawn every 2-4 hours?

 

Next is dbname, referencing an entry in the database. What exactly is stored for this guy in the database? Or any other NPC with a reference to the database? Is the entry created when the server is installed, or is it created when the npc is loaded?

 

boss_respawn_set is just if the npc is a boss I assume.

 

 

Regarding the structure; it changes a bit depending on the npc. Some have a lot of variables, others have a few. Unlike all the other script files I've parsed, there is no empty space between the variables when one is skipped. It's just not there. Can I assume that npcpos.txt is imported different, only reading which variables are actually applied? So if a variable isn't mentioned, I don't have to account for it?

 

Thanks,

 

-B

 

 

1 hour ago, Bumble said:

Progress update:

Spawn areas are parsing and loading correctly now.

 

I'm working on the different variables for each npc spawn. I'm curious what information is stored for NPCs on the database, and I was hoping someone in here could help me out.

Here's an example:


npc_ex_begin	[raid_boss_von_helman]	pos={{59331;-42403;-3003;0;20%};{59709;-42310;-3003;0;20%};{59717;-41974;-3003;0;20%};{59333;-41858;-3003;0;20%};{59047;-42165;-3003;0;20%}}	total=1	respawn=3hour	respawn_rand=1hour	dbname=[raid_boss_von_helman]	boss_respawn_set=yes	npc_ex_end

'raid_boss_von_helman' is the ID.

Then comes the position, following pos={.

But why does this one suddenly have a percentage in his coordinates? What does the 20% mean?

 

after that comes the total number of spawns alive at any time, which is obviously set to 1.

 

Then respawn time, self-explanatory.

 

Then comes respawn_rand. Is that amount of time it can deviate from respawn time? So this guy can spawn every 2-4 hours?

 

Next is dbname, referencing an entry in the database. What exactly is stored for this guy in the database? Or any other NPC with a reference to the database? Is the entry created when the server is installed, or is it created when the npc is loaded?

 

boss_respawn_set is just if the npc is a boss I assume.

 

 

Regarding the structure; it changes a bit depending on the npc. Some have a lot of variables, others have a few. Unlike all the other script files I've parsed, there is no empty space between the variables when one is skipped. It's just not there. Can I assume that npcpos.txt is imported different, only reading which variables are actually applied? So if a variable isn't mentioned, I don't have to account for it?

 

Thanks,

 

-B

 

 

I think % value there is a chance that an NPC will spawn on each of the specified pos={. It has 5 values, 20% each, 100% spawn rate total. Other NPCs that have this % value, also have a total sum of 100% depending on the number of coordinates.

 

E.g. Uruka:

 

npc_ex_begin    [uruka]    pos={{3075;-10966;-3650;0;30%};{5202;-11331;-3650;0;30%};{5225;-8439;-3550;0;40%}}

 

3 values with 100% total.

 

About respawn_rand, I found this topic on L2Shrine with replies from @eressea: https://forum.l2shrine.com/topic/1622-respawn-of-world-bosses/, where she describes it in more detail and with a formula! :) There are also other options mentioned there, and I saw a couple of other ways it may work on different servers; but I think it can also depend on whether it is java or off platform.

 

Now, dbname=[ , not so sure... Looks like some specific NPC ID, bosses and NPCs such as siege units have it mostly; monsters spawning on a certain territory don't usually have that. So a bit hard for me to say for sure to what and where it references to.

 

Edited by Weedy

Also, found one utility, not sure if it is available somewhere here on MC, called NpcPosMaker. It has several features plus a radar which helps with the visualisation/finding the value for the direction NPCs are facing. 

 

If it would be of any help, I can share it here.

Edited by Weedy

  • Author

Weedy, that's exactly what I was looking for. Good find!

 

I'm still looking for some info on the different database values (dbname, dbsaving), but the info you posted takes me a long way.

 

Thanks!

-B

1 hour ago, Weedy said:

Also, found one utility, not sure if it is available somewhere here on MC, called NpcPosMaker. It has several features plus a radar which helps with the visualisation/finding the value for the direction NPCs are facing. 

 

If it would be of any help, I can share it here.

 

yeah share it if u can

 

1 hour ago, Bumble said:

Weedy, that's exactly what I was looking for. Good find!

 

I'm still looking for some info on the different database values (dbname, dbsaving), but the info you posted takes me a long way.

 

Thanks!

-B

 

RBs/(CH)Siege NPCs time of death gets written in the db, probably because of a different way to calculate respawns between the normal npcmaker and npcmaker_ex and the need to reestablish a RB/(CH)siege after a server crash and continue where it was left at.

 

dbname should be about what value to put in the id column of the db table responsible for keeping that kind of info and the dbsaving should be about what data to save about that npc, the ones I've seen are time of death, position and a generic parameters thing which I don't have a live server running atm to check what is about (PC name that killed that NPC could be one param, HP/MP values of the NPC another, etc),

Edited by sepultribe

  • Author

Thanks sepultribe, that makes a lot of sense. That was the last info I needed to parse the npcpos file completely.

 

I'll start implementing the info into L2h, then I'll start editing and exporting functionality.

 

-B

  • Author

Progress update:

World blocks are loading in correctly, and selecting a block loads the correct radar map.

Selecting a spawn area draws a polygon on the radar map, showing the location or area of the spawn.

Some edge cases are not loaded correctly yet, I'm working on that.

There are some scaling issues with the polygons for now, but full screen mode seems to work. I'll have to revisit my calculations.

 

Here's an example of all the spawn areas in Execution Grounds:

GqiDDg6.jpg

 

It's getting there, but still very buggy.

When I'm happy with how the polygons behave, and when I'm sure all the correct areas are loaded in, I'll move on to loading in NPCs.

 

I'm off for today,

 

-B

  • Author

Update:

 

-World maps are loading in correctly

-Spawn territories are loading in correctly

-Layers are working and selectable, switching to correct image upon button press

-polygons are shown precisely and correctly

-All NPCs in selected spawn territory is loaded into NPCs list correctly

 

I'm currently evaluating my next steps. The properties per npc varies, so the original idea with just a small section for properties on the right, is not going to work. The user needs access to more variables. I'll have to come up with another design.

 

Also, the NPC makers all depend on specific AI. The default ones are nice and easy to work with, but some of them are very specific. Example: If the user starts adding NPCs to a spawn area with ai 'royal_req_next_maker', it might not show up ingame as intended. I need a way for the different AIs to be visible and understandable. I'm considering limiting spawn system to default AI maker; which is the most commonly used one anyway.

 

I can expand on the spawn system later, when I start tackling AI. Without all the special AI cases, L2H still allows modders to spawn whatever they want wherever. It just doesn't support events or boss phases etc.... yet.

 

Maybe down the line, I'll allow users to create zones themselves. It should be relatively simple, since I already have the whole coordinate system algorithm in place.

 

I'm going to reconsider the design for now, let me know if you have any ideas. I need it to contain more editable fields, and support buttons for eventual terrain drawing on the map.

 

-B

Edited by Bumble

On 1/25/2019 at 5:25 AM, Bumble said:

Progress update:

World blocks are loading in correctly, and selecting a block loads the correct radar map.

Selecting a spawn area draws a polygon on the radar map, showing the location or area of the spawn.

Some edge cases are not loaded correctly yet, I'm working on that.

There are some scaling issues with the polygons for now, but full screen mode seems to work. I'll have to revisit my calculations.

 

Here's an example of all the spawn areas in Execution Grounds:

GqiDDg6.jpg

 

It's getting there, but still very buggy.

When I'm happy with how the polygons behave, and when I'm sure all the correct areas are loaded in, I'll move on to loading in NPCs.

 

I'm off for today,

 

-B

Thanks, Bumble! So cool :) I have also a question, if am I understanding it correctly, that those spawn areas are the ones specified as;

 

territory_begin

npcmaker_begin

npc_begin

npcmaker_end

 

So, if we are looking at EG, as on the screenshot above, let's take mandragoras, for example:

 

territory_begin    [dion02_2122_19]    {{41756;149052;-3894;-3094};{41136;151006;-3894;-3094};{40160;151658;-3894;-3094};{38625;151563;-3894;-3094};{36644;150004;-3894;-3094};{36000;148753;-3894;-3094};{40615;148333;-3894;-3094}}    territory_end        
npcmaker_begin    [dion02_2122_19]    initial_spawn=all    maximum_npc=6        
npc_begin    [mandragora_sprout]    pos=anywhere    total=2    respawn=35sec    npc_end
npc_begin    [manadragora]    pos=anywhere    total=4    respawn=35sec    npc_end
npcmaker_end    

 

Meaning that the spawn consists of 6 npcs max with 35 sec respawn time, 4 of which are standards and 2 are sprouts; and then the spawn area is identified by coordinates as the corners between which the spawning happens?

 

And when you mention allowing users to create zones themselves, do you mean creating these spawn areas, as above?

Edited by Weedy

u have the territory which is a 3d space defined by multiple x/y/z(min&max) coordinates, at least 3 are needed.

 

and yeah I guess with this tool you will be able to add coordinates inside the brackets of the territory field

Edited by sepultribe

  • Author

@Weedy

That is correct. The NPC spawns in the boxed zone, defined by the coordinates you see in the npcpos file.

I haven't followed the development of L2j closely, but that was a huge difference for a long time; L2j would use static spawn points (npcs always spawning on same locations). It felt so weird, you could just circle the same 3-4 spawnpoints to maximize your grind, and the NPCs looked so static, as if the world wasn't "alive".

 

@sepultribe

Yes, that's correct. Although it wouldn't be creating from scratch. As with weapons/armors/npcs/droplists, it makes a lot more sense to clone existing ones. The main issue with server-side spawn areas, is that there are no indicators for layers. We can't know if a spawn area is on the 2nd or 3rd floor of cruma tower for instance. I guess, if you went through and compared the different depths for each layer, you could find the threshold points, but that's a massive amount of work for very little gain. If someone actually has the data for this, or wants to go through the trouble of looking through all the geodata files to write down the minZ/maxZ values, I can implement it. But it would take days to get right, I imagine.

 

Instead, I'm suggesting that you grab a spawn area that you know is on the correct layer. With this tool, you'll be able to clone it, then move it to where you want the spawnzone to be. That way, we know it'll be on the right layer, you're only adjusting the name of the spawn area, and the XY positions of the polygon.

 

I'm currently trying to figure out the exact difference between npc_begin and npc_ex_begin. @eressea, do you know why there are these two distinct npc makers? A lot of places, they seem to spawn the same types of NPCs, and I don't really understand why one is chosen instead of the other.

Edited by Bumble

1 hour ago, Bumble said:

I'm currently trying to figure out the exact difference between npc_begin and npc_ex_begin. @eressea, do you know why there are these two distinct npc makers? A lot of places, they seem to spawn the same types of NPCs, and I don't really understand why one is chosen instead of the other.

 

There are two classes in L2NPC - NpcMaker and NpcMakerEx (which is derived from NpcMaker) so NpcMakerEx is maker with some extended functionality

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.