Пример #1
0
 public void stopQuestTimers() {
   for (QuestTimer timer : getTimers().values()) {
     timer.setQuestState(null);
     timer.stop();
   }
   _timers.clear();
 }
Пример #2
0
 public boolean cancelQuestTimer(String name) {
   QuestTimer timer = removeQuestTimer(name);
   if (timer != null) {
     timer.stop();
   }
   return timer != null;
 }
Пример #3
0
 QuestTimer removeQuestTimer(String name) {
   QuestTimer timer = getTimers().remove(name);
   if (timer != null) {
     timer.setQuestState(null);
   }
   return timer;
 }
Пример #4
0
 /**
  * Add a timer to the quest.<br>
  * <br>
  *
  * @param name: name of the timer (also passed back as "event" in notifyEvent)
  * @param time: time in ms for when to fire the timer
  * @param npc: npc associated with this timer (can be null)
  */
 public void startQuestTimer(String name, long time, NpcInstance npc) {
   QuestTimer timer = new QuestTimer(name, time, npc);
   timer.setQuestState(this);
   QuestTimer oldTimer = getTimers().put(name, timer);
   if (oldTimer != null) {
     oldTimer.stop();
   }
   timer.start();
 }