Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions Modules/Data/SpellDamage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,13 @@ local Data = ECSLoader:ImportModule("Data")
---@type DataUtils
local DataUtils = ECSLoader:ImportModule("DataUtils")

local _SpellDamage = {}

local _, _, classId = UnitClass("player")

---@param school number
---@return number
function Data:GetSpellDamage(school)
local spellDmg = GetSpellBonusDamage(school)
local modifier = _SpellDamage:GetGeneralTalentModifier()
spellDmg = spellDmg * (1 + (modifier / 100))
return DataUtils:Round(spellDmg, 0)
end

---@return number
function _SpellDamage:GetGeneralTalentModifier()
local mod = 0

if classId == Data.MAGE then
local talentSlot = ECS.IsWotlk and 17 or 14
local _, _, _, _, points, _, _, _ = GetTalentInfo(1, talentSlot)
mod = points * 1 -- 0-3% Arcane Instability
end

return mod
end

---@return number
function Data:SpellPenetration()
return DataUtils:Round(GetSpellPenetration(), 2) .. "%"
Expand All @@ -49,4 +30,4 @@ end
function Data:GetSpellHasteBonus()
local hasteBonus = GetCombatRatingBonus(CR_HASTE_SPELL)
return DataUtils:Round(hasteBonus, 2) .. "%"
end
end
Loading