71 lines
2.4 KiB
Lua
71 lines
2.4 KiB
Lua
--UNIT_AURA DRUID_HOTS_REMOVE_HOT UPDATE_HOTS
|
|
function(e, ...)
|
|
if not WeakAurasSaved.DruidHots then WeakAurasSaved.DruidHots = {} end
|
|
if not WeakAurasSaved.DruidHotsTotal then WeakAurasSaved.DruidHotsTotal = {
|
|
["Rejuvenation"] = 0,
|
|
["Regrowth"] = 0,
|
|
["Lifebloom"] = 0,
|
|
["Wild Growth"] = 0,
|
|
["Spring Blossoms"] = 0,
|
|
["Grove Tending"] = 0,
|
|
["Rejuvenation (Germination)"] = 0,
|
|
} end
|
|
if e == "UNIT_AURA" then
|
|
local u = ...
|
|
local index = 1
|
|
local GUID = UnitGUID(u)
|
|
local buff, update = 0, 0
|
|
WeakAurasSaved.DruidHots[GUID] = {}
|
|
while UnitBuff(u, index, "PLAYER") do
|
|
local name = UnitBuff(u, index, "PLAYER")
|
|
local dur = select(6, UnitBuff(u, index, "PLAYER"))
|
|
if aura_env.hots[name] then
|
|
buff = 1
|
|
WeakAurasSaved.DruidHots[GUID][name] = C_Timer.NewTimer(dur, function() WeakAuras.ScanEvents("DRUID_HOTS_REMOVE_HOT", GUID, name) end)
|
|
end
|
|
index = index + 1
|
|
if index > 20 then break end
|
|
end
|
|
if buff == 0 then WeakAurasSaved.DruidHots[GUID] = nil end
|
|
if buff == 1 then WeakAuras.ScanEvents("UPDATE_HOTS") end
|
|
--DevTools_Dump(WeakAurasSaved.DruidHots)
|
|
elseif e == "DRUID_HOTS_REMOVE_HOT" then
|
|
local GUID, bname = ...
|
|
WeakAurasSaved.DruidHots[GUID][bname] = nil
|
|
WeakAuras.ScanEvents("UPDATE_HOTS")
|
|
--DevTools_Dump(WeakAurasSaved.DruidHots)
|
|
elseif e == "UPDATE_HOTS" then
|
|
WeakAurasSaved.DruidHotsTotal = {
|
|
["Rejuvenation"] = 0,
|
|
["Regrowth"] = 0,
|
|
["Lifebloom"] = 0,
|
|
["Wild Growth"] = 0,
|
|
["Spring Blossoms"] = 0,
|
|
["Grove Tending"] = 0,
|
|
["Rejuvenation (Germination)"] = 0,
|
|
}
|
|
for k,v in pairs(WeakAurasSaved.DruidHots) do
|
|
for k2, v2 in pairs(v) do
|
|
--print(k2)
|
|
WeakAurasSaved.DruidHotsTotal[k2] = WeakAurasSaved.DruidHotsTotal[k2] + 1
|
|
end
|
|
end
|
|
--DevTools_Dump(WeakAurasSaved.DruidHotsTotal)
|
|
end
|
|
end
|
|
|
|
--DISPLAY
|
|
function()
|
|
return WeakAurasSaved.DruidHotsTotal["Grove Tending"]
|
|
end
|
|
|
|
--INIT
|
|
aura_env.hots = {
|
|
["Rejuvenation"] = 1,
|
|
["Regrowth"] = 1,
|
|
["Lifebloom"] = 1,
|
|
["Wild Growth"] = 1,
|
|
["Spring Blossoms"] = 1,
|
|
["Grove Tending"] = 1,
|
|
["Rejuvenation (Germination)"] = 1,
|
|
} |