Thread Tools Display Modes
11-02-15, 09:42 AM   #1
Oniya
A Wyrmkin Dreamwalker
Join Date: Feb 2015
Posts: 57
Question GetItemSpell - get spell ID

http://wowprogramming.com/docs/api/GetItemSpell

is it possible to get spell id as well? Name not so useful
  Reply With Quote
11-02-15, 10:00 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Oniya View Post
http://wowprogramming.com/docs/api/GetItemSpell

is it possible to get spell id as well? Name not so useful
Have you actually tried that function in-game? I don't know how long ago that documentation was updated, but many functions that previously returned only a spell name have been updated in the last few years to also return a spell ID, so it's possible that function was one of them.

If it really doesn't, then you're probably stuck hardcoding the data in your addon for the items you're interested in.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
11-02-15, 10:08 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Have you tried passing the name into this? (I don't remember if it works for items...)
http://wowprogramming.com/docs/api/GetSpellInfo
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
11-02-15, 10:54 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Seerah View Post
Have you tried passing the name into this? (I don't remember if it works for items...)
http://wowprogramming.com/docs/api/GetSpellInfo
That won't work; GetSpellInfo only works with names for spells that are in your spellbook and known. It doesn't work for "future" spells or "other specs" spells that are shown in the spellbook, since you don't currently know those, and it doesn't work for things like your vehicle's spells, even though you can "/cast" them by name from macros.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
11-05-15, 12:13 PM   #5
Oniya
A Wyrmkin Dreamwalker
Join Date: Feb 2015
Posts: 57
Originally Posted by Phanx View Post
Have you actually tried that function in-game? I don't know how long ago that documentation was updated, but many functions that previously returned only a spell name have been updated in the last few years to also return a spell ID, so it's possible that function was one of them.

If it really doesn't, then you're probably stuck hardcoding the data in your addon for the items you're interested in.
ye, i tried it, that why i am asking about maybe there is some other exists that i am not aware of
  Reply With Quote
11-05-15, 01:54 PM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Oniya View Post
ye, i tried it, that why i am asking about maybe there is some other exists that i am not aware of
Well, both Wowpedia and Wowprogramming are maintained by volunteers, so it's not uncommon to find outdated info in either place... and unfortunately Wowprogramming doesn't (as far as I can see as an unregistered user) show the date a particular page was last edited.

No other such function exists as far as I know. If you need to know the IDs of spells cast by using items, you have some quality time with Wowhead in your future.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
11-05-15, 02:31 PM   #7
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
I'll have to do some testing as I haven't personally run the addon myself in a while, but this was one of the ideas behind SpellList. I really need to do a complete rewrite to get it back into release-ready status, but it should still work even though it's missing a large chunk of new spells (2 years worth of updates) and the code is making me sick looking at it.
__________________
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 » General Authoring Discussion » GetItemSpell - get spell ID

Thread Tools
Display Modes

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