Thread Tools Display Modes
07-15-05, 10:49 PM   #1
fvisker
A Kobold Labourer
Join Date: Jul 2005
Posts: 1
Spell Number Listing

I am looking for a by number listing for warrior spells/abilities.

Right now all I know is that:

Overpower(rank 3) = 76
Overpower(rank 4) = 77
Execute(rank 4) = 80

It doesn't seem to follow any pattern that I can see, can anyone help me please? Just counting the actions doesn't seem to work, as nothing adds up right.

Ironfeet
49 Warrior
  Reply With Quote
07-15-05, 10:58 PM   #2
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
Use this function to get spellid:

function GetSpellID(spellname)
local i,done,name,id,spellrank=1,false;
_,_,spellrank = string.find(spellname,"%((Rank %d+)%)");
spellname = string.gsub(spellname,"%(Rank %d+%)","");
while not done do
name,rank = GetSpellName(i,BOOKTYPE_SPELL);
if not name then
done=true;
elseif (name==spellname and not spellrank) or (name==spellname and rank==spellrank) then
id = i;
end i = i+1;
end
return id
end
--

to use:

id = GetSpellID("Overpower")
id = GetSpellID("Heroic Strike(Rank 2)")

Hmm do warrior skills have ranks? Ranks is optional in the function. If you don't give it one, it will return the highest rank. Or nil if the spell can't be found. (and spell+rank if rank is explicitly declared)

If not sure how to use it, wrap it in a minimal addon. Make the two files with the bold filenames and stick them in a directory called Startup under AddOns:

Startup.toc
## Interface: 1600
## Title: Startup
## Notes: Executes startup scripts
Startup.xml

Startup.xml
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script>
function GetSpellID(spellname)
local i,done,name,id,spellrank=1,false;
_,_,spellrank = string.find(spellname,"%((Rank %d+)%)");
spellname = string.gsub(spellname,"%(Rank %d+%)","");
while not done do
name,rank = GetSpellName(i,BOOKTYPE_SPELL);
if not name then
done=true;
elseif (name==spellname and not spellrank) or (name==spellname and rank==spellrank) then
id = i;
end i = i+1;
end
return id
end
</Script>
</Ui>

Then you can use GetSpellID within scripts. Tho be aware that the numbers returned won't be the same for everyone. The closest is at 60 when everyone has almost all their spells.
  Reply With Quote
07-15-05, 11:11 PM   #3
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
If you're looking for the action id, which is used in IsActionInRange(slot), then use this function:

function GetActionID(actionname)
local i,id;
for i=1,120 do
GameTooltip:SetAction(i)
if GameTooltipTextLeft1:GetText()==actionname then
id,i = i,120
end
end
return id
end
--

to use:
slot = GetActionID("Overpower")
slot = GetActionID("Heroic Strike")

This will return the slot number for the macro/spell name you give it, without the ranks. If you want you can stick it at the end of the .xml above just after the "end" and before the "</Script>"

edit: note the way it abuses GameTooltip is not "friendly" to other mods. I would use this function for discovery purposes only. If you wanted to put it in a released mod/macro collection, you'll want to make your own tooltip inherited from GameTooltip.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Spell Number Listing

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