Page 1 of 1

Spawn Tables made easy

Posted: Fri Nov 02, 2007 1:17 pm
by John Adams
THIS INFO IS OBSOLETE! Do not use.
This is not meant to inspire anyone to build spawn tables for the current versions, but instead to give those anxious admins out there something to do with their time while we find us some data. Say you want to spawn ol Naggy in Antonica, and keep him there even after you shut down and restart your world. As I posted elsewhere, the spawn routines are in place and working (respawns, maybe not, since you can't kill anything yet).
Here's how you set up an NPC (generic)... Note all these values are arbitrary, and not accurate at all. This is just a sample :)
npcs:
First, let's make an NPC, in this case, my buddy Lord Nagafen...

Code: Select all

INSERT INTO `npcs` (`id`, `name`, `min_level`, `max_level`, `enc_level`, `race`, `race_type`, `class_`, `gender`, `min_group_size`, `max_group_size`, `show_name`, `attackable`, `show_level`, `targetable`, `show_command_icon`, `display_hand_icon`, `command_list_type`, `command_list_subtype`, `faction_id`, `hair_type_id`, `facial_hair_type_id`, `wing_type_id`, `chest_type_id`, `legs_type_id`, `soga_hair_type_id`, `soga_facial_hair_type_id`) VALUES (1000, 'Lord Nagafen ', 1, 50, 0, 275, 275, 33, 1, 0, 0, 1, 1, 1, 1, 1, 0, 'NPC', '', 0, 0, 0, 0, 0, 0, 0, 0);
That will insert the NPC record for Naggy into your npcs table. Note his NPC ID is '1000' (in this example).
Creating the spawn point --
spawngroup:
In the DB, find the table: `spawngroup` and enter a new spawngroup for your mob:

Code: Select all

INSERT INTO `spawngroup` (`id`, `name`) VALUES (1, 'Lord_Nagafen');
This name can be anything, since it does not appear in the client - only for you to identify. Field `id` is used in the other 2 spawn tables, so if you are creating your own, this is the ID to remember as well.
spawnentry:
Open the table: `spawnentry`. and enter new spawnentry details:

Code: Select all

INSERT INTO `spawnentry` (`id`, `npcid`, `objectid`, `spawngroupid`, `spawnpercentage`) VALUES (1, 196, 0, 1, 100);
Important Values --
npcid = npcs table `id` value (1000 in this case)
spawngroupid = spawngroup table `id` value (1 in this case)
spawnpercentage = 100%, without the '%' sign :)
spawns:
Open the table: `spawns`. and enter new spawn 'point' for your npc (you can get the x,y,z by typing /loc in game where you want your guy to pop) --

Code: Select all

INSERT INTO `spawns` (`id`, `zone_id`, `spawngroup_id`, `x`, `y`, `z`, `x_offset`, `y_offset`, `z_offset`, `heading`, `respawn`, `location_id`) VALUES (1, 12, 1, -100, -15, 0, 0, 0, 0, 270, 3600, 0);
Important Values --
zone_id = from table: `zones` where you want the mob to spawn (12 = Antonica)
spawngroup_id = again, the `id` value from spawngroup table
x, y, z, heading = your /loc from in game
respawn = prolly does nothing yet
location_id = leave ZERO, since it seems to crash my client if > 0.
Restart your world, log in, and if you used my coords above, you should have a retarded red dragon standing in a corn field, amazed at the puffs of smoke coming from his own nostrils.
Everyone, please add, change, debunk, or flame away. I know this is not important information, but for those interested in persisting spawns until the team gets the DB rolling, have fun.
Oh, and export/backup your work often, since I am not sure if feeds from the world startup will nuke your tables ;)

Posted: Fri Nov 02, 2007 4:00 pm
by Lawles
Ya i been having fun with this for a few days i got a few spawns in my antonica that always pop when server starts.. as i see of so far respawn doesnt work cause i have entered alot of diffrent numbers in there and got no result.. I am good at figuring out DB's lol.. not very skilled in programming yet.. working on my degree.. :) But good info for new server creators.. :)
~Lawles

Posted: Fri Nov 02, 2007 9:05 pm
by John Adams
Cool. How are you getting NPCs to "die" or vanish so they have the opportunity to respawn? I haven't figured that out yet.

Posted: Wed Nov 07, 2007 8:22 pm
by Zcoretri
Am I wrong in that a tinyint unsigned data type can't accept a value greater than 255?
Just wondering because MySQL is balking at the 275 value for race.

Posted: Thu Nov 08, 2007 5:22 am
by LethalEncounter
Race has a max value of 255, race type is the field that you need to change that affects the spawns appearance

Posted: Thu Nov 08, 2007 7:26 am
by ZexisStryfe
what exactly does race define anyway? Is it so things like the Master spells work?

Posted: Thu Nov 08, 2007 3:19 pm
by LethalEncounter
Race is mainly (always?) used for playable races. Most NPCs on live have either a 0 or 255 in that field. The highest I have seen the field (besides 255) is 19.

Posted: Tue Jan 29, 2008 11:32 am
by CrabClaw
A sticky of this, before it gets lost? We can keep it up to date for any changes as well. Maybe even incorporate the working /spawn commands list like a mini FAQ.

Posted: Wed Jun 04, 2008 2:00 pm
by John Adams
Link, can you un-sticky this (but maybe keep it for reference) because the spawn tables are nothing like this anymore?
Thanks!
Edit: Oh, nm.. I can unsticky myself! ;)