LibAchievementsArchive

Developer Reference

Table of Contents

  1. Getting Started
  2. Functions

Getting Started

First, add LibAchievementsArchive (LAA) as a dependency in your addon's manifest:

## DependsOn: LibAchievementsArchive>=3

The library can be accessed via the LibAchievementsArchive global variable, and it is recommended that you localize it for usage; for example:

local LAA = LibAchievementsArchive

Functions

The following functions mirror (and behave identically to) their counterparts found in the in-game API, except with the added string charId parameter:

LAA.ArchivedGetAchievementProgress( charId, achievementId )
LAA.ArchivedGetAchievementTimestamp( charId, achievementId )
LAA.ArchivedIsAchievementComplete( charId, achievementId )
LAA.ArchivedGetAchievementCriterion( charId, achievementId, criterionIndex )
LAA.ArchivedGetAchievementLink( charId, achievementId, linkStyle )

If charId (string) is omitted (nil), the current character is assumed.

Note: If there is no archived data available for the specified character, these functions will return default values consistent with a character who has made no progress with the achievement; i.e., they will not indicate to the caller that no archived data is available for the character. Addon authors who wish to determine if archived data is available for a particular character should use LAA.GetCharacterInformation.

The following mirrors (and behaves identically to) GetAchievementNumCriteria and provides a snapshot of the returns of this API function prior to Update 33.

LAA.ArchivedGetAchievementNumCriteria( achievementId )

Note: A return of 0 indicates that the achievement was not valid prior to Update 33; this does not necessarily mean that this achievement remains invalid in Update 33 and beyond.

Retrieve a list of all the character IDs for which archived data is available:

LAA.GetValidCharacterIds( onlyCurrentServerAndAccount )

If the optional onlyCurrentServerAndAccount parameter is true, only character IDs belonging to the same server and account as the current character will be retrieved; otherwise, every character ID—including those belonging to other servers and/or accounts—will be retrieved.

Retrieve the server, @account name, and character name associated with a particular character ID:

LAA.GetCharacterInformation( charId )

If charId (string) is omitted (nil), the current character is assumed.

Returns: server, accountName, characterName

The return is nil if there is no archived data stored for the specified character.

Note: accountName and characterName are the historical names associated with the character when the data was scanned prior to Update 33. They may differ from the current names if the player has since changed them.

Get the highest valid achievement ID from Update 32:

LAA.ArchivedGetMaxAchievementId( )

Note: There can be new achievements added in Update 33 and beyond with achievement IDs lower than the Update 32 maximum ID. In other words, you must not assume that achievement IDs below this limit that were invalid in Update 32 will continue to be invalid in Update 33 and beyond.