update to 1.1.10
[QuestHelper.git] / collect_spec.lua
blob664c2684b4f251dc3de469b8221b58ef060658a2
1 QuestHelper_File["collect_spec.lua"] = "Development Version"
2 QuestHelper_Loadtime["collect_spec.lua"] = GetTime()
4 local Bitstream
6 local classlookup = {
7 ["DEATHKNIGHT"] = "K",
8 ["DRUID"] = "D",
9 ["HUNTER"] = "H",
10 ["MAGE"] = "M",
11 ["PALADIN"] = "N",
12 ["PRIEST"] = "P",
13 ["ROGUE"] = "R",
14 ["SHAMAN"] = "S",
15 ["WARLOCK"] = "L",
16 ["WARRIOR"] = "W"
19 local function GetSpecBolus()
20 local _, id = UnitClass("player")
21 local level = UnitLevel("player")
23 local bso = Bitstream.Output(8)
25 for t = 1, GetNumTalentTabs() do -- come on. Is this ever not going to be 3? Seriously?
26 for ta = 1, GetNumTalents(t) do
27 local _, _, _, _, rank, _ = GetTalentInfo(t, ta)
28 bso:append(rank, 3)
29 end
30 bso:append(6, 3) -- no 6-point talents, so we use this as an end-of-tree market
31 end
32 bso:append(7, 3) -- end-of-spec! because of *all of those 4-tree classes*
34 return string.format("%s%02d%s", classlookup[id], level, bso:finish())
35 end
37 function QH_Collect_Spec_Init(_, API)
38 Bitstream = API.Utility_Bitstream
39 QuestHelper: Assert(Bitstream)
41 API.Utility_GetSpecBolus = GetSpecBolus
42 end