GetSpellBookItemInfo

From Wowpedia
Jump to: navigation, search
Game Flavors
Links
Patch
Added in 4.0.1 / 1.13.2

Retrieves information about a specific spellbook item.

skillType, special = GetSpellBookItemInfo(spellName)
                   = GetSpellBookItemInfo(index, bookType)

Arguments

spellName 
string - The localized name of the spell to query.

index 
number - The index into the spellbook.
bookType
string - BOOKTYPE_SPELL or BOOKTYPE_PET depending on if you wish to query the player or pet spellbook. Internally the game only tests if this value is equal to "pet" and treats any other string value as "spell"
BOOKTYPE
Constant Value Description
BOOKTYPE_SPELL "spell" The General, Class, Specs and Professions tabs
BOOKTYPE_PET "pet" The Pet tab

Returns

skillType 
string?Optional. Could be nil. - The type of the spell (SPELL, FUTURESPELL, PETACTION, FLYOUT).
special 
number?Optional. Could be nil.
  • For SPELL and FUTURESPELL, the SpellID used in GetSpellInfo(spellID)
  • For PETACTION, the ActionID used in C_ActionBar.HasPetActionButtons(petActionID); furthermore, the SpellID can be obtained by applying the bitmask 0xFFFFFF.
  • For FLYOUT, the FlyoutID used in GetFlyoutInfo(flyoutID)

Example

Prints all spells in the spellbook for the player, except the profession tab ones.

for i = 1, GetNumSpellTabs() do
	local _, _, offset, numSlots = GetSpellTabInfo(i)
	for j = offset+1, offset+numSlots do
		print(i, j, GetSpellBookItemInfo(j, BOOKTYPE_SPELL))
	end
end