turtle-wow: update Immolate duration after cast Conflagrate

This commit is contained in:
Artur Morozov
2024-11-04 14:30:24 +01:00
committed by GitHub
parent f420c5f7f7
commit b56836d2eb
2 changed files with 26 additions and 6 deletions
+9
View File
@@ -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
+17 -6
View File
@@ -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)