[98008] = 180, -- Spirit Link Totem
},
[270] = { -- Mistweaver Monk
- [115310] = (180-40), -- Revival, already lowered by Artifact when lvl 75
+ [115310] = 180, -- Revival
},
};
-local monkRelics = { -- Tendrils of Revival
- ["151012"] = -10,
- ["151010"] = -10,
- ["147112"] = -10,
- ["152291"] = -10,
-};
local cds = {}; -- CD durations currently available modified by passive cdfixes
-- CD fixes active e.g. cdfixes[guid] = -60, no need for spellid as
local idToGuid = {};
local guidToId = {};
local guidToSpecid = {};
-local monks = {};
-local monksWithLegendary = {};
local dead = {};
local disconnected = {};
frames[frame.guid][frame.spellid] = nil;
if not next(frames[frame.guid]) then frames[frame.guid] = nil end
cds[frame.guid][frame.spellid] = nil;
- monks[frame.guid] = nil;
- monksWithLegendary[frame.guid] = nil;
dead[frame.guid] = nil;
disconnected[frame.guid] = nil;
if runningcds[frame.guid] then runningcds[frame.guid][frame.spellid] = nil end
end
end
-local function updateMonk(guid, _, _, weapon, wrist)
- local id = guidToId[guid];
- if id then
- local _, _, _, relic1, relic2, relic3 = strsplit(":", weapon);
- local cdfix = 0;
- if monkRelics[relic1] then cdfix = cdfix + monkRelics[relic1] end
- if monkRelics[relic2] then cdfix = cdfix + monkRelics[relic2] end
- if monkRelics[relic3] then cdfix = cdfix + monkRelics[relic3] end
- if cdfix ~= 0 then
- cdfixes[guid] = cdfix;
- else
- cdfixes[guid] = nil;
- end
-
- if wrist == 137096 then -- Petrichor Lagniappe
- monksWithLegendary[guid] = true;
- else
- monksWithLegendary[guid] = nil;
- end
- monks[guid] = true;
- updateUnitCD(guid);
- end
-end
-
--- a secondary tick for monks inventory check out of combat
-local function monkTick()
- if not InCombatLockdown() then
- for guid, _ in pairs(monks) do
- local id = guidToId[guid];
- if id then OmaInspect.Request(guid, id, updateMonk, true) end
- end
- end
- CTimerAfter(10, monkTick);
-end
-
local function updateDruid(guid, _, talent)
local id = guidToId[guid];
if id then
if trackedcds[specid] then
guidToId[guid] = "player";
guidToSpecid[guid] = specid;
- if specid == 270 then -- Monk
- local weapon = GetInventoryItemLink("player", INVSLOT_MAINHAND);
- local wrist = GetInventoryItemID("player", INVSLOT_WRIST);
- updateMonk(guid, nil, nil, weapon, wrist);
- elseif specid == 105 then -- Druid
- local _, _, _, talent = GetTalentInfo(6, 2, 1);
+ if specid == 105 then -- Druid
+ local _, _, _, talent = GetTalentInfo(6, 1, 1);
updateDruid(guid, nil, talent);
else
updateUnitCD(guid);
end
updateUnitCD(guid);
OmaInspect.Request(guid, id, updatePriest);
- elseif specs[class] == 270 then
- -- Monk, have to check inventory for CD modifications
- -- updateUnitCD (without having fixes yet)
- updateUnitCD(guid);
- OmaInspect.Request(guid, id, updateMonk, true);
elseif specs[class] == 105 then
-- Druid, have to inspect to get talents
-- updateUnitCD (without having fixes yet)
end
end
end,
- ["UNIT_SPELLCAST_SUCCEEDED"] = function(id, _, _, _, spellid)
+ ["UNIT_SPELLCAST_SUCCEEDED"] = function(id, _, spellid)
local guid = idToGuid[id];
if guid and frames[guid] then
local frame = frames[guid][spellid];
if frame then
CdDown(guid, spellid, GetTime());
- elseif monksWithLegendary[guid] and spellid == 115151 then
- -- Renewing Mist with legendary affects Revival
- if runningcds[guid] and runningcds[guid][115310] then
- runningcds[guid][115310] = runningcds[guid][115310] - 2;
- end
elseif guidToSpecid[guid] == 257 and spellid == 62618 then
-- assumed Holy priest cast Barrier, set to update to Disc
guidToSpecid[guid] = 256;
cdframe:RegisterEvent("PLAYER_ENTERING_WORLD");
-- initial tick
CTimerAfter(0.5, tick);
- CTimerAfter(10, monkTick);
end
+cdframe:SetScript("OnEvent", cdtracker);
cdframe:RegisterEvent("PLAYER_LOGIN");
-cdframe:SetScript("OnEvent", function(self, event)
- if event == "PLAYER_LOGIN" then
- return cdtracker();
- end
-end);