WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Tutorials & Other Helpful Info. (https://www.wowinterface.com/forums/forumdisplay.php?f=12)
-   -   How to get the skill ID? (https://www.wowinterface.com/forums/showthread.php?t=18164)

ywwow 09-13-08 04:52 AM

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!

Duugu 09-13-08 05:18 AM

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");


p3lim 09-13-08 08:01 AM

Fireball rank 1:
http://www.wowhead.com/?spell=133

SpellID is 133

ywwow 09-13-08 12:49 PM

Quote:

Originally Posted by Duugu (Post 102037)
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!

Duugu 09-13-08 01:02 PM

Oh. Yes I did. I'm sorry.
I just meant the spellid is part of the link. :)

ywwow 09-13-08 01:15 PM

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?

Seerah 09-13-08 01:18 PM

No, what you are quoting is in reference to something else.

ywwow 09-13-08 01:31 PM

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"?

Duugu 09-13-08 02:01 PM

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. :)


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

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