vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 CT_RA_ClassSpells = { };
2 CT_RA_HMark = nil;
3  
4 function CT_RA_GetClassSpells()
5 local noRankSpells = {
6 ["Blessing of Kings"] = 1,
7 ["Blessing of Freedom"] = 1,
8 ["Blessing of Salvation"] = 1
9 };
10 CT_RA_ClassSpells = { };
11 CT_RA_HMark = nil;
12 for i = 1, GetNumSpellTabs(), 1 do
13 local name, texture, offset, numSpells = GetSpellTabInfo(i);
14 for y = 1, numSpells, 1 do
15 local spellName, rankName = GetSpellName(offset+y, BOOKTYPE_SPELL);
16 local useless, useless, rank = string.find(rankName, "(%d+)");
17 if ( not CT_RA_ClassSpells[spellName] or ( CT_RA_ClassSpells[spellName]["rank"] and tonumber(rank) and CT_RA_ClassSpells[spellName]["rank"] < tonumber(rank) ) or noRankSpells[spellName] ) then
18 CT_RA_ClassSpells[spellName] = { ["rank"] = tonumber(rank), ["tab"] = i, ["spell"] = y+offset };
19 end
20 if ( not CT_RA_HMark and spellName == CT_RA_HUNTERSMARK ) then
21 CT_RA_HMark = { y+offset, i+1 };
22 end
23 end
24 end
25 end
26  
27 function CT_RA_ClassSpells_OnEvent(event)
28 if ( event == "SPELLS_CHANGED" ) then
29 CT_RA_GetClassSpells();
30 end
31 end