Class KillsForQuestCounter

java.lang.Object
games.stendhal.server.util.KillsForQuestCounter

public class KillsForQuestCounter extends Object
Helps counting the number of kills needed for a quest.
  • Constructor Details

    • KillsForQuestCounter

      public KillsForQuestCounter(String questState)
      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

      public int 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.
      Parameters:
      player - the player to count for
      creature - the creature to be killed
      Returns:
      a positive number representing the number of kills still needed, or -1 in case of an error