Class LuaQuestHelper

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

public class LuaQuestHelper extends Object
Exposes quest creation & handling to Lua.
  • Field Details

  • Method Details

    • get

      public static LuaQuestHelper get()
      Retrieves the static instance.
      Returns:
      Static QuestHelper instance.
    • create

      public games.stendhal.server.core.scripting.lua.LuaQuestHelper.LuaQuest create()
      Creates a new quest instance.
      Returns:
      New LuaQuest instance.
    • create

      public games.stendhal.server.core.scripting.lua.LuaQuestHelper.LuaQuest create(String slotName)
      Creates a new quest instance.
      Parameters:
      slotName - The slot identifier.
      Returns:
      New LuaQuest instance.
    • create

      public games.stendhal.server.core.scripting.lua.LuaQuestHelper.LuaQuest create(String slotName, String name)
      Creates a new quest instance.
      Parameters:
      name - The quest name.
      slotName - The slot identifier.
      minLevel - Recommended minimum level.
      Returns:
      New LuaQuest instance.
    • create

      public games.stendhal.server.core.scripting.lua.LuaQuestHelper.LuaQuest create(String slotName, String name, String desc)
      Creates a new quest instance.
      Parameters:
      slotName - The slot identifier.
      name - Reader friendly name.
      desc - Quest description.
      Returns:
      New LuaQuest instance.
    • load

      public void load(IQuest quest)
      Adds a quest to the world.
      Parameters:
      quest - Quest to be loaded.
    • unload

      public void unload(String questName)
      Removes a qeust from the world.
      Parameters:
      questName - String name of the quest.
    • cache

      @Deprecated public void cache(IQuest quest)
      Deprecated.
      Use LuaQuest.register.
      Caches a quest for loading at startup.
      Parameters:
      quest - Quest to be cached.
    • register

      @Deprecated public void register(IQuest quest)
      Deprecated.
      Use LuaQuest.register.
      Caches a quest for loading at startup.
      Parameters:
      quest - Quest to be cached.
    • isLoaded

      public boolean isLoaded(IQuest quest)
      Checks if a quest has been loaded.
      Parameters:
      quest - Quest instance to be checked.
      Returns:
      true if the instances matches stored quests.
    • listAll

      public String listAll(Player player)
      List all quests the player knows about.
      Parameters:
      player - Player to create the report for.
      Returns:
      Report.
    • list

      public String list(Player player, String questName)
      Creates a report on a specified quest for a specified player.
      Parameters:
      player - Player to create the report for.
      questName - Name of quest to be reported.
      Returns:
      Report.
    • listStates

      public String listStates(Player player)
      Dumps the internal quest states for the specified player. This is used for the InspectAction.
      Parameters:
      player - Player to create report for.
      Returns:
      Report.
    • getQuest

      public IQuest getQuest(String questName)
      Retrieves the IQuest object for a named quest.
      Parameters:
      questName - Name of quest.
      Returns:
      IQuest or null if it does not exist.
    • getQuestFromSlot

      public IQuest getQuestFromSlot(String questSlot)
      Parameters:
      questSlot -
      Returns:
    • getOpen

      public List<String> getOpen(Player player)
      Parameters:
      player -
      Returns:
    • getCompleted

      public List<String> getCompleted(Player player)
      Parameters:
      player -
      Returns:
    • getIncomplete

      public List<String> getIncomplete(Player player, String region)
      Parameters:
      player -
      region -
      Returns:
    • getRepeatable

      public List<String> getRepeatable(Player player)
      Parameters:
      player -
      Returns:
    • getDescription

      public String getDescription(Player player, String questName)
      Parameters:
      player -
      questName -
      Returns:
    • getLevelWarning

      public String getLevelWarning(Player player, String questName)
      Parameters:
      player -
      questName -
      Returns:
    • getProgressDetails

      public List<String> getProgressDetails(Player player, String questName)
      Parameters:
      player -
      questName -
      Returns:
    • getNPCNamesForUnstartedInRegionForLevel

      public List<String> getNPCNamesForUnstartedInRegionForLevel(Player player, String region)
      Parameters:
      player -
      region -
      Returns:
    • getDescriptionForUnstartedInRegionFromNPCName

      public List<String> getDescriptionForUnstartedInRegionFromNPCName(Player player, String region, String name)
      Parameters:
      player -
      region -
      name -
      Returns: