spawn_location_entry

Development forum for the EQ2Emulator Database project.

Moderator: Team Members

Post Reply
User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

spawn_location_entry

Post by Gangrenous » Thu Jun 09, 2016 7:00 pm

I know you can have many spawn id's in spawn_location_entry but would there ever be a need to have two of the same spawn_location_id's in that table or can it be unique? I have yet to think of a reason two have the same spawn_location_id for multiple rows.
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: spawn_location_entry

Post by Jabantiz » Thu Jun 09, 2016 7:55 pm

I honestly have no clue what this table is for, was there and working when I finally started working on code so never bothered to look into it and as far as I can tell from the content on the emu server the location_id is never duplicated. Some one with more knowledge on the DB would need to answer this.

That being said I know you can assign a script based off of entry id and that will take priority over the others so maybe that is its point all along. For scripts it will be entry > location > spawn.

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: spawn_location_entry

Post by Gangrenous » Thu Jun 09, 2016 8:00 pm

I am really not understanding why the tables for spawn are designed the way they are. It is probably too much of a task to go back and redo the design at this point.
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: spawn_location_entry

Post by Jabantiz » Thu Jun 09, 2016 8:05 pm

There is a reason and it was well though out back in the early days. That being said I am horrible with sql for some reason and tend to avoid messing with the table structs as much as possible. All I know is that in the end they work and have been reliable. I will dig around in the private forums to see if there is info but I can't guarantee how accurate it will be as there has been no recent work on it (within the last 6 years)

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: spawn_location_entry

Post by Gangrenous » Thu Jun 09, 2016 9:02 pm

Indeed the spawn_location_id's are not unique, this is how you can have multiple NPC's spawn in one spot. They basically share one spawn point. I am just trying to redo the editor and make some sense of the spawn table design. Once you get into spawn groups, well that is too much for me. I really doubt on my server I ever use spawn groups. I can get most of my work down with spawn_location_entry and spawn_location_placement.

I am going to try to get the spawn groups on the form also, not sure how to display it all.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: spawn_location_entry

Post by Gangrenous » Mon Apr 08, 2019 11:51 am

Well now that I have the editor in a workable state I started working with the spawn locations more. It is not a many to one like I was hoping, which does not make any sense to me in the design. I am looking at this more from my needs, but I could see this as an issue even for the official database design. This is how I would think it should work, bare with me, only showing the data you would need to understand it. So lets say I wanted to place 4 skeletons I make in Antonica.

Code: Select all

spawn_location_name [ id: 10, name: Antonica_Skeletons]

spawn_location_entry [id: 1, spawn_id: 120000 spawn_location_id: 10, spawnpercentage: 100]

spawn_location_placement [id: 0, zone_id: 12, spawn_location_id: 10, x: 1000 y:1000 z: 1000]
spawn_location_placement [id: 0, zone_id: 12, spawn_location_id: 10, x: 987 y:987 z: 987]
spawn_location_placement [id: 0, zone_id: 12, spawn_location_id: 10, x: 50 y:50 z: 50]
spawn_location_placement [id: 0, zone_id: 12, spawn_location_id: 10, x: 550 y:560 z: 580]
But that is not how it works, this is how it works.

Code: Select all

spawn_location_name [ id: 10, name: Antonica_Skeletons_1]
spawn_location_name [ id: 11, name: Antonica_Skeletons_2]
spawn_location_name [ id: 12, name: Antonica_Skeletons_3]
spawn_location_name [ id: 13, name: Antonica_Skeletons_4]

spawn_location_entry [id: 1, spawn_id: 120000 spawn_location_id: 10, spawnpercentage: 100]
spawn_location_entry [id: 1, spawn_id: 120000 spawn_location_id: 11, spawnpercentage: 100]
spawn_location_entry [id: 1, spawn_id: 120000 spawn_location_id: 12, spawnpercentage: 100]
spawn_location_entry [id: 1, spawn_id: 120000 spawn_location_id: 13, spawnpercentage: 100]

spawn_location_placement [id: 0, zone_id: 12, spawn_location_id: 10, x: 1000 y:1000 z: 1000]
spawn_location_placement [id: 0, zone_id: 12, spawn_location_id: 11, x: 987 y:987 z: 987]
spawn_location_placement [id: 0, zone_id: 12, spawn_location_id: 12, x: 50 y:50 z: 50]
spawn_location_placement [id: 0, zone_id: 12, spawn_location_id: 13, x: 550 y:560 z: 580]
Maybe I am wrong here? But trying it the first way, only one will spawn, not all 4. I would have to think a cleaner way of doing it would had been a location and then a placement with a one-to-many relationship. That way you would not need so many locations for each placement. You could just keep adding placements for every single point you wanted to spawn. Where this reduces a ridiculous amount of space is when you have lets say 100 spawn points for a single mob in Antonica, which is not unbelievable since the zone is so large.
Resident Dirty Hippy

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests