Returns whether a spell is passive (cannot be cast)


See also Spell functions.

Signature:

isPassive = IsPassiveSpell(index, "bookType") or IsPassiveSpell("name")

Arguments:

  • index - Index of a spell in the spellbook (number, spellbookID)

  • bookType - Type of spellbook (string)

    • pet - The pet's spellbook
    • spell - The player's spellbook

  • name - Name of a spell (string)

Returns:

  • isPassive - 1 if the spell is passive; otherwise nil (1nil)

Examples:

-- prints a list of passive spells in the player's spellbook
local numTabs = GetNumSpellTabs()
for tabID=1,numTabs do
  local name,texture,offset,numSpells = GetSpellTabInfo(tabID)
  
  for spellID = offset + 1, offset + numSpells do
    if IsPassiveSpell(spellID, BOOKTYPE_SPELL) then
      local spell,rank = GetSpellName(spellID, BOOKTYPE_SPELL)
      print(" - " .. spell)
    end
  end
end