Quantcast WoWInterface - View Single Post - CooldownPulse
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
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote