First, add LibQuestStatus (LQS) as a dependency in your addon's manifest:
## DependsOn: LibQuestStatus
The library can be accessed via the LibQuestStatus global variable, and it is recommended that you localize it for usage; for example:
local LQS = LibQuestStatus
Callbacks
LQS.EVENT_QUEST_STATUS_UPDATED -- Fired when quest status data has been updated, either by player gameplay or by data import
Determine if a character has a particular quest in their quest journal:
LQS.HasQuestOnCharacter( questId, server, charId )
If server is omitted (nil), the current server is assumed.
If charId is omitted (nil), the current character is assumed.
This function is identical to the base-game HasQuest(), except with added server and charId parameters.
Determine if a character has ever completed a particular quest:
LQS.HasCompletedQuestOnCharacter( questId, server, charId )
If server is omitted (nil), the current server is assumed.
If charId is omitted (nil), the current character is assumed.
This function is identical to the base-game HasCompletedQuest(), except with added server and charId parameters.
An alternate version of GetQuestRepeatableType:
LQS.GetQuestRepeatableType( questId )
This function is identical to the base-game GetQuestRepeatableType(), except that it will return QUEST_REPEAT_WEEKLY for weekly trial quests. The base-game version returns QUEST_REPEAT_REPEATABLE for trial quests, which is technically correct (the best kind of correct!), but in practice is useless since the weekly coffer is what most players are interested in.
Get a table of every quest in a character's quest journal:
LQS.GetActiveQuestsForCharacter( server, charId )
If server is omitted (nil), the current server is assumed.
If charId is omitted (nil), the current character is assumed.
The return is a table in the following format:
{
[1234] = { -- questId
conditionType = QUEST_CONDITION_TYPE_EXAMPLE, -- equivalent to select(8, GetJournalQuestConditionInfo(journalQuestIndex, 1, 1))
completed = true, -- equivalent to GetJournalQuestIsComplete(journalQuestIndex)
},
[5678] = { -- questId
conditionType = QUEST_CONDITION_TYPE_EXAMPLE, -- equivalent to select(8, GetJournalQuestConditionInfo(journalQuestIndex, 1, 1))
completed = false, -- equivalent to GetJournalQuestIsComplete(journalQuestIndex)
},
}Determine if a repeatable quest is on cooldown for a character:
LQS.IsRepeatableQuestOnCooldownForCharacter( questId, server, charId )
If server is omitted (nil), the current server is assumed.
If charId is omitted (nil), the current character is assumed.
Get the list of servers and characters for which data is available:
LQS.GetServerAndCharacterList( alwaysIncludeCurrentCharacter )
If the optional alwaysIncludeCurrentCharacter parameter is true, the current character will be included even if the user has added the character's account to the exclusion list in the settings.
The return is a table in the following format:
{
[1] = {
server = "NA",
characters = {
[1] = {
charId = "8796093000000001",
account = "@ExampleAccount",
name = "Example Character A",
timestamp = 1778472000,
},
[2] = {
charId = "8796093000000002",
account = "@OtherAccount",
name = "Example Character B",
timestamp = 1778472000,
},
},
},
[2] = {
server = "EU",
characters = {
[1] = {
charId = "8798292000000001",
account = "@ExampleAccount",
name = "Example Character C",
timestamp = 1778472000,
},
},
},
}
If it appears in the results, the current server will be in the first index, and if it appears in the results, the current character will be in the first index. All other characters will be sorted by character ID. timestamp is the last time the data for that character was updated, expressed in Unix-style epoch form.
Determine if data is available for a character:
LQS.IsDataAvailableForCharacter( server, charId )
Get the highest valid quest ID:
LQS.GetMaxQuestId( )
Callbacks:
LQS.RegisterForCallback( name, eventCode, callback ) LQS.UnregisterForCallback( name, eventCode )
eventCode is one of the LQS.EVENT_* constants.
Open the LibQuestStatus settings panel:
LQS.OpenSettingsPanel( )