Class LuaActionHelper
java.lang.Object
games.stendhal.server.core.scripting.lua.LuaActionHelper
Exposes ChatAction classes to Lua.
-
Method Summary
Modifier and TypeMethodDescriptionclearQuest(String questSlot)
Removes quest slot from player.Creates an instance of a ChatAction from the class name string.create(org.luaj.vm2.LuaFunction lf)
Creates a custom ChatAction.static LuaActionHelper
get()
Retrieves the static instance.multiple(org.luaj.vm2.LuaTable actionList)
Helper method for creating a MultipleActions instance.
-
Method Details
-
get
Retrieves the static instance.- Returns:
- Static ActionHelper instance.
-
create
Creates a custom ChatAction.- Parameters:
lf
- Function to be invoked when ChatAction.fire() is called.- Returns:
- New ChatAction instance.
-
create
Creates an instance of a ChatAction from the class name string.- Parameters:
className
- Class basename.args
- Lua table of objects that should be passed to the constructor.- Returns:
- New
ChatAction
instance ornull
.
-
multiple
Helper method for creating a MultipleActions instance.- Parameters:
actionList
- LuaTable containing list of ChatAction instances.- Returns:
- New MultipleActions instance.
-
clearQuest
Removes quest slot from player. This is needed because it's impossible to passnil
values in a LuaTable.- Parameters:
questSlot
- Quest string identifier.- Returns:
- New SetQuestAction that sets quest state to
null
.
-