From 8b1be3abbc34907332f85244ecbdb118365b6e83 Mon Sep 17 00:00:00 2001 From: Aleksi Blinnikka Date: Wed, 30 Jun 2021 19:34:36 +0300 Subject: [PATCH] More auras and stagger tracking --- OmaTMW/TellMeWhen.lua | 16 ++++++++++++---- kehys/auras.lua | 29 ++++++++++++++++++++--------- kehys/events.lua | 7 ++----- kehys/frame.lua | 4 +++- kehys/updater.lua | 27 ++++++++++++++++++++------- 5 files changed, 57 insertions(+), 26 deletions(-) diff --git a/OmaTMW/TellMeWhen.lua b/OmaTMW/TellMeWhen.lua index 113a707..6037c86 100644 --- a/OmaTMW/TellMeWhen.lua +++ b/OmaTMW/TellMeWhen.lua @@ -93,9 +93,8 @@ local chars = { ["Vildan"] = { { unit = "target", - spec = 3, -- Retribution - auras = {"Judgment"}, - auraFilter = "PLAYER HARMFUL", + auras = {"Bursting With Pride"}, + auraFilter = "HELPFUL", x = 570, -- placed over Innervate frame y = 440, width = 80, @@ -120,6 +119,15 @@ local chars = { width = 80, height = 80, }, + { + unit = "player", + auras = {"Seraphim", "Righteous Verdict"}, + auraFilter = "PLAYER HELPFUL", + x = 570, + y = 480, + width = 40, + height = 40, + }, { unit = "player", auras = {"Divine Shield"}, @@ -293,7 +301,7 @@ local settings = { "Chilling Touch", "Volatile Charge", "Liquid Gold", "Drained Soul", "Evoke Anguish", "Ancient Curse", "Corrosion", "Debilitating Spit", "Tasty Morsel", "Encroaching Shadows", "Corrupted Existence", "Madness Bomb", "Crimson Chorus", "Essence Sap", "Bloodlight", - "Arcane Vulnerability" + "Arcane Vulnerability", "Wicked Laceration", "Withering Touch" }, auraFilter = "HARMFUL", x = 660, diff --git a/kehys/auras.lua b/kehys/auras.lua index de01fa9..f777e22 100644 --- a/kehys/auras.lua +++ b/kehys/auras.lua @@ -32,6 +32,9 @@ local watchedAuras = { [102342] = {1, "tankcd"}, -- Ironbark [116849] = {1, "tankcd"}, -- Life Cocoon [196555] = {1, "tankcd"}, -- Netherwalk + --[124275] = {1, "stagger"}, -- Light Stagger (Monk) + --[124274] = {1, "stagger"}, -- Moderate Stagger (Monk) + [124273] = {1, "stagger"}, -- Heavy Stagger (Monk) -- M+ [209858] = {1, "stacks"}, -- Necrotic Wound (M+) [240559] = {1, "stacks"}, -- Grievous Wound (M+) @@ -102,6 +105,8 @@ local watchedAuras = { [327814] = {1, "heal"}, -- Wicked Gash (Gauntlet) (Sanguine Depths) [323687] = {1, "heal"}, -- Arcane Lightning (De Other Side) [324154] = {1, "heal"}, -- Dark Stride (Spires of Ascension) + [335305] = {1, "heal"}, -- Barbed Shackles (Sanguine Depths) + [336279] = {1, "heal"}, -- Explosive Anger (Sanguine Depths) -- Castle Nathria [346301] = {1, "stacks"}, -- Bloodlight (Shriekwing) [328897] = {7, "alert"}, -- Exsanguinated (Shriekwing) @@ -116,12 +121,13 @@ local watchedAuras = { [324982] = {1, "heal"}, -- Shared Suffering (Lady Inerva Darkvein) [324983] = {1, "heal"}, -- Shared Suffering (Lady Inerva Darkvein) [340860] = {1, "heal", 14}, -- Withering Touch (Artificer Xy'mox) + [326302] = {1, "alert"}, -- Stasis Trap (Artificer Xy'mox) [334771] = {1, "heal"}, -- Heart Hemorrhage (Stone Legion Generals) [326699] = {1, "stacks"}, -- Burden of Sin (Sire Denathrius) [329298] = {1, "alert"}, -- Gluttonous Miasma (Hungering Destroyer) [334755] = {14, "heal"}, -- Essence Sap (Hungering Destroyer) [343320] = {1, "alert"}, -- Curse of Caramain (Trash) - [333913] = {2, "stacks"}, -- Wicked Laceration (Stone Legion Generals) + [333913] = {1, "stacks"}, -- Wicked Laceration (Stone Legion Generals) }; local playerGuid = nil; @@ -133,8 +139,8 @@ auraEvents.SPELL_AURA_APPLIED = function(frame, id, source, _, _, atype, amount) frame[watchedAuras[id][2]][id] = amount; elseif atype == "DEBUFF" then frame[watchedAuras[id][2]][id] = amount; - if watchedAuras[id][3] ~= nil then - frame.stacks[id] = watchedAuras[id][3]; + if watchedAuras[id][3] ~= nil and frame.hits[id] == nil then + frame.hits[id] = watchedAuras[id][3]; end end end @@ -147,6 +153,9 @@ auraEvents.SPELL_AURA_REMOVED = function(frame, id, source, _, _, atype, amount) frame[watchedAuras[id][2]][id] = nil; elseif atype == "DEBUFF" then frame[watchedAuras[id][2]][id] = nil; + if watchedAuras[id][3] ~= nil then + frame.hits[id] = nil; + end end end end @@ -157,16 +166,18 @@ end auraEvents.SPELL_AURA_BROKEN_SPELL = auraEvents.SPELL_AURA_BROKEN; auraEvents.SPELL_PERIODIC_DAMAGE = function(frame, id, source) if watchedAuras[id][3] ~= nil then - if frame.stacks[id] ~= nil and frame.stacks[id] > 0 then - frame.stacks[id] = frame.stacks[id] - 1; - if frame.stacks[id] == 0 then - frame.stacks[id] = nil; + if frame.hits[id] ~= nil and frame.hits[id] > 0 then + frame.hits[id] = frame.hits[id] - 1; + if frame.hits[id] == 0 then + frame.hits[id] = nil; end - elseif frame.stacks[id] ~= nil then - frame.stacks[id] = nil; + elseif frame.hits[id] ~= nil then + frame.hits[id] = nil; end end end +auraEvents.SPELL_PERIODIC_ABSORBED = auraEvents.SPELL_PERIODIC_DAMAGE; +auraEvents.SPELL_PERIODIC_MISSED = auraEvents.SPELL_PERIODIC_DAMAGE; local counter = 0; local function clog(ts, event, _, source, _, _, _, dest, _, _, _, spellid, ...) diff --git a/kehys/events.lua b/kehys/events.lua index 7d46c61..ae201dd 100644 --- a/kehys/events.lua +++ b/kehys/events.lua @@ -77,11 +77,7 @@ local function updateName(frame, unit) local _, class = UnitClass(unit); local color = RAID_CLASS_COLORS[class]; - if class == "DEATHKNIGHT" then - frame.isdk = true; - else - frame.isdk = nil; - end + frame.classname = class; if color then if not frame.raid then @@ -207,6 +203,7 @@ local eventFuncs = { frame.heal = {}; frame.buff1 = {}; frame.buff2 = {}; + frame.stagger = {}; addon.SetAuras(frame.unit, frame.guid); end end, diff --git a/kehys/frame.lua b/kehys/frame.lua index f740c77..44bc149 100644 --- a/kehys/frame.lua +++ b/kehys/frame.lua @@ -54,11 +54,13 @@ function addon.NewRaidFrame(parent, width, height, unit, attributes, f.heal = {}; -- high healing auras f.tankcd = {}; -- tank CD auras f.stacks = {}; -- stacking aura tracking + f.hits = {}; -- hits aura tracking + f.stagger = {}; -- Monk Stagger tracking f.buff1 = {}; -- custom buff indicator 1 f.buff2 = {}; -- custom buff indicator 2 f.incoming = {}; -- incoming ability indicator f.rolename = nil; -- TANK, HEALER, DAMAGER, NONE - f.isdk = nil; -- DK death strike tracker for DK tanks + f.classname = nil; -- DK Death Strike and Monk Stagger tracker f.raid = true; f.rounds = 0; -- set up periodic updates diff --git a/kehys/updater.lua b/kehys/updater.lua index 94977d4..42aedf0 100644 --- a/kehys/updater.lua +++ b/kehys/updater.lua @@ -230,6 +230,7 @@ function addon.FrameUpdate(frame) frame.heal = {}; frame.buff1 = {}; frame.buff2 = {}; + frame.stagger = {}; addon.SetAuras(frame.unit, frame.guid); frame.rounds = 0; end @@ -246,6 +247,10 @@ function addon.FrameUpdate(frame) local _, amount = next(frame.stacks); frame.stack:SetText(amount); if not frame.stack:IsShown() then frame.stack:Show() end + elseif next(frame.hits) then + local _, amount = next(frame.hits); + frame.stack:SetText(amount); + if not frame.stack:IsShown() then frame.stack:Show() end elseif frame.stack:IsShown() then frame.stack:Hide(); end @@ -267,13 +272,21 @@ function addon.FrameUpdate(frame) elseif frame.glow:IsShown() then frame.glow:Hide(); end - -- DK death strike tracking - if frame.isdk and frame.rolename == "TANK" then - local power = UnitPower(unit); - if power < 45 then - frame.bottomwarn:Show(); - elseif frame.bottomwarn:IsShown() then - frame.bottomwarn:Hide(); + -- DK Death Strike and Monk Stagger tracking + if frame.rolename == "TANK" then + if frame.classname == "DEATHKNIGHT" then + local power = UnitPower(unit); + if power < 45 then + if not frame.bottomwarn:IsShown() then frame.bottomwarn:Show() end + elseif frame.bottomwarn:IsShown() then + frame.bottomwarn:Hide(); + end + elseif frame.classname == "MONK" then + if next(frame.stagger) then -- Heavy Stagger + if not frame.bottomwarn:IsShown() then frame.bottomwarn:Show() end + elseif frame.bottomwarn:IsShown() then + frame.bottomwarn:Hide(); + end end elseif frame.bottomwarn:IsShown() then frame.bottomwarn:Hide(); -- 2.39.5