Difference between revisions of "Admins:Content"
m (added sample item) |
|||
| Line 13: | Line 13: | ||
=== Create === | === Create === | ||
| − | To create the simple and easy to use [[Commands:spawn_create | /spawn create]] command. | + | To create the spawn use the simple and easy to use [[Commands:spawn_create | /spawn create]] command. |
=== Add (Save) === | === Add (Save) === | ||
Revision as of 20:14, 27 September 2009
Contents
About
WIP - This guide should help you get started but needs expanding on
Setting a Single Start Zone
Should you decide to you can override where players start. See Database:Starting.
Creating Spawns
Spawns can be set up easily in game which makes testing and setting positional parameters alot easier. First you need to Create the Spawn then Add it (save).
Create
To create the spawn use the simple and easy to use /spawn create command.
Add (Save)
To save the spawn so it loads everytime use the /spawn add command.
Once the spawn is added, be sure to reload all spawn points with /reload spawns
Assign a LUA Script
To do anything like pathing or dialogue you will need a lua script attached to your NPC. Once you done your /spawn create and [Commands:spawn_add | /spawn add]] you can set the NPC's lua script in the database.
To do this, fire up your favourite SQL editor and run the query SELECT id,name FROM spawns; Find the NPC that matches the one you wish to assign a spawn_script to and make a note of it's ID for example 44.
Now with your ID and file run the following statement to create a spawn_script (changing the ID and lua_script path where appropriate): INSERT INTO spawn_scripts (spawn_id,lua_script) VALUES (44,'SpawnScripts/myscript.lua');
Assuming you've done everything right the LUA_SCRIPT location will now be defined on the NPC.
Create the LUA file exactly as you defined it above (SpawnScripts/myscript.lua) and fill it with a sample script. For example:
function spawn(NPC) -- this is a comment end function hailed(NPC, Spawn) FaceTarget(NPC, Spawn) conversation = CreateConversation() StartConversation(conversation, NPC, Spawn, "Hey there " .. GetName(Spawn) .. ", how are ya doin' today?") end
Now /reload_spawnscripts to reload all spawn scripts.
Finally /reload_spawns to reload your NPCs (who will pick up on these new spawnscripts).
Your NPC should now respond to hails
- Note you can also run /luadebug start to help with debugging scripts.
Pathing
Pathing can be achieved using LUA scripts with the LUA function: LUA:MovementLoopAddLocation.
For example:
function spawn(NPC) --Syntax is NPC, x, y, z, speed, delay (in seconds) MovementLoopAddLocation(NPC, -233.71, -1.32,-78.60,1,0) MovementLoopAddLocation(NPC, -199.22, -1.30,-65.10,1,0) end
Loot
Loot can currently be set via the database tables loottable and lootdrop
See Database:Spawns for more information
Dialogue
See the LUA Function reference for dialogue and chat functions. In particular /say and StartConversation
Quests
See the LUA Function reference. Also check out the sample quests with the EQ2Emulator server pack.
Creating Items
Items can be configured via the Items table and it's children. See Database:Items for more information.
Sample Item (backpack)
- Load up your favourite sql editor and connect to your world database
- Create the item with a SQL statement
insert into items (name, item_type,icon,weight,description,sell_price,lua_script) values ('Basic Backpack','Bag', 10,5,'A 4 slot bag with 5 perc reduction',10,'');
- then find the ID for the one you just inserted
select id,name from items where name like '%Basic Backpack%';
- We'll say it was ID 1 for this example, then insert it's bag details into the item_defails_bag table
insert into item_details_bag (item_id,num_slots,weight_reduction) values (1,4,5);
- Now reload your items in game /reload items
- Search for it with /item
There's lots of other tables for different types of items, look at item_details_weapon etc
Setting up Merchants
Merchants can currently be set via the database tables merchants and merchants_inventory
You will also be required to set an entity object command to the NPC
See Database:Spawns for more information
Setting up Bankers
Bankers can be set via entity object commands on the spawn
See Database:Spawns for more information