No categories assigned

Admins:Content

Revision as of 19:44, 27 September 2009 by Bolly (talk | contribs)

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 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 spawn

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.

Now with your ID run the following statement to create a spawn_script: INSERT INTO spawn_scripts () VALUES ();

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 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.

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