QuestID

From Warcraft Wiki
Jump to navigation Jump to search

QuestID is a unique numeric identifier for quests. Many old World of Warcraft API functions related to quests use QuestLogIndex as a parameter, but modern functions tend to use QuestID. Functions such as GetQuestObjectiveInfo have been added that are functionally identical to older functions like GetQuestLogLeaderBoard, except they take a QuestID instead of a QuestLogIndex.

World of Warcraft information database websites, such as Wowhead and WoWDB, use a QuestID in the URL of quest information pages.

Issues with tasks

As of Patch 6.0.3, functions that have QuestID as an argument will return incorrect values for task quests. Tasks are also known as bonus objectives. If the player's character has not encountered a particular task this login session, quest functions that take QuestIDs will not return accurate values until the character enters the area and the task is activated. For example, IsQuestTask will return false for known tasks until the player enters the bonus objective area.

This is a major problem for addons that need to keep track of task progress between login sessions. One solution is to store quest information in saved variables. This example assumes that you're saving after having queried accurate task information.

function SaveTaskToDB(questID)
    addon.db.taskStorage[questID] = {}
    local _, _, numObjectives = GetTaskInfo(questID)
    for objectiveIndex = 1, numObjectives do
         local objDescription = GetQuestObjectiveInfo(questID, objectiveIndex)
         addon.db.taskStorage[questID][objectiveIndex] = {objective = objDescription }
    end
end

See also

  • QuestString - Comma-delimited information about a quest, including its QuestID.