|
|
@ -428,6 +428,25 @@ function Unit:GetCastingOrChannelingSpell() |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Unit:GetEmpowerStage() |
|
|
|
|
|
|
|
local stage = 0 |
|
|
|
|
|
|
|
local _, _, _, startTime, _, _, _, spellID, _, totalStages = UnitChannelInfo(self:GetOMToken()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if totalStages and totalStages > 0 then |
|
|
|
|
|
|
|
startTime = startTime / 1000 |
|
|
|
|
|
|
|
local currentTime = GetTime() |
|
|
|
|
|
|
|
local stageDuration = 0 |
|
|
|
|
|
|
|
for i = 1, totalStages do |
|
|
|
|
|
|
|
stageDuration = stageDuration + GetUnitEmpowerStageDuration((self:GetOMToken()), i - 1) / 1000 |
|
|
|
|
|
|
|
if startTime + stageDuration > currentTime then |
|
|
|
|
|
|
|
break -- Break early so we don't keep checking, we haven't hit this stage yet |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
stage = i |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
return stage |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
-- Get the end time of the cast or channel |
|
|
|
-- Get the end time of the cast or channel |
|
|
|
---@return number |
|
|
|
---@return number |
|
|
|
function Unit:GetCastingOrChannelingEndTime() |
|
|
|
function Unit:GetCastingOrChannelingEndTime() |
|
|
|