m
no edit summary
(→Notes) |
mNo edit summary |
||
| Line 2: | Line 2: | ||
Retrieves the cooldown data of the spell specified. | Retrieves the cooldown data of the spell specified. | ||
start, duration, enabled = GetSpellCooldown(spellName or | start, duration, enabled = GetSpellCooldown(spellName or slotID, "bookType"); | ||
==Arguments== | ==Arguments== | ||
:;spellName : String - name of the spell to retrieve cooldown data for. | :;spellName : String - name of the spell to retrieve cooldown data for. | ||
:; | :;slotID : Number - Valid values are 1 through total number of spells in the spellbook on all pages and all tabs, ignoring empty slots. | ||
:;bookType : String - BOOKTYPE_SPELL or BOOKTYPE_PET depending on whether you wish to query the player or pet spellbook. | :;bookType : String - BOOKTYPE_SPELL or BOOKTYPE_PET depending on whether you wish to query the player or pet spellbook. | ||
| Line 15: | Line 15: | ||
==Example== | ==Example== | ||
local start, duration, enabled = GetSpellCooldown("Presence of Mind"); | |||
if enabled == 0 then | if enabled == 0 then | ||
DEFAULT_CHAT_FRAME:AddMessage("Presence of Mind is currently active, use it and wait " .. duration .. " seconds for the next one."); | DEFAULT_CHAT_FRAME:AddMessage("Presence of Mind is currently active, use it and wait " .. duration .. " seconds for the next one."); | ||
| Line 26: | Line 26: | ||
===Result=== | ===Result=== | ||
Checks status of the [[Presence of Mind]] cooldown and outputs the appropriate message to the default chat frame. | Checks status of the [[Presence of Mind]] cooldown and outputs the appropriate message to the default chat frame. | ||
==Example== | |||
local name = GetSpellInfo(28370); | |||
local start, duration, enabled = GetSpellCooldown(name); | |||
etc... | |||
Example of using SpellIDs to retrieve cooldown info | |||
==Notes== | ==Notes== | ||
*The enabled return value allows addons to easily check if the player has used a buff-providing spell (such as Presence of Mind or Nature's Swiftness) without searching through the player's buffs. | *The enabled return value allows addons to easily check if the player has used a buff-providing spell (such as Presence of Mind or Nature's Swiftness) without searching through the player's buffs. | ||
*Values returned by this function are not updated immediately when UNIT_SPELLCAST_SUCCEEDED event is raised. | *Values returned by this function are not updated immediately when UNIT_SPELLCAST_SUCCEEDED event is raised. | ||
*GetSpellCooldown() does not directly accept SpellIDs. You must first retrieve the spell name using GetSpellInfo(spellID) | |||