Class PlayerHasKilledNumberOfCreaturesCondition

java.lang.Object
games.stendhal.server.entity.npc.condition.PlayerHasKilledNumberOfCreaturesCondition
All Implemented Interfaces:
ChatCondition, PreTransitionCondition

@Dev(category=KILLS, label="Kills?") public class PlayerHasKilledNumberOfCreaturesCondition extends Object implements ChatCondition
Checks if a player has killed the specified creature at least the specified number of times This can be with or without the help of other players. Note: This condition deals with kills since the player was created. To check kills in the context of a quest, use KilledForQuestCondition.
Author:
madmetzger
  • Constructor Details

    • PlayerHasKilledNumberOfCreaturesCondition

      public PlayerHasKilledNumberOfCreaturesCondition(String creature, Integer numberOfKills)
      Constructor to use condition with only one creature
      Parameters:
      creature - creature
      numberOfKills - number of kills
    • PlayerHasKilledNumberOfCreaturesCondition

      public PlayerHasKilledNumberOfCreaturesCondition(String creature, Integer numberOfKills, KillType killType)
      Constructor to use condition with only one creature.
      Parameters:
      creature - Creature name.
      numberOfKills - Required number of kills.
      killType - Required kill type: solo, shared, or either.
    • PlayerHasKilledNumberOfCreaturesCondition

      @Dev public PlayerHasKilledNumberOfCreaturesCondition(Map<String,​Integer> kills)
      creates a condition to kill each creature with the name specified in the map and the number as value
      Parameters:
      kills - map of creature name to kill and number of that creature to kill
    • PlayerHasKilledNumberOfCreaturesCondition

      public PlayerHasKilledNumberOfCreaturesCondition(Map<String,​Integer> kills, KillType killType)
      Creates a condition to kill each creature with the name specified in the map and the number as value
      Parameters:
      kills - Map of creature name to kill and number of that creature to kill.
      killType - Required kill type: solo, shared, or either.
    • PlayerHasKilledNumberOfCreaturesCondition

      public PlayerHasKilledNumberOfCreaturesCondition(Integer number, String... creatureNames)
      Constructor to use when you want to let kill the same number of each specified creature
      Parameters:
      number - the desired number
      creatureNames - the names of the creatures to kill
    • PlayerHasKilledNumberOfCreaturesCondition

      public PlayerHasKilledNumberOfCreaturesCondition(Integer number, KillType killType, String... creatureNames)
      Constructor to use when you want to let kill the same number of each specified creature.
      Parameters:
      number - Required number of kills.
      killType - Required kill type: solo, shared, or either.
      creatureNames - The names of the creatures to kill.
  • Method Details

    • fire

      public boolean fire(Player player, Sentence sentence, Entity npc)
      Description copied from interface: PreTransitionCondition
      can the transition be done?
      Specified by:
      fire in interface ChatCondition
      Specified by:
      fire in interface PreTransitionCondition
      Parameters:
      player - player who caused the transition
      sentence - text he/she said
      npc - the NPC doing the transition
      Returns:
      true, if the transition is possible, false otherwise
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object