View Single Post
08-25-23, 12:43 PM   #1
Benalish
A Flamescale Wyrmkin
 
Benalish's Avatar
Join Date: Dec 2012
Posts: 123
Ignoring global cooldown

Greetings,
I've created an icon that lights up when a spell is ready to use. Sometimes though, the icon blinks (disappears for a moment): I think it's a problem due to the global cooldown. I tried to work around this problem like this:

Lua Code:
  1. local usable, _ = IsUsableSpell(spellName)
  2. local start, duration = GetSpellCooldown(spellName)
  3. local ignore, gcd = GetSpellCooldown(61304)
  4. if (usable) then
  5.      if (duration == 0 and (start < ignore)) or (duration <= gcd) then --ignore global cooldown
  6.           --show icon
  7.      end
  8. else --hide icon
  9. end

Is there a better method?

Last edited by Benalish : 08-25-23 at 02:07 PM.
  Reply With Quote