Im working on a weakaura that determines if Cold Heart would deal more than 20 stacks of completely unbuffed worth of damage (due to mastery and/or strength buffs). I don't particularly want to track how much damage it will deal, just that its more than 20 stacks worth of damage, and i'd like it to dynamically update so i dont have to compare against a fixed number, because as I gain gear it would require constant updates.
Currently the code for this is as follows, but it does not work:
Code:
function KamiUI.coldHeartCappedStacks()
--print(coldHeart20stacks);
return coldHeart20stacks ~= nil and time()-coldHeart20stacks > 5;
end
function KamiUI.ColdHeartWorthCasting()
local name,_,_,chCount = UnitBuff("player","Cold Heart") ;
if (chCount == nil)then
coldHeart20stacks = nil;
return false;
end
local base, current, posBuff, negBuff = UnitStat("player", 1);
--local effective = base + posBuff + negBuff;
--print(base.." "..posBuff.." "..negBuff)
KamiUI.KamiLog(current .." "..base);
if (chCount == 20 and coldHeart20stacks == nil)then
coldHeart20stacks = time();
end
if (current * 2 * chCount > base * 2 * 20 or KamiUI.coldHeartCappedStacks()) then --times 2 for str-> attack Power conversion
return true;
end
return false;
end