Update ChannelDinger to be a little more reliable

This commit is contained in:
2024-08-24 22:43:21 +02:00
parent 3b6b9995cf
commit 9cb48bd6e6
3 changed files with 29 additions and 24 deletions

View File

@@ -1,14 +1,26 @@
aura_env.timer = 0
aura_env.totalTicks = 5
aura_env.totalTicks = 6
aura_env.player = UnitGUID("player")
aura_env.tick = ReactiveValue.new(0)
aura_env.statee = ReactiveValue.new(0)
-- Say...
-- 0 - none
-- 1 - channeling
-- 2 - lasttick
function aura_env.EstimateCastTime()
local haste = GetCombatRatingBonus(20)
-- 6 is the base cast time of drain soul
return 6 / (1 + haste / 100)
end
function aura_env.EstimateSemiFinalTick()
local castTime = aura_env.EstimateCastTime()
return (castTime / (aura_env.totalTicks)) * aura_env.totalTicks - 1
end
aura_env.statee:onChange(function(newstate)
-- print("newstate ".. newstate)
if newstate == 1 then
-- print("resetting ticks")
aura_env.tick:set(0)
end
if newstate == 2 then
WeakAuras.ScanEvents("PLAY_SOUND", "Interface\\AddOns\\WeakAuras\\Media\\Sounds\\RobotBlip.ogg")
end
end)
aura_env.tick:onChange(function(ticks)
-- print("ticks " .. ticks)
if ticks == aura_env.totalTicks - 1 then
aura_env.statee:set(2)
end
end)