diff --git a/Modules/Config/MeleeSection.lua b/Modules/Config/MeleeSection.lua index d5886b77..26577c97 100755 --- a/Modules/Config/MeleeSection.lua +++ b/Modules/Config/MeleeSection.lua @@ -92,7 +92,7 @@ function _Config:LoadMeleeSection() desc = function() return i18n("Shows/Hides the expertise value.") end, width = 1.5, hidden = function() - return (not ECS.IsWotlk) + return ECS.IsClassic end, disabled = function() return (not ExtendedCharacterStats.profile.melee.display); end, get = function () return ExtendedCharacterStats.profile.melee.expertise.display; end, @@ -383,4 +383,4 @@ function _Config:LoadMeleeSection() }, }, } -end \ No newline at end of file +end diff --git a/Modules/Data/Constants.lua b/Modules/Data/Constants.lua index 9899cfc2..7befc211 100755 --- a/Modules/Data/Constants.lua +++ b/Modules/Data/Constants.lua @@ -347,7 +347,15 @@ Data.Aura.SpellCrit = { [51470] = 5, -- Elemental Oath Rank 2 } Data.Enchant = {} +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.Enchant.Ids = { + ANIMALISTIC_EXPERTISE = 7875, -- Your melee attacks have 5% less chance to be Dodged or Parried. BIZNICK_SCOPE = 2523, -- 3% Hit from Biznicks 247x128 Accurascope } Data.Enchant.MP5 = { @@ -374,13 +382,6 @@ 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, @@ -403,19 +404,284 @@ Data.Gem.MP5 = { [32216] = 2, [32225] = 2, } +Data.Item = {} +Data.Item.IncreaseExpertise = { + [233376] = 1, + [233397] = 1, + [233401] = 1, + [233412] = 1, + [233413] = 1, + [233415] = 1, + [233442] = 1, + [233579] = 1, + [233582] = 1, + [233585] = 1, + [233600] = 1, + [233612] = 1, + [233614] = 2, + [233618] = 1, + [233634] = 1, + [233635] = 1, + [233637] = 1, + [233640] = 2, + [233642] = 1, + [233651] = 1, + [233658] = 1, + [233659] = 1, + [233661] = 1, + [233662] = 1, + [233663] = 1, + [233665] = 1, + [233666] = 1, + [233668] = 1, + [233689] = 1, + [233692] = 1, + [233693] = 1, + [233699] = 1, + [233700] = 1, + [233711] = 1, + [233992] = 1, + [234650] = 1, + [234748] = 1, + [234984] = 1, + [234985] = 2, + [235005] = 1, + [235888] = 1, + [236005] = 1, + [236006] = 1, + [236007] = 1, + [236008] = 1, + [236009] = 1, + [236010] = 1, + [236011] = 1, + [236012] = 1, + [236013] = 1, + [236016] = 1, + [236019] = 1, + [236020] = 1, + [236021] = 1, + [236022] = 1, + [236023] = 1, + [236026] = 1, + [236029] = 1, + [236030] = 1, + [236031] = 1, + [236032] = 1, + [236033] = 1, + [236034] = 1, + [236035] = 1, + [236036] = 1, + [236037] = 1, + [236038] = 1, + [236039] = 1, + [236040] = 1, + [236050] = 1, + [236051] = 1, + [236052] = 1, + [236054] = 1, + [236055] = 1, + [236056] = 1, + [236124] = 1, + [236125] = 1, + [236128] = 1, + [236129] = 1, + [236130] = 1, + [236133] = 1, + [236134] = 1, + [236135] = 1, + [236136] = 1, + [236137] = 1, + [236138] = 1, + [236139] = 1, + [236140] = 1, + [236141] = 1, + [236170] = 1, + [236171] = 1, + [236172] = 1, + [236174] = 1, + [236175] = 1, + [236176] = 1, + [236201] = 1, + [236202] = 1, + [236203] = 1, + [236204] = 1, + [236205] = 1, + [236206] = 1, + [236207] = 1, + [236208] = 1, + [236209] = 1, + [236210] = 1, + [236211] = 1, + [236212] = 1, + [236215] = 1, + [236216] = 1, + [236218] = 1, + [236222] = 1, + [236255] = 1, + [236260] = 1, + [236262] = 1, + [236263] = 1, + [236293] = 1, + [236300] = 2, + [236304] = 1, + [236306] = 1, + [236309] = 1, + [236311] = 1, + [236319] = 1, + [236339] = 1, + [236341] = 1, + [237275] = 1, + [237512] = 1, +} +Data.Item.IsTimeworn = { + [233496] = true, + [233505] = true, + [233506] = true, + [233514] = true, + [233516] = true, + [233517] = true, + [233518] = true, + [233520] = true, + [233521] = true, + [233522] = true, + [233523] = true, + [233559] = true, + [233560] = true, + [233561] = true, + [233563] = true, + [233564] = true, + [233566] = true, + [233567] = true, + [233568] = true, + [233573] = true, + [233574] = true, + [233575] = true, + [233577] = true, + [233578] = true, + [233579] = true, + [233582] = true, + [233583] = true, + [233584] = true, + [233590] = true, + [233591] = true, + [233592] = true, + [233593] = true, + [233594] = true, + [233595] = true, + [233598] = true, + [233603] = true, + [233604] = true, + [233607] = true, + [233608] = true, + [233610] = true, + [233611] = true, + [233612] = true, + [233613] = true, + [233614] = true, + [233617] = true, + [233618] = true, + [233619] = true, + [233622] = true, + [233623] = true, + [233624] = true, + [233625] = true, + [233631] = true, + [233632] = true, + [233633] = true, + [233635] = true, + [233637] = true, + [233644] = true, + [233645] = true, + [233646] = true, + [234062] = true, + [234063] = true, + [234064] = true, + [234065] = true, + [234066] = true, + [234068] = true, + [234069] = true, + [234070] = true, + [234071] = true, + [234072] = true, + [234073] = true, + [234075] = true, + [234077] = true, + [234078] = true, + [234081] = true, + [234082] = true, + [234084] = true, + [234087] = true, + [234088] = true, + [234090] = true, + [234091] = true, + [234093] = true, + [234094] = true, + [234095] = true, + [234098] = true, + [234099] = true, + [234100] = true, + [234102] = true, + [234103] = true, + [234105] = true, + [234106] = true, + [234107] = true, + [234108] = true, + [234109] = true, + [234110] = true, + [234111] = true, + [234114] = true, + [234117] = true, + [234120] = true, + [234123] = true, + [234146] = true, + [234147] = true, + [234148] = true, + [234149] = true, + [234150] = true, + [234156] = true, + [234157] = true, + [234161] = true, + [234162] = true, + [234163] = true, + [234164] = true, + [234165] = true, + [234166] = true, + [234167] = true, + [234168] = true, + [234171] = true, + [234173] = true, + [234174] = true, + [234962] = true, + [234963] = true, + [235047] = true, +} +Data.Item.TimewornExpertise = { + [234018] = 1, + [234022] = 1, + [234027] = 1, + [234031] = 1, + [234035] = 1, +} Data.setNames = { AUGURS_REGALIA = "Augur's Regalia", BLOODSOUL_EMBRACE = "Bloodsoul Embrace", + BONESCYTHE_LEATHERS = "Bonescythe Leathers", DAWN_OF_TRANSCENDENCE = "Dawn of Transcendence", + DREAMWALKER_GUARDIAN = "Dreamwalker Guardian", + DREADNOUGHTS_BATTLEGEAR = "Dreadnought's Battlegear", FEL_IRON_CHAIN = "Fel Iron Chain", FREETHINKERS_ARMOR = "Freethinker's Armor", GREEN_DRAGON_MAIL = "Green Dragon Mail", HARUSPEXS_GARB = "Haruspex's Garb", LIVING_GREEN_DRAGON_MAIL = "Living Green Dragon Mail", + PLAGUEHEART_STITCHINGS = "Plagueheart Stitchings", PRIMAL_MOONCLOTH = "Primal Mooncloth", + REDEMPTION_BULWARK = "Redemption Bulwark", STORMRAGE_RAIMENT = "Stormrage Raiment", + SYMBOLS_OF_UNENDING_LIFE = "Symbols of Unending Life", TEN_STORMS = "The Ten Storms", THE_EARTHSHATTERER = "The Earthshatterer", + THE_EARTHSHATTERER_RESOLVE = "The Earthshatterer Resolve", VESTMENTS_OF_TRANSCENDENCE = "Vestments of Transcendence", WINDHAWK_ARMOR = "Windhawk Armor", } diff --git a/Modules/Data/DataUtils.lua b/Modules/Data/DataUtils.lua index 352c51ef..e8986ed1 100644 --- a/Modules/Data/DataUtils.lua +++ b/Modules/Data/DataUtils.lua @@ -107,7 +107,7 @@ function DataUtils:GetEnchantFromItemLink(itemLink) if itemLink then local _, itemStringLink = GetItemInfo(itemLink) if itemStringLink then - local _, _, enchant = string.find(itemStringLink, "item:%d+:(%d*)") + local _, _, enchant, _ = strsplit(":", itemStringLink, 4) return tonumber(enchant) end end @@ -129,12 +129,12 @@ function DataUtils.GetRuneForEquipSlot(equipSlot) end ---@param itemLink ItemLink ----@return (number, number, number) | nil +---@return (string, string, string) | nil function DataUtils:GetSocketedGemsFromItemLink(itemLink) if itemLink then local _, itemStringLink = GetItemInfo(itemLink) if itemStringLink then - local _, _, gem1, gem2, gem3 = string.find(itemStringLink, "item:%d*:%d*:(%d*):(%d*):(%d*)") + local _, _, gem1, gem2, gem3, _ = strsplit(":", itemStringLink, 6) return gem1, gem2, gem3 end end diff --git a/Modules/Data/ItemSets.lua b/Modules/Data/ItemSets.lua index cabd680a..5f02900c 100755 --- a/Modules/Data/ItemSets.lua +++ b/Modules/Data/ItemSets.lua @@ -17,6 +17,17 @@ local itemSets = { [19691] = true, [19692] = true, }, + [setNames.BONESCYTHE_LEATHERS] = { + [236032] = true, + [236033] = true, + [236034] = true, + [236035] = true, + [236036] = true, + [236037] = true, + [236038] = true, + [236039] = true, + [236040] = true + }, [setNames.DAWN_OF_TRANSCENDENCE] = { [231155] = true, [231156] = true, @@ -27,6 +38,28 @@ local itemSets = { [231161] = true, [231162] = true, }, + [setNames.DREADNOUGHTS_BATTLEGEAR] = { + [236005] = true, + [246006] = true, + [236007] = true, + [236008] = true, + [236009] = true, + [236010] = true, + [236011] = true, + [236012] = true, + [236013] = true + }, + [setNames.DREAMWALKER_GUARDIAN] = { + [236201] = true, + [236202] = true, + [236203] = true, + [236204] = true, + [236205] = true, + [236206] = true, + [236207] = true, + [236208] = true, + [236209] = true + }, [setNames.FEL_IRON_CHAIN] = { [23490] = true, [23491] = true, @@ -62,6 +95,28 @@ local itemSets = { [21874] = true, [21875] = true, }, + [setNames.PLAGUEHEART_STITCHINGS] = { + [236068] = true, + [236069] = true, + [236070] = true, + [236071] = true, + [236072] = true, + [236073] = true, + [236074] = true, + [236075] = true, + [236076] = true + }, + [setNames.REDEMPTION_BULWARK] = { + [236133] = true, + [236134] = true, + [236135] = true, + [236136] = true, + [236137] = true, + [236138] = true, + [236139] = true, + [236140] = true, + [236141] = true + }, [setNames.STORMRAGE_RAIMENT] = { [16897] = true, [16898] = true, @@ -72,6 +127,11 @@ local itemSets = { [16903] = true, [16904] = true, }, + [setNames.SYMBOLS_OF_UNENDING_LIFE] = { + [233417] = true, + [233418] = true, + [233419] = true + }, [setNames.TEN_STORMS] = { [16943] = true, [16944] = true, @@ -83,16 +143,27 @@ local itemSets = { [16950] = true }, [setNames.THE_EARTHSHATTERER] = { - [22468] = true, - [22470] = true, - [22469] = true, - [22466] = true, + [22464] = true, [22465] = true, + [22466] = true, [22467] = true, - [22464] = true, + [22468] = true, + [22469] = true, + [22470] = true, [22471] = true, [23065] = true }, + [setNames.THE_EARTHSHATTERERS_RESOLVE] = { + [236160] = true, + [236162] = true, + [236163] = true, + [236164] = true, + [236165] = true, + [236166] = true, + [236167] = true, + [236168] = true, + [236169] = true + }, [setNames.VESTMENTS_OF_TRANSCENDENCE] = { [16919] = true, [16920] = true, @@ -108,18 +179,30 @@ local itemSets = { [29523] = true, [29524] = true, }, - [setNames.GREEN_DRAGON_MAIL] = { - [15045] = true, - [15046] = true, - [20296] = true, - }, - [setNames.LIVING_GREEN_DRAGON_MAIL] = { - [227877] = true, - [227878] = true, - [227879] = true, - }, } +function Data:HasSetBonusIncreasedExpertise2() + if classId == Data.WARRIOR then + return Data:IsSetBonusActive(setNames.DREADNOUGHTS_BATTLEGEAR, 2) + elseif classId == Data.DRUID then + return Data:IsSetBonusActive(setNames.DREAMWALKER_GUARDIAN, 2) + elseif classId == Data.SHAMAN then + return Data:IsSetBonusActive(setNames.THE_EARTHSHATTERERS_RESOLVE, 2) + elseif classId == Data.PALADIN then + return Data:IsSetBonusActive(setNames.REDEMPTION_BULWARK, 2) + elseif classId == Data.ROGUE then + return Data:IsSetBonusActive(setNames.BONESCYTHE_LEATHERS, 2) + elseif classId == Data.WARLOCK then + return Data:IsSetBonusActive(setNames.PLAGUEHEART_STITCHINGS, 2) + end +end + +function Data:HasSetBonusIncreasedExpertise5() + if classId == Data.DRUID then + return Data:IsSetBonusActive(setNames.SYMBOLS_OF_UNENDING_LIFE, 3) + end +end + ---@return number function Data:GetSetBonusModifierMP5() local mod = 0 diff --git a/Modules/Data/Melee.lua b/Modules/Data/Melee.lua index a58448a6..9b6aa17e 100755 --- a/Modules/Data/Melee.lua +++ b/Modules/Data/Melee.lua @@ -232,6 +232,33 @@ end ---@return number function Data:GetExpertise() local expertise, _ = GetExpertise() + + if ECS.IsSoD then + -- count timeworn items + local timeworn = 0 + for i = 1, 18 do + local id, _ = GetInventoryItemID("player", i) + if Data.Item.IsTimeworn[id] then + timeworn = timeworn + 1 + end + end + + for i = 1, 18 do + local id, _ = GetInventoryItemID("player", i) + expertise = expertise + (Data.Item.IncreaseExpertise[id] or 0) + expertise = expertise + timeworn * (Data.Item.TimewornExpertise[id] or 0) + if classId == Data.DRUID then + local itemLink = GetInventoryItemLink("player", i) + if itemLink then + local enchant = DataUtils:GetEnchantFromItemLink(itemLink) + if enchant and enchant == Data.Enchant.Ids.ANIMALISTIC_EXPERTISE then + expertise = expertise + 5 + end + end + end + end + end + return DataUtils:Round(expertise, 0) end @@ -277,4 +304,3 @@ function Data:GetMeleeHasteBonus() local hasteBonus = GetCombatRatingBonus(CR_HASTE_MELEE) return DataUtils:Round(hasteBonus, 2) .. "%" end - diff --git a/Modules/Profile.lua b/Modules/Profile.lua index 2739d369..cc6e2f5c 100755 --- a/Modules/Profile.lua +++ b/Modules/Profile.lua @@ -127,7 +127,7 @@ local function GetDefaultStatsProfile() textColor = colors.ATTACK_SPEED_SECONDARY, statColor = colors.ATTACK_SPEED_PRIMARY, }, - expertise = {display = true, isTbcOnly = true, refName = "Expertise", text = "Expertise"}, + expertise = {display = true, refName = "Expertise", text = "Expertise"}, expertiseRating = {display = true, isTbcOnly = true, refName = "ExpertiseRating", text = "Expertise Rating"}, hasteRating = { display = true,