Thread Tools Display Modes
12-20-23, 06:48 AM   #1
Benalish
A Flamescale Wyrmkin
 
Benalish's Avatar
Join Date: Dec 2012
Posts: 123
API IsSpellKnown

From https://wowwiki-archive.fandom.com/w...I_IsSpellKnown

Lua Code:
  1. isKnown = IsSpellKnown(spellID, isPetSpell)

Arguments
spellID: integer - the spell ID number
isPetSpell: boolean (optional) - if true, will check if the currently active pet knows the spell; if false or omitted, will check if the player knows the spell

Returns
isKnown: boolean - whether the player (or pet) knows the given spell

For the spells I know, starting from their name I can get their ID via
Lua Code:
  1. GetSpellLink(name)
But I can't get the ID of a spell I don't know, so is there an alternative way to find out if I know a spell?
  Reply With Quote
12-20-23, 02:00 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
That site may be out of date ..

https://warcraft.wiki.gg/wiki/World_...aft_API#Spells

If you know a spell it will be accessible via the spellbook.
Or you can use wowhead to identify spellIDs to use the IsSpellKnown functions.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
12-20-23, 07:48 PM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
You can always /dump GetSpellInfo() and refer to the link for which return is the SpellID.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » API IsSpellKnown


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off