API How to distinguish between Spell CD and GCD?

Hello, I’m trying to get a feel for APIs. As an exercise I would like to implement a WA progress bar (display of the CD of “Wild Growth” - Druid HoT with 6s CD) with custom triggers.

Version WotLK

Progress Bar Original, Trigger 1

Type: Spell (Cooldown/Charges/Count)
Spell: Wild Growth
Show:  On Cooldown

… changed to …

Progress Bar Custom, Trigger 1

Type: Custom
Event Type: Status
Check On: Every Frame

Custom Trigger
  function()
     return GetSpellCooldown("Wild Growth") ~= 0
  end

Duration Info
  function()
     local startTime, duration = GetSpellCooldown("Wild Growth")
     return duration, startTime + duration;
  end

The custom trigger works, but in contrast to the original trigger, it is also triggered by other spells on every GCD. Does anyone have any tips on how to solve this?

Make sure to wrap your code in code tags ``` code ``` or the </> button in the post editor so that the forums don’t butcher your quotes and stuff.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.