Class BringOrderedListOfItemsQuestLogic
java.lang.Object
games.stendhal.server.maps.quests.logic.BringOrderedListOfItemsQuestLogic
Basic behavior for quests which are based on bringing a list of items to an
NPC, in a specific order. The NPC keeps track of the items already brought to
him.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionitemsStillNeeded(Player player)
Gets a sentence to be said by the NPC, enumerating the items that still need to be brought.itemsStillNeededWithHash(Player player)
Gets a sentence to be said by the NPC, enumerating the items that still need to be brought.neededItemsWithAmounts(Player player)
Gets a list of items that still need to be brought.boolean
proceedItems(Player player, EventRaiser eventRaiser)
Give items to the NPC, in the required order.void
setItemCollector(ItemCollector itemCollector)
Sets the item collector to be used.void
Sets the quest on which to apply the logic.void
updateQuantitiesInQuestStatus(Player player)
Updates the status of the player's quest with the quantities of already brought items.
-
Constructor Details
-
BringOrderedListOfItemsQuestLogic
public BringOrderedListOfItemsQuestLogic()
-
-
Method Details
-
itemsStillNeeded
Gets a sentence to be said by the NPC, enumerating the items that still need to be brought. The item names are not prefixed by a hash. For a variant where they are, seeitemsStillNeededWithHash(Player)
.- Parameters:
player
- the player which needs to bring items- Returns:
- an enumeration of still needed items
- See Also:
itemsStillNeededWithHash(Player)
-
itemsStillNeededWithHash
Gets a sentence to be said by the NPC, enumerating the items that still need to be brought. The item names are prefixed by a hash. For a variant where they aren't, seeitemsStillNeeded(Player)
.- Parameters:
player
- the player which needs to bring items- Returns:
- an enumeration of still needed items
- See Also:
itemsStillNeeded(Player)
-
neededItemsWithAmounts
Gets a list of items that still need to be brought. Each item is prefixed by the quantity still needed. An example list element: "5 iron bars". For a sentence that groups the list items, seeitemsStillNeeded(Player)
.- Parameters:
player
- the player which needs to bring items- Returns:
- a list of still needed items, along with their respective quantities
- See Also:
itemsStillNeeded(Player)
-
proceedItems
Give items to the NPC, in the required order.- Parameters:
player
- the player which needs to bring itemseventRaiser
- the NPC that should say what's the next item to bring- Returns:
true
if there are still items to bring after this,false
otherwise
-
updateQuantitiesInQuestStatus
Updates the status of the player's quest with the quantities of already brought items.- Parameters:
player
- the player for which to update the quest status
-
setItemCollector
Sets the item collector to be used.- Parameters:
itemCollector
- anItemCollector
-
setQuest
Sets the quest on which to apply the logic.- Parameters:
quest
- a quest
-