diff --git a/libs/libdebuff.lua b/libs/libdebuff.lua index afac1df2..f4a5d9ca 100644 --- a/libs/libdebuff.lua +++ b/libs/libdebuff.lua @@ -61,6 +61,15 @@ function libdebuff:GetDuration(effect, rank) end end +function libdebuff:UpdateDuration(unit, unitlevel, effect, duration) + if not unit or not effect or not duration then return end + unitlevel = unitlevel or 0 + + if libdebuff.objects[unit] and libdebuff.objects[unit][unitlevel] and libdebuff.objects[unit][unitlevel][effect] then + libdebuff.objects[unit][unitlevel][effect].duration = duration + end +end + function libdebuff:GetMaxRank(effect) local max = 0 for id in pairs(L["debuffs"][effect]) do diff --git a/modules/turtle-wow.lua b/modules/turtle-wow.lua index 1c7cf16e..d3182192 100644 --- a/modules/turtle-wow.lua +++ b/modules/turtle-wow.lua @@ -41,14 +41,13 @@ pfUI:RegisterModule("turtle-wow", "vanilla", function () WorldMapFrameTitle:Hide() end - -- refresh paladin judgements on holy strike - -- taken from: https://github.com/doorknob6/pfUI-turtle/blob/master/modules/debuffs.lua HookScript(libdebuff, "OnEvent", function() if event == "CHAT_MSG_SPELL_SELF_DAMAGE" then - local spell = string.find(string.sub(arg1,6,17), "Holy Strike") - - --arg2 is holy dmg when it hits, nil when it misses - if spell and arg2 then + -- refresh paladin judgements on holy strike + -- taken from: https://github.com/doorknob6/pfUI-turtle/blob/master/modules/debuffs.lua + local holystrike = string.find(string.sub(arg1,6,17), "Holy Strike") + --arg2 is spell dmg when it hits, nil when it misses + if holystrike and arg2 then for seal in L["judgements"] do local name = UnitName("target") local level = UnitLevel("target") @@ -64,6 +63,18 @@ pfUI:RegisterModule("turtle-wow", "vanilla", function () end end end + + -- refresh Immolate duration after cast Conflagrate + local conflagrate = string.find(string.sub(arg1,6,17), "Conflagrate") + --arg2 is spell dmg when it hits, nil when it misses + if conflagrate and arg2 then + local name = UnitName("target") + local level = UnitLevel("target") + if libdebuff.objects[name][level]["Immolate"] then + local duration = libdebuff.objects[name][level]["Immolate"].duration + libdebuff:UpdateDuration(name, level, "Immolate", duration - 3) + end + end end end)