2012-01-01 04:01:18 +01:00
local GetTime = QuestHelper_GetTime
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 " ,
2012-09-25 04:00:15 +02:00
[ " WARRIOR " ] = " W " ,
[ " MONK " ] = " O "
2010-10-24 23:17:33 +02:00
} ;
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 " ,
2012-09-25 04:00:15 +02:00
[ " Goblin " ] = " L " ,
[ " Pandaren " ] = " P "
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 " )
--[[ assert(racelookup[race]) ]]
2010-12-16 13:50:13 +01:00
--local bso = Bitstream.Output(8)
2011-01-21 02:06:11 +01:00
local talents = { }
2010-10-24 23:17:33 +02:00
2012-09-25 04:00:15 +02:00
--local points = (GetUnspentTalentPoints() or 0)
2011-01-22 02:45:43 +01:00
local talents_learned = false
for t = 1 , GetNumTalentTabs ( ) do -- come on. Is this ever not going to be 3? Seriously? Perhaps someday, but not as of Cat.
local _ , tab , _ , _ , p , _ , _ , yn = GetTalentTabInfo ( t )
p = p or 0
2011-06-19 06:05:19 +02:00
talents_learned = true
talents [ tab ] = { }
for ta = 1 , GetNumTalents ( t ) do
local talent , _ , _ , _ , rank , _ = GetTalentInfo ( t , ta )
2011-07-06 20:56:10 +02:00
if talent then talents [ tab ] [ talent ] = rank end
2010-10-24 23:17:33 +02:00
end
end
2011-01-22 02:45:43 +01:00
2011-01-21 02:06:11 +01:00
local spec = { }
2011-06-19 06:05:19 +02:00
spec.talents = talents
2011-01-22 02:45:43 +01:00
spec.class = id
spec.race = race
2011-01-21 02:06:11 +01:00
spec.level = level
--return string.format("(2%s,%s,%02d)", classlookup[id], racelookup[race] or "", level) .. talstr
return spec
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