2 -- 2019 Aleksi Blinnikka
4 local CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo;
5 local UnitAura = UnitAura;
6 local UnitGUID = UnitGUID;
8 local guids = addon.FrameGuids;
10 --[286988] = duration, -- Searing Embers
11 --[257908] = {bar=false}, -- Oiled Blade
12 --[268391] = {bar=false}, -- Mental Assault
13 --[272571] = {bar=false}, -- Choking Waters
14 --[268008] = {bar=false}, -- Snake Charm
15 --[280605] = {bar=false}, -- Brain Freeze
16 --[268797] = {bar=false}, -- Transmute to Goo
17 --[265889] = {bar=false}, -- Torch Strike
18 --[266209] = {bar=false}, -- Wicked Frenzy
19 --[258323] = {bar=false}, -- Infected Wound
20 --[262513] = {bar=false}, -- Azerite Heartseeker
21 [287280] = {1, "buff1"}, -- Glimmer of Light
22 [194384] = {1, "buff1"}, -- Atonement
23 [61295] = {1, "buff1"}, -- Riptide
24 [53563] = {1, "buff2"}, -- Beacon of Light
25 [156910] = {1, "buff2"}, -- Beacon of Faith
26 [200025] = {1, "buff2"}, -- Beacon of Virtue
28 [6940] = {1, "tankcd"}, -- Blessing of Sacrifice
29 [33206] = {1, "tankcd"}, -- Pain Suppression
30 [47788] = {1, "tankcd"}, -- Guardian Spirit
31 [102342] = {1, "tankcd"}, -- Ironbark
32 [116849] = {1, "tankcd"}, -- Life Cocoon
33 [196555] = {1, "tankcd"}, -- Netherwalk
35 [209858] = {1, "stacks"}, -- Necrotic Wound (M+)
36 [240559] = {1, "stacks"}, -- Grievous Wound (M+)
37 [240443] = {1, "stacks"}, -- Burst (M+)
38 [260741] = {1, "heal"}, -- Jagged Nettles (Waycrest Manor)
40 [265264] = {2, "alert"}, -- Void Lash (Zek'voz)
41 -- Battle of Dazar'alor
42 [285213] = {1, "alert"}, -- Caress of Death (Rastakhan)
43 [288415] = {1, "alert"}, -- Caress of Death in Death realm (Rastakhan)
44 [285195] = {8, "stacks"}, -- Deathly Withering (Rastakhan)
45 [286646] = {1, "heal"}, -- Gigavolt Charge (Mekkatorque)
46 [288939] = {1, "heal"}, -- Gigavolt Radiation (Mekkatorque)
47 [287891] = {1, "stacks"}, -- Sheep Shrapnel (Mekkatorque)
48 [287114] = {1, "alert"}, -- Miscalculated Teleport (Mekkatorque)
49 [287167] = {1, "stacks"}, -- Discombobulation (Mekkatorque)
50 [287993] = {1, "stacks"}, -- Chilling Touch (Jaina)
51 [283507] = {1, "heal"}, -- Volatile Charge (Opulence)
52 [287648] = {1, "heal"}, -- Volatile Charge (Opulence)
53 [284556] = {1, "stacks"}, -- Shadow-Touched (Opulence)
54 [287072] = {1, "heal"}, -- Liquid Gold (Opulence)
55 [284781] = {1, "heal"}, -- Grievous Axe (Rastakhan)
56 [290955] = {1, "heal"}, -- Grievous Axe (Rastakhan)
58 [282566] = {1, "stacks"}, -- Promises of Power (Restless Cabal)
59 [282738] = {1, "alert"}, -- Embrace of the Void (Restless Cabal)
60 [285652] = {1, "alert"}, -- Insatiable Torment (Uu'nat)
61 [285367] = {2, "stacks"}, -- Piercing Gaze of N'Zoth (Uu'nat)
62 [284733] = {1, "alert"}, -- Embrace of the Void (Uu'nat)
63 [285685] = {1, "alert"}, -- Gift of N'Zoth: Lunacy (Uu'nat)
65 [292127] = {1, "alert"}, -- Darkest Depths (Underwater)
66 [298569] = {1, "stacks"}, -- Drained Soul (Queen Azshara)
67 [297586] = {1, "alert"}, -- Suffering (Queen's Court)
68 [294711] = {5, "heal"}, -- Frost (Sivara)
69 [294715] = {5, "heal"}, -- Toxic (Sivara)
70 [296693] = {1, "stacks"}, -- Waterlogged (Ashvane)
71 [297333] = {1, "heal"}, -- Briny Bubble (Ashvane)
72 [298306] = {1, "stacks"}, -- Incubation Fluid (Orgozoa)
74 [313255] = {20, "stacks"}, -- Creeping Madness (Wrathion)
75 [310224] = {1, "stacks"}, -- Annihilation (Vexiona)
76 [307358] = {1, "heal"}, -- Debilitating Spit (Shad'har)
77 [318078] = {1, "alert"}, -- Fixate (Shad'har)
78 [312486] = {1, "stacks"}, -- Recurring Nightmare (Il'gynoth)
79 [313400] = {1, "stacks"}, -- Corrupted Mind (N'zoth)
80 [319346] = {1, "heal"}, -- Infinity's Toll (N'zoth) phase marker
81 [316506] = {1, "alert"}, -- Heartpiercer Venom (Trash)
82 [315025] = {1, "heal"}, -- Ancient Curse (Maut)
83 [315311] = {1, "stacks"}, -- Ravage (Hivemind)
84 [313460] = {1, "alert"}, -- Nullification (Hivemind)
85 [313461] = {1, "heal"}, -- Corrosion (Hivemind)
86 [307359] = {1, "heal"}, -- Despair (Vexiona)
87 [313077] = {1, "heal"}, -- Unleashed Nightmare (Ra-den)
88 [316065] = {1, "alert"}, -- Corrupted Existence (Ra-den)
89 [313364] = {1, "heal"}, -- Mental Decay (Carapace of N'zoth)
91 local playerGuid = nil;
93 local auraEvents = {};
94 auraEvents.SPELL_AURA_APPLIED = function(frame, id, source, _, _, atype, amount)
95 if (amount == nil and watchedAuras[id][1] == 1) or (amount ~= nil and amount >= watchedAuras[id][1]) then
97 if atype == "BUFF" and source == playerGuid then
98 frame[watchedAuras[id][2]][id] = amount;
99 elseif atype == "DEBUFF" then
100 frame[watchedAuras[id][2]][id] = amount;
104 auraEvents.SPELL_AURA_APPLIED_DOSE = auraEvents.SPELL_AURA_APPLIED;
105 auraEvents.SPELL_AURA_REFRESH = auraEvents.SPELL_AURA_APPLIED;
106 auraEvents.SPELL_AURA_REMOVED = function(frame, id, source, _, _, atype, amount)
107 if amount == nil or amount == 0 then
108 if atype == "BUFF" and source == playerGuid then
109 frame[watchedAuras[id][2]][id] = nil;
110 elseif atype == "DEBUFF" then
111 frame[watchedAuras[id][2]][id] = nil;
115 auraEvents.SPELL_AURA_REMOVED_DOSE = auraEvents.SPELL_AURA_REMOVED;
116 auraEvents.SPELL_AURA_BROKEN = function(frame, id, source)
117 return auraEvents.SPELL_AURA_REMOVED(frame, id, source, nil, nil, nil, 0);
119 auraEvents.SPELL_AURA_BROKEN_SPELL = auraEvents.SPELL_AURA_BROKEN;
122 local function clog(ts, event, _, source, _, _, _, dest, _, _, _, spellid, ...)
123 if auraEvents[event] and watchedAuras[spellid] and guids[dest] then
124 auraEvents[event](guids[dest], spellid, source, ...);
127 addon.Events.Clog = clog;
129 local types = {["HELPFUL"] = "BUFF", ["HARMFUL"] = "DEBUFF"};
130 local function setAuras(unit, guid)
132 local spellid, count, source;
133 for filter, atype in pairs(types) do
136 name, _, count, _, _, _, source, _, _, spellid = UnitAura(unit, i, filter);
137 if not spellid then break end
138 if count == 0 then count = nil end
139 if source ~= nil then
140 clog(0, "SPELL_AURA_APPLIED", nil, UnitGUID(source), nil, nil, nil,
141 guid, nil, nil, nil, spellid, nil, nil, atype, count);
142 elseif filter == "HARMFUL" then
143 clog(0, "SPELL_AURA_APPLIED", nil, nil, nil, nil, nil,
144 guid, nil, nil, nil, spellid, nil, nil, atype, count);
150 addon.SetAuras = setAuras;
152 local frame = CreateFrame("Frame");
154 frame:SetScript("OnEvent", function()
155 playerGuid = UnitGUID("player");
156 frame:UnregisterAllEvents();
157 frame:SetScript("OnEvent", function()
158 return clog(CombatLogGetCurrentEventInfo());
160 frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
162 frame:RegisterEvent("PLAYER_LOGIN");
164 -- debug slash command to get target auras
165 SLASH_KEHYS1 = "/kaura"
166 function SlashCmdList.KEHYS(msg, editBox)
167 local name, spellid, count, source;
168 local unit = "target";
169 if msg and msg ~= "" then
172 for filter, atype in pairs(types) do
175 name, _, count, _, _, _, source, _, _, spellid = UnitAura(unit, i, filter);
176 if not spellid then break end
177 print(atype, name, count, source, spellid);