C_QuestLog.GetAllCompletedQuestIDs

From Warcraft Wiki
Jump to navigation Jump to search

Returns all completed quests for the character.

quests = C_QuestLog.GetAllCompletedQuestIDs()

Returns

quests
number[] - The sorted quest IDs

Details

  • A quest appears in the list only after it has been completed and turned in, not while it is in your log.
  • Completing certain quests can cause other quests (alternate versions, etc.) to appear completed also.
  • Some quests are invisible. These quests are not offered to players but suddenly become "completed" due to some other in-game occurrence.
  • Daily quests and World quests appear completed only if they have been completed that day.
  • Pet Battle quests are account-wide and will be returned from this API across all characters. They can be discerned with GetQuestTagInfo() tagID 102.

Example

For a fresh toon who only completed the first three starter quests: Warming Up (56775), Stand Your Ground (58209) and Brace for Impact (58208)

/dump C_QuestLog.GetAllCompletedQuestIDs()
{
	[1] = 56775, -- "Warming Up"
	[2] = 58208, -- "Brace for Impact"
	[3] = 58209, -- "Stand Your Ground"
}

Prints completed questIds and their names.

  • Quest data might have to be cached first, from after the initial query or with QuestEventListener.
  • Some quests returned from this don't seem to exist or have a name.
for _, id in pairs(C_QuestLog.GetAllCompletedQuestIDs()) do
	local name = C_QuestLog.GetTitleForQuestID(id)
	print(id, name)
end

Patch changes

Shadowlands Patch 9.0.1 (2020-10-13): Moved to C_QuestLog.GetAllCompletedQuestIDs() and returns quest IDs in a sorted array ({ QuestID1, QuestID2, ... })
Wrath-Logo-Small.png Patch 3.3.0 (2009-12-08): Added as GetQuestsCompleted()