public void stopQuestTimers() { for (QuestTimer timer : getTimers().values()) { timer.setQuestState(null); timer.stop(); } _timers.clear(); }
public boolean cancelQuestTimer(String name) { QuestTimer timer = removeQuestTimer(name); if (timer != null) { timer.stop(); } return timer != null; }
QuestTimer removeQuestTimer(String name) { QuestTimer timer = getTimers().remove(name); if (timer != null) { timer.setQuestState(null); } return timer; }
/** * 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(); }