2010-11-08 14:28:59 +01:00
QuestHelper_File [ " collect_spec.lua " ] = " 4.0.1.$svnversion$ "
2010-10-24 23:17:33 +02:00
QuestHelper_Loadtime [ " collect_spec.lua " ] = GetTime ( )
local Bitstream
local classlookup = {
[ " DEATHKNIGHT " ] = " K " ,
[ " DRUID " ] = " D " ,
[ " HUNTER " ] = " H " ,
[ " MAGE " ] = " M " ,
[ " PALADIN " ] = " N " ,
[ " PRIEST " ] = " P " ,
[ " ROGUE " ] = " R " ,
[ " SHAMAN " ] = " S " ,
[ " WARLOCK " ] = " L " ,
[ " WARRIOR " ] = " W "
} ;
local racelookup = {
[ " Draenei " ] = " R " ,
[ " Gnome " ] = " G " ,
[ " Dwarf " ] = " D " ,
[ " Human " ] = " H " ,
[ " NightElf " ] = " E " ,
2010-12-16 13:50:13 +01:00
[ " Worgen " ] = " W " ,
2010-10-24 23:17:33 +02:00
[ " Orc " ] = " O " ,
[ " Troll " ] = " T " ,
[ " Tauren " ] = " N " ,
[ " Undead " ] = " U " ,
[ " BloodElf " ] = " B " ,
2010-12-16 13:50:13 +01:00
[ " Goblin " ] = " L "
2010-10-24 23:17:33 +02:00
-- lol i spelled nub
}
local function GetSpecBolus ( )
local _ , id = UnitClass ( " player " )
local level = UnitLevel ( " player " )
local _ , race = UnitRace ( " player " )
2010-12-16 13:50:13 +01:00
local talstr = " ( "
2010-10-24 23:17:33 +02:00
--[[ assert(racelookup[race]) ]]
2010-12-16 13:50:13 +01:00
--local bso = Bitstream.Output(8)
2010-10-24 23:17:33 +02:00
for t = 1 , GetNumTalentTabs ( ) do -- come on. Is this ever not going to be 3? Seriously?
2010-12-16 13:50:13 +01:00
if t == 1 then
talstr = talstr .. " ( "
else
talstr = talstr .. " ,( "
end
2010-10-24 23:17:33 +02:00
for ta = 1 , GetNumTalents ( t ) do
local _ , _ , _ , _ , rank , _ = GetTalentInfo ( t , ta )
2010-12-16 13:50:13 +01:00
if ta == 1 then
talstr = talstr .. rank
else
talstr = talstr .. " , " .. rank
end
--bso:append(rank, 3)
2010-10-24 23:17:33 +02:00
end
2010-12-16 13:50:13 +01:00
talstr = talstr .. " ) "
--bso:append(6, 3) -- no 6-point talents, so we use this as an end-of-tree market
2010-10-24 23:17:33 +02:00
end
2010-12-16 13:50:13 +01:00
talstr = talstr .. " ) "
--bso:append(7, 3) -- end-of-spec! because of *all of those 4-tree classes*
2010-10-24 23:17:33 +02:00
2010-12-16 13:50:13 +01:00
--return string.format("2%s%s%02d", classlookup[id], racelookup[race] or "", level) .. bso:finish()
return string.format ( " (2%s,%s,%02d) " , classlookup [ id ] , racelookup [ race ] or " " , level ) .. talstr
2010-10-24 23:17:33 +02:00
end
function QH_Collect_Spec_Init ( _ , API )
Bitstream = API.Utility_Bitstream
QuestHelper : Assert ( Bitstream )
API.Utility_GetSpecBolus = GetSpecBolus
end