Skip to content

Commit

Permalink
fix #19
Browse files Browse the repository at this point in the history
.toc update
  • Loading branch information
AznamirWoW committed Aug 24, 2023
1 parent 86dbee3 commit b2dc5db
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 60 deletions.
81 changes: 24 additions & 57 deletions PallyPower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ local WisdomPallys, MightPallys, KingsPallys, SalvPallys, LightPallys, SancPally
local classlist, classes = {}, {}

PallyPower.player = UnitName("player")

PallyPower_Talents = {}
PallyPower_Assignments = {}
PallyPower_NormalAssignments = {}
PallyPower_AuraAssignments = {}
Expand Down Expand Up @@ -191,6 +191,7 @@ function PallyPower:OnEnable()
isPally = select(2, UnitClass("player")) == "PALADIN"

self.opt.enable = true
self:ScanTalents()
self:ScanSpells()
self:ScanCooldowns()
self:RegisterEvent("CHAT_MSG_ADDON")
Expand Down Expand Up @@ -1259,42 +1260,34 @@ function PallyPower:NeedsBuff(class, test, playerName)
return true
end

function PallyPower:ScanTalents()
local numTabs = GetNumTalentTabs()
for t = 1, numTabs do
for i = 1, GetNumTalents(t) do
local _, textureID = GetTalentInfo(t, i)
PallyPower_Talents[textureID] = {t, i}
end
end
end

function PallyPower:ScanSpells()
--self:Debug("[ScanSpells]")
if isPally then
local RankInfo = {}
for i = 1, #self.Spells do -- find max spell ranks
local spellName = GetSpellInfo(self.Spells[i])
local spellName, _, spellTexture = GetSpellInfo(self.Spells[i])
local spellRank = GetSpellSubtext(GetSpellInfo(self.Spells[i]))
if spellName then
RankInfo[i] = {}
if not spellRank or spellRank == "" then -- spells without ranks
spellRank = "1" -- BoK and BoS
end
local talent = 0
if i == 1 then
if self.isWrath then
-- TODO: GetTalentInfo bugged on beta right now so column/rows are "correct" but incorrect
-- talent = talent + select(5, GetTalentInfo(1, 6)) -- Improved Blessing of Wisdom
talent = talent + select(5, GetTalentInfo(1, 6)) -- Improved Blessing of Wisdom
else
talent = talent + select(5, GetTalentInfo(1, 10)) -- Improved Blessing of Wisdom
end
elseif i == 2 then
if self.isWrath then
-- TODO: GetTalentInfo bugged on beta right now so column/rows are "correct" but incorrect
-- talent = talent + select(5, GetTalentInfo(3, 5)) -- Improved Blessing of Might
talent = talent + select(5, GetTalentInfo(3, 1)) -- Improved Blessing of Might
else
talent = talent + select(5, GetTalentInfo(3, 1)) -- Improved Blessing of Might
end
elseif i == 3 and not self.isWrath then
talent = talent + select(5, GetTalentInfo(2, 6)) -- Blessing of Kings
elseif i == 6 and not self.isWrath then
if self.isBCC then
talent = talent + select(5, GetTalentInfo(2, 14)) -- Blessing of Sanctuary
else
talent = talent + select(5, GetTalentInfo(2, 12)) -- Blessing of Sanctuary
if PallyPower_Talents[spellTexture] then
local tab = PallyPower_Talents[spellTexture][1]
local loc = PallyPower_Talents[spellTexture][2]
if i == 1 or i == 2 or i == 3 or i == 6 then
talent = talent + select(5, GetTalentInfo(tab, loc))
end
end
RankInfo[i].talent = talent
Expand All @@ -1305,45 +1298,19 @@ function PallyPower:ScanSpells()
AllPallys[self.player] = RankInfo
AllPallys[self.player].AuraInfo = {}
for i = 1, PALLYPOWER_MAXAURAS do -- find max ranks/talents for auaras
local spellName = GetSpellInfo(self.Auras[i])
local spellName, _, spellTexture = GetSpellInfo(self.Auras[i])
local spellRank = GetSpellSubtext(GetSpellInfo(self.Auras[i]))
if spellName then
AllPallys[self.player].AuraInfo[i] = {}
if not spellRank or spellRank == "" then -- spells without ranks
spellRank = "1" -- Concentration
end
local talent = 0
if i == 1 then
if self.isWrath then
-- TODO: GetTalentInfo bugged on beta right now so column/rows are "correct" but incorrect
-- talent = talent + select(5, GetTalentInfo(2, 11)) -- Improved Devotion Aura
talent = talent + select(5, GetTalentInfo(2, 2)) -- Improved Devotion Aura
else
talent = talent + select(5, GetTalentInfo(2, 1)) -- Improved Devotion Aura
end
elseif i == 2 then
if self.isWrath then
-- TODO: GetTalentInfo bugged on beta right now so column/rows are "correct" but incorrect
-- talent = talent + select(5, GetTalentInfo(3, 14)) -- Sanctified Retribution
talent = talent + select(5, GetTalentInfo(3, 15)) -- Sanctified Retribution
else
talent = talent + select(5, GetTalentInfo(3, 11)) -- Improved Retribution Aura
end
elseif i == 3 then
if self.isWrath then
-- TODO: GetTalentInfo bugged on beta right now so column/rows are "correct" but incorrect
-- talent = talent + select(5, GetTalentInfo(1, 9)) -- Improved Concentration Aura
talent = talent + select(5, GetTalentInfo(1, 8)) -- Improved Concentration Aura
elseif self.isBCC then
talent = talent + select(5, GetTalentInfo(2, 12)) -- Improved Concentration Aura
else
talent = talent + select(5, GetTalentInfo(2, 11)) -- Improved Concentration Aura
end
elseif i == 7 and not self.isWrath then
if self.isBCC then
talent = talent + select(5, GetTalentInfo(3, 14)) -- Sanctity Aura
else
talent = talent + select(5, GetTalentInfo(3, 13)) -- Sanctity Aura
if PallyPower_Talents[spellTexture] then
local tab = PallyPower_Talents[spellTexture][1]
local loc = PallyPower_Talents[spellTexture][2]
if i == 1 or i == 2 or i == 3 or i == 7 then
talent = talent + select(5, GetTalentInfo(tab, loc))
end
end
AllPallys[self.player].AuraInfo[i].talent = talent
Expand Down
2 changes: 1 addition & 1 deletion PallyPower.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 30401
## Interface: 30402
## Author: Aznamir, Dyaxler, Es, gallantron
## Title: PallyPower Classic
## Version: @project-version@
Expand Down
2 changes: 1 addition & 1 deletion PallyPower_Vanilla.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 11403
## Interface: 11404
## Author: Aznamir, Dyaxler, Es, gallantron
## Title: PallyPower Classic
## Version: @project-version@
Expand Down
2 changes: 1 addition & 1 deletion PallyPower_Wrath.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 30401
## Interface: 30402
## Author: Aznamir, Dyaxler, Es, gallantron
## Title: PallyPower Classic
## Version: @project-version@
Expand Down

0 comments on commit b2dc5db

Please sign in to comment.