Package games.stendhal.server.util
Class KillsForQuestCounter
java.lang.Object
games.stendhal.server.util.KillsForQuestCounter
Helps counting the number of kills needed for a quest.
-
Constructor Summary
ConstructorDescriptionKillsForQuestCounter(String questState)
Initializes a kill counter for a quest, based on the recorded quest state. -
Method Summary
Modifier and TypeMethodDescriptionint
remainingKills(Player player, String creature)
Tells the number of times the specified player still needs to kill the specified kind of creature in order to fulfill the quest's requirements.
-
Constructor Details
-
KillsForQuestCounter
Initializes a kill counter for a quest, based on the recorded quest state.- Parameters:
questState
- the recorded quest state, in the form: "creatureName,requiredSoloKills,requiredSharedKills,totalSoloKillsWhenQuestStarted,totalSharedKillsWhenQuestStarted"
-
-
Method Details
-
remainingKills
Tells the number of times the specified player still needs to kill the specified kind of creature in order to fulfill the quest's requirements.- Parameters:
player
- the player to count forcreature
- the creature to be killed- Returns:
- a positive number representing the number of kills still needed,
or
-1
in case of an error
-