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
8 changes: 7 additions & 1 deletion Modules/Data/Constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,13 @@ Data.Enchant.MP5 = {
[3836] = 8, -- Master's Inscription of the Crag
[7099] = 12, -- Blackfathom Mana Oil. This effect only applies within Blackfathom Deeps.
}
Data.Enchant.BlockValue = {
["2583"] = 15, -- Presence of Might
["2653"] = 18, -- Enchant Shield - Tough Shield
["2655"] = 15, -- Enchant Shield - Shield Block
["3849"] = 81, -- Titanium Plating
["7633"] = 15, -- Presence of Valor
}
Data.Gem = {}
Data.Gem.MP5 = {
[23106] = 1,
Expand All @@ -398,7 +405,6 @@ Data.Gem.MP5 = {
}
Data.setNames = {
AUGURS_REGALIA = "Augur's Regalia",
BATTLEGEAR_OF_MIGHT = "Battlegear of Might",
BLOODSOUL_EMBRACE = "Bloodsoul Embrace",
DAWN_OF_TRANSCENDENCE = "Dawn of Transcendence",
FEL_IRON_CHAIN = "Fel Iron Chain",
Expand Down
22 changes: 14 additions & 8 deletions Modules/Data/Defense.lua
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,10 @@ end

---@return number
function Data:GetBlockValue()
local setBonus = _Defense:GetItemModifierBlockValue()
local blockValue = GetShieldBlock() + setBonus

local blockValue = 0
if C_SpellBook.IsSpellKnown(107) and C_PaperDollInfo.OffhandHasShield() then
blockValue = blockValue + GetShieldBlock() + _Defense:GetEnchantsBlockValue()
end
return DataUtils:Round(blockValue, 2)
end

Expand All @@ -233,12 +234,17 @@ function Data:GetResilienceRating()
return DataUtils:Round(GetCombatRating(15), 2)
end

function _Defense:GetItemModifierBlockValue()
---@return number
function _Defense:GetEnchantsBlockValue()
local mod = 0

if Data:HasSetBonusModifierBlockValue() then
mod = mod + 30
for i = 1, 18 do
local itemLink = GetInventoryItemLink("player", i)
if itemLink then
local enchant = DataUtils:GetEnchantFromItemLink(itemLink)
if enchant then
mod = mod + (Data.Enchant.BlockValue[itemLink] or 0)
end
end
end

return mod
end
18 changes: 0 additions & 18 deletions Modules/Data/ItemSets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ local itemSets = {
[19830] = true,
[19956] = true
},
[setNames.BATTLEGEAR_OF_MIGHT] = {
[16861] = true,
[16862] = true,
[16863] = true,
[16864] = true,
[16865] = true,
[16866] = true,
[16867] = true,
[16868] = true
},
[setNames.BLOODSOUL_EMBRACE] = {
[19690] = true,
[19691] = true,
Expand Down Expand Up @@ -198,14 +188,6 @@ function Data:HasNatureCritBonusModifier()
return false
end

function Data:HasSetBonusModifierBlockValue()
if classId == Data.WARRIOR then
return Data:IsSetBonusActive(setNames.BATTLEGEAR_OF_MIGHT, 3)
end

return false
end

function Data:IsSetBonusActive(setName, bonusLevel)
local setItems = itemSets[setName]
if (not setItems) then
Expand Down
Loading