Skip to content

Commit

Permalink
Update EventHandlers.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
rdw-software committed Aug 13, 2023
1 parent f8ffdbe commit d14d810
Showing 1 changed file with 50 additions and 4 deletions.
54 changes: 50 additions & 4 deletions Core/EventHandlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -589,12 +589,45 @@ local timewalkingCriteriaLUT = {
[34410] = "Taran Zhu", -- [123095] = "Taran Zhu", -- Object: Taran Zhu's Personal Stash
}

local timeRiftCriteriaLUT = {
[60685] = "Gill'dan (Azmerloth)",
[60688] = "Freya (Ulderoth)",
[60689] = "The Lich King (Azmourne)",
[60690] = "Illidan Stormrage (Azewrath)",
[60691] = "Fury of N'zoth (Azq'roth)",
[60692] = "Varian Wrynn (The Warlands)",
[60693] = "Overlord Mechagon (A.Z.E.R.O.T.H.)",
}

-- TODO add missing items to DB?
local timeRiftMounts = {
"Felstorm Dragon",
"Gold-Toed Albatross",
"Perfected Juggernaut",
"Reins of the Scourgebound Vanquisher",
"Sulfur Hound's Leash",
}

local timeRiftPets = {
"Briarhorn Hatchling",
"Doomrubble",
"Gill'dan",
"Jeepers",
"Killbot 9000",
"N'Ruby",
"Obsidian Warwhelp",
}

-- TODO Horde/Alliance
-- Horn of the White War Wolf - H
-- Reins of the Ravenous Black Gryphon - A

function R:OnCriteriaComplete(event, id)
local encounterName = timewalkingCriteriaLUT[id]
local timewalkingEncounterName = timewalkingCriteriaLUT[id]
local timeRiftEncounterName = timeRiftCriteriaLUT[id]
R:Debug("Detected achievement criteria completion: " .. tostring(id))
if encounterName then -- Is an encounter that can't otherwise be detected
-- (due to the mount dropping from an object, and not a lootable NPC)
R:Debug("Completed criteria for relevant encounter: " .. tostring(encounterName))
if timewalkingEncounterName then
R:Debug("Completed criteria for Timewalking encounter: " .. tostring(timewalkingEncounterName))
local v = self.db.profile.groups.mounts["Reins of the Infinite Timereaver"]
if v and type(v) == "table" and v.enabled ~= false and R:IsAttemptAllowed(v) then
if v.attempts == nil then
Expand All @@ -605,6 +638,19 @@ function R:OnCriteriaComplete(event, id)
R:OutputAttempts(v)
end
end

if timeRiftEncounterName then
R:Debug("Completed criteria for Time Rift encounter: " .. tostring(timewalkingEncounterName))
for _, itemName in ipairs(timeRiftMounts) do
R:Debug("Adding attempt for item " .. itemName) -- TODO Remove
-- addAttemptForItem(itemName, "mounts")
end

for _, itemName in ipairs(timeRiftPets) do
R:Debug("Adding attempt for item " .. itemName) -- TODO Remove
-- addAttemptForItem(itemName, "pets")
end
end
end

-------------------------------------------------------------------------------------
Expand Down

0 comments on commit d14d810

Please sign in to comment.