Spell & Ability API (Retail — Patch 12.0.0)
Comprehensive reference for all Spell, SpellBook, ActionBar, Cooldown, Totem, Shapeshifting, and related APIs. Covers spell information, cooldowns, usability, range checking, spellbook navigation, action bar slot management, spell procs, diminishing returns, assisted combat, and global spell functions.
Source of truth: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#Spell
SpellBook: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#SpellBook
ActionBar: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#ActionBar
Current as of: Patch 12.0.0 (Build 65655) — January 28, 2026
Scope: Retail only. No deprecated or removed functions.
Scope
This skill covers these API systems:
- C_Spell — Core spell information, cooldowns, charges, usability, range, type checks
- C_SpellBook — Spellbook navigation, skill lines, slot queries, spell lookup
- C_ActionBar — Action bar slot management, state queries, bar pages, overrides
- C_SpellActivationOverlay — Spell proc/activation glow detection
- C_SpellDiminish — Diminishing returns tracking for crowd control
- C_CooldownViewer — Cooldown viewer categories and layout
- C_AssistedCombat — Assisted combat (rotation helper) integration
- Totem — Totem query functions (GetTotemInfo, DestroyTotem)
- Shapeshifting — Form/stance functions (GetShapeshiftForm, GetShapeshiftFormInfo)
- Global Spell Functions — CastSpellByName, CastSpellByID, SpellIsTargeting, etc.
When to Use This Skill
Use this skill when you need to:
- Query spell info: name, description, icon, subtext, link, power cost
- Check spell cooldowns, charges, or GCD state
- Determine if a spell is usable, in range, or on cooldown
- Navigate the spellbook: enumerate skill lines, find spell slots, check known spells
- Manage action bars: query action type, usability, cooldown, texture for a slot
- Detect action bar pages, bonus bars, override bars, vehicle bars
- Check for spell procs / activation overlays (glowing buttons)
- Track diminishing returns on crowd control effects
- Query totem state, duration, or destroy totems
- Check or cast shapeshift forms and stances
- Cast spells programmatically (protected functions)
- Handle spell targeting (SpellIsTargeting, SpellTargetUnit, SpellStopCasting)
- Use the assisted combat (rotation helper) system
- Work with flyout menus and multi-cast totem spells
Reference Files
| Reference |
Contents |
| SPELLS-CORE.md |
C_Spell — spell info, cooldowns, charges, usability, range, type checks |
| SPELLBOOK.md |
C_SpellBook — spellbook navigation, skill lines, slot queries |
| ACTIONBAR.md |
C_ActionBar — action bar slots, state, pages, overrides, pet/vehicle bars |
| COOLDOWNS-CASTING.md |
Cooldowns, casting functions, spell targeting, procs, DR, assisted combat |
| TOTEM-SHAPESHIFT.md |
Totem functions, shapeshifting/stances, global spell casting functions |
C_Spell — Core Spell API (Quick Reference)
The C_Spell namespace provides direct access to spell data by spellIdentifier — which can be a spellID (number) or spellName (string).
Wiki: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#Spell
Key Functions
| Function |
Returns |
Description |
C_Spell.GetSpellInfo(spellIdentifier) |
spellInfo table |
Primary spell data (name, icon, castTime, etc.) |
C_Spell.GetSpellName(spellIdentifier) |
name |
Localized spell name |
C_Spell.GetSpellDescription(spellIdentifier) |
description |
Tooltip description text |
C_Spell.GetSpellTexture(spellIdentifier) |
iconID, originalIconID |
Spell icon texture |
C_Spell.GetSpellSubtext(spellIdentifier) |
subtext |
Rank or specialization label |
C_Spell.GetSpellLink(spellIdentifier [, glyphID]) |
spellLink |
Clickable hyperlink |
C_Spell.DoesSpellExist(spellIdentifier) |
spellExists |
Validates a spell ID/name |
C_Spell.GetSpellIDForSpellIdentifier(spellIdentifier) |
spellID |
Resolves spell name → ID |
C_Spell.GetBaseSpell(spellIdentifier [, spec]) |
baseSpellID |
Unwraps overrides to base spell |
C_Spell.GetOverrideSpell(spellIdentifier [, spec [, onlyKnown [, ignoreOverrideID]]]) |
overrideSpellID |
Gets current override for a spell |
Cooldowns & Charges
| Function |
Returns |
Description |
C_Spell.GetSpellCooldown(spellIdentifier) |
spellCooldownInfo |
Start time, duration, enabled, modRate |
C_Spell.GetSpellCooldownDuration(spellIdentifier) |
duration |
Remaining cooldown in seconds |
C_Spell.GetSpellCharges(spellIdentifier) |
chargeInfo |
Charges, maxCharges, start, duration |
C_Spell.GetSpellChargeDuration(spellIdentifier) |
duration |
Charge recharge duration |
C_Spell.GetSpellLossOfControlCooldown(spellIdentifier) |
startTime, duration |
LoC lockout timing |
C_Spell.GetSpellLossOfControlCooldownDuration(spellIdentifier) |
duration |
Remaining LoC duration |
Usability & Range
| Function |
Returns |
Description |
C_Spell.IsSpellUsable(spellIdentifier) |
isUsable, insufficientPower |
Can be cast now? |
C_Spell.IsSpellInRange(spellIdentifier [, targetUnit]) |
inRange |
Target in range? |
C_Spell.SpellHasRange(spellIdentifier) |
hasRange |
Does the spell have range? |
C_Spell.IsSpellDisabled(spellIdentifier) |
disabled |
Is spell disabled? |
C_Spell.GetSpellCastCount(spellIdentifier) |
castCount |
Number of available casts |
Type Checks
| Function |
Returns |
Description |
C_Spell.IsSpellPassive(spellIdentifier) |
isPassive |
Passive ability? |
C_Spell.IsSpellHarmful(spellIdentifier) |
isHarmful |
Offensive spell? |
C_Spell.IsSpellHelpful(spellIdentifier) |
isHelpful |
Beneficial spell? |
C_Spell.IsAutoAttackSpell(spellIdentifier) |
isAutoAttack |
Auto-attack? |
C_Spell.IsAutoRepeatSpell(spellIdentifier) |
isAutoRepeat |
Auto-repeat (e.g., Auto Shot)? |
C_Spell.IsRangedAutoAttackSpell(spellIdentifier) |
isRangedAutoAttack |
Ranged auto-attack? |
C_Spell.IsCurrentSpell(spellIdentifier) |
isCurrentSpell |
Currently being cast? |
C_Spell.IsConsumableSpell(spellIdentifier) |
consumable |
Consumes a resource on use? |
C_Spell.IsPressHoldReleaseSpell(spellIdentifier) |
isPressHoldRelease |
Empowered spell? |
C_Spell.IsClassTalentSpell(spellIdentifier) |
isClassTalent |
From the talent tree? |
C_Spell.IsPvPTalentSpell(spellIdentifier) |
isPvPTalent |
PvP talent? |
C_Spell.IsSpellCrowdControl(spellIdentifier) |
isCrowdControl |
CC effect? |
C_Spell.IsSpellImportant(spellIdentifier) |
isImportant |
Marked as important? |
C_Spell.IsPriorityAura(spellID) |
isHighPriority |
High-priority display aura? |
C_Spell.IsSelfBuff(spellID) |
hasSelfEffectsOnly |
Only affects self? |
C_Spell.IsExternalDefensive(spellID) |
isExternalDefensive |
External defensive? |
Power Cost & Data
| Function |
Returns |
Description |
C_Spell.GetSpellPowerCost(spellIdentifier) |
powerCosts table |
Resources required to cast |
C_Spell.GetSpellLevelLearned(spellIdentifier) |
levelLearned |
Level at which spell is learned |
C_Spell.GetSpellSkillLineAbilityRank(spellIdentifier) |
rank |
Rank for profession recipes |
C_Spell.GetSpellMaxCumulativeAuraApplications(spellID) |
cumulativeAura |
Max stacks |
C_Spell.GetAuraStatChanges(spellID) |
healthChange, powerTypeChanges |
Stat effects of an aura |
C_Spell.GetDeadlyDebuffInfo(spellIdentifier) |
deadlyDebuffInfo |
Deadly debuff display data |
C_Spell.GetSpellQueueWindow() |
result |
Spell queue window (ms) |
Spell Manipulation
| Function |
Returns |
Description |
C_Spell.CancelSpellByID(spellID) |
— |
Cancel a channeled/cast spell |
C_Spell.PickupSpell(spellIdentifier) |
— |
Attach spell to cursor |
C_Spell.RequestLoadSpellData(spellIdentifier) |
— |
Request async spell data load |
C_Spell.IsSpellDataCached(spellIdentifier) |
isCached |
Is data ready for query? |
C_Spell.EnableSpellRangeCheck(spellIdentifier, enable) |
— |
Enable/disable range checking |
C_Spell.SetSpellAutoCastEnabled(spellIdentifier, enabled) |
— |
Toggle pet spell autocast |
C_Spell.ToggleSpellAutoCast(spellIdentifier) |
— |
Toggle pet spell autocast |
C_Spell.GetSpellAutoCast(spellIdentifier) |
autoCastAllowed, autoCastEnabled |
Autocast state |
Visibility & Display
| Function |
Returns |
Description |
C_Spell.GetVisibilityInfo(spellID, visibilityType) |
hasCustom, alwaysShowMine, showForMySpec |
Aura display visibility rules |
C_Spell.GetSpellDisplayCount(spellIdentifier [, maxDisplayCount [, replacementString]]) |
displayCount |
Display count for stacking |
Targeting & Trade
| Function |
Returns |
Description |
C_Spell.TargetSpellIsEnchanting() |
isEnchanting |
Current targeting spell is enchant? |
C_Spell.TargetSpellJumpsUpgradeTrack() |
jumpsUpgradeTrack |
Upgrade track jump? |
C_Spell.TargetSpellReplacesBonusTree() |
result |
Replaces bonus loot tree? |
C_Spell.GetSpellTradeSkillLink(spellIdentifier) |
spellLink |
Trade skill recipe link |
C_SpellBook — Spellbook Navigation (Quick Reference)
The C_SpellBook namespace manages the spellbook UI, skill lines, and per-slot queries. Functions take (spellBookItemSlotIndex, spellBookItemSpellBank) where spellBank is Enum.SpellBookSpellBank.Player or Enum.SpellBookSpellBank.Pet.
Wiki: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#SpellBook
Key Functions
| Function |
Returns |
Description |
C_SpellBook.GetNumSpellBookSkillLines() |
numSkillLines |
Number of spellbook tabs |
C_SpellBook.GetSpellBookSkillLineInfo(skillLineIndex) |
skillLineInfo |
Tab name, icon, offset, count |
C_SpellBook.GetSpellBookItemInfo(slot, bank) |
spellBookItemInfo |
Detailed spell/flyout info for a slot |
C_SpellBook.GetSpellBookItemType(slot, bank) |
itemType, actionID, spellID |
Type: SPELL, FLYOUT, FUTURESPELL, PETACTION |
C_SpellBook.GetSpellBookItemName(slot, bank) |
name, subName |
Localized name of slot |
C_SpellBook.GetSpellBookItemTexture(slot, bank) |
iconID |
Icon for slot |
C_SpellBook.GetSpellBookItemDescription(slot, bank) |
description |
Tooltip text |
C_SpellBook.GetSpellBookItemLink(slot, bank [, glyphID]) |
spellLink |
Hyperlink |
C_SpellBook.GetSpellBookItemLevelLearned(slot, bank) |
levelLearned |
Level learned |
C_SpellBook.FindSpellBookSlotForSpell(spellIdentifier [, includeHidden [, includeFlyouts [, includeFutureSpells [, includeOffSpec]]]]) |
slotIndex, bank |
Find slot for a spell |
C_SpellBook.IsSpellKnown(spellID [, spellBank]) |
isKnown |
Does the player know the spell? |
C_SpellBook.IsSpellInSpellBook(spellID [, spellBank [, includeOverrides]]) |
isInSpellBook |
Is it in the spellbook? |
C_SpellBook.IsSpellKnownOrInSpellBook(spellID [, spellBank [, includeOverrides]]) |
isKnownOrInSpellBook |
Known OR in spellbook? |
Slot Usability & State
| Function |
Returns |
Description |
C_SpellBook.IsSpellBookItemUsable(slot, bank) |
isUsable, insufficientPower |
Can cast from this slot? |
C_SpellBook.IsSpellBookItemPassive(slot, bank) |
isPassive |
Passive ability? |
C_SpellBook.IsSpellBookItemOffSpec(slot, bank) |
isOffSpec |
Belongs to inactive spec? |
C_SpellBook.IsSpellBookItemHarmful(slot, bank) |
isHarmful |
Harmful to targets? |
C_SpellBook.IsSpellBookItemHelpful(slot, bank) |
isHelpful |
Helpful to targets? |
C_SpellBook.IsSpellBookItemInRange(slot, bank [, targetUnit]) |
inRange |
In range of target? |
C_SpellBook.SpellBookItemHasRange(slot, bank) |
hasRange |
Has range requirement? |
C_SpellBook.IsAutoAttackSpellBookItem(slot, bank) |
isAutoAttack |
Auto-attack entry? |
C_SpellBook.IsRangedAutoAttackSpellBookItem(slot, bank) |
isRangedAutoAttack |
Ranged auto-attack? |
C_SpellBook.IsClassTalentSpellBookItem(slot, bank) |
isClassTalent |
Class talent? |
C_SpellBook.IsPvPTalentSpellBookItem(slot, bank) |
isPvPTalent |
PvP talent? |
Slot Cooldowns & Charges
| Function |
Returns |
Description |
C_SpellBook.GetSpellBookItemCooldown(slot, bank) |
spellCooldownInfo |
Cooldown for slot |
C_SpellBook.GetSpellBookItemCooldownDuration(slot, bank) |
duration |
Remaining cooldown |
C_SpellBook.GetSpellBookItemCharges(slot, bank) |
chargeInfo |
Charge info |
C_SpellBook.GetSpellBookItemChargeDuration(slot, bank) |
duration |
Charge recharge time |
C_SpellBook.GetSpellBookItemCastCount(slot, bank) |
castCount |
Available casts |
C_SpellBook.GetSpellBookItemLossOfControlCooldown(slot, bank) |
startTime, duration |
LoC lockout |
C_SpellBook.GetSpellBookItemLossOfControlCooldownDuration(slot, bank) |
duration |
Remaining LoC |
Spell Lookup
| Function |
Returns |
Description |
C_SpellBook.FindBaseSpellByID(spellID) |
baseSpellID |
Resolve to base spell |
C_SpellBook.FindSpellOverrideByID(spellID) |
overrideSpellID |
Get current override |
C_SpellBook.GetCurrentLevelSpells(level) |
spellIDs |
Spells learned at a level |
C_SpellBook.GetSkillLineIndexByID(skillLineID) |
skillIndex |
Skill line index by ID |
C_SpellBook.HasPetSpells() |
numPetSpells, petNameToken |
Does the pet have spells? |
C_SpellBook.ContainsAnyDisenchantSpell() |
contains |
Has disenchant? |
C_SpellBook.FindFlyoutSlotBySpellID(spellID) |
flyoutSlot |
Find flyout containing spell |
Other Slot Operations
| Function |
Returns |
Description |
C_SpellBook.CastSpellBookItem(slot, bank [, targetSelf]) |
— |
Cast from spellbook slot |
C_SpellBook.PickupSpellBookItem(slot, bank) |
— |
Pick up spell to cursor |
C_SpellBook.GetSpellBookItemAutoCast(slot, bank) |
autoCastAllowed, autoCastEnabled |
Autocast state |
C_SpellBook.SetSpellBookItemAutoCastEnabled(slot, bank, enabled) |
— |
Set autocast |
C_SpellBook.ToggleSpellBookItemAutoCast(slot, bank) |
— |
Toggle autocast |
C_SpellBook.GetSpellBookItemPowerCost(slot, bank) |
powerCosts |
Resource cost |
C_SpellBook.GetSpellBookItemTradeSkillLink(slot, bank) |
spellLink |
Trade skill link |
C_SpellBook.GetSpellBookItemSkillLineIndex(slot, bank) |
skillLineIndex |
Which skill line tab |
C_ActionBar — Action Bar Slot Management (Quick Reference)
The C_ActionBar namespace manages the 120+ action bar slots. Actions are referenced by actionID (1–180) or slotID.
Wiki: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#ActionBar
Action Slot Layout
| Bar |
Slots |
Notes |
| Main bar |
1–12 |
Always visible |
| Bar 2 (Bottom Left) |
13–24 |
Toggled via settings |
| Bar 3 (Bottom Right) |
25–36 |
Toggled via settings |
| Bar 4 (Right) |
37–48 |
Toggled via settings |
| Bar 5 (Right 2) |
49–60 |
Toggled via settings |
| Bars 6–10 |
61–120 |
Additional bars |
| StanceBar pages |
121–180 |
Stance-specific bars |
Core Queries
| Function |
Returns |
Description |
C_ActionBar.HasAction(actionID) |
hasAction |
Is something in this slot? |
C_ActionBar.GetSpell(actionID) |
spellID |
Spell in slot (nil if not a spell) |
C_ActionBar.GetActionTexture(actionID) |
textureFileID |
Icon for the action |
C_ActionBar.GetActionText(actionID) |
text |
Display text (macros) |
C_ActionBar.GetActionCooldown(actionID) |
cooldownInfo |
Cooldown data |
C_ActionBar.GetActionCooldownDuration(actionID) |
duration |
Remaining cooldown |
C_ActionBar.GetActionChargeDuration(actionID) |
duration |
Charge recharge time |
C_ActionBar.GetActionCharges(actionID) |
chargeInfo |
Charge state |
C_ActionBar.IsUsableAction(actionID) |
isUsable, isLackingResources |
Can use? |
C_ActionBar.IsActionInRange(actionID [, target]) |
isInRange |
Target in range? |
Action State Checks
| Function |
Returns |
Description |
C_ActionBar.IsCurrentAction(actionID) |
isCurrentAction |
Being cast now? |
C_ActionBar.IsAttackAction(actionID) |
isAttackAction |
Auto-attack? |
C_ActionBar.IsAutoRepeatAction(actionID) |
isAutoRepeatAction |
Auto-repeat? |
C_ActionBar.IsConsumableAction(actionID) |
isConsumableAction |
Consumable? |
C_ActionBar.IsEquippedAction(actionID) |
isEquippedAction |
Equipped item? |
C_ActionBar.IsStackableAction(actionID) |
isStackableAction |
Stackable item? |
C_ActionBar.IsItemAction(actionID) |
isItemAction |
Item action? |
C_ActionBar.IsHarmfulAction(actionID, useNeutral) |
isHarmful |
Harmful? |
C_ActionBar.IsHelpfulAction(actionID, useNeutral) |
isHelpful |
Helpful? |
C_ActionBar.IsInterruptAction(slotID) |
isInterruptAction |
Interrupt? |
C_ActionBar.IsAssistedCombatAction(slotID) |
isAssistedCombat |
Assisted combat action? |
C_ActionBar.HasRangeRequirements(actionID) |
hasRangeRequirements |
Has range? |
Bar Pages & Overrides
| Function |
Returns |
Description |
C_ActionBar.GetActionBarPage() |
currentPage |
Current page (1–6) |
C_ActionBar.SetActionBarPage(pageIndex) |
— |
Switch page |
C_ActionBar.GetBonusBarIndex() |
bonusBarIndex |
Class-specific bonus bar |
C_ActionBar.GetBonusBarOffset() |
bonusBarOffset |
Offset for bonus bar |
C_ActionBar.HasBonusActionBar() |
hasBonusActionBar |
Has bonus bar? |
C_ActionBar.GetOverrideBarIndex() |
overrideBarIndex |
Override bar index |
C_ActionBar.GetOverrideBarSkin() |
textureFileID |
Override bar texture |
C_ActionBar.HasOverrideActionBar() |
hasOverrideActionBar |
Override active? |
C_ActionBar.GetExtraBarIndex() |
extraBarIndex |
Extra action button bar |
C_ActionBar.HasExtraActionBar() |
hasExtraActionBar |
Extra bar active? |
C_ActionBar.GetVehicleBarIndex() |
vehicleBarIndex |
Vehicle bar index |
C_ActionBar.HasVehicleActionBar() |
hasVehicleActionBar |
In vehicle? |
C_ActionBar.GetTempShapeshiftBarIndex() |
tempShapeshiftBarIndex |
Temp shapeshift bar |
C_ActionBar.HasTempShapeshiftActionBar() |
hasTempShapeshiftActionBar |
Has temp form bar? |
C_ActionBar.GetMultiCastBarIndex() |
multiCastBarIndex |
Multi-cast bar (totem) |
C_ActionBar.ShouldOverrideBarShowHealthBar() |
showHealthBar |
Show health bar? |
C_ActionBar.ShouldOverrideBarShowManaBar() |
showManaBar |
Show mana bar? |
C_ActionBar.IsPossessBarVisible() |
isPossessBarVisible |
Possess bar visible? |
Display & Count
| Function |
Returns |
Description |
C_ActionBar.GetActionDisplayCount(actionID [, maxDisplayCount [, replacementString]]) |
displayCount |
Display count for stacking |
C_ActionBar.GetActionUseCount(actionID) |
count |
Remaining uses |
C_ActionBar.GetActionAutocast(actionID) |
autoCastAllowed, autoCastEnabled |
Autocast state |
C_ActionBar.GetActionLossOfControlCooldown(actionID) |
startTime, duration |
LoC cooldown |
C_ActionBar.GetActionLossOfControlCooldownDuration(actionID) |
duration |
Remaining LoC |
Spell ↔ Action Lookups
| Function |
Returns |
Description |
C_ActionBar.FindSpellActionButtons(spellID) |
slots |
Find all slots containing a spell |
C_ActionBar.HasSpellActionButtons(spellID) |
hasButtons |
Is spell on any bar? |
C_ActionBar.IsOnBarOrSpecialBar(spellID) |
isOnBar |
On any bar or special bar? |
C_ActionBar.FindFlyoutActionButtons(flyoutID) |
slots |
Find flyout button slots |
C_ActionBar.HasFlyoutActionButtons(flyoutID) |
hasFlyoutButtons |
Flyout on bar? |
C_ActionBar.FindPetActionButtons(petActionID) |
slots |
Pet action on bar? |
C_ActionBar.HasPetActionButtons(petActionID) |
hasPetButtons |
Pet action exists? |
C_ActionBar.FindAssistedCombatActionButtons() |
slots |
Assisted combat slots |
C_ActionBar.HasAssistedCombatActionButtons() |
hasButtons |
Has assisted combat? |
C_ActionBar.GetPetActionPetBarIndices(petActionID) |
slots |
Pet bar indices |
C_ActionBar.HasPetActionPetBarIndices(petActionID) |
hasIndices |
Has pet bar indices? |
Profession & Gear
| Function |
Returns |
Description |
C_ActionBar.GetProfessionQuality(actionID) |
quality |
Crafting result quality |
C_ActionBar.GetProfessionQualityInfo(actionID) |
info |
Quality info table |
C_ActionBar.GetItemActionOnEquipSpellID(actionID) |
onEquipSpellID |
On-equip spell ID |
C_ActionBar.IsEquippedGearOutfitAction(slotID) |
isEquipped |
Gear outfit equipped? |
C_ActionBar.GetBonusBarIndexForSlot(slotID) |
bonusBarIndex |
Bonus bar for slot |
Slot Management
| Function |
Returns |
Description |
C_ActionBar.PutActionInSlot(slotID) |
— |
Place cursor action into slot |
C_ActionBar.RegisterActionUIButton(checkboxFrame, actionID, cooldownFrame) |
— |
Register frame for updates |
C_ActionBar.UnregisterActionUIButton(checkboxFrame) |
— |
Unregister frame |
C_ActionBar.ForceUpdateAction(slotID) |
— |
Force action update |
C_ActionBar.EnableActionRangeCheck(actionID, enable) |
— |
Enable/disable range check |
C_ActionBar.ToggleAutoCastPetAction(slotID) |
— |
Toggle pet autocast |
C_ActionBar.IsAutoCastPetAction(slotID) |
isAutoCastPetAction |
Pet autocast? |
C_ActionBar.IsEnabledAutoCastPetAction(slotID) |
isEnabled |
Pet autocast enabled? |
Auxiliary Namespaces (Quick Reference)
C_SpellActivationOverlay — Spell Procs
Detects when a spell has a visual activation overlay (glowing border / proc alert).
| Function |
Returns |
Description |
C_SpellActivationOverlay.IsSpellOverlayed(spellID) |
isOverlayed |
Spell has active proc glow? |
Wiki: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#SpellActivationOverlay
C_SpellDiminish — Diminishing Returns
Tracks diminishing returns (DR) categories for crowd control and interrupt tracking.
| Function |
Returns |
Description |
C_SpellDiminish.GetAllSpellDiminishCategories([ruleset]) |
categories |
All DR categories |
C_SpellDiminish.GetSpellDiminishCategoryInfo(category) |
categoryInfo |
Info for a DR category |
C_SpellDiminish.IsSystemSupported() |
isSupported |
Is DR tracking available? |
C_SpellDiminish.ShouldTrackSpellDiminishCategory(category, ruleset) |
isTracked |
Should this category be tracked? |
Wiki: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#SpellDiminishUI
C_CooldownViewer — Cooldown Display
Provides categorized cooldown data for the cooldown viewer UI.
| Function |
Returns |
Description |
C_CooldownViewer.GetCooldownViewerCategorySet(category [, allowUnlearned]) |
cooldownIDs |
Cooldowns in a category |
C_CooldownViewer.GetCooldownViewerCooldownInfo(cooldownID) |
cooldownInfo |
Cooldown details |
C_CooldownViewer.GetLayoutData() |
data |
Viewer layout state |
C_CooldownViewer.GetValidAlertTypes(cooldownID) |
validAlertTypes |
Valid alert types for cooldown |
C_CooldownViewer.IsCooldownViewerAvailable() |
isAvailable, failureReason |
Is viewer available? |
C_CooldownViewer.SetLayoutData(data) |
— |
Save layout state |
Wiki: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#CooldownViewer
C_AssistedCombat — Rotation Helper
The Assisted Combat system (new in 12.0) provides suggested spell rotations.
| Function |
Returns |
Description |
C_AssistedCombat.GetActionSpell() |
spellID |
Current action spell suggestion |
C_AssistedCombat.GetNextCastSpell([checkForVisibleButton]) |
spellID |
Next suggested cast |
C_AssistedCombat.GetRotationSpells() |
spellIDs |
All rotation spells |
C_AssistedCombat.IsAvailable() |
isAvailable, failureReason |
Is system available? |
Wiki: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#AssistedCombat
C_LevelLink — Spell Level Lock
Checks if spells or actions are level-locked for scaling content.
| Function |
Returns |
Description |
C_LevelLink.IsActionLocked(actionID) |
isLocked |
Action locked by level? |
C_LevelLink.IsSpellLocked(spellID) |
isLocked |
Spell locked by level? |
Totem Functions
Totem functions query and manage totem/minion slots. Shamans have 4 totem slots; other classes may have totem-style minions (e.g., Death Knight ghouls, mushrooms).
Wiki: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#Totem
| Function |
Returns |
Description |
GetTotemInfo(slot) |
haveTotem, totemName, startTime, duration, icon, modRate, spellID |
Complete totem info |
GetTotemTimeLeft(slot) |
timeLeft |
Remaining duration (seconds) |
GetTotemCannotDismiss(slot) |
cannotDismiss |
Can this totem be dismissed? |
DestroyTotem(slot) |
— |
Destroy totem/minion #protected |
TargetTotem(slot) |
— |
Target the totem |
totem Slot Constants
EARTH_TOTEM_SLOT = 2
FIRE_TOTEM_SLOT = 1
WATER_TOTEM_SLOT = 3
AIR_TOTEM_SLOT = 4
Shapeshifting / Stances
Manages shapeshift forms (Druid forms, Warrior stances, Rogue stealth, Paladin auras, etc.).
Wiki: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#Shapeshifting
Category: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API (Shapeshifting section)
| Function |
Returns |
Description |
GetNumShapeshiftForms() |
numForms |
Number of available forms |
GetShapeshiftForm([flag]) |
index |
Current form (0 = none) |
GetShapeshiftFormID() |
index |
Form ID of current form |
GetShapeshiftFormInfo(index) |
icon, active, castable, spellID |
Info for a form |
GetShapeshiftFormCooldown(index) |
startTime, duration, isActive |
Cooldown for a form |
CancelShapeshiftForm() |
— |
Leave current form #protected |
CastShapeshiftForm(index) |
— |
Enter a form #protected |
Global Spell Casting Functions
These are category-level functions (not namespaced) for casting, targeting, and confirming spells.
Wiki: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API (Spells category)
Casting (Protected)
| Function |
Description |
CastSpell(spellIndex, spellbookType) |
Cast from spellbook by index #protected |
CastSpellByID(spellID [, target]) |
Cast by spell ID #protected |
CastSpellByName(name [, target]) |
Cast by name #protected |
UseAction(slot [, checkCursor [, onSelf]]) |
Use action bar slot #protected |
SpellStopCasting() |
Stop current cast #protected |
Targeting (Protected)
| Function |
Description |
SpellIsTargeting() |
Is a spell waiting for target selection? |
SpellCanTargetUnit(unit) |
Can the pending spell target this unit? |
SpellTargetUnit(unit) |
Cast pending spell on unit #protected |
SpellStopTargeting() |
Cancel pending spell targeting #protected |
SpellTargetItem(item) |
Cast pending spell on item #protected |
SpellCanTargetItem() |
Can pending spell target an item? |
SpellCanTargetItemID() |
Can pending spell target an item ID? |
SpellCanTargetQuest() |
Can pending spell target a quest? |
SpellCancelQueuedSpell() |
Cancel queued spell |
CancelSpellByName(name) |
Cancel channeling by name #nocombat |
Spell Confirmation
| Function |
Description |
AcceptSpellConfirmationPrompt(spellID) |
Accept a spell confirmation dialog |
DeclineSpellConfirmationPrompt(spellID) |
Decline a spell confirmation dialog |
GetSpellConfirmationPromptsInfo() |
Get pending confirmations |
Action Button Helpers
| Function |
Returns |
Description |
GetActionInfo(slot) |
actionType, id, subType |
What's in this action slot? |
GetActionBarToggles() |
bar1..bar7 |
Which extra bars are visible |
SetActionBarToggles(bar1..bar7, alwaysShow) |
— |
Set visibility of extra bars |
PetHasActionBar() |
hasActionBar |
Does pet have an action bar? |
GetPossessInfo(index) |
texture, spellID, enabled |
Possession bar info |
Flyouts
| Function |
Returns |
Description |
GetFlyoutInfo(flyoutID) |
name, description, numSlots, isKnown |
Flyout menu info |
GetFlyoutSlotInfo(flyoutID, slot) |
flyoutSpellID, overrideSpellID, isKnown, spellName, slotSpecID |
Individual flyout slot |
FlyoutHasSpell(flyoutID, spellID) |
hasSpell |
Does flyout contain spell? |
GetNumFlyouts() |
count |
Total flyout count |
FindSpellBookSlotBySpellID(spellID [, isPet]) |
slot |
Legacy slot lookup |
Combat Pet Actions
| Function |
Returns |
Description |
CastPetAction(index [, target]) |
— |
Cast pet action #protected |
GetPetActionCooldown(index) |
startTime, duration, enable |
Pet action cooldown |
GetPetActionInfo(index) |
name, texture, isToken, isActive, autoCastAllowed, autoCastEnabled, spellID, checksRange, inRange |
Full pet action info |
GetPetActionSlotUsable(index) |
isUsable |
Can use this pet action? |
Multi-Cast / Totem Bar
| Function |
Returns |
Description |
GetMultiCastTotemSpells(slot) |
totem1..totem7 |
Valid spells for a totem slot |
SetMultiCastSpell(actionID, spellID) |
— |
Set totem bar spell #protected |
Misc Spell Helpers
| Function |
Returns |
Description |
GetSpellBaseCooldown(spellID) |
cooldownMS, gcdMS |
Base cooldown in milliseconds |
IsSelectedSpellBookItem(spellSlot) |
bool |
Is this slot selected? |
CancelUnitBuff(unit, buffIndex [, filter]) |
— |
Remove a buff #nocombat |
QueryCastSequence(sequence) |
index, item, spell |
Preview next step in /castsequence |
Patch 12.0.0 — Secret Values Impact
Spell-related APIs are significantly affected by Secret Values in Patch 12.0.0:
C_Secrets Predicates for Spells
| Function |
Returns |
Description |
C_Secrets.GetSpellCastSecrecy(spellIdentifier) |
secrecy |
Cast info secret level |
C_Secrets.GetSpellCooldownSecrecy(spellIdentifier) |
secrecy |
Cooldown data secret level |
C_Secrets.GetSpellAuraSecrecy(spellIdentifier) |
secrecy |
Aura data secret level |
C_Secrets.ShouldCooldownsBeSecret() |
hasSecretCooldowns |
Any cooldowns secret? |
C_Secrets.ShouldSpellCooldownBeSecret(spellIdentifier) |
isCooldownSecret |
This spell's CD secret? |
C_Secrets.ShouldSpellAuraBeSecret(spellIdentifier) |
isAuraSecret |
This spell's aura secret? |
C_Secrets.ShouldSpellBookItemCooldownBeSecret(slot, bank) |
isCooldownSecret |
Spellbook slot CD secret? |
C_Secrets.ShouldActionCooldownBeSecret(actionID) |
isCooldownSecret |
Action slot CD secret? |
C_Secrets.ShouldTotemSlotBeSecret(slot) |
isTotemSecret |
Totem info secret? |
C_Secrets.ShouldTotemSpellBeSecret(spellID) |
isTotemSecret |
Specific totem spell secret? |
C_Secrets.ShouldUnitSpellCastBeSecret(unit, spellIdentifier) |
isSpellCastSecret |
Cast info secret? |
C_Secrets.ShouldUnitSpellCastingBeSecret(unit) |
isSpellCastingSecret |
All cast info for unit secret? |
What Returns Secrets
- Cooldown times —
C_Spell.GetSpellCooldown() may return secret start/duration when C_Secrets.ShouldSpellCooldownBeSecret() is true
- Spell cast info —
UnitCastingInfo() / UnitChannelInfo() return secret fields when unit identity is restricted
- Totem info —
GetTotemInfo() may return secret startTime/duration when the totem spell is secret
Safe Patterns
-- Safe: Pass cooldown secrets directly to Cooldown widget
local cdInfo = C_Spell.GetSpellCooldown(spellID)
myCooldownFrame:SetCooldown(cdInfo.startTime, cdInfo.duration)
-- Safe: Display spell name (concatenation works with secrets)
local name = C_Spell.GetSpellName(spellID)
myFontString:SetText(name)
-- UNSAFE: Cannot branch on cooldown values
local cdInfo = C_Spell.GetSpellCooldown(spellID)
if cdInfo.duration > 0 then end -- ERROR if duration is secret
Common Patterns
Iterate All Spellbook Entries
local numLines = C_SpellBook.GetNumSpellBookSkillLines()
for skillIndex = 1, numLines do
local info = C_SpellBook.GetSpellBookSkillLineInfo(skillIndex)
for slotIndex = info.itemIndexOffset + 1, info.itemIndexOffset + info.numSpellBookItems do
local itemInfo = C_SpellBook.GetSpellBookItemInfo(slotIndex, Enum.SpellBookSpellBank.Player)
if itemInfo and itemInfo.itemType == Enum.SpellBookItemType.Spell then
print(itemInfo.name, itemInfo.spellID)
end
end
end
Check If Spell Is Usable and in Range
local function CanCastOnTarget(spellID, unit)
local isUsable, insufficientPower = C_Spell.IsSpellUsable(spellID)
if not isUsable then return false, insufficientPower end
if C_Spell.SpellHasRange(spellID) then
local inRange = C_Spell.IsSpellInRange(spellID, unit)
if inRange == false then return false end
end
local cdInfo = C_Spell.GetSpellCooldown(spellID)
-- Note: cdInfo.duration may be a secret value in 12.0
-- Cannot branch on it — pass to Cooldown widget instead
return true
end
Display Action Button State
local function UpdateActionButton(button, actionID)
if not C_ActionBar.HasAction(actionID) then
button:Hide()
return
end
button.icon:SetTexture(C_ActionBar.GetActionTexture(actionID))
local isUsable, noMana = C_ActionBar.IsUsableAction(actionID)
if isUsable then
button.icon:SetVertexColor(1, 1, 1)
elseif noMana then
button.icon:SetVertexColor(0.5, 0.5, 1)
else
button.icon:SetVertexColor(0.4, 0.4, 0.4)
end
-- Use activation overlay for proc detection
if C_SpellActivationOverlay.IsSpellOverlayed(C_ActionBar.GetSpell(actionID)) then
button.overlay:Show()
else
button.overlay:Hide()
end
end
Monitor Totem State
local function UpdateTotemFrame(slot)
local haveTotem, name, startTime, duration, icon, modRate, spellID = GetTotemInfo(slot)
if haveTotem then
-- startTime/duration may be secret in 12.0
myTotemIcon:SetTexture(icon)
myTotemCooldown:SetCooldown(startTime, duration) -- Widget accepts secrets
myTotemName:SetText(name)
end
end
Query Shapeshift Forms
local function ShowAvailableForms()
local numForms = GetNumShapeshiftForms()
for i = 1, numForms do
local icon, active, castable, spellID = GetShapeshiftFormInfo(i)
print(C_Spell.GetSpellName(spellID), active and "(Active)" or "")
end
end
Related Events
| Event |
Payload |
When |
SPELL_DATA_LOAD_RESULT |
spellID, success |
Async spell data load complete |
ACTIONBAR_SLOT_CHANGED |
slot |
Action placed/removed from slot |
ACTIONBAR_PAGE_CHANGED |
— |
Action bar page changed |
ACTIONBAR_UPDATE_COOLDOWN |
— |
Action cooldown updated |
ACTIONBAR_UPDATE_USABLE |
— |
Action usability changed |
ACTIONBAR_UPDATE_STATE |
— |
Action state changed |
UPDATE_BONUS_ACTIONBAR |
— |
Bonus bar changed (stance/form) |
UPDATE_EXTRA_ACTIONBAR |
— |
Extra action button changed |
UPDATE_OVERRIDE_ACTIONBAR |
— |
Override bar state changed |
UPDATE_VEHICLE_ACTIONBAR |
— |
Vehicle bar changed |
UPDATE_POSSESS_BAR |
— |
Possession bar changed |
SPELL_ACTIVATION_OVERLAY_SHOW |
spellID, ... |
Proc overlay should show |
SPELL_ACTIVATION_OVERLAY_HIDE |
spellID |
Proc overlay should hide |
SPELL_UPDATE_COOLDOWN |
— |
Spell cooldowns changed |
SPELL_UPDATE_USABLE |
— |
Spell usability changed |
SPELL_UPDATE_CHARGES |
— |
Spell charges changed |
CURRENT_SPELL_CAST_CHANGED |
— |
Current cast changed |
SPELLS_CHANGED |
— |
Spellbook contents changed |
LEARNED_SPELL_IN_SKILL_LINE |
spellID, skillLineIndex, isGuildPerkSpell |
New spell learned |
PLAYER_TOTEM_UPDATE |
slot |
Totem state changed |
UPDATE_SHAPESHIFT_FORM |
— |
Shapeshift form changed |
UPDATE_SHAPESHIFT_FORMS |
— |
Available forms changed |
UPDATE_SHAPESHIFT_COOLDOWN |
— |
Form cooldown changed |
SPELL_CONFIRMATION_PROMPT |
spellID, confirmType, text, duration, currencyID, currencyCost, difficultyID |
Spell confirmation needed |
SPELL_CONFIRMATION_TIMEOUT |
spellID |
Confirmation timed out |
PET_BAR_UPDATE |
— |
Pet bar updated |
PET_BAR_UPDATE_COOLDOWN |
— |
Pet action cooldown changed |
PET_BAR_UPDATE_USABLE |
— |
Pet action usability changed |
ASSISTED_COMBAT_UPDATE |
— |
Rotation helper suggestion changed |
COOLDOWN_VIEWER_UPDATE |
— |
Cooldown viewer data changed |
SPELL_FLYOUT_UPDATE |
flyoutID, spellID, isLearned |
Flyout spell learned/changed |
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: wow-api-spells-abilities3description: Complete reference for WoW Retail Spell, SpellBook, ActionBar, Cooldown, Totem, and Shapeshifting APIs. Covers C_Spell info/cooldown/usability/range, C_SpellBook navigation/slot queries, C_ActionBar slot management/state/overrides, C_SpellActivationOverlay procs, C_SpellDiminish DR tracking, C_CooldownViewer, C_AssistedCombat rotation helpers, totem queries, shapeshift forms, casting/channeling functions, flyouts, spell confirmation, and global spell category functions. Use when working with spells, abilities, action bars, cooldowns, casting, totems, shapeshift forms, spell procs, or diminishing returns. Use when this capability is needed.4---56# Spell & Ability API (Retail — Patch 12.0.0)78Comprehensive reference for all Spell, SpellBook, ActionBar, Cooldown, Totem, Shapeshifting, and related APIs. Covers spell information, cooldowns, usability, range checking, spellbook navigation, action bar slot management, spell procs, diminishing returns, assisted combat, and global spell functions.910> **Source of truth:** https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#Spell11> **SpellBook:** https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#SpellBook12> **ActionBar:** https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#ActionBar13> **Current as of:** Patch 12.0.0 (Build 65655) — January 28, 202614> **Scope:** Retail only. No deprecated or removed functions.1516## Scope1718This skill covers these API systems:1920- **C_Spell** — Core spell information, cooldowns, charges, usability, range, type checks21- **C_SpellBook** — Spellbook navigation, skill lines, slot queries, spell lookup22- **C_ActionBar** — Action bar slot management, state queries, bar pages, overrides23- **C_SpellActivationOverlay** — Spell proc/activation glow detection24- **C_SpellDiminish** — Diminishing returns tracking for crowd control25- **C_CooldownViewer** — Cooldown viewer categories and layout26- **C_AssistedCombat** — Assisted combat (rotation helper) integration27- **Totem** — Totem query functions (GetTotemInfo, DestroyTotem)28- **Shapeshifting** — Form/stance functions (GetShapeshiftForm, GetShapeshiftFormInfo)29- **Global Spell Functions** — CastSpellByName, CastSpellByID, SpellIsTargeting, etc.3031## When to Use This Skill3233Use this skill when you need to:34- Query spell info: name, description, icon, subtext, link, power cost35- Check spell cooldowns, charges, or GCD state36- Determine if a spell is usable, in range, or on cooldown37- Navigate the spellbook: enumerate skill lines, find spell slots, check known spells38- Manage action bars: query action type, usability, cooldown, texture for a slot39- Detect action bar pages, bonus bars, override bars, vehicle bars40- Check for spell procs / activation overlays (glowing buttons)41- Track diminishing returns on crowd control effects42- Query totem state, duration, or destroy totems43- Check or cast shapeshift forms and stances44- Cast spells programmatically (protected functions)45- Handle spell targeting (SpellIsTargeting, SpellTargetUnit, SpellStopCasting)46- Use the assisted combat (rotation helper) system47- Work with flyout menus and multi-cast totem spells4849## Reference Files5051| Reference | Contents |52|-----------|----------|53| [SPELLS-CORE.md](references/SPELLS-CORE.md) | C_Spell — spell info, cooldowns, charges, usability, range, type checks |54| [SPELLBOOK.md](references/SPELLBOOK.md) | C_SpellBook — spellbook navigation, skill lines, slot queries |55| [ACTIONBAR.md](references/ACTIONBAR.md) | C_ActionBar — action bar slots, state, pages, overrides, pet/vehicle bars |56| [COOLDOWNS-CASTING.md](references/COOLDOWNS-CASTING.md) | Cooldowns, casting functions, spell targeting, procs, DR, assisted combat |57| [TOTEM-SHAPESHIFT.md](references/TOTEM-SHAPESHIFT.md) | Totem functions, shapeshifting/stances, global spell casting functions |5859---6061## C_Spell — Core Spell API (Quick Reference)6263The `C_Spell` namespace provides direct access to spell data by `spellIdentifier` — which can be a `spellID` (number) or `spellName` (string).6465> **Wiki:** https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#Spell6667### Key Functions6869| Function | Returns | Description |70|----------|---------|-------------|71| `C_Spell.GetSpellInfo(spellIdentifier)` | `spellInfo` table | Primary spell data (name, icon, castTime, etc.) |72| `C_Spell.GetSpellName(spellIdentifier)` | `name` | Localized spell name |73| `C_Spell.GetSpellDescription(spellIdentifier)` | `description` | Tooltip description text |74| `C_Spell.GetSpellTexture(spellIdentifier)` | `iconID, originalIconID` | Spell icon texture |75| `C_Spell.GetSpellSubtext(spellIdentifier)` | `subtext` | Rank or specialization label |76| `C_Spell.GetSpellLink(spellIdentifier [, glyphID])` | `spellLink` | Clickable hyperlink |77| `C_Spell.DoesSpellExist(spellIdentifier)` | `spellExists` | Validates a spell ID/name |78| `C_Spell.GetSpellIDForSpellIdentifier(spellIdentifier)` | `spellID` | Resolves spell name → ID |79| `C_Spell.GetBaseSpell(spellIdentifier [, spec])` | `baseSpellID` | Unwraps overrides to base spell |80| `C_Spell.GetOverrideSpell(spellIdentifier [, spec [, onlyKnown [, ignoreOverrideID]]])` | `overrideSpellID` | Gets current override for a spell |8182### Cooldowns & Charges8384| Function | Returns | Description |85|----------|---------|-------------|86| `C_Spell.GetSpellCooldown(spellIdentifier)` | `spellCooldownInfo` | Start time, duration, enabled, modRate |87| `C_Spell.GetSpellCooldownDuration(spellIdentifier)` | `duration` | Remaining cooldown in seconds |88| `C_Spell.GetSpellCharges(spellIdentifier)` | `chargeInfo` | Charges, maxCharges, start, duration |89| `C_Spell.GetSpellChargeDuration(spellIdentifier)` | `duration` | Charge recharge duration |90| `C_Spell.GetSpellLossOfControlCooldown(spellIdentifier)` | `startTime, duration` | LoC lockout timing |91| `C_Spell.GetSpellLossOfControlCooldownDuration(spellIdentifier)` | `duration` | Remaining LoC duration |9293### Usability & Range9495| Function | Returns | Description |96|----------|---------|-------------|97| `C_Spell.IsSpellUsable(spellIdentifier)` | `isUsable, insufficientPower` | Can be cast now? |98| `C_Spell.IsSpellInRange(spellIdentifier [, targetUnit])` | `inRange` | Target in range? |99| `C_Spell.SpellHasRange(spellIdentifier)` | `hasRange` | Does the spell have range? |100| `C_Spell.IsSpellDisabled(spellIdentifier)` | `disabled` | Is spell disabled? |101| `C_Spell.GetSpellCastCount(spellIdentifier)` | `castCount` | Number of available casts |102103### Type Checks104105| Function | Returns | Description |106|----------|---------|-------------|107| `C_Spell.IsSpellPassive(spellIdentifier)` | `isPassive` | Passive ability? |108| `C_Spell.IsSpellHarmful(spellIdentifier)` | `isHarmful` | Offensive spell? |109| `C_Spell.IsSpellHelpful(spellIdentifier)` | `isHelpful` | Beneficial spell? |110| `C_Spell.IsAutoAttackSpell(spellIdentifier)` | `isAutoAttack` | Auto-attack? |111| `C_Spell.IsAutoRepeatSpell(spellIdentifier)` | `isAutoRepeat` | Auto-repeat (e.g., Auto Shot)? |112| `C_Spell.IsRangedAutoAttackSpell(spellIdentifier)` | `isRangedAutoAttack` | Ranged auto-attack? |113| `C_Spell.IsCurrentSpell(spellIdentifier)` | `isCurrentSpell` | Currently being cast? |114| `C_Spell.IsConsumableSpell(spellIdentifier)` | `consumable` | Consumes a resource on use? |115| `C_Spell.IsPressHoldReleaseSpell(spellIdentifier)` | `isPressHoldRelease` | Empowered spell? |116| `C_Spell.IsClassTalentSpell(spellIdentifier)` | `isClassTalent` | From the talent tree? |117| `C_Spell.IsPvPTalentSpell(spellIdentifier)` | `isPvPTalent` | PvP talent? |118| `C_Spell.IsSpellCrowdControl(spellIdentifier)` | `isCrowdControl` | CC effect? |119| `C_Spell.IsSpellImportant(spellIdentifier)` | `isImportant` | Marked as important? |120| `C_Spell.IsPriorityAura(spellID)` | `isHighPriority` | High-priority display aura? |121| `C_Spell.IsSelfBuff(spellID)` | `hasSelfEffectsOnly` | Only affects self? |122| `C_Spell.IsExternalDefensive(spellID)` | `isExternalDefensive` | External defensive? |123124### Power Cost & Data125126| Function | Returns | Description |127|----------|---------|-------------|128| `C_Spell.GetSpellPowerCost(spellIdentifier)` | `powerCosts` table | Resources required to cast |129| `C_Spell.GetSpellLevelLearned(spellIdentifier)` | `levelLearned` | Level at which spell is learned |130| `C_Spell.GetSpellSkillLineAbilityRank(spellIdentifier)` | `rank` | Rank for profession recipes |131| `C_Spell.GetSpellMaxCumulativeAuraApplications(spellID)` | `cumulativeAura` | Max stacks |132| `C_Spell.GetAuraStatChanges(spellID)` | `healthChange, powerTypeChanges` | Stat effects of an aura |133| `C_Spell.GetDeadlyDebuffInfo(spellIdentifier)` | `deadlyDebuffInfo` | Deadly debuff display data |134| `C_Spell.GetSpellQueueWindow()` | `result` | Spell queue window (ms) |135136### Spell Manipulation137138| Function | Returns | Description |139|----------|---------|-------------|140| `C_Spell.CancelSpellByID(spellID)` | — | Cancel a channeled/cast spell |141| `C_Spell.PickupSpell(spellIdentifier)` | — | Attach spell to cursor |142| `C_Spell.RequestLoadSpellData(spellIdentifier)` | — | Request async spell data load |143| `C_Spell.IsSpellDataCached(spellIdentifier)` | `isCached` | Is data ready for query? |144| `C_Spell.EnableSpellRangeCheck(spellIdentifier, enable)` | — | Enable/disable range checking |145| `C_Spell.SetSpellAutoCastEnabled(spellIdentifier, enabled)` | — | Toggle pet spell autocast |146| `C_Spell.ToggleSpellAutoCast(spellIdentifier)` | — | Toggle pet spell autocast |147| `C_Spell.GetSpellAutoCast(spellIdentifier)` | `autoCastAllowed, autoCastEnabled` | Autocast state |148149### Visibility & Display150151| Function | Returns | Description |152|----------|---------|-------------|153| `C_Spell.GetVisibilityInfo(spellID, visibilityType)` | `hasCustom, alwaysShowMine, showForMySpec` | Aura display visibility rules |154| `C_Spell.GetSpellDisplayCount(spellIdentifier [, maxDisplayCount [, replacementString]])` | `displayCount` | Display count for stacking |155156### Targeting & Trade157158| Function | Returns | Description |159|----------|---------|-------------|160| `C_Spell.TargetSpellIsEnchanting()` | `isEnchanting` | Current targeting spell is enchant? |161| `C_Spell.TargetSpellJumpsUpgradeTrack()` | `jumpsUpgradeTrack` | Upgrade track jump? |162| `C_Spell.TargetSpellReplacesBonusTree()` | `result` | Replaces bonus loot tree? |163| `C_Spell.GetSpellTradeSkillLink(spellIdentifier)` | `spellLink` | Trade skill recipe link |164165---166167## C_SpellBook — Spellbook Navigation (Quick Reference)168169The `C_SpellBook` namespace manages the spellbook UI, skill lines, and per-slot queries. Functions take `(spellBookItemSlotIndex, spellBookItemSpellBank)` where `spellBank` is `Enum.SpellBookSpellBank.Player` or `Enum.SpellBookSpellBank.Pet`.170171> **Wiki:** https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#SpellBook172173### Key Functions174175| Function | Returns | Description |176|----------|---------|-------------|177| `C_SpellBook.GetNumSpellBookSkillLines()` | `numSkillLines` | Number of spellbook tabs |178| `C_SpellBook.GetSpellBookSkillLineInfo(skillLineIndex)` | `skillLineInfo` | Tab name, icon, offset, count |179| `C_SpellBook.GetSpellBookItemInfo(slot, bank)` | `spellBookItemInfo` | Detailed spell/flyout info for a slot |180| `C_SpellBook.GetSpellBookItemType(slot, bank)` | `itemType, actionID, spellID` | Type: SPELL, FLYOUT, FUTURESPELL, PETACTION |181| `C_SpellBook.GetSpellBookItemName(slot, bank)` | `name, subName` | Localized name of slot |182| `C_SpellBook.GetSpellBookItemTexture(slot, bank)` | `iconID` | Icon for slot |183| `C_SpellBook.GetSpellBookItemDescription(slot, bank)` | `description` | Tooltip text |184| `C_SpellBook.GetSpellBookItemLink(slot, bank [, glyphID])` | `spellLink` | Hyperlink |185| `C_SpellBook.GetSpellBookItemLevelLearned(slot, bank)` | `levelLearned` | Level learned |186| `C_SpellBook.FindSpellBookSlotForSpell(spellIdentifier [, includeHidden [, includeFlyouts [, includeFutureSpells [, includeOffSpec]]]])` | `slotIndex, bank` | Find slot for a spell |187| `C_SpellBook.IsSpellKnown(spellID [, spellBank])` | `isKnown` | Does the player know the spell? |188| `C_SpellBook.IsSpellInSpellBook(spellID [, spellBank [, includeOverrides]])` | `isInSpellBook` | Is it in the spellbook? |189| `C_SpellBook.IsSpellKnownOrInSpellBook(spellID [, spellBank [, includeOverrides]])` | `isKnownOrInSpellBook` | Known OR in spellbook? |190191### Slot Usability & State192193| Function | Returns | Description |194|----------|---------|-------------|195| `C_SpellBook.IsSpellBookItemUsable(slot, bank)` | `isUsable, insufficientPower` | Can cast from this slot? |196| `C_SpellBook.IsSpellBookItemPassive(slot, bank)` | `isPassive` | Passive ability? |197| `C_SpellBook.IsSpellBookItemOffSpec(slot, bank)` | `isOffSpec` | Belongs to inactive spec? |198| `C_SpellBook.IsSpellBookItemHarmful(slot, bank)` | `isHarmful` | Harmful to targets? |199| `C_SpellBook.IsSpellBookItemHelpful(slot, bank)` | `isHelpful` | Helpful to targets? |200| `C_SpellBook.IsSpellBookItemInRange(slot, bank [, targetUnit])` | `inRange` | In range of target? |201| `C_SpellBook.SpellBookItemHasRange(slot, bank)` | `hasRange` | Has range requirement? |202| `C_SpellBook.IsAutoAttackSpellBookItem(slot, bank)` | `isAutoAttack` | Auto-attack entry? |203| `C_SpellBook.IsRangedAutoAttackSpellBookItem(slot, bank)` | `isRangedAutoAttack` | Ranged auto-attack? |204| `C_SpellBook.IsClassTalentSpellBookItem(slot, bank)` | `isClassTalent` | Class talent? |205| `C_SpellBook.IsPvPTalentSpellBookItem(slot, bank)` | `isPvPTalent` | PvP talent? |206207### Slot Cooldowns & Charges208209| Function | Returns | Description |210|----------|---------|-------------|211| `C_SpellBook.GetSpellBookItemCooldown(slot, bank)` | `spellCooldownInfo` | Cooldown for slot |212| `C_SpellBook.GetSpellBookItemCooldownDuration(slot, bank)` | `duration` | Remaining cooldown |213| `C_SpellBook.GetSpellBookItemCharges(slot, bank)` | `chargeInfo` | Charge info |214| `C_SpellBook.GetSpellBookItemChargeDuration(slot, bank)` | `duration` | Charge recharge time |215| `C_SpellBook.GetSpellBookItemCastCount(slot, bank)` | `castCount` | Available casts |216| `C_SpellBook.GetSpellBookItemLossOfControlCooldown(slot, bank)` | `startTime, duration` | LoC lockout |217| `C_SpellBook.GetSpellBookItemLossOfControlCooldownDuration(slot, bank)` | `duration` | Remaining LoC |218219### Spell Lookup220221| Function | Returns | Description |222|----------|---------|-------------|223| `C_SpellBook.FindBaseSpellByID(spellID)` | `baseSpellID` | Resolve to base spell |224| `C_SpellBook.FindSpellOverrideByID(spellID)` | `overrideSpellID` | Get current override |225| `C_SpellBook.GetCurrentLevelSpells(level)` | `spellIDs` | Spells learned at a level |226| `C_SpellBook.GetSkillLineIndexByID(skillLineID)` | `skillIndex` | Skill line index by ID |227| `C_SpellBook.HasPetSpells()` | `numPetSpells, petNameToken` | Does the pet have spells? |228| `C_SpellBook.ContainsAnyDisenchantSpell()` | `contains` | Has disenchant? |229| `C_SpellBook.FindFlyoutSlotBySpellID(spellID)` | `flyoutSlot` | Find flyout containing spell |230231### Other Slot Operations232233| Function | Returns | Description |234|----------|---------|-------------|235| `C_SpellBook.CastSpellBookItem(slot, bank [, targetSelf])` | — | Cast from spellbook slot |236| `C_SpellBook.PickupSpellBookItem(slot, bank)` | — | Pick up spell to cursor |237| `C_SpellBook.GetSpellBookItemAutoCast(slot, bank)` | `autoCastAllowed, autoCastEnabled` | Autocast state |238| `C_SpellBook.SetSpellBookItemAutoCastEnabled(slot, bank, enabled)` | — | Set autocast |239| `C_SpellBook.ToggleSpellBookItemAutoCast(slot, bank)` | — | Toggle autocast |240| `C_SpellBook.GetSpellBookItemPowerCost(slot, bank)` | `powerCosts` | Resource cost |241| `C_SpellBook.GetSpellBookItemTradeSkillLink(slot, bank)` | `spellLink` | Trade skill link |242| `C_SpellBook.GetSpellBookItemSkillLineIndex(slot, bank)` | `skillLineIndex` | Which skill line tab |243244---245246## C_ActionBar — Action Bar Slot Management (Quick Reference)247248The `C_ActionBar` namespace manages the 120+ action bar slots. Actions are referenced by `actionID` (1–180) or `slotID`.249250> **Wiki:** https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#ActionBar251252### Action Slot Layout253254| Bar | Slots | Notes |255|-----|-------|-------|256| Main bar | 1–12 | Always visible |257| Bar 2 (Bottom Left) | 13–24 | Toggled via settings |258| Bar 3 (Bottom Right) | 25–36 | Toggled via settings |259| Bar 4 (Right) | 37–48 | Toggled via settings |260| Bar 5 (Right 2) | 49–60 | Toggled via settings |261| Bars 6–10 | 61–120 | Additional bars |262| StanceBar pages | 121–180 | Stance-specific bars |263264### Core Queries265266| Function | Returns | Description |267|----------|---------|-------------|268| `C_ActionBar.HasAction(actionID)` | `hasAction` | Is something in this slot? |269| `C_ActionBar.GetSpell(actionID)` | `spellID` | Spell in slot (nil if not a spell) |270| `C_ActionBar.GetActionTexture(actionID)` | `textureFileID` | Icon for the action |271| `C_ActionBar.GetActionText(actionID)` | `text` | Display text (macros) |272| `C_ActionBar.GetActionCooldown(actionID)` | `cooldownInfo` | Cooldown data |273| `C_ActionBar.GetActionCooldownDuration(actionID)` | `duration` | Remaining cooldown |274| `C_ActionBar.GetActionChargeDuration(actionID)` | `duration` | Charge recharge time |275| `C_ActionBar.GetActionCharges(actionID)` | `chargeInfo` | Charge state |276| `C_ActionBar.IsUsableAction(actionID)` | `isUsable, isLackingResources` | Can use? |277| `C_ActionBar.IsActionInRange(actionID [, target])` | `isInRange` | Target in range? |278279### Action State Checks280281| Function | Returns | Description |282|----------|---------|-------------|283| `C_ActionBar.IsCurrentAction(actionID)` | `isCurrentAction` | Being cast now? |284| `C_ActionBar.IsAttackAction(actionID)` | `isAttackAction` | Auto-attack? |285| `C_ActionBar.IsAutoRepeatAction(actionID)` | `isAutoRepeatAction` | Auto-repeat? |286| `C_ActionBar.IsConsumableAction(actionID)` | `isConsumableAction` | Consumable? |287| `C_ActionBar.IsEquippedAction(actionID)` | `isEquippedAction` | Equipped item? |288| `C_ActionBar.IsStackableAction(actionID)` | `isStackableAction` | Stackable item? |289| `C_ActionBar.IsItemAction(actionID)` | `isItemAction` | Item action? |290| `C_ActionBar.IsHarmfulAction(actionID, useNeutral)` | `isHarmful` | Harmful? |291| `C_ActionBar.IsHelpfulAction(actionID, useNeutral)` | `isHelpful` | Helpful? |292| `C_ActionBar.IsInterruptAction(slotID)` | `isInterruptAction` | Interrupt? |293| `C_ActionBar.IsAssistedCombatAction(slotID)` | `isAssistedCombat` | Assisted combat action? |294| `C_ActionBar.HasRangeRequirements(actionID)` | `hasRangeRequirements` | Has range? |295296### Bar Pages & Overrides297298| Function | Returns | Description |299|----------|---------|-------------|300| `C_ActionBar.GetActionBarPage()` | `currentPage` | Current page (1–6) |301| `C_ActionBar.SetActionBarPage(pageIndex)` | — | Switch page |302| `C_ActionBar.GetBonusBarIndex()` | `bonusBarIndex` | Class-specific bonus bar |303| `C_ActionBar.GetBonusBarOffset()` | `bonusBarOffset` | Offset for bonus bar |304| `C_ActionBar.HasBonusActionBar()` | `hasBonusActionBar` | Has bonus bar? |305| `C_ActionBar.GetOverrideBarIndex()` | `overrideBarIndex` | Override bar index |306| `C_ActionBar.GetOverrideBarSkin()` | `textureFileID` | Override bar texture |307| `C_ActionBar.HasOverrideActionBar()` | `hasOverrideActionBar` | Override active? |308| `C_ActionBar.GetExtraBarIndex()` | `extraBarIndex` | Extra action button bar |309| `C_ActionBar.HasExtraActionBar()` | `hasExtraActionBar` | Extra bar active? |310| `C_ActionBar.GetVehicleBarIndex()` | `vehicleBarIndex` | Vehicle bar index |311| `C_ActionBar.HasVehicleActionBar()` | `hasVehicleActionBar` | In vehicle? |312| `C_ActionBar.GetTempShapeshiftBarIndex()` | `tempShapeshiftBarIndex` | Temp shapeshift bar |313| `C_ActionBar.HasTempShapeshiftActionBar()` | `hasTempShapeshiftActionBar` | Has temp form bar? |314| `C_ActionBar.GetMultiCastBarIndex()` | `multiCastBarIndex` | Multi-cast bar (totem) |315| `C_ActionBar.ShouldOverrideBarShowHealthBar()` | `showHealthBar` | Show health bar? |316| `C_ActionBar.ShouldOverrideBarShowManaBar()` | `showManaBar` | Show mana bar? |317| `C_ActionBar.IsPossessBarVisible()` | `isPossessBarVisible` | Possess bar visible? |318319### Display & Count320321| Function | Returns | Description |322|----------|---------|-------------|323| `C_ActionBar.GetActionDisplayCount(actionID [, maxDisplayCount [, replacementString]])` | `displayCount` | Display count for stacking |324| `C_ActionBar.GetActionUseCount(actionID)` | `count` | Remaining uses |325| `C_ActionBar.GetActionAutocast(actionID)` | `autoCastAllowed, autoCastEnabled` | Autocast state |326| `C_ActionBar.GetActionLossOfControlCooldown(actionID)` | `startTime, duration` | LoC cooldown |327| `C_ActionBar.GetActionLossOfControlCooldownDuration(actionID)` | `duration` | Remaining LoC |328329### Spell ↔ Action Lookups330331| Function | Returns | Description |332|----------|---------|-------------|333| `C_ActionBar.FindSpellActionButtons(spellID)` | `slots` | Find all slots containing a spell |334| `C_ActionBar.HasSpellActionButtons(spellID)` | `hasButtons` | Is spell on any bar? |335| `C_ActionBar.IsOnBarOrSpecialBar(spellID)` | `isOnBar` | On any bar or special bar? |336| `C_ActionBar.FindFlyoutActionButtons(flyoutID)` | `slots` | Find flyout button slots |337| `C_ActionBar.HasFlyoutActionButtons(flyoutID)` | `hasFlyoutButtons` | Flyout on bar? |338| `C_ActionBar.FindPetActionButtons(petActionID)` | `slots` | Pet action on bar? |339| `C_ActionBar.HasPetActionButtons(petActionID)` | `hasPetButtons` | Pet action exists? |340| `C_ActionBar.FindAssistedCombatActionButtons()` | `slots` | Assisted combat slots |341| `C_ActionBar.HasAssistedCombatActionButtons()` | `hasButtons` | Has assisted combat? |342| `C_ActionBar.GetPetActionPetBarIndices(petActionID)` | `slots` | Pet bar indices |343| `C_ActionBar.HasPetActionPetBarIndices(petActionID)` | `hasIndices` | Has pet bar indices? |344345### Profession & Gear346347| Function | Returns | Description |348|----------|---------|-------------|349| `C_ActionBar.GetProfessionQuality(actionID)` | `quality` | Crafting result quality |350| `C_ActionBar.GetProfessionQualityInfo(actionID)` | `info` | Quality info table |351| `C_ActionBar.GetItemActionOnEquipSpellID(actionID)` | `onEquipSpellID` | On-equip spell ID |352| `C_ActionBar.IsEquippedGearOutfitAction(slotID)` | `isEquipped` | Gear outfit equipped? |353| `C_ActionBar.GetBonusBarIndexForSlot(slotID)` | `bonusBarIndex` | Bonus bar for slot |354355### Slot Management356357| Function | Returns | Description |358|----------|---------|-------------|359| `C_ActionBar.PutActionInSlot(slotID)` | — | Place cursor action into slot |360| `C_ActionBar.RegisterActionUIButton(checkboxFrame, actionID, cooldownFrame)` | — | Register frame for updates |361| `C_ActionBar.UnregisterActionUIButton(checkboxFrame)` | — | Unregister frame |362| `C_ActionBar.ForceUpdateAction(slotID)` | — | Force action update |363| `C_ActionBar.EnableActionRangeCheck(actionID, enable)` | — | Enable/disable range check |364| `C_ActionBar.ToggleAutoCastPetAction(slotID)` | — | Toggle pet autocast |365| `C_ActionBar.IsAutoCastPetAction(slotID)` | `isAutoCastPetAction` | Pet autocast? |366| `C_ActionBar.IsEnabledAutoCastPetAction(slotID)` | `isEnabled` | Pet autocast enabled? |367368---369370## Auxiliary Namespaces (Quick Reference)371372### C_SpellActivationOverlay — Spell Procs373374Detects when a spell has a visual activation overlay (glowing border / proc alert).375376| Function | Returns | Description |377|----------|---------|-------------|378| `C_SpellActivationOverlay.IsSpellOverlayed(spellID)` | `isOverlayed` | Spell has active proc glow? |379380> **Wiki:** https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#SpellActivationOverlay381382### C_SpellDiminish — Diminishing Returns383384Tracks diminishing returns (DR) categories for crowd control and interrupt tracking.385386| Function | Returns | Description |387|----------|---------|-------------|388| `C_SpellDiminish.GetAllSpellDiminishCategories([ruleset])` | `categories` | All DR categories |389| `C_SpellDiminish.GetSpellDiminishCategoryInfo(category)` | `categoryInfo` | Info for a DR category |390| `C_SpellDiminish.IsSystemSupported()` | `isSupported` | Is DR tracking available? |391| `C_SpellDiminish.ShouldTrackSpellDiminishCategory(category, ruleset)` | `isTracked` | Should this category be tracked? |392393> **Wiki:** https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#SpellDiminishUI394395### C_CooldownViewer — Cooldown Display396397Provides categorized cooldown data for the cooldown viewer UI.398399| Function | Returns | Description |400|----------|---------|-------------|401| `C_CooldownViewer.GetCooldownViewerCategorySet(category [, allowUnlearned])` | `cooldownIDs` | Cooldowns in a category |402| `C_CooldownViewer.GetCooldownViewerCooldownInfo(cooldownID)` | `cooldownInfo` | Cooldown details |403| `C_CooldownViewer.GetLayoutData()` | `data` | Viewer layout state |404| `C_CooldownViewer.GetValidAlertTypes(cooldownID)` | `validAlertTypes` | Valid alert types for cooldown |405| `C_CooldownViewer.IsCooldownViewerAvailable()` | `isAvailable, failureReason` | Is viewer available? |406| `C_CooldownViewer.SetLayoutData(data)` | — | Save layout state |407408> **Wiki:** https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#CooldownViewer409410### C_AssistedCombat — Rotation Helper411412The Assisted Combat system (new in 12.0) provides suggested spell rotations.413414| Function | Returns | Description |415|----------|---------|-------------|416| `C_AssistedCombat.GetActionSpell()` | `spellID` | Current action spell suggestion |417| `C_AssistedCombat.GetNextCastSpell([checkForVisibleButton])` | `spellID` | Next suggested cast |418| `C_AssistedCombat.GetRotationSpells()` | `spellIDs` | All rotation spells |419| `C_AssistedCombat.IsAvailable()` | `isAvailable, failureReason` | Is system available? |420421> **Wiki:** https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#AssistedCombat422423### C_LevelLink — Spell Level Lock424425Checks if spells or actions are level-locked for scaling content.426427| Function | Returns | Description |428|----------|---------|-------------|429| `C_LevelLink.IsActionLocked(actionID)` | `isLocked` | Action locked by level? |430| `C_LevelLink.IsSpellLocked(spellID)` | `isLocked` | Spell locked by level? |431432---433434## Totem Functions435436Totem functions query and manage totem/minion slots. Shamans have 4 totem slots; other classes may have totem-style minions (e.g., Death Knight ghouls, mushrooms).437438> **Wiki:** https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#Totem439440| Function | Returns | Description |441|----------|---------|-------------|442| `GetTotemInfo(slot)` | `haveTotem, totemName, startTime, duration, icon, modRate, spellID` | Complete totem info |443| `GetTotemTimeLeft(slot)` | `timeLeft` | Remaining duration (seconds) |444| `GetTotemCannotDismiss(slot)` | `cannotDismiss` | Can this totem be dismissed? |445| `DestroyTotem(slot)` | — | Destroy totem/minion `#protected` |446| `TargetTotem(slot)` | — | Target the totem |447448### totem Slot Constants449450```lua451EARTH_TOTEM_SLOT = 2452FIRE_TOTEM_SLOT = 1453WATER_TOTEM_SLOT = 3454AIR_TOTEM_SLOT = 4455```456457---458459## Shapeshifting / Stances460461Manages shapeshift forms (Druid forms, Warrior stances, Rogue stealth, Paladin auras, etc.).462463> **Wiki:** https://warcraft.wiki.gg/wiki/World_of_Warcraft_API#Shapeshifting 464> **Category:** https://warcraft.wiki.gg/wiki/World_of_Warcraft_API (Shapeshifting section)465466| Function | Returns | Description |467|----------|---------|-------------|468| `GetNumShapeshiftForms()` | `numForms` | Number of available forms |469| `GetShapeshiftForm([flag])` | `index` | Current form (0 = none) |470| `GetShapeshiftFormID()` | `index` | Form ID of current form |471| `GetShapeshiftFormInfo(index)` | `icon, active, castable, spellID` | Info for a form |472| `GetShapeshiftFormCooldown(index)` | `startTime, duration, isActive` | Cooldown for a form |473| `CancelShapeshiftForm()` | — | Leave current form `#protected` |474| `CastShapeshiftForm(index)` | — | Enter a form `#protected` |475476---477478## Global Spell Casting Functions479480These are category-level functions (not namespaced) for casting, targeting, and confirming spells.481482> **Wiki:** https://warcraft.wiki.gg/wiki/World_of_Warcraft_API (Spells category)483484### Casting (Protected)485486| Function | Description |487|----------|-------------|488| `CastSpell(spellIndex, spellbookType)` | Cast from spellbook by index `#protected` |489| `CastSpellByID(spellID [, target])` | Cast by spell ID `#protected` |490| `CastSpellByName(name [, target])` | Cast by name `#protected` |491| `UseAction(slot [, checkCursor [, onSelf]])` | Use action bar slot `#protected` |492| `SpellStopCasting()` | Stop current cast `#protected` |493494### Targeting (Protected)495496| Function | Description |497|----------|-------------|498| `SpellIsTargeting()` | Is a spell waiting for target selection? |499| `SpellCanTargetUnit(unit)` | Can the pending spell target this unit? |500| `SpellTargetUnit(unit)` | Cast pending spell on unit `#protected` |501| `SpellStopTargeting()` | Cancel pending spell targeting `#protected` |502| `SpellTargetItem(item)` | Cast pending spell on item `#protected` |503| `SpellCanTargetItem()` | Can pending spell target an item? |504| `SpellCanTargetItemID()` | Can pending spell target an item ID? |505| `SpellCanTargetQuest()` | Can pending spell target a quest? |506| `SpellCancelQueuedSpell()` | Cancel queued spell |507| `CancelSpellByName(name)` | Cancel channeling by name `#nocombat` |508509### Spell Confirmation510511| Function | Description |512|----------|-------------|513| `AcceptSpellConfirmationPrompt(spellID)` | Accept a spell confirmation dialog |514| `DeclineSpellConfirmationPrompt(spellID)` | Decline a spell confirmation dialog |515| `GetSpellConfirmationPromptsInfo()` | Get pending confirmations |516517### Action Button Helpers518519| Function | Returns | Description |520|----------|---------|-------------|521| `GetActionInfo(slot)` | `actionType, id, subType` | What's in this action slot? |522| `GetActionBarToggles()` | `bar1..bar7` | Which extra bars are visible |523| `SetActionBarToggles(bar1..bar7, alwaysShow)` | — | Set visibility of extra bars |524| `PetHasActionBar()` | `hasActionBar` | Does pet have an action bar? |525| `GetPossessInfo(index)` | `texture, spellID, enabled` | Possession bar info |526527### Flyouts528529| Function | Returns | Description |530|----------|---------|-------------|531| `GetFlyoutInfo(flyoutID)` | `name, description, numSlots, isKnown` | Flyout menu info |532| `GetFlyoutSlotInfo(flyoutID, slot)` | `flyoutSpellID, overrideSpellID, isKnown, spellName, slotSpecID` | Individual flyout slot |533| `FlyoutHasSpell(flyoutID, spellID)` | `hasSpell` | Does flyout contain spell? |534| `GetNumFlyouts()` | count | Total flyout count |535| `FindSpellBookSlotBySpellID(spellID [, isPet])` | slot | Legacy slot lookup |536537### Combat Pet Actions538539| Function | Returns | Description |540|----------|---------|-------------|541| `CastPetAction(index [, target])` | — | Cast pet action `#protected` |542| `GetPetActionCooldown(index)` | `startTime, duration, enable` | Pet action cooldown |543| `GetPetActionInfo(index)` | `name, texture, isToken, isActive, autoCastAllowed, autoCastEnabled, spellID, checksRange, inRange` | Full pet action info |544| `GetPetActionSlotUsable(index)` | `isUsable` | Can use this pet action? |545546### Multi-Cast / Totem Bar547548| Function | Returns | Description |549|----------|---------|-------------|550| `GetMultiCastTotemSpells(slot)` | `totem1..totem7` | Valid spells for a totem slot |551| `SetMultiCastSpell(actionID, spellID)` | — | Set totem bar spell `#protected` |552553### Misc Spell Helpers554555| Function | Returns | Description |556|----------|---------|-------------|557| `GetSpellBaseCooldown(spellID)` | `cooldownMS, gcdMS` | Base cooldown in milliseconds |558| `IsSelectedSpellBookItem(spellSlot)` | bool | Is this slot selected? |559| `CancelUnitBuff(unit, buffIndex [, filter])` | — | Remove a buff `#nocombat` |560| `QueryCastSequence(sequence)` | index, item, spell | Preview next step in /castsequence |561562---563564## Patch 12.0.0 — Secret Values Impact565566Spell-related APIs are significantly affected by Secret Values in Patch 12.0.0:567568### C_Secrets Predicates for Spells569570| Function | Returns | Description |571|----------|---------|-------------|572| `C_Secrets.GetSpellCastSecrecy(spellIdentifier)` | `secrecy` | Cast info secret level |573| `C_Secrets.GetSpellCooldownSecrecy(spellIdentifier)` | `secrecy` | Cooldown data secret level |574| `C_Secrets.GetSpellAuraSecrecy(spellIdentifier)` | `secrecy` | Aura data secret level |575| `C_Secrets.ShouldCooldownsBeSecret()` | `hasSecretCooldowns` | Any cooldowns secret? |576| `C_Secrets.ShouldSpellCooldownBeSecret(spellIdentifier)` | `isCooldownSecret` | This spell's CD secret? |577| `C_Secrets.ShouldSpellAuraBeSecret(spellIdentifier)` | `isAuraSecret` | This spell's aura secret? |578| `C_Secrets.ShouldSpellBookItemCooldownBeSecret(slot, bank)` | `isCooldownSecret` | Spellbook slot CD secret? |579| `C_Secrets.ShouldActionCooldownBeSecret(actionID)` | `isCooldownSecret` | Action slot CD secret? |580| `C_Secrets.ShouldTotemSlotBeSecret(slot)` | `isTotemSecret` | Totem info secret? |581| `C_Secrets.ShouldTotemSpellBeSecret(spellID)` | `isTotemSecret` | Specific totem spell secret? |582| `C_Secrets.ShouldUnitSpellCastBeSecret(unit, spellIdentifier)` | `isSpellCastSecret` | Cast info secret? |583| `C_Secrets.ShouldUnitSpellCastingBeSecret(unit)` | `isSpellCastingSecret` | All cast info for unit secret? |584585### What Returns Secrets586587- **Cooldown times** — `C_Spell.GetSpellCooldown()` may return secret `start`/`duration` when `C_Secrets.ShouldSpellCooldownBeSecret()` is true588- **Spell cast info** — `UnitCastingInfo()` / `UnitChannelInfo()` return secret fields when unit identity is restricted589- **Totem info** — `GetTotemInfo()` may return secret `startTime`/`duration` when the totem spell is secret590591### Safe Patterns592593```lua594-- Safe: Pass cooldown secrets directly to Cooldown widget595local cdInfo = C_Spell.GetSpellCooldown(spellID)596myCooldownFrame:SetCooldown(cdInfo.startTime, cdInfo.duration)597598-- Safe: Display spell name (concatenation works with secrets)599local name = C_Spell.GetSpellName(spellID)600myFontString:SetText(name)601602-- UNSAFE: Cannot branch on cooldown values603local cdInfo = C_Spell.GetSpellCooldown(spellID)604if cdInfo.duration > 0 then end -- ERROR if duration is secret605```606607---608609## Common Patterns610611### Iterate All Spellbook Entries612613```lua614local numLines = C_SpellBook.GetNumSpellBookSkillLines()615for skillIndex = 1, numLines do616 local info = C_SpellBook.GetSpellBookSkillLineInfo(skillIndex)617 for slotIndex = info.itemIndexOffset + 1, info.itemIndexOffset + info.numSpellBookItems do618 local itemInfo = C_SpellBook.GetSpellBookItemInfo(slotIndex, Enum.SpellBookSpellBank.Player)619 if itemInfo and itemInfo.itemType == Enum.SpellBookItemType.Spell then620 print(itemInfo.name, itemInfo.spellID)621 end622 end623end624```625626### Check If Spell Is Usable and in Range627628```lua629local function CanCastOnTarget(spellID, unit)630 local isUsable, insufficientPower = C_Spell.IsSpellUsable(spellID)631 if not isUsable then return false, insufficientPower end632633 if C_Spell.SpellHasRange(spellID) then634 local inRange = C_Spell.IsSpellInRange(spellID, unit)635 if inRange == false then return false end636 end637638 local cdInfo = C_Spell.GetSpellCooldown(spellID)639 -- Note: cdInfo.duration may be a secret value in 12.0640 -- Cannot branch on it — pass to Cooldown widget instead641 return true642end643```644645### Display Action Button State646647```lua648local function UpdateActionButton(button, actionID)649 if not C_ActionBar.HasAction(actionID) then650 button:Hide()651 return652 end653654 button.icon:SetTexture(C_ActionBar.GetActionTexture(actionID))655656 local isUsable, noMana = C_ActionBar.IsUsableAction(actionID)657 if isUsable then658 button.icon:SetVertexColor(1, 1, 1)659 elseif noMana then660 button.icon:SetVertexColor(0.5, 0.5, 1)661 else662 button.icon:SetVertexColor(0.4, 0.4, 0.4)663 end664665 -- Use activation overlay for proc detection666 if C_SpellActivationOverlay.IsSpellOverlayed(C_ActionBar.GetSpell(actionID)) then667 button.overlay:Show()668 else669 button.overlay:Hide()670 end671end672```673674### Monitor Totem State675676```lua677local function UpdateTotemFrame(slot)678 local haveTotem, name, startTime, duration, icon, modRate, spellID = GetTotemInfo(slot)679 if haveTotem then680 -- startTime/duration may be secret in 12.0681 myTotemIcon:SetTexture(icon)682 myTotemCooldown:SetCooldown(startTime, duration) -- Widget accepts secrets683 myTotemName:SetText(name)684 end685end686```687688### Query Shapeshift Forms689690```lua691local function ShowAvailableForms()692 local numForms = GetNumShapeshiftForms()693 for i = 1, numForms do694 local icon, active, castable, spellID = GetShapeshiftFormInfo(i)695 print(C_Spell.GetSpellName(spellID), active and "(Active)" or "")696 end697end698```699700---701702## Related Events703704| Event | Payload | When |705|-------|---------|------|706| `SPELL_DATA_LOAD_RESULT` | `spellID, success` | Async spell data load complete |707| `ACTIONBAR_SLOT_CHANGED` | `slot` | Action placed/removed from slot |708| `ACTIONBAR_PAGE_CHANGED` | — | Action bar page changed |709| `ACTIONBAR_UPDATE_COOLDOWN` | — | Action cooldown updated |710| `ACTIONBAR_UPDATE_USABLE` | — | Action usability changed |711| `ACTIONBAR_UPDATE_STATE` | — | Action state changed |712| `UPDATE_BONUS_ACTIONBAR` | — | Bonus bar changed (stance/form) |713| `UPDATE_EXTRA_ACTIONBAR` | — | Extra action button changed |714| `UPDATE_OVERRIDE_ACTIONBAR` | — | Override bar state changed |715| `UPDATE_VEHICLE_ACTIONBAR` | — | Vehicle bar changed |716| `UPDATE_POSSESS_BAR` | — | Possession bar changed |717| `SPELL_ACTIVATION_OVERLAY_SHOW` | `spellID, ...` | Proc overlay should show |718| `SPELL_ACTIVATION_OVERLAY_HIDE` | `spellID` | Proc overlay should hide |719| `SPELL_UPDATE_COOLDOWN` | — | Spell cooldowns changed |720| `SPELL_UPDATE_USABLE` | — | Spell usability changed |721| `SPELL_UPDATE_CHARGES` | — | Spell charges changed |722| `CURRENT_SPELL_CAST_CHANGED` | — | Current cast changed |723| `SPELLS_CHANGED` | — | Spellbook contents changed |724| `LEARNED_SPELL_IN_SKILL_LINE` | `spellID, skillLineIndex, isGuildPerkSpell` | New spell learned |725| `PLAYER_TOTEM_UPDATE` | `slot` | Totem state changed |726| `UPDATE_SHAPESHIFT_FORM` | — | Shapeshift form changed |727| `UPDATE_SHAPESHIFT_FORMS` | — | Available forms changed |728| `UPDATE_SHAPESHIFT_COOLDOWN` | — | Form cooldown changed |729| `SPELL_CONFIRMATION_PROMPT` | `spellID, confirmType, text, duration, currencyID, currencyCost, difficultyID` | Spell confirmation needed |730| `SPELL_CONFIRMATION_TIMEOUT` | `spellID` | Confirmation timed out |731| `PET_BAR_UPDATE` | — | Pet bar updated |732| `PET_BAR_UPDATE_COOLDOWN` | — | Pet action cooldown changed |733| `PET_BAR_UPDATE_USABLE` | — | Pet action usability changed |734| `ASSISTED_COMBAT_UPDATE` | — | Rotation helper suggestion changed |735| `COOLDOWN_VIEWER_UPDATE` | — | Cooldown viewer data changed |736| `SPELL_FLYOUT_UPDATE` | `flyoutID, spellID, isLearned` | Flyout spell learned/changed |737738---739> Converted and distributed by [TomeVault](https://tomevault.io/claim/jburlison) — claim your Tome and manage your conversions.740<!-- tomevault:4.0:skill_md:2026-04-13 -->