Classic Spell Ranks

Classic Spell Ranks

Client Version: 1.13.5


Rating:

Are you using addons that need the api GetSpellInfo function ? Well, it is broken atm, because it does not return spell ranks at all. Which is really a problem for classic addons.
So here comes this api hotfix. It is magically adding spell ranks to the GetSpellInfo function.
As soon as Blizzard is patching the client correctly, this addon is no more needed.

For addon developers : please notice, that this version of GetSpellInfo delivers directly integer numbers as ranks or nil. The original api delivered a localized string , and you had to parse it in order to retrieve the spell rank … . The easiest way is to have a translation table inbetween, that accepts both , strings and numbers. Something like this :

local rank_names=
{
[ 1]=1,[ 2]= 2,[ 3]= 3,[ 4]= 4,[ 5]= 5,[ 6]= 6,[ 7]= 7,[ 8]=8,
[ 9]=9,[10]=10,[11]=11,[12]=12,[13]=13,[14]=14,[15]=15,[16]=16,

[“Rank 1” ]= 1,[“Rank 2” ]= 2,[“Rank 3” ]= 3,[“Rank 4” ]= 4,[“Rank 5” ]=5,
[“Rank 6” ]= 6,[“Rank 7” ]= 7,[“Rank 8” ]= 8,[“Rank 9” ]= 9,[“Rank 11”]=10,
[“Rank 12”]=11,[“Rank 13”]=12,[“Rank 14”]=13,[“Rank 15”]=15,[“Rank 16”]=16,
};

Version 1.1 is no more crashing when using GetSpellInfo with names thanks for the testing !