Files
wow-weakauras/FreshShit/AchievementSniffer/init.lua
2024-10-21 11:54:59 +02:00

89 lines
2.5 KiB
Lua

---@class aura_env
---@field achievements table<number, string>
---@field Scan fun(playerName: string)
---@class WeakAurasSaved
---@field Cyka table<string, table<string, table<number, string>>>
if not WeakAurasSaved.Cyka then WeakAurasSaved.Cyka = {} end
if not WeakAurasSaved.Cyka.AchievementSniffer then WeakAurasSaved.Cyka.AchievementSniffer = {} end
aura_env.achievements = {
522, -- Somebody Likes Me
523, -- 5 Exalted Reputations
524, -- 10 Exalted Reputations
521, -- 15 Exalted Reputations
520, -- 20 Exalted Reputations
519, -- 25 Exalted Reputations
518, -- 30 Exalted Reputations
1556, -- 25 Fish
1557, -- 50 Fish
1558, -- 100 Fish
238, -- An Honorable Kill
513, -- 100 Honorable Kills
515, -- 500 Honorable Kills
516, -- 1000 Honorable Kills
512, -- 5000 Honorable Kills
509, -- 10000 Honorable Kills
239, -- 25000 Honorable Kills
503, -- 50 Quests Completed
504, -- 100 Quests Completed
505, -- 250 Quests Completed
506, -- 500 Quests Completed
507, -- 1000 Quests Completed
1017, -- Can I Keep Him?
15, -- Plenty of Pets
1248, -- Plethora of Pets
1250, -- Shop Smart, Shop Pet...Smart
2516, -- Lil' Game Hunter
5876, -- Petting Zoo
11188, -- Broken Isles Explorer
11190, -- Broken Isles Pathfinder, Part One
11157, -- Loremaster of Legion
10763, -- Azsuna Matata
10790, -- Vrykul Story, Bro
11124, -- Good Suramaritan
10059, -- Ain't No Mountain High Enough
10698, -- That's Val'sharah Folks!
10672, -- Broken Isles Diplomat
10665, -- Explore Azsuna
10666, -- Explore Val'sharah
10667, -- Explore Highmountain
10668, -- Explore Stormheim
10669, -- Explore Suramar
12069, -- Explore Argus
2141, -- Stable Keeper
2142, -- Filling Up The Barn
2143, -- Leading the Cavalry
7382, -- Dynamic Duo
7383, -- Terrific Trio
7384, -- Quintessential Quintet
245, -- That Takes Class
}
---@param playerName string
aura_env.Scan = function(playerName)
WeakAurasSaved.Cyka.AchievementSniffer[playerName] = {}
for i, aid in ipairs(aura_env.achievements) do
local completed, month, day, year = GetAchievementComparisonInfo(aid)
local date = ""
if completed then
---@type string
local yearstr = "" .. year
if year < 100 then yearstr = "20" .. year end
date = string.format("%04d-%02d-%02d", yearstr, month, day)
end
local data = {
id = aid,
date = date,
completed = completed,
}
WeakAurasSaved.Cyka.AchievementSniffer[playerName][aid] = data
end
end
--/run WeakAurasSaved.Cyka.AchievementSniffer = {}