Quantcast WoWInterface - View Single Post - Browse GetSpellInfo ?
View Single Post
08-06-10, 02:42 PM   #5
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,447
Ah, I gotcha.

Some addons either get the user to enter the spellID themselves or the name in complete. The former allows for auto localisation and the latter means it will always be in the users language. They can look up unknown spells from wowhead etc.

The only other thing I can think of is to *learn* the buffs/debuffs as they happen and add them to a database and allow the user to black/whitelist them. Another option that some addons use.

All of these options will be less time consuming/intensive than cycling through 1 million numbers to see if there is a spell attached which may or may not have a buff/debuff linked to it.

However, having not built an addon as in depth as the one it seems you are trying to make I can't think of what else you can do.

But in answer to your question. I would hazard a guess that the max spell ID at present ( I am sure it will change with each expansion ) is 99,999. This is based on Gift of the Naaru being under 60,000 ID. However, seeing as that is a BC spell the numbers may have jumped up even higher.

for spellid = 1,99999 do
local spellName = GetSpellInfo(spellid)
if ( spellName ) then
AddSpellToDB(spellid,spellName)
end
end

The higher the max number the longer the delay in that addon being loaded and others after it. It will mean that users will be at the loading screen longer while your addon generates its database. So bear that in mind and see if one of the other options I mentioned will be more beneficial for your users.
__________________
  Reply With Quote