Merge pull request 'main' (#7) from CiscOH/Bastion:main into main

Reviewed-on: Bastion/Bastion#7
main
4n0n 2 years ago
commit 596e72d80a
  1. 19
      src/Unit/Unit.lua

@ -1125,6 +1125,25 @@ function Unit:IsWithinCone(Target, Angle, Distance, rotation)
return diff <= Angle and self:GetDistance(Target) <= Distance
end
function Unit:GetEmpoweredStage()
local stage = 0
local _, _, _, startTime, _, _, _, spellID, _, numStages = UnitChannelInfo(self:GetOMToken())
if numStages and numStages > 0 then
startTime = startTime / 1000
local currentTime = GetTime()
local stageDuration = 0
for i = 1, numStages do
stageDuration = stageDuration + GetUnitEmpowerStageDuration((self:GetOMToken()), i - 1) / 1000
if startTime + stageDuration > currentTime then
break
end
stage = i
end
end
return stage
end
-- local empowering = {}
-- Bastion.EventManager:RegisterWoWEvent("UNIT_SPELLCAST_EMPOWER_START", function(...)

Loading…
Cancel
Save