I'm trying to track the time remaining of Lifebloom casted on raidtargets but can't seem to get this working, maybe I just got off on the wrong foot and did it all wrong. Any help would be appreciated!
Code:
function()
if not IsInGroup() then
local has_lifebloom, _, _, _, _, _, expirationTime = UnitBuff("player", "Lifebloom", nil, "PLAYER")
if has_lifebloom then
return expirationTime or 0
end
elseif IsInRaid() then
local group_size = GetNumGroupMembers()
for i=1, group_size do
local has_lifebloom, _, _, _, _, _, expirationTime = UnitBuff("raid"..i , "Lifebloom", nil, "PLAYER")
if has_lifebloom then
return expirationTime or 0
end
end
else
local group_size = GetNumGroupMembers() - 1
for i=1, group_size do
local has_lifebloom, _, _, _, _, _, expirationTime = UnitBuff("party"..i , "Lifebloom", nil, "PLAYER")
if has_lifebloom then
return expirationTime or 0
end
end
local has_lifebloom, _, _, _, _, _, expirationTime = UnitBuff("player", "Lifebloom", nil, "PLAYER")
if has_lifebloom then
return expirationTime or 0
end
end
end