Class AbstractQuest
java.lang.Object
games.stendhal.server.maps.quests.AbstractQuest
- All Implemented Interfaces:
IQuest
- Direct Known Subclasses:
AdMemoriaInPortfolio,AdosDeathmatch,AdventureIsland,AGrandfathersWish,AntivenomRing,BalloonForBobby,Blackjack,BowsForOuchit,BuiltQuest,CaptureFlagQuest,ChocolateForElisabeth,CloakCollector,CloakCollector2,CloaksForBario,ClubOfThorns,CodedMessageFromFinnFarmer,CollectEnemyData,CrownForTheWannaBeKing,DailyItemQuest,DailyMonsterQuest,DiceGambling,DragonLair,EasterGiftsForChildren,ElfPrincess,ElvishArmor,EmotionCrystals,FindGhosts,FindJefsMom,FindRatChildren,FishermansLicenseCollector,FishermansLicenseQuiz,FishSoup,FishSoupForHughie,FruitsForCoralia,GoodiesForRudolph,GuessKills,HelpMrsYeti,HelpTomi,HelpWithTheHarvest,HerbsForCarmen,HerbsForJynath,HouseBuying,HungryJoshua,IcecreamForAnnie,ImperialPrincess,JailedBarbarian,JailedDwarf,KanmararnSoldiers,KillBlordroughs,KillDarkElves,KillDhohrNuggetcutter,KillEnemyArmy,KillMonks,KillSpiders,KoboldishTorcibud,LearnAboutKarma,LearnAboutOrbs,LookUpQuote,LuaQuestHelper.LuaQuest,Marriage,Maze,McPeglegIOU,MealForGroongo,MedicineForTad,MeetBunny,MeetHackim,MeetHayunn,MeetIo,MeetKetteh,MeetMarieHenri,MeetMonogenes,MeetSanta,MeetZynn,MineTownRevivalWeeks,MineTownRevivalWeeksConstruction,MithrilCloak,MixtureForOrtiv,MuseumEntranceFee,NewsFromHackim,ObsidianKnife,PaperChase,RainbowBeans,RestockFlowerShop,ReverseArrow,RingMaker,SadScientist,ScubaLicenseQuiz,SevenCherubs,SheepGrowing,Snowballs,SolveRiddles,Soup,StuffForBaldemar,StuffForVulcanus,SuntanCreamForZara,SuppliesForPhalk,TakeGoldforGrafindle,TheMissingBooks,ThePiedPiper,ToysCollector,TutorialIsland,UltimateCollector,VampireSword,WaterForXhiphin,WeaponsCollector,WeaponsCollector2,WeeklyItemQuest,WizardBank,ZekielsPracticalTestQuest,ZooFood
Abstract class for quests. This is a default implementation of IQuest.
- Author:
- hendrik
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidadds the quest to the game world (e.g.voidfillQuestInfo(String name, String description, boolean repeatable) fill fields of questInfo object with info about this questvoidfillQuestInfo(String name, String description, boolean repeatable, int completionsIndex) fill fields of questInfo object with info about this questvoidfillQuestInfo(String name, String description, boolean repeatable, Integer completionsOpenIndex, Integer completionsCompleteIndex) fill fields of questInfo object with info about this questvoidfillQuestInfo(String name, String description, boolean repeatable, Pair<Integer, Integer> completionsIndex) fill fields of questInfo object with info about this questintgetCompletedCount(Player player) Retrieves number of times player has completed quest.getFormattedHistory(Player player) Gets a list of possible hint-names.intReturns the minimum level of player expected to start the quest.abstract StringgetName()Returns the name of the quest.Returns the starter NPC for the quest, or null if there is nonegetQuestInfo(Player player) function will return information about this questReturns the region where the quest adventure takes place (or begins), or null for global questsabstract StringThe slot-name in !quests.booleanisCompleted(Player player) Was the quest completed? Note: A quest can be completed without its status being "Done" (e.booleanisRepeatable(Player player) May the quest be repeated?booleanWas the quest started?booleanDenotes whether quest details should be included in travel log.booleanisVisibleOnQuestStatus(Player player) Denotes whether quest details should be included in travel log.booleanremoves a quest from the world.voidupdatePlayer(Player player) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface games.stendhal.server.maps.quests.IQuest
getHistory
-
Field Details
-
questInfo
-
npcs
NPCList.
-
-
Constructor Details
-
AbstractQuest
public AbstractQuest()
-
-
Method Details
-
getQuestInfo
Description copied from interface:IQuestfunction will return information about this quest- Specified by:
getQuestInfoin interfaceIQuest- Parameters:
player- - player for whom required quest info- Returns:
- - QuestInfo object with info about this quest
-
updatePlayer
- Specified by:
updatePlayerin interfaceIQuest- Parameters:
player- Player
-
fillQuestInfo
public void fillQuestInfo(String name, String description, boolean repeatable, Integer completionsOpenIndex, Integer completionsCompleteIndex) fill fields of questInfo object with info about this quest- Parameters:
name- - name of the questdescription- - short description of this quest in a neutral tense (not first person)repeatable- - is quest repeatable or notcompletionsOpenIndex- Slot index where completions count is stored while quest is in open state.completionsCompleteIndex- Slot index where completions count is stored while quest is in complete state.
-
fillQuestInfo
public void fillQuestInfo(String name, String description, boolean repeatable, int completionsIndex) fill fields of questInfo object with info about this quest- Parameters:
name- - name of the questdescription- - short description of this quest in a neutral tense (not first person)repeatable- - is quest repeatable or notcompletionsIndex- Slot index where completions count is stored while quest in open or complete state.
-
fillQuestInfo
public void fillQuestInfo(String name, String description, boolean repeatable, Pair<Integer, Integer> completionsIndex) fill fields of questInfo object with info about this quest- Parameters:
name- - name of the questdescription- - short description of this quest in a neutral tense (not first person)repeatable- - is quest repeatable or notcompletionsIndexes- Pair of indexes where first value represents slot index for open state and second represents index for complete state.
-
fillQuestInfo
fill fields of questInfo object with info about this quest- Parameters:
name- - name of the questdescription- - short description of this quest in a neutral tense (not first person)repeatable- - is quest repeatable or not
-
getSlotName
The slot-name in !quests.- Specified by:
getSlotNamein interfaceIQuest- Returns:
- the slot's name
-
addToWorld
public abstract void addToWorld()Description copied from interface:IQuestadds the quest to the game world (e.g. by placing SpeakerNPCs there)- Specified by:
addToWorldin interfaceIQuest
-
removeFromWorld
public boolean removeFromWorld()removes a quest from the world.- Specified by:
removeFromWorldin interfaceIQuest- Returns:
- true, if the quest could be removed; false otherwise.
-
getHint
Description copied from interface:IQuestGets a list of possible hint-names.The hint system will ensure that the same hint is not displayed twice. This class creates a list of useful hints (without hints about already completed parts).
-
getMinLevel
public int getMinLevel()Description copied from interface:IQuestReturns the minimum level of player expected to start the quest. Used for choosing which hints to give. To set a hard minimum level requirement for doing the quest, use level related ChatConditions in the quest methods- Specified by:
getMinLevelin interfaceIQuest- Returns:
- level
-
getFormattedHistory
- Specified by:
getFormattedHistoryin interfaceIQuest
-
isCompleted
Description copied from interface:IQuestWas the quest completed? Note: A quest can be completed without its status being "Done" (e. g. rejected, failed).- Specified by:
isCompletedin interfaceIQuest- Parameters:
player- Player- Returns:
- true, if it was completed, false otherwise
-
getCompletedCount
Description copied from interface:IQuestRetrieves number of times player has completed quest.- Specified by:
getCompletedCountin interfaceIQuest- Parameters:
player- Player for whom quest is being checked.- Returns:
- Number of completions.
-
isRepeatable
Description copied from interface:IQuestMay the quest be repeated?- Specified by:
isRepeatablein interfaceIQuest- Parameters:
player- Player- Returns:
- true, if it can be repeated, false otherwise
-
isStarted
Description copied from interface:IQuestWas the quest started? -
getName
Description copied from interface:IQuestReturns the name of the quest. -
isVisibleOnQuestStatus
public boolean isVisibleOnQuestStatus()Denotes whether quest details should be included in travel log. Override to create custom checks.- Specified by:
isVisibleOnQuestStatusin interfaceIQuest- Returns:
- `true` if details should be included.
-
isVisibleOnQuestStatus
Denotes whether quest details should be included in travel log. Override to create custom checks.- Specified by:
isVisibleOnQuestStatusin interfaceIQuest- Parameters:
player- Player for whom details are requested.- Returns:
- `true` if details should be included.
-
getRegion
Returns the region where the quest adventure takes place (or begins), or null for global quests -
getNPCName
Returns the starter NPC for the quest, or null if there is none- Specified by:
getNPCNamein interfaceIQuest- Returns:
- NPC name, or null for quests with no starter NPC
-