Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:API GetSpellName
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{wowapi}} Retrieves the spell name and spell rank for a spell in the player's spellbook. If you're trying to read the spell book at login, register for the [[Events P (Party, Petition, Pet, PlayerBank, Player)#PLAYER_LOGIN|PLAYER_LOGIN]] event. ''spellName'', ''spellRank'' = GetSpellName( ''spellId'', ''bookType'' ); ---- ;''Arguments'' :;spellId : Integer - Spell ID. Valid values are 1 through total number of spells in the spellbook on all pages and all tabs, ignoring empty slots. :;bookType : String - Either '''BOOKTYPE_SPELL''' ("spell") or '''BOOKTYPE_PET''' ("pet"). ---- ;''Returns'' :;spellName : String - Name of the spell as it appears in the spellbook, eg. ''"Lesser Heal"'' :;spellRank : String - The spell rank or type, eg. ''"Rank 3"'', ''"Racial Passive"''. This can be an empty string. '''Note:''' for the ''Enchanting'' trade skill at rank ''Apprentice'', the returned string contains a trailing space, ie. ''"Apprentice "''. This might be the case for other trade skills and ranks also. ---- ;''Example'' local i = 1 while true do local spellName, spellRank = GetSpellName(i, BOOKTYPE_SPELL) if not spellName then do break end end -- use spellName and spellRank here DEFAULT_CHAT_FRAME:AddMessage( spellName .. '(' .. spellRank .. ')' ) i = i + 1 end ;''Result'' : Displays every spell in the player's spellbook, on all pages and all tabs, in the format required by [[API_CastSpellByName|CastSpellByName]]. ---- == Cataclysm Change == This function has been renamed to {{api|GetSpellBookItemName}}(). Also in 4.0.1, certain spells will not appear in the player's spell book, such as Track Beasts. As such, it will not be searchable from this function.
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Api
(
edit
)
Template:Apinav
(
edit
)
Template:Editlink
(
edit
)
Template:Tocright
(
edit
)
Template:Wowapi
(
edit
)