Class QuestStateGreaterThanCondition

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

@Dev(category=QUEST_SLOT, label="State?") public class QuestStateGreaterThanCondition extends Object implements ChatCondition
Condition to check if the value in a quest slot is greater than an expected value. If the value is not a number, it is treated as 0.
Author:
madmetzger
  • Constructor Details

    • QuestStateGreaterThanCondition

      public QuestStateGreaterThanCondition(String quest, int index, int expectedSmallerValue)
      Create a new QuestStateGreaterThanCondition
      Parameters:
      quest - name of the quest slot
      index - index where the number is stored in the quest slot
      expectedSmallerValue - expected smaller value to compare
  • 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