I am trying to figure out how to determine when the next dot tick will occur on a debuff.
The issue i'm running into is how to handle haste.
Currently this is what I have to determine the time until next tick for living bomb (assuming only 1 living bomb on me)
I saw that in the cata classic client there is a UnitSpellHaste, but it is always returning 0. I am wondering if it only applies to modifiers from buffs like bloodlust and doesn't take into consideration haste from items.
Code:
for i = 1, 40 do
local name, _, _, _, duration, expirationTime, _, _, _, spellId = UnitDebuff("player", i)
if (name == "Living Bomb") then
local timeDebuffApplied = expirationTime - duration
local tickInterval = 3 --(seconds) This isn't accurate if unit has any haste
local timeElapsed = GetTime() - timeDebuffApplied
local timeTowardsNextTick = math.fmod(timeElapsed, tickInterval)
local timeUntilNextTick = tickInterval - timeTowardsNextTick
end
end
Any ideas?
The only thing I can think of to rig it up is to assume 0% haste until the first tick occurs and then recalculate based off that and storing the haste of that unit in some table to do a lookup against for future applications of spells. I'm really hoping there is a better approach.