Difference between revisions of "Template:LUA:Main Page"
(Created page with "__HIDETITLE__ {{PageHeaderParent|LUA}} <div style="width: 75%; margin: auto; background: #F5FAFF; border: 1px solid #AAA;"><div style="background: #F5FAFF; border: 1px solid...") |
(updated for all functions page. Missisng item, quest, spell, spawn, and general functions pages) |
||
| Line 27: | Line 27: | ||
|- | |- | ||
| style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | | style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | ||
| − | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">'''''<U>[[LUA: | + | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">'''''<U>[[LUA:AllFunctions|{{#ifexist: LUA:AllFunctions|<span style="color:#99ccff;">All Functions</span>|<span style="color:#00ffff;">All Functions</span>}}]]</U>'''''</div> |
<div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">You will find a list of all functions within this page. | <div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">You will find a list of all functions within this page. | ||
</div> | </div> | ||
| style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | | style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | ||
| − | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">Get Functions</div> | + | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">'''''<U>[[LUA:GetFunctions|{{#ifexist: LUA:GetFunctions|<span style="color:#99ccff;">Get Functions</span>|<span style="color:#00ffff;">Get Functions</span>}}]]</U>'''''</div> |
<div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">This set of functions will GET info from the World or Database for use within any LUA script. | <div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">This set of functions will GET info from the World or Database for use within any LUA script. | ||
</div> | </div> | ||
|- | |- | ||
| style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | | style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | ||
| − | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">Set Functions</div> | + | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">'''''<U>[[LUA:SetFunctions|{{#ifexist: LUA:SetFunctions|<span style="color:#99ccff;">Set Functions</span>|<span style="color:#00ffff;">Set Functions</span>}}]]</U>'''''</div> |
<div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">This set of functions will SET info in the World or Database from within any LUA script. | <div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">This set of functions will SET info in the World or Database from within any LUA script. | ||
</div> | </div> | ||
| style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | | style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | ||
| − | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">Item Functions</div> | + | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">'''''<U>[[LUA:ItemFunctions|{{#ifexist: LUA:ItemFunctions|<span style="color:#99ccff;">Item Functions</span>|<span style="color:#00ffff;">Item Functions</span>}}]]</U>'''''</div> |
<div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">This set of function are used to make game Items perform special tasks (clickies or quest items) . | <div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">This set of function are used to make game Items perform special tasks (clickies or quest items) . | ||
</div> | </div> | ||
|- | |- | ||
| style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | | style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | ||
| − | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">Quest Functions</div> | + | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">'''''<U>[[LUA:QuestFunctions|{{#ifexist: LUA:QuestFunctions|<span style="color:#99ccff;">Quest Functions</span>|<span style="color:#00ffff;">Quest Functions</span>}}]]</U>'''''</div> |
<div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">These functions are for use within Quest scripts, and are some of the more complex LUA Functions in the EQ2Emulator. | <div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">These functions are for use within Quest scripts, and are some of the more complex LUA Functions in the EQ2Emulator. | ||
</div> | </div> | ||
| style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | | style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | ||
| − | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">Spell Functions</div> | + | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">'''''<U>[[LUA:SpellFunctions|{{#ifexist: LUA:SpellFunctions|<span style="color:#99ccff;">Spell Functions</span>|<span style="color:#00ffff;">Spell Functions</span>}}]]</U>'''''</div> |
<div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">These functions are used within Spell scripts to generate the expected effect of casting spells or using abilities. | <div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">These functions are used within Spell scripts to generate the expected effect of casting spells or using abilities. | ||
|- | |- | ||
| style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | | style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | ||
| − | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">Spawn Functions</div> | + | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">'''''<U>[[LUA:SpawnFunctions|{{#ifexist: LUA:SpawnFunctions|<span style="color:#99ccff;">Spawn Functions</span>|<span style="color:#00ffff;">Spawn Functions</span>}}]]</U>'''''</div> |
<div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">These are functions that normally go into SpawnScripts for interacting with NPCs or other types of Spawns. | <div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">These are functions that normally go into SpawnScripts for interacting with NPCs or other types of Spawns. | ||
</div> | </div> | ||
| style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | | style="width: 50%; background: #FCFCFC; border: 1px solid #AAA; vertical-align: top;" | | ||
| − | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">General Functions</div> | + | <div style="background: #3e5389; border: 1px solid #7BC; padding: 5px; margin: 3px; font-weight: bold; text-align: center; font-size: 120%; color: #99ccff;">'''''<U>[[LUA:MiscFunctions|{{#ifexist: LUA:MiscFunctions|<span style="color:#99ccff;">General Functions</span>|<span style="color:#00ffff;">General Functions</span>}}]]</U>'''''</div> |
<div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">These are general functions that do not fall under any other classification. | <div style="text-align: left; font-size: 1em; margin: 0.3em 1em;">These are general functions that do not fall under any other classification. | ||
</div> | </div> | ||
|} | |} | ||
Revision as of 14:51, 27 February 2022
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.
| ||