Database:Spawns
- Last edited 14 years ago by I need to Update My Profile
About
Please fill more information in here as you find it
Table Breakdown
The following lists how fields function in the database
Generic Spawn Fields
Generic information like name, race, etc
- name = The name of the spawn
Entity Command Fields
This allows you to tag an npc as a banker, a merchant and so forth. Run the query SELECT * FROM entity_commands to see commands set up on your server.
- command_primary = The primary entity command of the NPC, see the entity_commands table for more information. EG: 9 may = bank
- command_secondary = The secondary entity command of the NPC, see the entity_commands table for more information. EG: 9 may = bank
Merchant Fields
This allows you to configure the NPC as a merchant, note you should tag the entity command ie: frommerchant (see your entity_command table) or bank etc.
- merchant_id = The merchant list id
- merchant_type = (1 - no buy), (2 - no buy back), (3 - spells), (4 - crafting)
Appearances
NPC Appearances (see npc_appearances table) allow you to customise how Spawns appear in game via various types.
For example to change the colour of an npc's skin first find the spawn ID:
<pre> SELECT id,name FROM spawn WHERE name LIKE '%Tester%' </pre>
(Or /spawn details)
Now insert a row into npc_appearances with the relevent spawn ID, type (for example skin_color) and RGB Color.
<pre> insert into npc_appearance (spawn_id,type,red,green,blue) values (58,'skin_color',255,218,185); </pre>
Menders
Menders are merchants that are able to repair your items
You require:
- Merchant Type of 16
- Entity Command 'repair'
<pre> SELECT * FROM entity_commands WHERE command LIKE '%repair%'; </pre>
Eg returns 8
Updating the Spawn:
<pre> UPDATE spawn SET merchant_type = 16, command_primary = 8,attackable = 0,show_command_icon = 1 WHERE name LIKE '%Merchant Harrok%'; </pre>
Pathing
NPC pathing can be achieved via SpawnScripts and LUA. See LUA:MovementLoopAddLocation for more information.
Related tables
spawn_ground
Allows you to create ground spawns for use with harvesting and similar skills
- spawn_id - the id of the spawn
- number_harvests - how many harvests
- num_attempts_per_harvest - how many times per harvest
- groundspawn_entity_id - id of the groundspawn
- collection_skill - skill used ('Unused','Mining','Gathering','Fishing','Trapping','Foresting')
Example
Note: this example requires you to have set the starting_skills for your players so they can use fishing and harvesting skills and such
Where the spawn_id object is ID: 85 and groundspawn_entry_id is: 1 where 5 is the entitycommand for fish <pre> update spawn set command_primary = 5 where id = 85; </pre> <pre> insert into spawn_ground (spawn_id, number_harvests, num_attempts_per_harvest,groundspawn_entry_id, collection_skill) values (85, 5, 1, 1, 'Fishing'); </pre> <pre> insert into groundspawn_items (groundspawn_entry_id,item_id,num_items) values (1,14,20); </pre>
now enable the command icon:
- /spawn set show_command_icon 1
disable level
- /spawn set show_level 0
disable attackable and hand icon
- /spawn set attackable 0
- /spawn set display_hand_icon 0
Now you need to create the spell
<pre> INSERT INTO `wiki_spells`(`id`,`type`,`cast_type`,`name`,`description`,`icon`,`icon2`,`icontype`,`class_skill`,`mastery_skill`,`duration_until_cancel`,`target_type`,`success_message`,`fade_message`,`interruptable`,`lua_script`,`spell_visual`,`effect_message`,`spell_book_type`,`can_effect_raid`,`affect_only_group_members`,`is_active`,`display_spell_tier`,`friendly_spell`,`group_spell`) values (3,2,0,'Fishing',,774,65535,65535,0,0,0,0,NULL,NULL,1,'harvest.lua',568,NULL,2,0,0,0,0,0,0); </pre>
Configuring the Tier
You must also set a value in the spell_tiers table for the command to function
<pre> insert into spell_tiers (spell_id,tier) values (3,1); </pre>
Setting the Visual State =
The spell_visual field above is the animation that will play when your character engages in the activity
To find a list of spell_visual ID's you can query the reference_spell_effects table
<pre> SELECT * FROM reference_spell_effects WHERE name LIKE '%fish%' </pre>
The Script
Harvest.lua: <pre> --[[ Script Name : harvest.lua Script Purpose : Fishing, Foresting, Gathering, Mining, Trapping Script Author : John Adams Script Date : 2008.12.05 Script Notes : --]]
function cast(Caster, Target) Harvest(Caster, Target) end </pre>
spawn_loot
Provides a list of loot tables that a spawn id should drop
- spawn_id = id of the spawn
- loottable_id = id of the loot table
loottable
A list of loot tables, which acts as a parent to lootdrops
- name = descriptive name of the loottable
- mincoin = minimum amount of coin
- maxcoin = maximum amount of coin
- maxlootitems = maximum amount of items that should drop
- lootdrop_probability = probability of the lootdrop occuring
- coin_probability = probability of the coin occuring
lootdrop
Loot drops are members of loot tables and list items that drop
- loot_table_id = id of the lootttable (see above)
- item_id = the id of one of the items to appear in the lootdrop list
- item_charges = number of charges on this item
- equip_item = should the npc equip this item
- probability = probability of this item dropping
Merchants
Merchant-lists list a selection of inventories that a merchant list will sell
- merchant_id = the merchant_id for your table
- inventory_id = the inventory the merchant list will show (see merchant_inventory)
- description = the description of the merchant list
merchant_inventory
Merchant inventories allow you to configure the items for sale in a merchant list
- inventory_id = the inventory_id to place the item in (see merchants/inventory_id)
- item_id = the id of the item to sell
- quantity = the amount of item to sell