Thread Tools Display Modes
02-02-15, 08:28 AM   #1
Basil2
An Aku'mai Servant
Join Date: Feb 2015
Posts: 30
Need a table SpellName = SpellID

I need my addon to work with any language client. So I can't write GetSpellCooldown("Riptide") but
GetSpellCooldown(61295). However this is not informative at all.

The best IMHO solution is:
Code:
RiptideId = 61295
GetSpellCooldown(RiptideId)
So I am looking for a list like 'RiptideId = 61295' with all spells with their IDs. I guess somebody already did the job by exploring wowhead and preparing such table.

Could you please tell where is such table?
  Reply With Quote
02-02-15, 09:01 AM   #2
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
With GetSpellInfo you get the localized name.
http://wow.gamepedia.com/API_GetSpellInfo
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
02-02-15, 10:34 AM   #3
sirann
A Flamescale Wyrmkin
Join Date: Mar 2007
Posts: 142
Could you do some asinine method of making a:

Code:
local spelltable = {}
local checker
for i = 1, 200000 do
     checker = (GetSpellInfo(i))
     if checker then
          spelltable.i = checker
     end
end
and then having ## SavedVariables: spelltable in the wtf?

Load in, exit game, and copy and paste the spelltable read out from the wtf file into excel for readability?
  Reply With Quote
02-02-15, 12:14 PM   #4
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
http://www.wowace.com/addons/libplayerspells-1-0/ could be worth a look.
  Reply With Quote
02-02-15, 02:12 PM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Basil2 View Post
So I am looking for a list like 'RiptideId = 61295' with all spells with their IDs. I guess somebody already did the job by exploring wowhead and preparing such table.
There are some 200,000 spells in the game. I seriously doubt you need all of them.

There is no "One Best Solution" for all purposes -- what exactly does your addon do, and what does it need a list of spell IDs for?
__________________
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
02-03-15, 01:26 AM   #6
Basil2
An Aku'mai Servant
Join Date: Feb 2015
Posts: 30
Originally Posted by Phanx View Post
There are some 200,000 spells in the game. I seriously doubt you need all of them.
Ouch. Yes I don't need them all

There is no "One Best Solution" for all purposes -- what exactly does your addon do, and what does it need a list of spell IDs for?
Addon plays arena as resto shaman. So I need to implement very complicated logic with spells collaboration - source with names looks MUCH better with numbers. Having 15 year C++ background I prefer constants to comments
  Reply With Quote
02-03-15, 03:10 AM   #7
Choonstertwo
A Chromatic Dragonspawn
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 194
Even though Lua doesn't have constants, there's nothing stopping you from using a normal local variable like a constant:
lua Code:
  1. local RIPTIDE_ID = 61295
  2.  
  3. -- ...
  4.  
  5. if GetSpellCooldown(RIPTIDE_ID) == 0 then
  6.     DoStuff()
  7. end
  Reply With Quote
02-03-15, 11:30 PM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Choonstertwo View Post
Even though Lua doesn't have constants, there's nothing stopping you from using a normal local variable like a constant:
And if you're working with a large number of spells and want to avoid creating 50 variables, you could just use a table:

Code:
local id = {
    EARTH_SHIELD = 974,
    PURIFY_SPIRIT = 77130,
    RIPTIDE = 61295,
}

if GetSpellCooldown(id.RIPTIDE) == 0 then
    -- do stuff
end
But:

Originally Posted by Basil2 View Post
Addon plays arena as resto shaman.
You should probably clarify that comment. If you're writing a bot, that's against the TOS and the rules of this site, and you will not get any further help here.
__________________
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
02-04-15, 01:02 AM   #9
Basil2
An Aku'mai Servant
Join Date: Feb 2015
Posts: 30
Originally Posted by Phanx View Post
You should probably clarify that comment. If you're writing a bot, that's against the TOS and the rules of this site, and you will not get any further help here.
Addons cannot cast so it can't be a bot My addon will advise the best spell in the situation by showing it's name and icon. It's like "SpellFlash" addon but for arena.
  Reply With Quote
02-03-15, 06:40 AM   #10
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by Basil2 View Post
Addon plays arena as resto shaman.
Saaaay what?
  Reply With Quote
02-02-15, 04:12 PM   #11
TOM_RUS
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 95
Originally Posted by Basil2 View Post
I need my addon to work with any language client. So I can't write GetSpellCooldown("Riptide") but
GetSpellCooldown(61295). However this is not informative at all.

The best IMHO solution is:
Code:
RiptideId = 61295
GetSpellCooldown(RiptideId)
So I am looking for a list like 'RiptideId = 61295' with all spells with their IDs. I guess somebody already did the job by exploring wowhead and preparing such table.

Could you please tell where is such table?
If your addon needs such table, you are doing something wrong. Spell ID should be enough for ALL cases. Also, what you gonna do with spells that have same name but different id?

Originally Posted by Basil2 View Post
So I can't write GetSpellCooldown("Riptide") but
GetSpellCooldown(61295). However this is not informative at all.
Put a comment...
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Need a table SpellName = SpellID


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