1
0
Bifurcation 0
Ce dépôt a été archivé le 2020-03-15. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
questhelperredux/QuestHelper/collect_spec.lua

79 lignes
1,8 Kio
Lua
Brut Vue normale Historique

local GetTime = QuestHelper_GetTime
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",
["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]) ]]
--local bso = Bitstream.Output(8)
local talents = {}
2010-10-24 23:17:33 +02:00
2012-09-25 04:00:15 +02:00
--local points = (GetUnspentTalentPoints() or 0)
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
talents_learned = true
talents[tab] = {}
for ta = 1, GetNumTalents(t) do
local talent, _, _, _, rank, _ = GetTalentInfo(t, ta)
if talent then talents[tab][talent] = rank end
2010-10-24 23:17:33 +02:00
end
end
local spec = {}
spec.talents = talents
spec.class = id
spec.race = race
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