Please help edit this code for Mind Blast Cooldown Please
Hey everyone Happy New Year!
I been using this lua code that works for most of my spells as a shadow priest. It will change the bar meter color to ( whatever color you choose in WeakAuras2 ) by setting the warning time. So if I set the warning time to 3 then the bar meter will change color when there is 3 seconds left on that buff or debuff.
My problem is it won't work for Mind Blast cause it's not a buff or a debuff that appears on target or player. It's just a cooldown after it's been cast. I only changed the spell name to Mind Blast, Player HARMFUL to HELPFUL, "target" to "player"
function(progress, r1, g1, b1, a1, r2, g2, b2, a2)
-- Set the debuff and threshold time here:
local debuff_name, warning_time = "Mind Blast", 3
local _,_,_,_,_,_,expires, etc = UnitDebuff("player", debuff_name, nil, "PLAYER|HELPFUL")
if expires ~= nil then
local time_left = expires - GetTime()
if time_left < warning_time then
return r2, g2, b2, a2
end
end
return r1,g1,b1, a1
end
Can anyone edit this lua code the right way to make it work for the Mind Blast cooldown please?
__________________
The Maddness Within lua
Last edited by EvilMaddness : 01-01-16 at 07:30 PM.
|