WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   API IsSpellKnown (https://www.wowinterface.com/forums/showthread.php?t=59739)

Benalish 12-20-23 06:48 AM

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?

Xrystal 12-20-23 02:00 PM

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.

SDPhantom 12-20-23 07:48 PM

You can always /dump GetSpellInfo() and refer to the link for which return is the SpellID.


All times are GMT -6. The time now is 04:04 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI