Class AbstractQuest

java.lang.Object
games.stendhal.server.maps.quests.AbstractQuest
All Implemented Interfaces:
IQuest
Direct Known Subclasses:
AdMemoriaInPortfolio, AdosDeathmatch, AmazonPrincess, AntivenomRing, ArmorForDagobert, BalloonForBobby, BeerForHayunn, Blackjack, BowsForOuchit, Campfire, CaptureFlagQuest, ChocolateForElisabeth, CleanAthorsUnderground, CleanStorageSpace, CloakCollector, CloakCollector2, CloaksForBario, ClubOfThorns, CoalForHaunchy, CodedMessageFromFinnFarmer, CollectEnemyData, CrownForTheWannaBeKing, DailyItemQuest, DailyMonsterQuest, DiceGambling, DragonLair, EasterGiftsForChildren, EggsForMarianne, ElfPrincess, ElvishArmor, EmotionCrystals, FindGhosts, FindJefsMom, FindRatChildren, FishermansLicenseCollector, FishermansLicenseQuiz, FishSoup, FishSoupForHughie, FruitsForCoralia, GoodiesForRudolph, GuessKills, HatForMonogenes, HelpMrsYeti, HelpTomi, HelpWithTheHarvest, HerbsForCarmen, HerbsForJynath, HouseBuying, HungryJoshua, IcecreamForAnnie, ImperialPrincess, JailedBarbarian, JailedDwarf, KanmararnSoldiers, KillBlordroughs, KillDarkElves, KillDhohrNuggetcutter, KillEnemyArmy, KillGnomes, KillMonks, KillSpiders, KoboldishTorcibud, LearnAboutKarma, LearnAboutOrbs, LookBookforCeryl, LookUpQuote, Marriage, Maze, McPeglegIOU, MealForGroongo, MedicineForTad, MeetBunny, MeetHackim, MeetHayunn, MeetIo, MeetKetteh, MeetMarieHenri, MeetMonogenes, MeetSanta, MeetZynn, MineTownRevivalWeeks, MineTownRevivalWeeksConstruction, MithrilCloak, MixtureForOrtiv, MuseumEntranceFee, NewsFromHackim, ObsidianKnife, PaperChase, PizzaDelivery, PlinksToy, RainbowBeans, RestockFlowerShop, ReverseArrow, RingMaker, SadScientist, ScubaLicenseQuiz, SevenCherubs, SheepGrowing, SimpleQuestCreator.SimpleQuest, Snowballs, SolveRiddles, Soup, StuffForBaldemar, StuffForVulcanus, SuntanCreamForZara, SuppliesForPhalk, TakeGoldforGrafindle, TheMissingBooks, ThePiedPiper, ToysCollector, TrapsForKlaas, TutorialIsland, UltimateCollector, VampireSword, WaterForXhiphin, WeaponsCollector, WeaponsCollector2, WeeklyItemQuest, WizardBank, ZekielsPracticalTestQuest, ZooFood

public abstract class AbstractQuest extends Object implements IQuest
Abstract class for quests. This is a default implementation of IQuest.
Author:
hendrik
  • Field Details

    • questInfo

      protected QuestInfo questInfo
    • npcs

      protected NPCList npcs
      NPCList.
  • Constructor Details

    • AbstractQuest

      public AbstractQuest()
  • Method Details

    • getQuestInfo

      public QuestInfo getQuestInfo(Player player)
      Description copied from interface: IQuest
      function will return information about this quest
      Specified by:
      getQuestInfo in interface IQuest
      Parameters:
      player - - player for whom required quest info
      Returns:
      - QuestInfo object with info about this quest
    • updatePlayer

      public void updatePlayer(Player player)
      Specified by:
      updatePlayer in interface IQuest
      Parameters:
      player - Player
    • fillQuestInfo

      public void fillQuestInfo(String name, String description, boolean repeatable)
      fill fields of questInfo object with info about this quest
      Parameters:
      name - - name of the quest
      description - - short description of this quest in a neutral tense (not first person)
      repeatable - - is quest repeatable or not
    • getSlotName

      public abstract String getSlotName()
      The slot-name in !quests.
      Specified by:
      getSlotName in interface IQuest
      Returns:
      the slot's name
    • addToWorld

      public abstract void addToWorld()
      Description copied from interface: IQuest
      adds the quest to the game world (e.g. by placing SpeakerNPCs there)
      Specified by:
      addToWorld in interface IQuest
    • removeFromWorld

      public boolean removeFromWorld()
      removes a quest from the world.
      Specified by:
      removeFromWorld in interface IQuest
      Returns:
      true, if the quest could be removed; false otherwise.
    • getHint

      public List<String> getHint(Player player)
      Description copied from interface: IQuest
      Gets 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).

      Specified by:
      getHint in interface IQuest
      Parameters:
      player - Player
      Returns:
      list of history item-names
    • getMinLevel

      public int getMinLevel()
      Description copied from interface: IQuest
      Returns 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:
      getMinLevel in interface IQuest
      Returns:
      level
    • getFormattedHistory

      public List<String> getFormattedHistory(Player player)
      Specified by:
      getFormattedHistory in interface IQuest
    • isCompleted

      public boolean isCompleted(Player player)
      Description copied from interface: IQuest
      Was the quest completed? Note: A quest can be completed without its status being "Done" (e. g. rejected, failed).
      Specified by:
      isCompleted in interface IQuest
      Parameters:
      player - Player
      Returns:
      true, if it was completed, false otherwise
    • isRepeatable

      public boolean isRepeatable(Player player)
      Description copied from interface: IQuest
      May the quest be repeated?
      Specified by:
      isRepeatable in interface IQuest
      Parameters:
      player - Player
      Returns:
      true, if it can be repeated, false otherwise
    • isStarted

      public boolean isStarted(Player player)
      Description copied from interface: IQuest
      Was the quest started?
      Specified by:
      isStarted in interface IQuest
      Parameters:
      player - Player
      Returns:
      true, if it was started, false otherwise
    • getName

      public abstract String getName()
      Description copied from interface: IQuest
      Returns the name of the quest.
      Specified by:
      getName in interface IQuest
      Returns:
      name
    • isVisibleOnQuestStatus

      public boolean isVisibleOnQuestStatus()
      Description copied from interface: IQuest
      Determines whether the quest should be shown in the Quest Status/Progress log
      Specified by:
      isVisibleOnQuestStatus in interface IQuest
      Returns:
      true, if the quest is visible, false otherwise
    • getRegion

      public String getRegion()
      Returns the region where the quest adventure takes place (or begins), or null for global quests
      Specified by:
      getRegion in interface IQuest
      Returns:
      region, or null for global quests
    • getNPCName

      public String getNPCName()
      Returns the starter NPC for the quest, or null if there is none
      Specified by:
      getNPCName in interface IQuest
      Returns:
      NPC name, or null for quests with no starter NPC