Class LuaActionHelper

java.lang.Object
games.stendhal.server.core.scripting.lua.LuaActionHelper

public class LuaActionHelper extends Object
Exposes ChatAction classes to Lua.
  • Method Details

    • get

      public static LuaActionHelper get()
      Retrieves the static instance.
      Returns:
      Static ActionHelper instance.
    • create

      public ChatAction create(org.luaj.vm2.LuaFunction lf)
      Creates a custom ChatAction.
      Parameters:
      lf - Function to be invoked when ChatAction.fire() is called.
      Returns:
      New ChatAction instance.
    • create

      public ChatAction create(String className, org.luaj.vm2.LuaTable args)
      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 or null.
    • multiple

      public MultipleActions multiple(org.luaj.vm2.LuaTable actionList)
      Helper method for creating a MultipleActions instance.
      Parameters:
      actionList - LuaTable containing list of ChatAction instances.
      Returns:
      New MultipleActions instance.
    • clearQuest

      public SetQuestAction clearQuest(String questSlot)
      Removes quest slot from player. This is needed because it's impossible to pass nil values in a LuaTable.
      Parameters:
      questSlot - Quest string identifier.
      Returns:
      New SetQuestAction that sets quest state to null.