Only tested this a little bit but works fine so far. Use custom/event type.
Events: SPELL_UPDATE_COOLDOWN,UNIT_SPELLCAST_START,UNIT_SPELLCAST_STOP,UNIT_SPELLCAST_INTERRUPTED, UNIT_SPELLCAST_DELAYED
Custom Trigger:
Code:
function(event,...)
local TOLERANCE=0.400
--local TOLERANCE=GetCVar("maxSpellStartRecoveryoffset")/1000
if event=="SPELL_UPDATE_COOLDOWN" then
elseif event=="UNIT_SPELLCAST_START" or event=="UNIT_SPELLCAST_DELAYED" then
if ...~="player" then return end
local name,_,text,icon,startTime,expTime=UnitCastingInfo("player")
WA_castexp=expTime and (expTime/1000-TOLERANCE) or 0
WA_castdur=expTime and (WA_castexp-(startTime/1000)) or 0
elseif event=="UNIT_SPELLCAST_STOP" or event=="UNIT_SPELLCAST_INTERRUPTED" then
if ...~="player" then return end
WA_castexp=0
WA_castdur=0
end
local startTime,duration=GetSpellCooldown(61304)
WA_gcdexp=startTime+duration-TOLERANCE
WA_gcddur=duration-TOLERANCE
WA_castexp=WA_castexp or 0
WA_castdur=WA_castdur or 0
local now=GetTime()
return WA_gcdexp-now>0 or WA_castexp-now>0
end
Hide: Custom
Custom Untrigger:
Code:
function(event,...)
if event=="SPELL_UPDATE_COOLDOWN" then
return true
elseif event=="UNIT_SPELLCAST_START" or event=="UNIT_SPELLCAST_DELAYED" then
return ...=="player"
elseif event=="UNIT_SPELLCAST_STOP" or event=="UNIT_SPELLCAST_INTERRUPTED" then
return ...=="player"
end
end
Duration Info:
Code:
function()
if WA_gcdexp>WA_castexp then
return WA_gcddur,WA_gcdexp
else
return WA_castdur,WA_castexp
end
end