Interface IQuestServiceEvents

interface IQuestServiceEvents {
    allQuestsComplete: (() => void);
    quest:complete: ((quest: IQuest) => void);
    quest:start: ((quest: IQuest) => void);
    quest:update: ((quest: IQuest) => void);
    system:ready: ((quests: Map<number, IQuest>) => void);
}

Properties

allQuestsComplete: (() => void)

Triggered when all quests are completed.

quest:complete: ((quest: IQuest) => void)

Triggered when a quest is completed.

Type declaration

    • (quest): void
    • Parameters

      • quest: IQuest

        The quest object.

      Returns void

quest:start: ((quest: IQuest) => void)

Triggered when a quest is started.

Type declaration

    • (quest): void
    • Parameters

      • quest: IQuest

        The quest object.

      Returns void

quest:update: ((quest: IQuest) => void)

Triggered when a quest is updated.

Type declaration

    • (quest): void
    • Parameters

      • quest: IQuest

        The quest object.

      Returns void

system:ready: ((quests: Map<number, IQuest>) => void)

Triggered when the quest system is ready.

// The quest system might not be ready when the script is loaded.
if(questService.isSystemReady){
console.log('Quest system is ready', questService.quests);
} else {
questService.on('system:ready', () => {
console.log('Quest system is ready', questService.quests);
});
}