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,930
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.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote