AchievementID
Jump to navigation
Jump to search
A whole-number achievementID enumerates every achievement. It is the first field in the payload of an AchievementLink.
Achievements added to the game in later expansions typically have a larger value. For example: [Northrend Dungeonmaster], [Cataclysm Dungeon Hero] and [Pandaria Dungeon Hero] have ids 1288, 4844 and 6925.
As a payload
The following events provide achievementID in their payload:
- ACHIEVEMENT_EARNED → achievementID, alreadyEarned
- ACHIEVEMENT_PLAYER NAME → achievementID, "description"
- RECEIVED_ACHIEVEMENT_MEMBER LIST → achievementID
- TRACKED_ACHIEVEMENT_LIST CHANGED → achievementID, added
- TRACKED_ACHIEVEMENT_UPDATE → achievementID, criteriaID, elapsed, duration
As an argument
The following functions accept achievementID as an argument:
- GetAchievementCriteriaInfo(achievementID, index) - Returns detailed info about an achievement's criteria
- GetAchievementCriteriaInfoByID(achievementID, criteriaID) - Returns detailed info about an achievement's criteria
- GetAchievementLink(achievementID) - Returns a properly-formatted AchievementLink
- GetAchievementInfo(achievementID) - Provides detailed information about an achievement (name, completion status and date, icon, etc.)
- GetAchievementCategory(achievementID) - Returns the category to which an achievement belongs
- GetAchievementNumCriteria(achievementID) - Returns the number of criteria required to obtain this achievement
- C_AchievementInfo.GetRewardItemID - Returns information about an item rewarded for completing an achievement
- GetPreviousAchievement(achievementID) - Returns information about the previous achievement in a chain of related achievements
- GetNextAchievement(achievementID) - Returns information about the next achievement in a chain of related achievements
- C_AchievementInfo.GetSupercedingAchievements(achievementID) - Returns a table listing all achievements which supercede the given one (ie, levels 70, 80, 90 and 100 all supercede reaching level 60)
- AddTrackedAchievement(achievementID) - Adds this achievement to the quest tracker
- RemoveTrackedAchievement(achievementID) - Removes this achievement from the quest tracker
Example
local frame = CreateFrame("Frame");
frame:RegisterEvent("ACHIEVEMENT_EARNED")
frame:HookScript("OnEvent", function(event, arg1)
if (event == "ACHIEVEMENT_EARNED") then
print("Hurray! You earned " .. select(2, GetAchievementInfo(arg1)));
end
end);
Possible result: "Hurray! You earned Outland Dungeonmaster"
External links
Popular datamining websites also use the achievementID in the url to identify each achievement in the game.
For example, [Outland Dungeonmaster] has id 1284 and may be accessed using these links:
|