Class LuaWorldHelper
java.lang.Object
games.stendhal.server.core.scripting.ScriptingSandbox
games.stendhal.server.core.scripting.lua.LuaWorldHelper
-
Field Summary
Fields inherited from class games.stendhal.server.core.scripting.ScriptingSandbox
filename -
Method Summary
Modifier and TypeMethodDescriptioncreateEvent(String source, String event, String... params) Creates a new game event.createEvent(String source, String event, org.luaj.vm2.LuaTable params) Creates a new game event.static LuaWorldHelperget()Retrieves singleton instance.booleanvoidraiseEvent(String source, String event, String... params) Executes a new game event.voidraiseEvent(String source, String event, org.luaj.vm2.LuaTable params) Executes a new game event.voidrunAfter(int turns, org.luaj.vm2.LuaFunction func) Executes a function after a specified number of turns.voidSets the background music for the current zone.voidSets the background music for the current zone.Methods inherited from class games.stendhal.server.core.scripting.ScriptingSandbox
add, add, add, add, addGameEvent, execute, getCreature, getCreatures, getItem, getItems, getMessage, getZone, getZone, modify, playerIsInZone, postExecute, preExecute, privateText, remove, remove, setMessage, setZone, setZone, unload
-
Method Details
-
get
Retrieves singleton instance. -
load
- Specified by:
loadin classScriptingSandbox
-
setMusic
Sets the background music for the current zone.- Parameters:
filename- File basename excluding .ogg extension.args- Lua table of key=value integer values. Valid keys are `volume`, `x`, `y`, & `radius`.
-
setMusic
Sets the background music for the current zone.- Parameters:
filename- File basename excluding .ogg extension.
-
runAfter
public void runAfter(int turns, org.luaj.vm2.LuaFunction func) Executes a function after a specified number of turns.- Parameters:
turns- Number of turns to wait.func- The function to be executed.
-
createEvent
Creates a new game event.- Parameters:
source- Source of the event, usually a character.event- Name of event.params- List of event parameters.- Returns:
- New `games.stendhal.server.core.engine.GameEvent` instance.
-
createEvent
Creates a new game event.- Parameters:
source- Source of the event, usually a character.event- Name of event.params- List of event parameters.- Returns:
- New `games.stendhal.server.core.engine.GameEvent` instance.
-
raiseEvent
Executes a new game event.- Parameters:
source- Source of the event, usually a character.event- Name of event.params- List of event parameters.
-
raiseEvent
Executes a new game event.- Parameters:
source- Source of the event, usually a character.event- Name of event.params- List of event parameters.
-