Class KilledInSumForQuestCondition

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

@Dev(category=IGNORE, label="Kills?") public class KilledInSumForQuestCondition extends Object implements ChatCondition
Checking sum of quest creatures kills in player's quest and kills slots.. Quest string should have in proper quest index string like "creature1,w,x,y,z,creature2,a,b,c,d,creature3,..." Where creature1, creature2 - names of creatures to kill; w,x and a,b - number of creatures to kill, solo and shared; y,z and c,d - number of creatures killed by player before starting this quest, both solo and shared.
Author:
yoriy
See Also:
StartRecordingKillsAction, KilledForQuestCondition
  • Constructor Details

    • KilledInSumForQuestCondition

      public KilledInSumForQuestCondition(String quest, int index, int killsSum)
      Creates a new KilledInSumForQuestCondition.
      Parameters:
      quest - - the quest slot
      index - - quest slot index where information stored
      killsSum - - required sum of creatures kills
  • Method Details

    • fire

      public boolean fire(Player player, Sentence sentence, Entity npc)
      return true if player have killed proper sum of creatures.
      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
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

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

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