I'm in the process of modifying an aura where I've combined elements from different ones I like (I'm not good at creating my own) and I need help with the finishing touches π
I'm struggling with modifying a custom trigger that runs the calculations behind my co-tanks' vengeance as well as my own both in terms of value and percentage (of max potential value)
I'm quite certain the problem lies in the ..
- Trigger Event(s):
which is currently set to: TRIGGER:2 UNIT_MAXHEALTH:player
and ..
- The Custom Trigger:
if event == "STATUS" or event == "OPTIONS" then
local _, _, _, _, duration, expirationTime = WA_GetUnitAura("player", 132365, "HELPFUL")
local data = C_UnitAuras.GetPlayerAuraBySpellID(132365)
local duration = data and data.duration or 0
local expirationTime = data and data.expirationTime or 0
local value = data and data.points and data.points[1] or 0
local total = UnitHealthMax("player")
local percent = Round(value/total*100)
states:Update("", {
icon = C_Spell.GetSpellTexture(132365),
value = value,
total = UnitHealthMax("player"),
percent = percent,
duration = duration,
expirationTime = expirationTime,
progressType = "static",
})
end
if event == "TRIGGER" and states[""] then
if watched[""] and watched[""].tooltip1 then
local value = watched[""].tooltip1
local total = states:Get("", "total")
local percent = Round(value/total*100)
states:Update("", {
value = value,
percent = percent,
duration = watched[""].duration,
expirationTime = watched[""].expirationTime,
})
else
states:Update("", {
value = 0,
percent = 0,
duration = 0,
expirationTime = 0,
})
end
elseif event == "UNIT_MAXHEALTH" and states[""] then
local value = states:Get("", "value") or 0
local total = UnitHealthMax("player")
local percent = Round(value/total*100)
states:Update("", {
percent = percent,
total = total
})
end
end
I want the code to run on the unit specified from the dynamic group's 2nd trigger, which are tied to two different child auras.
I hope I've communicated the problem clearly enough for someone to understand what i'm trying to accomplish if you want to help don't hesitate to ping me or reach out directly, thanks π
