Skip to content

Commit

Permalink
[fix] Add melee hit from Feral Combat Specialization Rune
Browse files Browse the repository at this point in the history
Related to #333
  • Loading branch information
BreakBB committed Dec 22, 2024
1 parent 12a8ff3 commit c3eb22a
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion Modules/Data/Melee.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
local Data = ECSLoader:ImportModule("Data")
---@type DataUtils
local DataUtils = ECSLoader:ImportModule("DataUtils")
---@type Utils
local Utils = ECSLoader:ImportModule("Utils")

local _Melee = {}
local _, _, classId = UnitClass("player")
Expand Down Expand Up @@ -44,7 +46,7 @@ function _Melee:GetHitRatingBonus()
if CR_HIT_MELEE then
return GetCombatRatingBonus(CR_HIT_MELEE) + _Melee:GetHitTalentBonus() + _Melee:GetHitFromBuffs()
end
return GetHitModifier()
return GetHitModifier() + _Melee.GetHitFromRunes()
end

function _Melee:GetHitTalentBonus()
Expand Down Expand Up @@ -114,6 +116,23 @@ function _Melee:GetHitFromBuffs()
return mod
end

function _Melee.GetHitFromRunes()
local mod = 0

if (not ECS.IsSoD) then
return mod
end

local finger1Rune = DataUtils.GetRuneForEquipSlot(Utils.CHAR_EQUIP_SLOTS.Finger1)
local finger2Rune = DataUtils.GetRuneForEquipSlot(Utils.CHAR_EQUIP_SLOTS.Finger2)

if classId == Data.DRUID and (finger1Rune == 51245 or finger2Rune == 51245) and DataUtils:IsShapeshifted() then
mod = mod + 3 -- 3% from Feral Combat Specialization Rune
end

return mod
end

---@return string
function Data:MeleeHitMissChanceSameLevel()
local mainBase, mainMod, _, _ = UnitAttackBothHands("player")
Expand Down

0 comments on commit c3eb22a

Please sign in to comment.