Reply
Thread Tools Display Modes
Unread 09-13-08, 04:52 AM   #1
ywwow
A Murloc Raider
 
ywwow's Avatar
Join Date: May 2008
Posts: 9
How to get the skill ID?

I am a junior on mod writing.I noticed that there were item id and skill id.Now many mods can show item id,and we can use it in macros and so on. But how about the skill id?I know it can be found at some wow database websites,but how do they get this information?And is there other way to find a skill's id?

I hope my poor English have stated my meaning clearly.Eagerly waiting for your help!
__________________
Young Learner.I am sorry about my poor English.
ywwow is offline   Reply With Quote
Unread 09-13-08, 05:18 AM   #2
Duugu
Premium Member
 
Duugu's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 659
Could you please specify the term "skill id"?

If "skill id" is a spell id then you could get it out of the spell link:
Code:
local name, rank = GetSpellInfo(spellName, spellRank);
DEFAULT_CHAT_FRAME:AddMessage("Spell: |Hspell:" .. SpellID .."|h|r|cff71d5ff[" .. name .. " " .. rank .. "]|r|h");
Duugu is offline   Reply With Quote
Unread 09-13-08, 08:01 AM   #3
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,265
Fireball rank 1:
http://www.wowhead.com/?spell=133

SpellID is 133
p3lim is offline   Reply With Quote
Unread 09-13-08, 12:49 PM   #4
ywwow
A Murloc Raider
 
ywwow's Avatar
Join Date: May 2008
Posts: 9
Originally Posted by Duugu View Post
Could you please specify the term "skill id"?

If "skill id" is a spell id then you could get it out of the spell link:
Code:
local name, rank = GetSpellInfo(spellName, spellRank);
DEFAULT_CHAT_FRAME:AddMessage("Spell: |Hspell:" .. SpellID .."|h|r|cff71d5ff[" .. name .. " " .. rank .. "]|r|h");
I am sorry but the code is not correct.Yes,the "skill id" is "SpellId".After seen the code,I checked at wowwiki to find the API.And there is code as above but using "GetSpellInfo(SpellID)".It seems you mixed "GetSpellLink(SpellName,SpellRank)"and"GetSpellInfo(SpellID/SpellName/SpellLink)" together.Then the experiment in game also failed.

After all,thank you all the same!
__________________
Young Learner.I am sorry about my poor English.
ywwow is offline   Reply With Quote
Unread 09-13-08, 01:02 PM   #5
Duugu
Premium Member
 
Duugu's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 659
Oh. Yes I did. I'm sorry.
I just meant the spellid is part of the link.
Duugu is offline   Reply With Quote
Unread 09-13-08, 01:15 PM   #6
ywwow
A Murloc Raider
 
ywwow's Avatar
Join Date: May 2008
Posts: 9
Just now I saw this setence:
"spellID is the index of a spell in a spellbook. The indices increase from top to bottom, then left to right, then between categories (e.g.: General -> Discipline). spellIDs will change as players learn new spells and professions. "

So it means everyone's spellID can be different from each other?
__________________
Young Learner.I am sorry about my poor English.
ywwow is offline   Reply With Quote
Unread 09-13-08, 01:18 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 9,589
No, what you are quoting is in reference to something else.
__________________
"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

Seerah is offline   Reply With Quote
Unread 09-13-08, 01:31 PM   #8
ywwow
A Murloc Raider
 
ywwow's Avatar
Join Date: May 2008
Posts: 9
Code:
local i = 1
while true do
   local spellName, spellRank = GetSpellName(i, BOOKTYPE_SPELL)
   if not spellName then
      do break end
   end   
   DEFAULT_CHAT_FRAME:AddMessage( spellName .. '(' .. spellRank .. ')'..'SpellID:'..i )   
   i = i + 1
end
Can I in this way get the SpellID which can be used as the item id in macros in the form of "item:id"?
__________________
Young Learner.I am sorry about my poor English.
ywwow is offline   Reply With Quote
Unread 09-13-08, 02:01 PM   #9
Duugu
Premium Member
 
Duugu's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 659
The spell id has nothing to do with you spell book. It's just a unique number for every spell in wow. The spell id of a given spell is the same for every player on every realm.

This is my code to get the spell link and the spell id out of the spell link:
Code:
local spellLink = GetSpellLink(name, rank)
local spellID = string.sub(spellLink, 19, string.find(spellLink, "%[") -3)
Don't know if the spell id can be used in macros.

btw: don't know what you're about to do, but there are approximately 25.000 spells/spell id's.
Duugu is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Tutorials & Other Helpful Info. » How to get the skill 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