Skip to content
Merged
Show file tree
Hide file tree
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
33 changes: 4 additions & 29 deletions Modules/Data/Melee.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,43 +55,18 @@ function _Melee:GetHitRatingBonus()
return hit + (GetHitModifier() or 0)
end

---If a talent spell has the "Apply Aura: Modifies Hit Chance" effect, then we need to handle it here.
---If the effect is "Apply Aura: Mod Spell Hit Chance %", then GetHitModifier() already accounts for it and we don't need to handle it here.
---In TBC and WotLK clients, if a talent spell has the "Apply Aura: Mod Melee & Ranged Hit Chance %", then GetHitModifier() already accounts for it and we don't need to handle it here.
---@return number
function _Melee:GetHitTalentBonus()
local mod = 0

if classId == Data.WARRIOR then
if ECS.IsWotlk then
-- precision
mod = 1 * DataUtils:GetActiveTalentSpell({29590,29591,29592})
end
elseif classId == Data.HUNTER then
if ECS.IsWotlk then
-- focused aim
mod = 1 * DataUtils:GetActiveTalentSpell({53620,53621,53622})
end
elseif classId == Data.SHAMAN then
if ECS.IsWotlk then
-- Dual Wield Specialization
if Data:GetMeleeAttackSpeedOffHand() > 0 then
mod = 2 * DataUtils:GetActiveTalentSpell({30816,30818,30819})
end
elseif ECS.IsClassic then
if ECS.IsClassic then
if classId == Data.SHAMAN then
-- Nature's Guidance
mod = 1 * DataUtils:GetActiveTalentSpell({16180,16196,16198})
end
elseif classId == Data.ROGUE then
if ECS.IsClassic then
elseif classId == Data.ROGUE then
-- precision
mod = 1 * DataUtils:GetActiveTalentSpell({13705,13832,13843,13844,13845})
end
elseif classId == Data.DEATHKNIGHT then
-- Nerves of Cold Steel
-- This assumes a DK is dual wielding and not only using a one-hand main hand weapon
if Data:GetMeleeAttackSpeedOffHand() > 0 then
mod = 1 * DataUtils:GetActiveTalentSpell({49226,50137,50138})
end
end

return mod
Expand Down
17 changes: 1 addition & 16 deletions Modules/Data/Ranged.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ local DataUtils = ECSLoader:ImportModule("DataUtils")

local _Ranged = {}

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

---@return number
function Data:GetRangeAttackPower()
if UnitHasRelicSlot("player") then
Expand Down Expand Up @@ -80,20 +78,7 @@ function _Ranged:GetHitBonus()
hitValue = hitValue + GetCombatRatingBonus(CR_HIT_RANGED)
end

return hitValue + (GetHitModifier() or 0) + _Ranged:GetHitTalentBonus()
end

---If a talent spell has the "Apply Aura: Modifies Hit Chance" effect, then we need to handle it here.
---If the effect is "Apply Aura: Mod Spell Hit Chance %", then GetHitModifier() already accounts for it and we don't need to handle it here.
---@return number
function _Ranged:GetHitTalentBonus()
local bonus = 0

if ECS.IsWotlk and classId == Data.HUNTER then
bonus = bonus + 1 * DataUtils:GetActiveTalentSpell({53620,53621,53622}) -- Focused Aim
end

return bonus
return hitValue + (GetHitModifier() or 0)
end

---@return string
Expand Down
Loading