Package games.stendhal.server.core.rp
Class StendhalQuestSystem
java.lang.Object
games.stendhal.server.core.rp.StendhalQuestSystem
Loads and manages all quests.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cacheQuest(IQuest quest)
Caches a quest for loading later.static StendhalQuestSystem
get()
gets the singleton instance of the StendhalQuestSystemgetCompletedQuests(Player player)
Gets a list of completed quests.getIncompleteQuests(Player player, String region)
gets a list of incomplete quests in a specified regiongetNPCNamesForUnstartedQuestsInRegionForLevel(Player player, String region)
gets a list of the unique npc names for unstarted quests in a specified regiongetOpenQuests(Player player)
gets a list of open questsgets the IQuest object for a named quest.getQuestDescription(Player player, String questName)
gets the description of a questgetQuestDescriptionForUnstartedQuestInRegionFromNPCName(Player player, String region, String name)
Gets quest descriptions for unstarted quests in a specified region matching a specific npc name.getQuestFromSlot(String questSlot)
gets the IQuest object for a quest.getQuestLevelWarning(Player player, String questName)
If the quest is too dangerous, add a warning unless the player has already completed it.getQuestProgressDetails(Player player, String questName)
gets details on the progress of the questgetRepeatableQuests(Player player)
Get the list of quests a player has completed, and can now do again.void
init()
Initializes the QuestSystem.boolean
Checks if a quest instance has been added to the world.creates a report on a specified quest for a specified playerlistQuests(Player player)
lists all quest the player knows about, including open and completed quests.listQuestsStates(Player player)
dumps the internal quest states for the specified player.void
Loads all quests stored in the cache.void
loads the quests and adds it to the worldvoid
unloadQuest(String questName)
unloads a quest and removes the things related to it from the world.static void
updatePlayerQuests(Player player)
-
Method Details
-
get
gets the singleton instance of the StendhalQuestSystem- Returns:
- StendhalQuestSystem
-
updatePlayerQuests
- Parameters:
player
-
-
init
public void init()Initializes the QuestSystem. -
loadQuest
loads the quests and adds it to the world- Parameters:
quest
- a Quest
-
cacheQuest
Caches a quest for loading later.- Parameters:
quest
- Quest to be cached.
-
loadCachedQuests
public void loadCachedQuests()Loads all quests stored in the cache. -
listQuests
lists all quest the player knows about, including open and completed quests.- Parameters:
player
- Player to create the report for- Returns:
- quest report
-
listQuest
creates a report on a specified quest for a specified player- Parameters:
player
- PlayerquestName
- name of quest- Returns:
- quest report
-
listQuestsStates
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
gets a list of open quests- Parameters:
player
- Player to return the list for- Returns:
- list of open quests
-
getCompletedQuests
Gets a list of completed quests.- Parameters:
player
- Player to return the list for- Returns:
- list of completed quests
-
getRepeatableQuests
Get the list of quests a player has completed, and can now do again.- Parameters:
player
-- Returns:
- list of quest names
-
getQuestDescription
gets the description of a quest- Parameters:
player
- player to get the details forquestName
- name of quest- Returns:
- description
-
getQuestLevelWarning
If the quest is too dangerous, add a warning unless the player has already completed it.- Parameters:
player
- Player to get the warning forquestName
- quest- Returns:
- warning or empty string
-
getQuestProgressDetails
gets details on the progress of the quest- Parameters:
player
- player to get the details forquestName
- name of quest- Returns:
- details
-
getQuest
gets the IQuest object for a named quest.- Parameters:
questName
- name of quest- Returns:
- IQuest or
null
if it does not exist.
-
getQuestFromSlot
gets the IQuest object for a quest.- Parameters:
questSlot
- Slot name used for quest.- Returns:
- IQuest or
null
if it does not exist.
-
unloadQuest
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
gets a list of incomplete quests in a specified region- Parameters:
player
- Player to return the list forregion
- Region to check in- Returns:
- list of incomplete quests in the region
-
getNPCNamesForUnstartedQuestsInRegionForLevel
gets a list of the unique npc names for unstarted quests in a specified region- Parameters:
player
- Player to return the list forregion
- 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 forregion
- Region to check inname
- npc name- Returns:
- quest description (there may be more than one)
-
isLoaded
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.
-