View Single Post
02-14-15, 02:47 PM   #1
dihavs
A Murloc Raider
Join Date: Feb 2015
Posts: 5
(Weakauras) Duration info raid/party

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

Last edited by dihavs : 02-14-15 at 02:50 PM.
  Reply With Quote