Thread: CooldownPulse
View Single Post
01-09-15, 07:39 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You're probably running into the same problem I recently solved in CoolLine, which I'm now maintaining. Since Cataclysm, and much much more in WoD, a spell isn't always a spell. A single spell ID can be any of a bunch of different spells at any given time depending on your spec, talents, and/or glyphs.

If you're using GetSpellBaseCooldown to determine which spells have cooldowns, then for spells that report no cooldown that way, you'll need to do another check to see if the current spell doesn't match the base spell for that ID, and if not, use tooltip scanning to read the current spell's tooltip and look for cooldown info:

Code:
local spellName = GetSpellBookItemName(index, bookType)
local slotType, spellID = GetSpellBookItemInfo(index, bookType)
local cd = GetSpellBaseCooldown(spellID)
if cd then
    -- Normal non-morphing spell with a cooldown.
elseif spellName ~= GetSpellInfo(spellID) then
    -- Morphing spell, use SetSpellBookItem and tooltip scanning to look for a cooldown.
    -- Useful global strings: SPELL_RECAST_TIME_MIN, SPELL_RECAST_TIME_SEC
end
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote