I'm not sure exactly what you're asking. This code
Code:
local start, duration, enabled = GetSpellCooldown("Overpower", BOOKTYPE_SPELL);
-- <... some code... >
local start, duration, enabled = GetSpellCooldown("Revenge", BOOKTYPE_SPELL);
won't generate an error, but it will overwrite the old values of
start,
duration, and
enabled, so be sure you're done with them. If you want to make multiple calls with the same variable name, you'd want to do
Code:
local start, duration, enabled = GetSpellCooldown("Overpower", BOOKTYPE_SPELL);
-- code to handle overpower
start, duration, enabled = GetSpellCooldown("Revenge", BOOKTYPE_SPELL);
-- code to handle revenge
-- etc
although if you'll see below, you don't even need the
, duration, enabled part.
I'm not certain
enabled means what you think it means. Make sure you always
read the documentation on functions you use so that you don't spend hours chasing down what you
think is a bug but what is
actually you grabbing the wrong argument.
enabled
Number - 0 if the spell is active (Stealth, Shadowmeld, Presence of Mind, etc) and the cooldown will begin as soon as the spell is used/cancelled; 1 otherwise.
|
It sounds like
enabled marks when a 'buff' is active whose termination will result in a cooldown. Just check startTime - if it's '0', the spell has no cooldown.