Class StendhalQuestSystem

java.lang.Object
games.stendhal.server.core.rp.StendhalQuestSystem

public class StendhalQuestSystem extends Object
Loads and manages all quests.
  • Method Details

    • get

      public static StendhalQuestSystem get()
      gets the singleton instance of the StendhalQuestSystem
      Returns:
      StendhalQuestSystem
    • updatePlayerQuests

      public static void updatePlayerQuests(Player player)
      Parameters:
      player -
    • init

      public void init()
      Initializes the QuestSystem.
    • loadQuest

      public void loadQuest(IQuest quest)
      loads the quests and adds it to the world
      Parameters:
      quest - a Quest
    • cacheQuest

      public void cacheQuest(IQuest quest)
      Caches a quest for loading later.
      Parameters:
      quest - Quest to be cached.
    • loadCachedQuests

      public void loadCachedQuests()
      Loads all quests stored in the cache.
    • listQuests

      public String listQuests(Player player)
      lists all quest the player knows about, including open and completed quests.
      Parameters:
      player - Player to create the report for
      Returns:
      quest report
    • listQuest

      public String listQuest(Player player, String questName)
      creates a report on a specified quest for a specified player
      Parameters:
      player - Player
      questName - name of quest
      Returns:
      quest report
    • listQuestsStates

      public String listQuestsStates(Player player)
      dumps the internal quest states for the specified player. This is used for the InspectAction.
      Parameters:
      player - Player to create the report for
      Returns:
      report
    • getOpenQuests

      public List<String> getOpenQuests(Player player)
      gets a list of open quests
      Parameters:
      player - Player to return the list for
      Returns:
      list of open quests
    • getCompletedQuests

      public List<String> getCompletedQuests(Player player)
      Gets a list of completed quests.
      Parameters:
      player - Player to return the list for
      Returns:
      list of completed quests
    • getRepeatableQuests

      public List<String> getRepeatableQuests(Player player)
      Get the list of quests a player has completed, and can now do again.
      Parameters:
      player -
      Returns:
      list of quest names
    • getQuestDescription

      public String getQuestDescription(Player player, String questName)
      gets the description of a quest
      Parameters:
      player - player to get the details for
      questName - name of quest
      Returns:
      description
    • getQuestLevelWarning

      public String getQuestLevelWarning(Player player, String questName)
      If the quest is too dangerous, add a warning unless the player has already completed it.
      Parameters:
      player - Player to get the warning for
      questName - quest
      Returns:
      warning or empty string
    • getQuestProgressDetails

      public List<String> getQuestProgressDetails(Player player, String questName)
      gets details on the progress of the quest
      Parameters:
      player - player to get the details for
      questName - name of quest
      Returns:
      details
    • getQuest

      public IQuest getQuest(String questName)
      gets 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)
      gets the IQuest object for a quest.
      Parameters:
      questSlot - Slot name used for quest.
      Returns:
      IQuest or null if it does not exist.
    • unloadQuest

      public void unloadQuest(String questName)
      unloads a quest and removes the things related to it from the world.

      Note: The quest in question has to support this

      Parameters:
      questName - quest to unload
    • getIncompleteQuests

      public List<String> getIncompleteQuests(Player player, String region)
      gets a list of incomplete quests in a specified region
      Parameters:
      player - Player to return the list for
      region - Region to check in
      Returns:
      list of incomplete quests in the region
    • getNPCNamesForUnstartedQuestsInRegionForLevel

      public List<String> getNPCNamesForUnstartedQuestsInRegionForLevel(Player player, String region)
      gets a list of the unique npc names for unstarted quests in a specified region
      Parameters:
      player - Player to return the list for
      region - Region to check in
      Returns:
      list of the unique npc names for unstarted quests in a specified region
    • getQuestDescriptionForUnstartedQuestInRegionFromNPCName

      public List<String> getQuestDescriptionForUnstartedQuestInRegionFromNPCName(Player player, String region, String name)
      Gets quest descriptions for unstarted quests in a specified region matching a specific npc name.
      Parameters:
      player - Player to return the list for
      region - Region to check in
      name - npc name
      Returns:
      quest description (there may be more than one)
    • isLoaded

      public boolean isLoaded(IQuest quest)
      Checks if a quest instance has been added to the world.
      Parameters:
      quest - IQuest instance to be checked.
      Returns:
      true if the instance matches stored quests.