Thread Tools Display Modes
06-14-24, 07:43 AM   #1
MinguasBeef
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 55
[ClassicCata] Calculating when the next dot tick will be for debuff

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.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » [ClassicCata] Calculating when the next dot tick will be for debuff

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off