Elemental WA Help: Mana Percentage and Earth/Fire Elemental Duration
I'm having trouble with two things, someone might help.
First off I would like to make a Manabar, but have trouble to calculate the current Manapercentage. I work with the normal custom function:
function()
local p = math.max(0, UnitMana("player")) / math.max(1, UnitManaMax("player")) * 100;
return string.format("%.f", p) .. "%%";
end
and it's not working. I guess you would have to work with PowerType to actually get the Mana and not the Maelstrom.
Secondly I'm not sure how to track the duration of my Fire/Earth Elemental. I'm working on a WA showing normal Icon if off Cooldown, desaturate Icon with CD when on CD, but I'd like to add the normal saturate Icon with a green duration time if the Elemental is out. Easily done for all my Totems, but the Elementals because i can't keep track of them as a Totem.