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 Summary
ConstructorDescriptionPlayerHasKilledNumberOfCreaturesCondition(Integer number, KillType killType, String... creatureNames)
Constructor to use when you want to let kill the same number of each specified creature.PlayerHasKilledNumberOfCreaturesCondition(Integer number, String... creatureNames)
Constructor to use when you want to let kill the same number of each specified creaturePlayerHasKilledNumberOfCreaturesCondition(String creature, Integer numberOfKills)
Constructor to use condition with only one creaturePlayerHasKilledNumberOfCreaturesCondition(String creature, Integer numberOfKills, KillType killType)
Constructor to use condition with only one creature.creates a condition to kill each creature with the name specified in the map and the number as valuePlayerHasKilledNumberOfCreaturesCondition(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 -
Method Summary
-
Constructor Details
-
PlayerHasKilledNumberOfCreaturesCondition
Constructor to use condition with only one creature- Parameters:
creature
- creaturenumberOfKills
- 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
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
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
Constructor to use when you want to let kill the same number of each specified creature- Parameters:
number
- the desired numbercreatureNames
- 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
Description copied from interface:PreTransitionCondition
can the transition be done?- Specified by:
fire
in interfaceChatCondition
- Specified by:
fire
in interfacePreTransitionCondition
- Parameters:
player
- player who caused the transitionsentence
- text he/she saidnpc
- the NPC doing the transition- Returns:
- true, if the transition is possible, false otherwise
-
hashCode
public int hashCode() -
equals
-