Skip to content

Commit

Permalink
Added spell changes for Cataclysm Classic
Browse files Browse the repository at this point in the history
  • Loading branch information
Xianghar committed Apr 29, 2024
1 parent 83a51c9 commit 96bdc5b
Show file tree
Hide file tree
Showing 7 changed files with 619 additions and 34 deletions.
26 changes: 7 additions & 19 deletions EnhanceCDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,18 @@ TotemTimers.EnhanceCDsCenterProcAnchor = CenterProcAnchor
CenterProcAnchor:Hide()
CenterProcAnchor:SetSize(130,65)
CenterProcAnchor:Show()
--local cpt = CenterProcAnchor:CreateTexture(nil, "BACKGROUND")
--cpt:SetAllPoints(CenterProcAnchor)
--cpt:SetTexture("Interface\\AddOns\\TotemTimers\\textures\\maelstrom_weapon")
--cpt:SetTexture(GetSpellTexture(SpellIDs.Maelstrom))

local LeftProcAnchor = CreateFrame("Frame", "LeftProcAnchor", UIParent)
TotemTimers.EnhanceCDsLeftProcAnchor = LeftProcAnchor
--LeftProcAnchor:Hide()
LeftProcAnchor:Hide()
LeftProcAnchor:SetSize(65, 130)
--local cpt = LeftProcAnchor:CreateTexture(nil, "BACKGROUND")
--cpt:SetAllPoints(LeftProcAnchor)
--cpt:SetTexture("Interface\\AddOns\\TotemTimers\\textures\\maelstrom_weapon")
--cpt:SetTexture(GetSpellTexture(SpellIDs.Maelstrom))



local RightProcAnchor = CreateFrame("Frame", nil, UIParent)
TotemTimers.EnhanceCDsRightProcAnchor = RightProcAnchor
--RightProcAnchor:Hide()
RightProcAnchor:Hide()
RightProcAnchor:SetSize(65, 130)
--cpt = RightProcAnchor:CreateTexture(nil, "BACKGROUND")
--cpt:SetAllPoints(RightProcAnchor)
--cpt:SetTexture("Interface\\AddOns\\TotemTimers\\textures\\maelstrom_weapon")
--cpt:SetTexture(GetSpellTexture(SpellIDs.Maelstrom))



local function ChangeCDOrder(self, _, _, spell)
Expand Down Expand Up @@ -301,10 +289,10 @@ function TotemTimers.ConfigEnhanceCDs()
FlameShockDuration:Activate()
end

--[[if (role == 2 or C_Seasons.GetActiveSeason() == 2) and Maelstrom
if (role == 2 or C_Seasons.GetActiveSeason() == 2) and Maelstrom
and TotemTimers.AvailableTalents.Maelstrom and TotemTimers.ActiveProfile.EnhanceCDsMaelstrom
then Maelstrom:Activate()
end]]
end

for i=1,#CDSpells[role] do
if TotemTimers.ActiveProfile.EnhanceCDs_Spells[role][i] and AvailableSpells[CDSpells[role][TotemTimers.ActiveProfile.EnhanceCDs_Order[role][i]]] then
Expand Down Expand Up @@ -721,7 +709,7 @@ local MaelstromName = GetSpellInfo(SpellIDs.Maelstrom)
local lastMaelstromCount = 0

function TotemTimers.MaelstromEvent(self)
--[[local _,_,count = AuraUtil.FindAuraByName(MaelstromName, "player", "HELPFUL")
local _,_,count = AuraUtil.FindAuraByName(MaelstromName, "player", "HELPFUL")
local numberOnly = Maelstrom.NumberOnly

if (not count or count < 5) and maelstromSpellsButtons and #maelstromSpellsButtons > 0 then
Expand Down Expand Up @@ -781,7 +769,7 @@ function TotemTimers.MaelstromEvent(self)
end

lastMaelstromCount = count
end]]
end
end


Expand Down
13 changes: 10 additions & 3 deletions GUI/EnhanceCDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ local function changeOrder(spell, dir, role)
TotemTimers.ProcessSetting("EnhanceCDs")
end

local specializations = {}
for i = 1, 3 do
local name, name2 = GetTalentTabInfo(i)
if type(name) == "number" then name = name2 end
specializations[i] = name
end

TotemTimers.options.args.enhancecds = {
type = "group",
name = "Combat Cooldowns",
Expand Down Expand Up @@ -346,21 +353,21 @@ TotemTimers.options.args.enhancecds = {
["2"] = {
order = 81,
type = "group",
name = GetTalentTabInfo(2) or "Enhancement",
name = specializations[2] or "Enhancement",
args = {
},
},
["1"] = {
order = 82,
type = "group",
name = GetTalentTabInfo(1) or "Elemental",
name = specializations[1] or "Elemental",
args = {
},
},
["3"] = {
order = 83,
type = "group",
name = GetTalentTabInfo(3) or "Restoration",
name = specializations[3] or "Restoration",
args = {
},
},
Expand Down
48 changes: 37 additions & 11 deletions Spells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ function TotemTimers.GetSpells()
end
end

function TotemTimers.GetTalents()
wipe(TotemTimers.AvailableTalents)
end

if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then

function TotemTimers.GetTalents()
TotemTimers.GetTalents = function()
wipe(TotemTimers.AvailableTalents)
TotemTimers.AvailableTalents.TotemicMastery = select(5, GetTalentInfo(3, 8)) * 10
TotemTimers.AvailableTalents.DualWield = AvailableSpells[SpellIDs.DualWield]
Expand All @@ -65,21 +69,28 @@ if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then

elseif LE_EXPANSION_LEVEL_CURRENT == LE_EXPANSION_BURNING_CRUSADE then

function TotemTimers.GetTalents()
TotemTimers.GetTalents = function()
wipe(TotemTimers.AvailableTalents)
TotemTimers.AvailableTalents.TotemicMastery = select(5, GetTalentInfo(3, 8)) * 10
TotemTimers.AvailableTalents.DualWield = select(5, GetTalentInfo(2, 18)) > 0
end

elseif LE_EXPANSION_LEVEL_CURRENT == LE_EXPANSION_WRATH_OF_THE_LICH_KING then

function TotemTimers.GetTalents()
TotemTimers.GetTalents = function()
wipe(TotemTimers.AvailableTalents)
TotemTimers.AvailableTalents.TotemicMastery = 0
TotemTimers.AvailableTalents.DualWield = select(5, GetTalentInfo(2, 17)) > 0
TotemTimers.AvailableTalents.Maelstrom = select(5, GetTalentInfo(2,24)) > 0
end

elseif LE_EXPANSION_LEVEL_CURRENT == LE_EXPANSION_CATACLYSM then
TotemTimers.GetTalents = function()
wipe(TotemTimers.AvailableTalents)
TotemTimers.AvailableTalents.TotemicMastery = 0
TotemTimers.AvailableTalents.DualWield = TotemTimers.Specialization == 2
TotemTimers.AvailableTalents.Maelstrom = select(5, GetTalentInfo(2,11)) > 0
end
end

function TotemTimers.GetBaseSpellID(spell)
Expand Down Expand Up @@ -154,16 +165,31 @@ end
TotemTimers.Specialization = 2

-- get specialization, if no points are spent (e.g. talents reset) do not change specialization
function TotemTimers.GetSpecialization()
local pointsSpent = 0
for i=1,3 do
local _,_,points = GetTalentTabInfo(i)
if points > pointsSpent then
pointsSpent = points
TotemTimers.Specialization = i

if GetPrimaryTalentTree then
function TotemTimers.GetSpecialization()
local spec = GetPrimaryTalentTree()
if spec and spec > 0 then
TotemTimers.Specialization = spec
elseif not TotemTimers.Specialization then
TotemTimers.Specialization = 2
end
TotemTimers.AddDebug("Spec: "..TotemTimers.Specialization)
end
TotemTimers.AddDebug("Spec: "..TotemTimers.Specialization)
else

function TotemTimers.GetSpecialization()
local pointsSpent = 0
for i=1,3 do
local _,_,points = GetTalentTabInfo(i)
if points > pointsSpent then
pointsSpent = points
TotemTimers.Specialization = i
end
end
TotemTimers.AddDebug("Spec: "..TotemTimers.Specialization)
end

end

function TotemTimers.ChangedTalents()
Expand Down
77 changes: 77 additions & 0 deletions TotemTimers_Cata.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
## Interface: 40400
## Title: TotemTimers
## Author: Xianghar
## Version: @project-version@
## SavedVariables: TotemTimers_GlobalSettings, TotemTimers_Profiles
## OptionalDeps: Masque
## LoadManagers: AddonLoader
## X-LoadOn-Class: Shaman
## X-Curse-Project-ID: 339602
## X-WoWI-ID: 25223
## X-Wago-ID: rkGrwANy

embeds.xml

localization\localization.lua
localization\localization.ge.lua
localization\localization.fr.lua
localization\localization.es.lua
localization\localization.ru.lua
localization\localization.cn.lua
localization\localization.tw.lua
localization\localization.ko.lua
localization\localization.br.lua
localization\localization.it.lua
localization\localization.esmx.lua

XiTimers.lua
XiTimers.xml

cata\TotemData.lua
TotemTimers.xml
TotemTimers.lua

Spells.lua

Animation.lua
Bindings.lua
ToolTips.lua
TotemSets.xml
TotemSets.lua
TTActionBars.lua
DefaultSettings.lua
Settings.lua
SetupTimers.lua
MultiSpell.lua
SetupTrackers.lua
Ankh.lua
Shield.lua
EarthShield.lua
Weapon.lua
EnhanceCDs.lua
LongCooldowns.lua
# Procs.lua
Warnings.lua
Masque.lua

GUI\localization.lua
GUI\localization.ge.lua
GUI\localization.ru.lua
GUI\localization.tw.lua
GUI\localization.cn.lua
GUI\localization.ko.lua
GUI\localization.fr.lua
GUI\localization.es.lua
GUI\localization.br.lua
GUI\localization.it.lua
GUI\localization.esmx.lua
GUI\General.lua
GUI\Timers.lua
GUI\Trackers.lua
GUI\EnhanceCDs.lua
GUI\Messages.lua
GUI\Totems.lua
GUI\Sets.lua
GUI\Profiles.lua


2 changes: 1 addition & 1 deletion TotemTimers.toc → TotemTimers_Wrath.toc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ EarthShield.lua
Weapon.lua
EnhanceCDs.lua
LongCooldowns.lua
Procs.lua
# Procs.lua
Warnings.lua
Masque.lua

Expand Down
Loading

0 comments on commit 96bdc5b

Please sign in to comment.