LUA:Main Page
- Last edited 3 years ago by Vlash Nytefall
LUA
Return to: Main Page | Tutorials | Portal | Forum | Project Manager | Bug Tracker
We have chosen Lua as our script engine for EQ2Emulator. Lua is a lightweight, multi-paradigm programming language designed primarily for embedded use in applications, and it extends the functionality of our server without the need to recompile the code each time you wish to add some form of interaction with an NPC, an event happening in a zone, quest steps for players to work through, etc.
LUA Basics
EQ2Emulator LUA has custom functions specific to the emulator core. These functions normally have parameters - that is, some value required to be passed from the World to the Script or vice-versa. An example of this is the function hailed(NPC, Spawn). Note that there are 2 parameters for function hailed(). What the parameter names are is up to you, as long as there are the proper number of parameters in the () parens.
Example: Here, the Player says Hello to the NPC.
function hailed(NPC, Player)
Say(Player, "Hello NPC!")
end
Current standards we have adopted are to use NPC as the value for the NPCs parameters, and depending on the type of script, and Spawn or Player for the Players parameters Nearly all other parameter values are dynamic - that is, they can be any valid variable name you choose. When coding scripts for the Official EQ2Emulator Project, be sure to follow our guidelines or your scripts will get rejected.
|
System Employed
EQ2Emulator employs LUA scripting for the following systems:
Spawns
Spells Quests Items Zones Below are the function names and a brief description of what the function does. For details on required parameters and usage, click the function name. | |||
|
You will find a list of all functions within this page.
|
This set of functions will GET info from the World or Database for use within any LUA script.
| ||
|
This set of functions will SET info in the World or Database from within any LUA script.
|
This set of function are used to make game Items perform special tasks (clickies or quest items) .
| ||
|
These functions are for use within Quest scripts, and are some of the more complex LUA Functions in the EQ2Emulator.
|
These functions are used within Spell scripts to generate the expected effect of casting spells or using abilities.
| ||
|
These are functions that normally go into SpawnScripts for interacting with NPCs or other types of Spawns.
|
These are general functions that do not fall under any other classification.
| ||