Skip to content

Commit ddfd1ac

Browse files
committed
Add Lemix keystone scanning
1 parent b018cf3 commit ddfd1ac

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

Modules/MythicPlus.lua

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@ local Addon = LibStub('AceAddon-3.0'):GetAddon('WoWthing_Collector')
22
local Module = Addon:NewModule('MythicPlus')
33

44

5+
local ACTIVITY_ID_TO_CHALLENGE_MAP_ID = {
6+
[1782] = 197, -- Eye of Azshara
7+
[1783] = 200, -- Halls of Valor
8+
[1785] = 206, -- Neltharion's Lair
9+
[1786] = 239, -- Seat of the Triumvirate
10+
[1787] = 208, -- Maw of Souls
11+
[1788] = 198, -- Darkheart Thicket
12+
[1789] = 210, -- Court of Stars
13+
[1790] = 199, -- Black Rook Hold
14+
[1791] = 209, -- Arcway
15+
[1793] = 234, -- Upper Kara
16+
[1794] = 227, -- Lower Kara
17+
[1795] = 207, -- Vault of the Wardens
18+
}
19+
520
function Module:OnEnable()
621
Addon.charData.mythicPlusV2 = Addon.charData.mythicPlusV2 or {}
722
Addon.charData.mythicPlusV2.seasons = Addon.charData.mythicPlusV2.seasons or {}
@@ -37,8 +52,20 @@ function Module:OnEnteringWorld()
3752
end
3853

3954
function Module:UpdateKeystone()
40-
Addon.charData.keystoneInstance = C_MythicPlus.GetOwnedKeystoneChallengeMapID()
41-
Addon.charData.keystoneLevel = C_MythicPlus.GetOwnedKeystoneLevel()
55+
local keystoneInstance = C_MythicPlus.GetOwnedKeystoneChallengeMapID()
56+
local keystoneLevel = C_MythicPlus.GetOwnedKeystoneLevel()
57+
58+
-- try TW key if we didn't find a normal one
59+
if keystoneInstance == nil and keystoneLevel == nil then
60+
local activityId, groupId, level = C_LFGList.GetOwnedKeystoneActivityAndGroupAndLevel(true)
61+
if activityId ~= nil and level ~= nil then
62+
keystoneInstance = ACTIVITY_ID_TO_CHALLENGE_MAP_ID[activityId]
63+
keystoneLevel = level
64+
end
65+
end
66+
67+
Addon.charData.keystoneInstance = keystoneInstance
68+
Addon.charData.keystoneLevel = keystoneLevel
4269
end
4370

4471
function Module:UpdateMythicPlusData()

0 commit comments

Comments
 (0)