Skip to content

Commit 18e1253

Browse files
committed
System - Added support for checking which Hero Tree is active
API - br.player.heroTree.nameOfTree Ex: br.player.heroTree.druidOfTheClaw Returns: True/False
1 parent 70ffcd1 commit 18e1253

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

System/Lists/Specs.lua

+67
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,70 @@ br.lists.spec = {
8282
Initial = 1446,
8383
}
8484
}
85+
br.lists.heroSpec = {
86+
DEATHKNIGHT = {
87+
sanlayn = 31,
88+
riderOfTheApocalypse = 32,
89+
deathbringer = 33
90+
},
91+
DEMONHUNTER = {
92+
felScarred = 34,
93+
aldrachiReaver = 35
94+
},
95+
DRUID = {
96+
druidOfTheClaw = 21,
97+
wildstalker = 22,
98+
keeperOfTheGrove = 23,
99+
elunesChosen = 24
100+
},
101+
EVOKER = {
102+
scalecommander = 36,
103+
flameshaper = 37,
104+
chronowarden = 38
105+
},
106+
HUNTER = {
107+
sentinel = 42,
108+
packLeader = 43,
109+
darkRanger = 44
110+
},
111+
MAGE = {
112+
sunfury = 39,
113+
spellslinger = 40,
114+
frostfire = 41
115+
},
116+
MONK = {
117+
conduitOfTheCelestials = 64,
118+
shadopan = 65,
119+
masterOfHarmony = 66
120+
},
121+
PALADIN = {
122+
templar = 48,
123+
lightsmith = 49,
124+
heraldOfTheSun = 50
125+
},
126+
PRIEST = {
127+
voidweaver = 18,
128+
archon = 19,
129+
oracle = 20
130+
},
131+
ROGUE = {
132+
trickster = 51,
133+
fatebound = 52,
134+
deathstalker = 53
135+
},
136+
SHAMAN = {
137+
totemic = 54,
138+
stormbringer = 55,
139+
farseer = 56
140+
},
141+
WARLOCK = {
142+
soulHarvester = 57,
143+
hellcaller = 58,
144+
diabolist = 59
145+
},
146+
WARRIOR = {
147+
slayer = 60,
148+
mountainThane = 61,
149+
colossus = 62
150+
}
151+
}

System/Loader/cBuilder.lua

+24
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,26 @@ function br.loader:new(spec, specName)
263263
end
264264
end
265265

266+
-- Check if Hero Spec if Active
267+
local function getHeroTreeInfo()
268+
local playerClass = select(2, br._G.UnitClass('player'))
269+
-- Retrieve the active hero talent spec ID
270+
local activeSpecID = C_ClassTalents.GetActiveHeroTalentSpec()
271+
-- Check if the specName exists in the br.lists.heroSpec table
272+
for class, specs in pairs(br.lists.heroSpec) do
273+
-- print("Class: "..tostring(class).." Specs: "..tostring(specs))
274+
for spec, specID in pairs(specs) do
275+
-- print("Spec: "..tostring(spec).." SpecID: "..tostring(specID))
276+
if class == playerClass then
277+
if self.heroTree == nil then self.heroTree = {} end
278+
if self.heroTree[spec] == nil then self.heroTree[spec] = false end
279+
self.heroTree[spec] = specID == activeSpecID or false
280+
end
281+
end
282+
end
283+
end
284+
285+
266286
local function getFunctions()
267287
-- Build Talent Info
268288
local allTalents = getTalentInfo()
@@ -282,6 +302,10 @@ function br.loader:new(spec, specName)
282302
end
283303
end
284304
end
305+
306+
-- Build Hero Tree Info
307+
getHeroTreeInfo()
308+
285309
-- Parse Holding Table
286310
for k, v in pairs(spellListTalents) do
287311
br.api.talent(self.talent, k, v, allTalents, self.spells)

0 commit comments

Comments
 (0)