From a456332ec7eb45fdab119078ef4d52a1741c846c Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Sun, 16 Mar 2025 03:56:12 +0100 Subject: [PATCH 01/11] wip --- Modules/Data/Constants.lua | 152 +++++++++++++++++++++++++++++++++++ Modules/Data/ItemSets.lua | 25 ++++++ Modules/Data/Melee.lua | 61 +++++++++++++- Modules/Data/Ranged.lua | 60 ++++++++++++++ Modules/Data/SpellDamage.lua | 62 +++++++++++++- 5 files changed, 358 insertions(+), 2 deletions(-) diff --git a/Modules/Data/Constants.lua b/Modules/Data/Constants.lua index a465ef8a..015e2bb4 100755 --- a/Modules/Data/Constants.lua +++ b/Modules/Data/Constants.lua @@ -346,8 +346,30 @@ Data.Aura = { [51466] = 3, -- Elemental Oath Rank 1 [51470] = 5, -- Elemental Oath Rank 2 }, + UndeadAttackPower = { -- melee + [17352] = 200, -- Argent Avenger + [24833] = 300, -- holy mightstone + [28486] = 30, -- Scourgebane Draught + }, + UndeadSpellPower = { -- spell + [24833] = 400, -- holy mightstone + [28488] = 15, -- Scourgebane Infusion + [60597] = 12000, -- Blessing of the Crusade + }, } Data.Enchant = { + BeastSlayer = { -- physical/spell + [31] = 2, + [188] = 2, + [189] = 4, + [190] = 6, + [191] = 8, + [192] = 10, + [193] = 12, + [194] = 14, + [249] = 2, -- Enchant Weapon - Minor Beastslayer + [853] = 6, -- Enchant Weapon - Lesser Beastslayer + }, BlockValue = { [2583] = 15, -- Presence of Might [2653] = 18, -- Enchant Shield - Tough Shield @@ -357,6 +379,12 @@ Data.Enchant = { }, Ids = { BIZNICK_SCOPE = 2523, -- 3% Hit from Biznicks 247x128 Accurascope + LESSER_ELEMENTAL_SLAYER = 854, -- +6 Enchant Weapon - Lesser Elemental Slayer + UNDEAD_DEMON_SLAYER_150 = 3093, -- Consecrated Weapon + }, + IncreaseSpellDamageUndead = { -- spell + [2685] = 60, -- Blessed Wizard Oil + [3592] = 100, -- Blessed Wizard Oil }, MP5 = { [2381] = 10, -- Enchant Chest - Greater Mana Restoration @@ -382,6 +410,12 @@ Data.Enchant = { [3836] = 8, -- Master's Inscription of the Crag [7099] = 12, -- Blackfathom Mana Oil. This effect only applies within Blackfathom Deeps. }, + UndeadSlayer = { -- melee/ranged + [2684] = 100, -- Consecrated Weapon + [3247] = 140, -- Enchant 2H Weapon - Scourgebane + [3593] = 170, + [7896] = 200, -- Consecrated Two-Handed Weapon + }, } Data.Gem = { MP5 = { @@ -444,9 +478,126 @@ Data.Gem = { [42146] = 17, -- Lustrous Dragon's Eye }, } +Data.Item = { + BeastSlaying = { -- ranged/melee + [1465] = 18, -- tigerbane + [3566] = 30, -- Raptorbane Armor + [7710] = 60, -- Loksey's Training Stick + [7756] = 30, -- Dog Training Gloves + [11628] = 24, -- Houndmaster's Bow + [11629] = 24, -- Houndmaster's Rifle + [11906] = 30, -- Beastsmasher + [11907] = 72, -- Beastslayer + [12709] = 45, -- pip's skinner + [13212] = 48, -- Halycon's Spiked Collar + [15782] = 33, -- Beaststalker Blade + [15783] = 33, -- Beasthunter Dagger + [16658] = 18, -- Wildhunter Cloak + [19946] = 60, -- Tigule's Harpoon + [37018] = -40, -- G.E.H.T.A. + [231272] = 99, -- Tigule's Harpoon + [231849] = 99, -- Tigule's Harpoon + }, + DemonSlaying = { -- ranged/melee + [10696] = 33, -- Enchanted Azsharite Felbane Sword + [10697] = 33, -- Enchanted Azsharite Felbane Dagger + [10698] = 78, -- Enchanted Azsharite Felbane Staff + [13044] = 99, -- Demonslayer + [18715] = 45, -- Lok'delar, Stave of the Ancient Keepers + [19963] = 117, -- Pitchfork of Madness + [20487] = 45, -- Lok'delar, Stave of the Ancient Keepers DEP + [29398] = 39, -- Circle of Banishing + [30788] = 93, -- Illidari-Bane Dagger + [31745] = 93, -- Illidari-Bane Broadsword + [220575] = 39, -- Eater of the Damned + [228332] = 45, -- Lok'delar, Stave of the Ancient Keepers + [231277] = 141, -- Pitchfork of Madness + [231864] = 141, -- Pitchfork of Madness + }, + DragonSlaying = { -- ranged/melee + [19961] = 48, -- Gri'lek's Grinder + [19962] = 117, -- Gri'lek's Carver + [220965] = 117, -- Scalebane Greataxe + [221457] = 36, -- Libram of Draconic Destruction + [231273] = 141, -- Gri'lek's Carver + [231274] = 60, -- Gri'lek's Grinder + [231846] = 141, -- Gri'lek's Carver + [231847] = 60, -- Gri'lek's Grinder + }, + ElementalSlaying = { -- ranged/melee + [18310] = 36, -- Fiendish Machete + [228056] = 36, -- Fiendish Machete + [228486] = 75, -- Treant's Bane + }, + IncreaseSpellDamageUndead = { -- spell + [18346] = 35, -- Threadbare Trousers + [19812] = 48, -- Rune of the Dawn + [23084] = 35, -- Gloves of Undead Cleansing + [23085] = 48, -- Robe of Undead Cleansing + [23091] = 26, -- Bracers of Undead Cleansing + [236716] = 35, -- Bracers of Undead Cleansing + [236717] = 48, -- Gloves of Undead Cleansing + [236718] = 65, -- Robe of Undead Cleansing + [236722] = 26, -- Bracers of Undead Warding + [236723] = 26, -- Gloves of Undead Warding + [236724] = 26, -- Robe of Undead Warding + [236725] = 35, -- Wristwraps of Undead Cleansing + [236726] = 48, -- Handwraps of Undead Cleansing + [236727] = 65, -- Tunic of Undead Cleansing + [236734] = 35, -- Wristguards of Undead Cleansing + [236735] = 48, -- Handguards of Undead Cleansing + [236736] = 65, -- Chestguard of Undead Cleansing + [236737] = 26, -- Wristguards of Undead Warding + [236738] = 26, -- Handguards of Undead Warding + [236739] = 26, -- Chestguard of Undead Warding + }, + IncreaseSpellDamageUndeadDemon = { -- spell + [23207] = 85, -- Champion of the Dawn + [236351] = 89, -- Champion of the Dawn + }, + UndeadDemonSlaying = { -- ranged/melee + [23207] = 150, -- Champion of the Dawn + [236352] = 157, -- Champion of the Dawn + }, + UndeadSlaying = { -- ranged/melee + [867] = 30, -- Gloves of Holy Might + [10805] = 30, -- Eater of the Dead + [13017] = 66, -- Hellslayer Battle Axe + [13209] = 81, -- Seal of the Dawn + [18758] = 45, -- Specter's Blade + [23078] = 60, -- Gauntlets of Undead Slaying + [23081] = 60, -- Handwraps of Undead Slaying + [23082] = 60, -- Handguards of Undead Slaying + [23087] = 81, -- Breastplate of Undead Slaying + [23088] = 81, -- Chestguard of Undead Slaying + [23089] = 81, -- Tunic of Undead Slaying + [23090] = 45, -- Bracers of Undead Slaying + [23092] = 45, -- Wristguards of Undead Slaying + [23093] = 45, -- Wristwraps of Undead Slaying + [209574] = 15, -- Discarded Tenets of the Silver Hand + [220575] = 39, -- Eater of the Damned + [228030] = 30, -- Malicious Axe + [236707] = 108, -- Tunic of Undead Slaying + [236708] = 108, -- Breastplate of Undead Slaying + [236709] = 108, -- Chestguard of Undead Slaying + [236710] = 60, -- Wristguards of Undead Slaying + [236711] = 60, -- Wristwraps of Undead Slaying + [236712] = 60, -- Bracers of Undead Slaying + [236713] = 81, -- Handwraps of Undead Slaying + [236714] = 81, -- Gauntlets of Undead Slaying + [236715] = 81, -- Handguards of Undead Slaying + [236731] = 45, -- Wristwraps of Undead Warding + [236732] = 45, -- Handwraps of Undead Warding + [236733] = 45, -- Tunic of Undead Warding + [236746] = 45, -- Bracers of Undead Warding + [236747] = 45, -- Gauntlets of Undead Warding + [236748] = 45, -- Breastplate of Undead Warding + }, +} Data.setNames = { AUGURS_REGALIA = "Augur's Regalia", BLOODSOUL_EMBRACE = "Bloodsoul Embrace", + CHAIN_OF_THE_SCARLET_CRUSADE = "Chain of the Scarlet Crusade", DAWN_OF_TRANSCENDENCE = "Dawn of Transcendence", FEL_IRON_CHAIN = "Fel Iron Chain", FREETHINKERS_ARMOR = "Freethinker's Armor", @@ -457,6 +608,7 @@ Data.setNames = { STORMRAGE_RAIMENT = "Stormrage Raiment", TEN_STORMS = "The Ten Storms", THE_EARTHSHATTERER = "The Earthshatterer", + THE_TWIN_BLADES_OF_AZZINOTH = "The Twin Blades of Azzinoth", VESTMENTS_OF_TRANSCENDENCE = "Vestments of Transcendence", WINDHAWK_ARMOR = "Windhawk Armor", } diff --git a/Modules/Data/ItemSets.lua b/Modules/Data/ItemSets.lua index 7e07ffed..e24af994 100755 --- a/Modules/Data/ItemSets.lua +++ b/Modules/Data/ItemSets.lua @@ -118,6 +118,18 @@ local itemSets = { [227878] = true, [227879] = true, }, + [setNames.CHAIN_OF_THE_SCARLET_CRUSADE] = { + [10328] = true, + [10329] = true, + [10330] = true, + [10331] = true, + [10332] = true, + [10333] = true + }, + [setNames.THE_TWIN_BLADES_OF_AZZINOTH] = { + [32837] = true, + [32838] = true + }, } ---@return number @@ -144,6 +156,19 @@ function Data:GetSetBonusModifierMP5() return mod end +---@return bool +function Data:HasDemonSlaying200() + if classId == Data.ROGUE or classId == Data.WARRIOR then + return Data:IsSetBonusActive(setNames.THE_TWIN_BLADES_OF_AZZINOTH, 2) + end + return false +end + +---@return bool +function Data:HasUndeadSlayer15() + return Data:IsSetBonusActive(setNames.CHAIN_OF_THE_SCARLET_CRUSADE, 5) +end + ---@return number function Data:GetSetBonusValueMP5() local bonus = 0 diff --git a/Modules/Data/Melee.lua b/Modules/Data/Melee.lua index ec86964d..7ef735c0 100755 --- a/Modules/Data/Melee.lua +++ b/Modules/Data/Melee.lua @@ -14,7 +14,66 @@ function Data:GetMeleeAttackPower() return melee + posBuff + negBuff end ----@return number +---@param creature number +---@return string +function Data:GetMeleeAttackPowerVsCreature(creature) + local dmg = 0 + -- auras + local j = 1 + repeat + local aura = C_UnitAuras.GetAuraDataByIndex("player", j, "HELPFUL") + j = j + 1 + if aura and aura.spellId then + if creature == Data.UNDEAD then + dmg = dmg + (Data.buffsUndeadAttackPower[aura.spellId] or 0) + elseif creature == Data.DEMON then + if aura.spellId == 11406 then dmg = dmg + 265 end -- Elixir of Demonslaying + end + end + until (not aura) + for i = 1, 18 do + -- items + local id, _ = GetInventoryItemID("player", i) + if creature == Data.UNDEAD then + dmg = dmg + (Data.itemsUndeadSlaying[id] or 0) + dmg = dmg + (Data.itemsUndeadDeamonSlaying[id] or 0) + elseif creature == Data.DEMON then + dmg = dmg + (Data.itemsDemonSlaying[id] or 0) + dmg = dmg + (Data.itemsUndeadDeamonSlaying[id] or 0) + elseif creature == Data.DRAGONKIN then + dmg = dmg + (Data.itemsDragonSlaying[id] or 0) + elseif creature == Data.MECHANICAL then + if id == 213319 then dmg = dmg + 30 end -- Machinist's Gloves + end + -- enchants + local itemLink = GetInventoryItemLink("player", i) + if itemLink then + local enchant = DataUtils:GetEnchantFromItemLink(itemLink) + if enchant then + if creature == Data.UNDEAD then + dmg = dmg + (Data.enchantsUndeadSlayer[enchant] or 0) + if enchant and enchant == Data.enchantIds.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end + elseif creature == Data.DEMON then + if enchant and enchant == Data.enchantIds.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end + elseif creature == Data.BEAST then + dmg = dmg + (Data.enchantsBeastSlayer[enchant] or 0) + elseif creature == Data.ELEMENTAL then + dmg = dmg + (Data.enchantsElementalSlayer[enchant] or 0) + if enchant and enchant == Data.enchantIds.LESSER_ELEMENTAL_SLAYER then dmg = dmg + 6 end + end + end + end + end + -- sets + if creature == Data.UNDEAD then + if Data:HasUndeadSlayer15() then dmg = dmg + 15 end + elseif creature == Data.DEMON then + if Data:HasDemonSlaying200() then dmg = dmg + 200 end + end + return dmg +end + +---@return string function Data:GetMeleeAttackSpeedMainHand() local mainHand, _ = UnitAttackSpeed("player") return DataUtils:Round(mainHand, 2) diff --git a/Modules/Data/Ranged.lua b/Modules/Data/Ranged.lua index 4c5562f0..f5fda667 100755 --- a/Modules/Data/Ranged.lua +++ b/Modules/Data/Ranged.lua @@ -19,6 +19,66 @@ function Data:GetRangeAttackPower() return melee + posBuff + negBuff end +---@param creature number +---@return string +function Data:GetRangedAttackPowerVsCreature(creature) + local dmg = 0 + -- auras + local j = 1 + repeat + local aura = C_UnitAuras.GetAuraDataByIndex("player", j, "HELPFUL") + j = j + 1 + if aura and aura.spellId then + if creature == Data.UNDEAD then + if aura.spellId == 58026 then dmg = dmg + 12000 end -- Blessing of the Crusade + elseif creature == Data.DEMON then + if aura.spellId == 11406 then dmg = dmg + 265 end -- Elixir of Demonslaying + end + end + until (not aura) + for i = 1, 18 do + -- items + local id, _ = GetInventoryItemID("player", i) + if creature == Data.UNDEAD then + dmg = dmg + (Data.itemsUndeadSlaying[id] or 0) + dmg = dmg + (Data.itemsUndeadDeamonSlaying[id] or 0) + elseif creature == Data.DEMON then + dmg = dmg + (Data.itemsDemonSlaying[id] or 0) + dmg = dmg + (Data.itemsUndeadDeamonSlaying[id] or 0) + elseif creature == Data.DRAGONKIN then + dmg = dmg + (Data.itemsDragonSlaying[id] or 0) + elseif creature == Data.MECHANICAL then + if id == 213319 then dmg = dmg + 30 end -- Machinist's Gloves + end + -- enchants + local itemLink = GetInventoryItemLink("player", i) + if itemLink then + local enchant = DataUtils:GetEnchantFromItemLink(itemLink) + if enchant then + if creature == Data.UNDEAD then + dmg = dmg + (Data.enchantsUndeadSlayer[enchant] or 0) + if enchant and enchant == Data.enchantIds.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end + elseif creature == Data.DEMON then + if enchant and enchant == Data.enchantIds.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end + elseif creature == Data.BEAST then + dmg = dmg + (Data.enchantsBeastSlayer[enchant] or 0) + elseif creature == Data.ELEMENTAL then + dmg = dmg + (Data.enchantsElementalSlayer[enchant] or 0) + if enchant and enchant == Data.enchantIds.LESSER_ELEMENTAL_SLAYER then dmg = dmg + 6 end + end + end + end + end + -- sets + if creature == Data.UNDEAD then + if Data:HasUndeadSlayer15() then dmg = dmg + 15 end + elseif creature == Data.DEMON then + if Data:HasDemonSlaying200() then dmg = dmg + 200 end + end + return dmg +end + + ---@return boolean function _Ranged:IsRangeAttackClass() return classId == Data.WARRIOR or classId == Data.ROGUE or classId == Data.HUNTER diff --git a/Modules/Data/SpellDamage.lua b/Modules/Data/SpellDamage.lua index 08f96a15..83e78ab2 100755 --- a/Modules/Data/SpellDamage.lua +++ b/Modules/Data/SpellDamage.lua @@ -10,7 +10,67 @@ function Data:GetSpellDamage(school) return DataUtils:Round(spellDmg, 0) end ----@return string +---@param creature number +---@return number +function Data:GetSpellPowerVsCreature(creature) + local spellDmg = 0 + -- auras + local j = 1 + repeat + local aura = C_UnitAuras.GetAuraDataByIndex("player", j, "HELPFUL") + j = j + 1 + if aura and aura.spellId then + if creature == Data.UNDEAD then + spellDmg = spellDmg + (Data.buffsUndeadSpellPower[aura.spellId] or 0) + end + end + until (not aura) + for i = 1, 18 do + -- items + local id, _ = GetInventoryItemID("player", i) + if creature == Data.UNDEAD then + spellDmg = spellDmg + (Data.itemsIncreaseSpellDamageUndead[id] or 0) + spellDmg = spellDmg + (Data.itemsIncreaseSpellDamageUndeadDemon[id] or 0) + elseif creature == Data.DEMON then + if id == 30787 then spellDmg = spellDmg + 185 end -- Illidari-Bane Mageblade + spellDmg = spellDmg + (Data.itemsIncreaseSpellDamageUndeadDemon[id] or 0) + end + -- enchants + local itemLink = GetInventoryItemLink("player", i) + if itemLink then + local enchant = DataUtils:GetEnchantFromItemLink(itemLink) + if enchant then + if creature == Data.UNDEAD then + spellDmg = spellDmg + (Data.enchantsUndeadSlayer[enchant] or 0) + spellDmg = spellDmg + (Data.enchantsIncreaseSpellDamageUndead[enchant] or 0) + elseif creature == Data.BEAST then + spellDmg = spellDmg + (Data.enchantsBeastSlayer[enchant] or 0) + elseif creature == Data.ELEMENTAL then + spellDmg = spellDmg + (Data.enchantsElementalSlayer[enchant] or 0) + end + end + end + end + + 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) .. "%" end From 37ea924b60eb25bc45d26ab65bfb57acce084d1c Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Fri, 23 Jan 2026 17:49:38 +0100 Subject: [PATCH 02/11] fixes --- Modules/Data/SpellDamage.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/Data/SpellDamage.lua b/Modules/Data/SpellDamage.lua index 83e78ab2..e250e0c3 100755 --- a/Modules/Data/SpellDamage.lua +++ b/Modules/Data/SpellDamage.lua @@ -3,6 +3,9 @@ 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) From cb622e191689d33b605e79b0f1ac05e803253e34 Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Sat, 14 Feb 2026 15:35:38 +0100 Subject: [PATCH 03/11] wip --- Modules/Data/SpellDamage.lua | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/Modules/Data/SpellDamage.lua b/Modules/Data/SpellDamage.lua index a57d672f..3481b418 100755 --- a/Modules/Data/SpellDamage.lua +++ b/Modules/Data/SpellDamage.lua @@ -54,23 +54,7 @@ function Data:GetSpellPowerVsCreature(creature) end end end - - 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 + return spellDmg end ---@return number From dd2a54fc4fdf70632f6be78f045f303f3a41a44e Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Sat, 14 Feb 2026 15:36:23 +0100 Subject: [PATCH 04/11] Remove IsRangeAttackClass function Removed the IsRangeAttackClass function from Ranged.lua. --- Modules/Data/Ranged.lua | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Modules/Data/Ranged.lua b/Modules/Data/Ranged.lua index b5b76850..cfdc2c38 100755 --- a/Modules/Data/Ranged.lua +++ b/Modules/Data/Ranged.lua @@ -78,11 +78,6 @@ function Data:GetRangedAttackPowerVsCreature(creature) return dmg end ----@return boolean -function _Ranged:IsRangeAttackClass() - return classId == Data.WARRIOR or classId == Data.ROGUE or classId == Data.HUNTER -end - ---@return number function Data:GetRangedHasteRating() local hasteRating = GetCombatRating(CR_HASTE_RANGED) From 9c44b615d525362818a85d9d60865da34f8127fa Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Sat, 14 Feb 2026 15:40:24 +0100 Subject: [PATCH 05/11] wip --- Modules/Data/SpellDamage.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Modules/Data/SpellDamage.lua b/Modules/Data/SpellDamage.lua index 3481b418..482c6b97 100755 --- a/Modules/Data/SpellDamage.lua +++ b/Modules/Data/SpellDamage.lua @@ -3,8 +3,7 @@ local Data = ECSLoader:ImportModule("Data") ---@type DataUtils local DataUtils = ECSLoader:ImportModule("DataUtils") -local _SpellDamage = {} -local _, _, classId = UnitClass("player") +local GetBuffDataByIndex = C_UnitAuras.GetBuffDataByIndex ---@param school number ---@return number @@ -20,7 +19,7 @@ function Data:GetSpellPowerVsCreature(creature) -- auras local j = 1 repeat - local aura = C_UnitAuras.GetAuraDataByIndex("player", j, "HELPFUL") + local aura = GetBuffDataByIndex("player", j) j = j + 1 if aura and aura.spellId then if creature == Data.UNDEAD then @@ -90,7 +89,7 @@ function Data:GetSpellHasteBonus() -- buffs local i = 1 repeat - local aura = C_UnitAuras.GetBuffDataByIndex("player", i) + local aura = GetBuffDataByIndex("player", i) if aura and aura.spellId then hasteBonus = hasteBonus + (Data.Aura.SpellHaste[aura.spellId] or 0) end From d09e4784e93d5fe2b16ae3010e8a9289a6f88667 Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Sat, 14 Feb 2026 15:42:42 +0100 Subject: [PATCH 06/11] Change aura retrieval method to GetBuffDataByIndex --- Modules/Data/Ranged.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Data/Ranged.lua b/Modules/Data/Ranged.lua index cfdc2c38..40a072b3 100755 --- a/Modules/Data/Ranged.lua +++ b/Modules/Data/Ranged.lua @@ -26,7 +26,7 @@ function Data:GetRangedAttackPowerVsCreature(creature) -- auras local j = 1 repeat - local aura = C_UnitAuras.GetAuraDataByIndex("player", j, "HELPFUL") + local aura = C_UnitAuras.GetBuffDataByIndex("player", j) j = j + 1 if aura and aura.spellId then if creature == Data.UNDEAD then From bd4ec557f6b8a820baadb280dc3bb8a26b72b7dc Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Sat, 14 Feb 2026 15:44:28 +0100 Subject: [PATCH 07/11] Change aura retrieval method to use GetBuffDataByIndex --- Modules/Data/Melee.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Data/Melee.lua b/Modules/Data/Melee.lua index 611874cb..c7cb2082 100755 --- a/Modules/Data/Melee.lua +++ b/Modules/Data/Melee.lua @@ -21,7 +21,7 @@ function Data:GetMeleeAttackPowerVsCreature(creature) -- auras local j = 1 repeat - local aura = C_UnitAuras.GetAuraDataByIndex("player", j, "HELPFUL") + local aura = C_UnitAuras.GetBuffDataByIndex("player", j) j = j + 1 if aura and aura.spellId then if creature == Data.UNDEAD then From 33bd3d30ab135303e56c2f10815bcb8fc456703c Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Tue, 3 Mar 2026 04:52:24 +0100 Subject: [PATCH 08/11] wip --- Modules/Data/Constants.lua | 10 ++++++++++ Modules/Data/ItemSets.lua | 4 ++-- Modules/Data/Melee.lua | 30 +++++++++++++++++------------- Modules/Data/Ranged.lua | 30 +++++++++++++++++------------- Modules/Data/SpellDamage.lua | 22 ++++++++++++---------- 5 files changed, 58 insertions(+), 38 deletions(-) diff --git a/Modules/Data/Constants.lua b/Modules/Data/Constants.lua index c6921e6a..3fe9f973 100755 --- a/Modules/Data/Constants.lua +++ b/Modules/Data/Constants.lua @@ -20,6 +20,16 @@ Data.MAGE = 8 Data.WARLOCK = 9 Data.DRUID = 11 +--- same as wowhead +Data.BEAST = 1 +Data.DRAGONKIN = 2 +Data.DEMON = 3 +Data.ELEMENTAL = 4 +Data.GIANT = 5 +Data.UNDEAD = 6 +Data.HUMANOID = 7 +Data.MECHANICAL = 9 + Data.Aura = { AllowCastingManaRegeneration = { [6117] = (ECS.IsWotlk and 0.5 or 0.3), -- Mage Armor rank 1 diff --git a/Modules/Data/ItemSets.lua b/Modules/Data/ItemSets.lua index e24af994..f9050bc2 100755 --- a/Modules/Data/ItemSets.lua +++ b/Modules/Data/ItemSets.lua @@ -156,7 +156,7 @@ function Data:GetSetBonusModifierMP5() return mod end ----@return bool +---@return boolean function Data:HasDemonSlaying200() if classId == Data.ROGUE or classId == Data.WARRIOR then return Data:IsSetBonusActive(setNames.THE_TWIN_BLADES_OF_AZZINOTH, 2) @@ -164,7 +164,7 @@ function Data:HasDemonSlaying200() return false end ----@return bool +---@return boolean function Data:HasUndeadSlayer15() return Data:IsSetBonusActive(setNames.CHAIN_OF_THE_SCARLET_CRUSADE, 5) end diff --git a/Modules/Data/Melee.lua b/Modules/Data/Melee.lua index 1e44a243..5f5c1e0f 100755 --- a/Modules/Data/Melee.lua +++ b/Modules/Data/Melee.lua @@ -1,3 +1,7 @@ +local GetBuffDataByIndex = C_UnitAuras.GetBuffDataByIndex +local GetInventoryItemID = GetInventoryItemID +local GetInventoryItemLink = GetInventoryItemLink + ---@class Data local Data = ECSLoader:ImportModule("Data") ---@type DataUtils @@ -21,11 +25,11 @@ function Data:GetMeleeAttackPowerVsCreature(creature) -- auras local j = 1 repeat - local aura = C_UnitAuras.GetBuffDataByIndex("player", j) + local aura = GetBuffDataByIndex("player", j) j = j + 1 if aura and aura.spellId then if creature == Data.UNDEAD then - dmg = dmg + (Data.buffsUndeadAttackPower[aura.spellId] or 0) + dmg = dmg + (Data.Aura.UndeadAttackPower[aura.spellId] or 0) elseif creature == Data.DEMON then if aura.spellId == 11406 then dmg = dmg + 265 end -- Elixir of Demonslaying end @@ -35,13 +39,13 @@ function Data:GetMeleeAttackPowerVsCreature(creature) -- items local id, _ = GetInventoryItemID("player", i) if creature == Data.UNDEAD then - dmg = dmg + (Data.itemsUndeadSlaying[id] or 0) - dmg = dmg + (Data.itemsUndeadDeamonSlaying[id] or 0) + dmg = dmg + (Data.Item.UndeadSlaying[id] or 0) + dmg = dmg + (Data.Item.UndeadDeamonSlaying[id] or 0) elseif creature == Data.DEMON then - dmg = dmg + (Data.itemsDemonSlaying[id] or 0) - dmg = dmg + (Data.itemsUndeadDeamonSlaying[id] or 0) + dmg = dmg + (Data.Item.DemonSlaying[id] or 0) + dmg = dmg + (Data.Item.UndeadDeamonSlaying[id] or 0) elseif creature == Data.DRAGONKIN then - dmg = dmg + (Data.itemsDragonSlaying[id] or 0) + dmg = dmg + (Data.Item.DragonSlaying[id] or 0) elseif creature == Data.MECHANICAL then if id == 213319 then dmg = dmg + 30 end -- Machinist's Gloves end @@ -51,15 +55,15 @@ function Data:GetMeleeAttackPowerVsCreature(creature) local enchant = DataUtils:GetEnchantFromItemLink(itemLink) if enchant then if creature == Data.UNDEAD then - dmg = dmg + (Data.enchantsUndeadSlayer[enchant] or 0) - if enchant and enchant == Data.enchantIds.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end + dmg = dmg + (Data.Enchant.UndeadSlayer[enchant] or 0) + if enchant and enchant == Data.Enchant.Ids.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end elseif creature == Data.DEMON then - if enchant and enchant == Data.enchantIds.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end + if enchant and enchant == Data.Enchant.Ids.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end elseif creature == Data.BEAST then - dmg = dmg + (Data.enchantsBeastSlayer[enchant] or 0) + dmg = dmg + (Data.Enchant.BeastSlayer[enchant] or 0) elseif creature == Data.ELEMENTAL then - dmg = dmg + (Data.enchantsElementalSlayer[enchant] or 0) - if enchant and enchant == Data.enchantIds.LESSER_ELEMENTAL_SLAYER then dmg = dmg + 6 end + dmg = dmg + (Data.Enchant.ElementalSlayer[enchant] or 0) + if enchant and enchant == Data.Enchant.Ids.LESSER_ELEMENTAL_SLAYER then dmg = dmg + 6 end end end end diff --git a/Modules/Data/Ranged.lua b/Modules/Data/Ranged.lua index 0ed93f0e..ab3352e4 100755 --- a/Modules/Data/Ranged.lua +++ b/Modules/Data/Ranged.lua @@ -1,3 +1,7 @@ +local GetBuffDataByIndex = C_UnitAuras.GetBuffDataByIndex +local GetInventoryItemID = GetInventoryItemID +local GetInventoryItemLink = GetInventoryItemLink + ---@class Data local Data = ECSLoader:ImportModule("Data") ---@type Utils @@ -20,13 +24,13 @@ function Data:GetRangeAttackPower() end ---@param creature number ----@return string +---@return number function Data:GetRangedAttackPowerVsCreature(creature) local dmg = 0 -- auras local j = 1 repeat - local aura = C_UnitAuras.GetBuffDataByIndex("player", j) + local aura = GetBuffDataByIndex("player", j) j = j + 1 if aura and aura.spellId then if creature == Data.UNDEAD then @@ -40,13 +44,13 @@ function Data:GetRangedAttackPowerVsCreature(creature) -- items local id, _ = GetInventoryItemID("player", i) if creature == Data.UNDEAD then - dmg = dmg + (Data.itemsUndeadSlaying[id] or 0) - dmg = dmg + (Data.itemsUndeadDeamonSlaying[id] or 0) + dmg = dmg + (Data.Item.UndeadSlaying[id] or 0) + dmg = dmg + (Data.Item.UndeadDeamonSlaying[id] or 0) elseif creature == Data.DEMON then - dmg = dmg + (Data.itemsDemonSlaying[id] or 0) - dmg = dmg + (Data.itemsUndeadDeamonSlaying[id] or 0) + dmg = dmg + (Data.Item.DemonSlaying[id] or 0) + dmg = dmg + (Data.Item.UndeadDeamonSlaying[id] or 0) elseif creature == Data.DRAGONKIN then - dmg = dmg + (Data.itemsDragonSlaying[id] or 0) + dmg = dmg + (Data.Item.DragonSlaying[id] or 0) elseif creature == Data.MECHANICAL then if id == 213319 then dmg = dmg + 30 end -- Machinist's Gloves end @@ -56,15 +60,15 @@ function Data:GetRangedAttackPowerVsCreature(creature) local enchant = DataUtils:GetEnchantFromItemLink(itemLink) if enchant then if creature == Data.UNDEAD then - dmg = dmg + (Data.enchantsUndeadSlayer[enchant] or 0) - if enchant and enchant == Data.enchantIds.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end + dmg = dmg + (Data.Enchant.UndeadSlayer[enchant] or 0) + if enchant and enchant == Data.Enchant.Ids.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end elseif creature == Data.DEMON then - if enchant and enchant == Data.enchantIds.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end + if enchant and enchant == Data.Enchant.Ids.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end elseif creature == Data.BEAST then - dmg = dmg + (Data.enchantsBeastSlayer[enchant] or 0) + dmg = dmg + (Data.Enchant.BeastSlayer[enchant] or 0) elseif creature == Data.ELEMENTAL then - dmg = dmg + (Data.enchantsElementalSlayer[enchant] or 0) - if enchant and enchant == Data.enchantIds.LESSER_ELEMENTAL_SLAYER then dmg = dmg + 6 end + dmg = dmg + (Data.Enchant.ElementalSlayer[enchant] or 0) + if enchant and enchant == Data.Enchant.Ids.LESSER_ELEMENTAL_SLAYER then dmg = dmg + 6 end end end end diff --git a/Modules/Data/SpellDamage.lua b/Modules/Data/SpellDamage.lua index 3f4e2de1..9dc57a17 100755 --- a/Modules/Data/SpellDamage.lua +++ b/Modules/Data/SpellDamage.lua @@ -1,10 +1,12 @@ +local GetBuffDataByIndex = C_UnitAuras.GetBuffDataByIndex +local GetInventoryItemID = GetInventoryItemID +local GetInventoryItemLink = GetInventoryItemLink + ---@class Data local Data = ECSLoader:ImportModule("Data") ---@type DataUtils local DataUtils = ECSLoader:ImportModule("DataUtils") -local GetBuffDataByIndex = C_UnitAuras.GetBuffDataByIndex - ---@param school number ---@return number function Data:GetSpellDamage(school) @@ -23,7 +25,7 @@ function Data:GetSpellPowerVsCreature(creature) j = j + 1 if aura and aura.spellId then if creature == Data.UNDEAD then - spellDmg = spellDmg + (Data.buffsUndeadSpellPower[aura.spellId] or 0) + spellDmg = spellDmg + (Data.Aura.UndeadSpellPower[aura.spellId] or 0) end end until (not aura) @@ -31,11 +33,11 @@ function Data:GetSpellPowerVsCreature(creature) -- items local id, _ = GetInventoryItemID("player", i) if creature == Data.UNDEAD then - spellDmg = spellDmg + (Data.itemsIncreaseSpellDamageUndead[id] or 0) - spellDmg = spellDmg + (Data.itemsIncreaseSpellDamageUndeadDemon[id] or 0) + spellDmg = spellDmg + (Data.Item.IncreaseSpellDamageUndead[id] or 0) + spellDmg = spellDmg + (Data.Item.IncreaseSpellDamageUndeadDemon[id] or 0) elseif creature == Data.DEMON then if id == 30787 then spellDmg = spellDmg + 185 end -- Illidari-Bane Mageblade - spellDmg = spellDmg + (Data.itemsIncreaseSpellDamageUndeadDemon[id] or 0) + spellDmg = spellDmg + (Data.Item.IncreaseSpellDamageUndeadDemon[id] or 0) end -- enchants local itemLink = GetInventoryItemLink("player", i) @@ -43,12 +45,12 @@ function Data:GetSpellPowerVsCreature(creature) local enchant = DataUtils:GetEnchantFromItemLink(itemLink) if enchant then if creature == Data.UNDEAD then - spellDmg = spellDmg + (Data.enchantsUndeadSlayer[enchant] or 0) - spellDmg = spellDmg + (Data.enchantsIncreaseSpellDamageUndead[enchant] or 0) + spellDmg = spellDmg + (Data.Enchant.UndeadSlayer[enchant] or 0) + spellDmg = spellDmg + (Data.Enchant.IncreaseSpellDamageUndead[enchant] or 0) elseif creature == Data.BEAST then - spellDmg = spellDmg + (Data.enchantsBeastSlayer[enchant] or 0) + spellDmg = spellDmg + (Data.Enchant.BeastSlayer[enchant] or 0) elseif creature == Data.ELEMENTAL then - spellDmg = spellDmg + (Data.enchantsElementalSlayer[enchant] or 0) + spellDmg = spellDmg + (Data.Enchant.ElementalSlayer[enchant] or 0) end end end From 694c10d756932c83469dfac6e650089b3fed69d7 Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Fri, 6 Mar 2026 04:35:53 +0100 Subject: [PATCH 09/11] wip --- Modules/Data/Constants.lua | 274 ++++++++++++++++++++--------------- Modules/Data/Melee.lua | 58 ++++---- Modules/Data/Ranged.lua | 32 ++-- Modules/Data/SpellDamage.lua | 19 ++- types/types.lua | 1 + 5 files changed, 215 insertions(+), 169 deletions(-) diff --git a/Modules/Data/Constants.lua b/Modules/Data/Constants.lua index 3fe9f973..3c351798 100755 --- a/Modules/Data/Constants.lua +++ b/Modules/Data/Constants.lua @@ -21,14 +21,17 @@ Data.WARLOCK = 9 Data.DRUID = 11 --- same as wowhead -Data.BEAST = 1 -Data.DRAGONKIN = 2 -Data.DEMON = 3 -Data.ELEMENTAL = 4 -Data.GIANT = 5 -Data.UNDEAD = 6 -Data.HUMANOID = 7 -Data.MECHANICAL = 9 +---@class table +Data.CreatureType = { + BEAST = 1, + DRAGONKIN = 2, + DEMON = 3, + ELEMENTAL = 4, +-- GIANT = 5, + UNDEAD = 6, + HUMANOID = 7, + MECHANICAL = 9, +} Data.Aura = { AllowCastingManaRegeneration = { @@ -56,6 +59,13 @@ Data.Aura = { [468466] = 1, -- Unmaking the Simulacrum [1213422] = 1, -- Aura of the Blue Dragon }, + AttackPowerVsCreature = { -- melee + [Data.CreatureType.UNDEAD] = { + [17352] = 200, -- Argent Avenger + [24833] = 300, -- holy mightstone + [28486] = 30, -- Scourgebane Draught + }, + }, CritReductionAll = { [21183] = (ECS.IsWotlk and -1 or nil), -- Hearth of the Crusader [30482] = 5, -- Molten Armor @@ -361,6 +371,18 @@ Data.Aura = { [25894] = (ECS.IsClassic and 1 or nil), -- Greater Blessing of Wisdom rank 1 [25918] = (ECS.IsClassic and 1 or nil), -- Greater Blessing of Wisdom rank 2 }, + PhysicalDamageVsCreature = { -- ranged/melee + [Data.CreatureType.DEMON] = { + [11406] = 265, -- Elixir of Demonslaying + }, + }, + SpellDamageVsCreature = { -- spell + [Data.CreatureType.UNDEAD] = { + [24833] = 400, -- holy mightstone + [28488] = 15, -- Scourgebane Infusion + [60597] = 12000, -- Blessing of the Crusade + }, + }, SpellCrit = { [24907] = ((not ECS.IsClassic) and 5 or nil), -- Moonkin Aura [29177] = 6, -- Elemental Devastation Rank 2 @@ -432,30 +454,8 @@ Data.Aura = { [1227200] = 20, -- Wickedness [1236220] = -50, -- Slow }, - UndeadAttackPower = { -- melee - [17352] = 200, -- Argent Avenger - [24833] = 300, -- holy mightstone - [28486] = 30, -- Scourgebane Draught - }, - UndeadSpellPower = { -- spell - [24833] = 400, -- holy mightstone - [28488] = 15, -- Scourgebane Infusion - [60597] = 12000, -- Blessing of the Crusade - }, } Data.Enchant = { - BeastSlayer = { -- physical/spell - [31] = 2, - [188] = 2, - [189] = 4, - [190] = 6, - [191] = 8, - [192] = 10, - [193] = 12, - [194] = 14, - [249] = 2, -- Enchant Weapon - Minor Beastslayer - [853] = 6, -- Enchant Weapon - Lesser Beastslayer - }, BlockValue = { [2583] = 15, -- Presence of Might [2653] = 18, -- Enchant Shield - Tough Shield @@ -465,12 +465,51 @@ Data.Enchant = { }, Ids = { BIZNICK_SCOPE = 2523, -- 3% Hit from Biznicks 247x128 Accurascope - LESSER_ELEMENTAL_SLAYER = 854, -- +6 Enchant Weapon - Lesser Elemental Slayer - UNDEAD_DEMON_SLAYER_150 = 3093, -- Consecrated Weapon }, - IncreaseSpellDamageUndead = { -- spell - [2685] = 60, -- Blessed Wizard Oil - [3592] = 100, -- Blessed Wizard Oil + PhysicalDamageVsCreature = { -- ranged/melee + [Data.CreatureType.BEAST] = { + [31] = 2, + [188] = 2, + [189] = 4, + [190] = 6, + [191] = 8, + [192] = 10, + [193] = 12, + [194] = 14, + [249] = 2, -- Enchant Weapon - Minor Beastslayer + [853] = 6, -- Enchant Weapon - Lesser Beastslayer + }, + [Data.CreatureType.DEMON] = { + [3093] = 150, -- Consecrated Weapon + }, + [Data.CreatureType.ELEMENTAL] = { + [854] = 6, -- Enchant Weapon - Lesser Elemental Slayer + }, + [Data.CreatureType.UNDEAD] = { + [2684] = 100, -- Consecrated Weapon + [3093] = 150, -- Consecrated Weapon + [3247] = 140, -- Enchant 2H Weapon - Scourgebane + [3593] = 170, + [7896] = 200, -- Consecrated Two-Handed Weapon + }, + }, + SpellDamageVsCreature = { -- spell + [Data.CreatureType.BEAST] = { + [31] = 2, + [188] = 2, + [189] = 4, + [190] = 6, + [191] = 8, + [192] = 10, + [193] = 12, + [194] = 14, + [249] = 2, -- Enchant Weapon - Minor Beastslayer + [853] = 6, -- Enchant Weapon - Lesser Beastslayer + }, + [Data.CreatureType.UNDEAD] = { + [2685] = 60, -- Blessed Wizard Oil + [3592] = 100, -- Blessed Wizard Oil + }, }, MP5 = { [2381] = 10, -- Enchant Chest - Greater Mana Restoration @@ -496,12 +535,6 @@ Data.Enchant = { [3836] = 8, -- Master's Inscription of the Crag [7099] = 12, -- Blackfathom Mana Oil. This effect only applies within Blackfathom Deeps. }, - UndeadSlayer = { -- melee/ranged - [2684] = 100, -- Consecrated Weapon - [3247] = 140, -- Enchant 2H Weapon - Scourgebane - [3593] = 170, - [7896] = 200, -- Consecrated Two-Handed Weapon - }, } Data.Gem = { MP5 = { @@ -565,81 +598,90 @@ Data.Gem = { }, } Data.Item = { - BeastSlaying = { -- ranged/melee - [1465] = 18, -- tigerbane - [3566] = 30, -- Raptorbane Armor - [7710] = 60, -- Loksey's Training Stick - [7756] = 30, -- Dog Training Gloves - [11628] = 24, -- Houndmaster's Bow - [11629] = 24, -- Houndmaster's Rifle - [11906] = 30, -- Beastsmasher - [11907] = 72, -- Beastslayer - [12709] = 45, -- pip's skinner - [13212] = 48, -- Halycon's Spiked Collar - [15782] = 33, -- Beaststalker Blade - [15783] = 33, -- Beasthunter Dagger - [16658] = 18, -- Wildhunter Cloak - [19946] = 60, -- Tigule's Harpoon - [37018] = -40, -- G.E.H.T.A. - [231272] = 99, -- Tigule's Harpoon - [231849] = 99, -- Tigule's Harpoon - }, - DemonSlaying = { -- ranged/melee - [10696] = 33, -- Enchanted Azsharite Felbane Sword - [10697] = 33, -- Enchanted Azsharite Felbane Dagger - [10698] = 78, -- Enchanted Azsharite Felbane Staff - [13044] = 99, -- Demonslayer - [18715] = 45, -- Lok'delar, Stave of the Ancient Keepers - [19963] = 117, -- Pitchfork of Madness - [20487] = 45, -- Lok'delar, Stave of the Ancient Keepers DEP - [29398] = 39, -- Circle of Banishing - [30788] = 93, -- Illidari-Bane Dagger - [31745] = 93, -- Illidari-Bane Broadsword - [220575] = 39, -- Eater of the Damned - [228332] = 45, -- Lok'delar, Stave of the Ancient Keepers - [231277] = 141, -- Pitchfork of Madness - [231864] = 141, -- Pitchfork of Madness - }, - DragonSlaying = { -- ranged/melee - [19961] = 48, -- Gri'lek's Grinder - [19962] = 117, -- Gri'lek's Carver - [220965] = 117, -- Scalebane Greataxe - [221457] = 36, -- Libram of Draconic Destruction - [231273] = 141, -- Gri'lek's Carver - [231274] = 60, -- Gri'lek's Grinder - [231846] = 141, -- Gri'lek's Carver - [231847] = 60, -- Gri'lek's Grinder - }, - ElementalSlaying = { -- ranged/melee - [18310] = 36, -- Fiendish Machete - [228056] = 36, -- Fiendish Machete - [228486] = 75, -- Treant's Bane - }, - IncreaseSpellDamageUndead = { -- spell - [18346] = 35, -- Threadbare Trousers - [19812] = 48, -- Rune of the Dawn - [23084] = 35, -- Gloves of Undead Cleansing - [23085] = 48, -- Robe of Undead Cleansing - [23091] = 26, -- Bracers of Undead Cleansing - [236716] = 35, -- Bracers of Undead Cleansing - [236717] = 48, -- Gloves of Undead Cleansing - [236718] = 65, -- Robe of Undead Cleansing - [236722] = 26, -- Bracers of Undead Warding - [236723] = 26, -- Gloves of Undead Warding - [236724] = 26, -- Robe of Undead Warding - [236725] = 35, -- Wristwraps of Undead Cleansing - [236726] = 48, -- Handwraps of Undead Cleansing - [236727] = 65, -- Tunic of Undead Cleansing - [236734] = 35, -- Wristguards of Undead Cleansing - [236735] = 48, -- Handguards of Undead Cleansing - [236736] = 65, -- Chestguard of Undead Cleansing - [236737] = 26, -- Wristguards of Undead Warding - [236738] = 26, -- Handguards of Undead Warding - [236739] = 26, -- Chestguard of Undead Warding - }, - IncreaseSpellDamageUndeadDemon = { -- spell - [23207] = 85, -- Champion of the Dawn - [236351] = 89, -- Champion of the Dawn + PhysicalDamageVsCreature = { -- ranged/melee + [Data.CreatureType.BEAST] = { + [1465] = 18, -- tigerbane + [3566] = 30, -- Raptorbane Armor + [7710] = 60, -- Loksey's Training Stick + [7756] = 30, -- Dog Training Gloves + [11628] = 24, -- Houndmaster's Bow + [11629] = 24, -- Houndmaster's Rifle + [11906] = 30, -- Beastsmasher + [11907] = 72, -- Beastslayer + [12709] = 45, -- pip's skinner + [13212] = 48, -- Halycon's Spiked Collar + [15782] = 33, -- Beaststalker Blade + [15783] = 33, -- Beasthunter Dagger + [16658] = 18, -- Wildhunter Cloak + [19946] = 60, -- Tigule's Harpoon + [37018] = -40, -- G.E.H.T.A. + [231272] = 99, -- Tigule's Harpoon + [231849] = 99, -- Tigule's Harpoon + }, + [Data.CreatureType.DEMON] = { + [10696] = 33, -- Enchanted Azsharite Felbane Sword + [10697] = 33, -- Enchanted Azsharite Felbane Dagger + [10698] = 78, -- Enchanted Azsharite Felbane Staff + [13044] = 99, -- Demonslayer + [18715] = 45, -- Lok'delar, Stave of the Ancient Keepers + [19963] = 117, -- Pitchfork of Madness + [20487] = 45, -- Lok'delar, Stave of the Ancient Keepers DEP + [29398] = 39, -- Circle of Banishing + [30788] = 93, -- Illidari-Bane Dagger + [31745] = 93, -- Illidari-Bane Broadsword + [220575] = 39, -- Eater of the Damned + [228332] = 45, -- Lok'delar, Stave of the Ancient Keepers + [231277] = 141, -- Pitchfork of Madness + [231864] = 141, -- Pitchfork of Madness + }, + [Data.CreatureType.DRAGONKIN] = { + [19961] = 48, -- Gri'lek's Grinder + [19962] = 117, -- Gri'lek's Carver + [220965] = 117, -- Scalebane Greataxe + [221457] = 36, -- Libram of Draconic Destruction + [231273] = 141, -- Gri'lek's Carver + [231274] = 60, -- Gri'lek's Grinder + [231846] = 141, -- Gri'lek's Carver + [231847] = 60, -- Gri'lek's Grinder + }, + [Data.CreatureType.ELEMENTAL] = { + [18310] = 36, -- Fiendish Machete + [228056] = 36, -- Fiendish Machete + [228486] = 75, -- Treant's Bane + }, + [Data.CreatureType.MECHANICAL] = { + [213319] = 30, -- Machinist's Gloves + }, + }, + SpellDamageVsCreature = { -- spell + [Data.CreatureType.DEMON] = { + [23207] = 85, -- Champion of the Dawn + [236351] = 89, -- Champion of the Dawn + }, + [Data.CreatureType.UNDEAD] = { + [18346] = 35, -- Threadbare Trousers + [19812] = 48, -- Rune of the Dawn + [23084] = 35, -- Gloves of Undead Cleansing + [23085] = 48, -- Robe of Undead Cleansing + [23091] = 26, -- Bracers of Undead Cleansing + [23207] = 85, -- Champion of the Dawn + [236351] = 89, -- Champion of the Dawn + [236716] = 35, -- Bracers of Undead Cleansing + [236717] = 48, -- Gloves of Undead Cleansing + [236718] = 65, -- Robe of Undead Cleansing + [236722] = 26, -- Bracers of Undead Warding + [236723] = 26, -- Gloves of Undead Warding + [236724] = 26, -- Robe of Undead Warding + [236725] = 35, -- Wristwraps of Undead Cleansing + [236726] = 48, -- Handwraps of Undead Cleansing + [236727] = 65, -- Tunic of Undead Cleansing + [236734] = 35, -- Wristguards of Undead Cleansing + [236735] = 48, -- Handguards of Undead Cleansing + [236736] = 65, -- Chestguard of Undead Cleansing + [236737] = 26, -- Wristguards of Undead Warding + [236738] = 26, -- Handguards of Undead Warding + [236739] = 26, -- Chestguard of Undead Warding + }, }, IsTimeworn = { [233496] = true, diff --git a/Modules/Data/Melee.lua b/Modules/Data/Melee.lua index 5f5c1e0f..ab06b723 100755 --- a/Modules/Data/Melee.lua +++ b/Modules/Data/Melee.lua @@ -1,6 +1,7 @@ local GetBuffDataByIndex = C_UnitAuras.GetBuffDataByIndex local GetInventoryItemID = GetInventoryItemID local GetInventoryItemLink = GetInventoryItemLink +local pairs = pairs ---@class Data local Data = ECSLoader:ImportModule("Data") @@ -11,6 +12,8 @@ local Utils = ECSLoader:ImportModule("Utils") local _Melee = {} local _, _, classId = UnitClass("player") +local DEMON = Data.CreatureType.DEMON +local UNDEAD = Data.CreatureType.UNDEAD ---@return number function Data:GetMeleeAttackPower() @@ -18,62 +21,51 @@ function Data:GetMeleeAttackPower() return melee + posBuff + negBuff end ----@param creature number ----@return string -function Data:GetMeleeAttackPowerVsCreature(creature) - local dmg = 0 +---@return table +function Data:GetMeleeAttackPowerVsCreature() + local dmg = {0,0,0,0,0,0,0,0,0} + -- auras local j = 1 repeat local aura = GetBuffDataByIndex("player", j) j = j + 1 if aura and aura.spellId then - if creature == Data.UNDEAD then - dmg = dmg + (Data.Aura.UndeadAttackPower[aura.spellId] or 0) - elseif creature == Data.DEMON then - if aura.spellId == 11406 then dmg = dmg + 265 end -- Elixir of Demonslaying + for _,type in pairs(Data.CreatureType) do + if Data.Aura.AttackPowerVsCreature[type] then + dmg[type] = dmg[type] + (Data.Aura.AttackPowerVsCreature[type][aura.spellId] or 0) + end + if Data.Aura.PhysicalDamageVsCreature[type] then + dmg[type] = dmg[type] + (Data.Aura.PhysicalDamageVsCreature[type][aura.spellId] or 0) + end end end until (not aura) for i = 1, 18 do -- items local id, _ = GetInventoryItemID("player", i) - if creature == Data.UNDEAD then - dmg = dmg + (Data.Item.UndeadSlaying[id] or 0) - dmg = dmg + (Data.Item.UndeadDeamonSlaying[id] or 0) - elseif creature == Data.DEMON then - dmg = dmg + (Data.Item.DemonSlaying[id] or 0) - dmg = dmg + (Data.Item.UndeadDeamonSlaying[id] or 0) - elseif creature == Data.DRAGONKIN then - dmg = dmg + (Data.Item.DragonSlaying[id] or 0) - elseif creature == Data.MECHANICAL then - if id == 213319 then dmg = dmg + 30 end -- Machinist's Gloves + for _,type in pairs(Data.CreatureType) do + if Data.Item.PhysicalDamageVsCreature[type] then + dmg[type] = dmg[type] + (Data.Item.PhysicalDamageVsCreature[type][id] or 0) + end end -- enchants local itemLink = GetInventoryItemLink("player", i) if itemLink then local enchant = DataUtils:GetEnchantFromItemLink(itemLink) if enchant then - if creature == Data.UNDEAD then - dmg = dmg + (Data.Enchant.UndeadSlayer[enchant] or 0) - if enchant and enchant == Data.Enchant.Ids.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end - elseif creature == Data.DEMON then - if enchant and enchant == Data.Enchant.Ids.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end - elseif creature == Data.BEAST then - dmg = dmg + (Data.Enchant.BeastSlayer[enchant] or 0) - elseif creature == Data.ELEMENTAL then - dmg = dmg + (Data.Enchant.ElementalSlayer[enchant] or 0) - if enchant and enchant == Data.Enchant.Ids.LESSER_ELEMENTAL_SLAYER then dmg = dmg + 6 end + for _,type in pairs(Data.CreatureType) do + if Data.Enchant.PhysicalDamageVsCreature[type] then + dmg[type] = dmg[type] + (Data.Enchant.PhysicalDamageVsCreature[type][enchant] or 0) + end end end end end -- sets - if creature == Data.UNDEAD then - if Data:HasUndeadSlayer15() then dmg = dmg + 15 end - elseif creature == Data.DEMON then - if Data:HasDemonSlaying200() then dmg = dmg + 200 end - end + if Data:HasUndeadSlayer15() then dmg[UNDEAD] = dmg[UNDEAD] + 15 end + if Data:HasDemonSlaying200() then dmg[DEMON] = dmg[DEMON] + 200 end + return dmg end diff --git a/Modules/Data/Ranged.lua b/Modules/Data/Ranged.lua index ab3352e4..e565c234 100755 --- a/Modules/Data/Ranged.lua +++ b/Modules/Data/Ranged.lua @@ -12,6 +12,12 @@ local DataUtils = ECSLoader:ImportModule("DataUtils") local _Ranged = {} local _, _, classId = UnitClass("player") +local BEAST = Data.CreatureType.BEAST +local DEMON = Data.CreatureType.DEMON +local DRAGONKIN = Data.CreatureType.DRAGONKIN +local ELEMENTAL = Data.CreatureType.ELEMENTAL +local MECHANICAL = Data.CreatureType.MECHANICAL +local UNDEAD = Data.CreatureType.UNDEAD ---@return number function Data:GetRangeAttackPower() @@ -23,7 +29,7 @@ function Data:GetRangeAttackPower() return melee + posBuff + negBuff end ----@param creature number +---@param creature CreatureType ---@return number function Data:GetRangedAttackPowerVsCreature(creature) local dmg = 0 @@ -33,9 +39,9 @@ function Data:GetRangedAttackPowerVsCreature(creature) local aura = GetBuffDataByIndex("player", j) j = j + 1 if aura and aura.spellId then - if creature == Data.UNDEAD then + if creature == UNDEAD then if aura.spellId == 58026 then dmg = dmg + 12000 end -- Blessing of the Crusade - elseif creature == Data.DEMON then + elseif creature == DEMON then if aura.spellId == 11406 then dmg = dmg + 265 end -- Elixir of Demonslaying end end @@ -43,15 +49,15 @@ function Data:GetRangedAttackPowerVsCreature(creature) for i = 1, 18 do -- items local id, _ = GetInventoryItemID("player", i) - if creature == Data.UNDEAD then + if creature == UNDEAD then dmg = dmg + (Data.Item.UndeadSlaying[id] or 0) dmg = dmg + (Data.Item.UndeadDeamonSlaying[id] or 0) - elseif creature == Data.DEMON then + elseif creature == DEMON then dmg = dmg + (Data.Item.DemonSlaying[id] or 0) dmg = dmg + (Data.Item.UndeadDeamonSlaying[id] or 0) - elseif creature == Data.DRAGONKIN then + elseif creature == DRAGONKIN then dmg = dmg + (Data.Item.DragonSlaying[id] or 0) - elseif creature == Data.MECHANICAL then + elseif creature == MECHANICAL then if id == 213319 then dmg = dmg + 30 end -- Machinist's Gloves end -- enchants @@ -59,14 +65,14 @@ function Data:GetRangedAttackPowerVsCreature(creature) if itemLink then local enchant = DataUtils:GetEnchantFromItemLink(itemLink) if enchant then - if creature == Data.UNDEAD then + if creature == UNDEAD then dmg = dmg + (Data.Enchant.UndeadSlayer[enchant] or 0) if enchant and enchant == Data.Enchant.Ids.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end - elseif creature == Data.DEMON then + elseif creature == DEMON then if enchant and enchant == Data.Enchant.Ids.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end - elseif creature == Data.BEAST then + elseif creature == BEAST then dmg = dmg + (Data.Enchant.BeastSlayer[enchant] or 0) - elseif creature == Data.ELEMENTAL then + elseif creature == ELEMENTAL then dmg = dmg + (Data.Enchant.ElementalSlayer[enchant] or 0) if enchant and enchant == Data.Enchant.Ids.LESSER_ELEMENTAL_SLAYER then dmg = dmg + 6 end end @@ -74,9 +80,9 @@ function Data:GetRangedAttackPowerVsCreature(creature) end end -- sets - if creature == Data.UNDEAD then + if creature == UNDEAD then if Data:HasUndeadSlayer15() then dmg = dmg + 15 end - elseif creature == Data.DEMON then + elseif creature == DEMON then if Data:HasDemonSlaying200() then dmg = dmg + 200 end end return dmg diff --git a/Modules/Data/SpellDamage.lua b/Modules/Data/SpellDamage.lua index 9dc57a17..8896df96 100755 --- a/Modules/Data/SpellDamage.lua +++ b/Modules/Data/SpellDamage.lua @@ -7,6 +7,11 @@ local Data = ECSLoader:ImportModule("Data") ---@type DataUtils local DataUtils = ECSLoader:ImportModule("DataUtils") +local BEAST = Data.CreatureType.BEAST +local DEMON = Data.CreatureType.DEMON +local ELEMENTAL = Data.CreatureType.ELEMENTAL +local UNDEAD = Data.CreatureType.UNDEAD + ---@param school number ---@return number function Data:GetSpellDamage(school) @@ -14,7 +19,7 @@ function Data:GetSpellDamage(school) return DataUtils:Round(spellDmg, 0) end ----@param creature number +---@param creature CreatureType ---@return number function Data:GetSpellPowerVsCreature(creature) local spellDmg = 0 @@ -24,7 +29,7 @@ function Data:GetSpellPowerVsCreature(creature) local aura = GetBuffDataByIndex("player", j) j = j + 1 if aura and aura.spellId then - if creature == Data.UNDEAD then + if creature == UNDEAD then spellDmg = spellDmg + (Data.Aura.UndeadSpellPower[aura.spellId] or 0) end end @@ -32,10 +37,10 @@ function Data:GetSpellPowerVsCreature(creature) for i = 1, 18 do -- items local id, _ = GetInventoryItemID("player", i) - if creature == Data.UNDEAD then + if creature == UNDEAD then spellDmg = spellDmg + (Data.Item.IncreaseSpellDamageUndead[id] or 0) spellDmg = spellDmg + (Data.Item.IncreaseSpellDamageUndeadDemon[id] or 0) - elseif creature == Data.DEMON then + elseif creature == DEMON then if id == 30787 then spellDmg = spellDmg + 185 end -- Illidari-Bane Mageblade spellDmg = spellDmg + (Data.Item.IncreaseSpellDamageUndeadDemon[id] or 0) end @@ -44,12 +49,12 @@ function Data:GetSpellPowerVsCreature(creature) if itemLink then local enchant = DataUtils:GetEnchantFromItemLink(itemLink) if enchant then - if creature == Data.UNDEAD then + if creature == UNDEAD then spellDmg = spellDmg + (Data.Enchant.UndeadSlayer[enchant] or 0) spellDmg = spellDmg + (Data.Enchant.IncreaseSpellDamageUndead[enchant] or 0) - elseif creature == Data.BEAST then + elseif creature == BEAST then spellDmg = spellDmg + (Data.Enchant.BeastSlayer[enchant] or 0) - elseif creature == Data.ELEMENTAL then + elseif creature == ELEMENTAL then spellDmg = spellDmg + (Data.Enchant.ElementalSlayer[enchant] or 0) end end diff --git a/types/types.lua b/types/types.lua index 48e5fe55..c52588c7 100644 --- a/types/types.lua +++ b/types/types.lua @@ -24,6 +24,7 @@ ---@field refName string ---@field text string +---@alias CreatureType number ---@alias EquipSlot string ---@alias ItemLink string ---@alias Color string From 06c71b06941a4ade2c4092943e4c46aa1053127c Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Fri, 6 Mar 2026 16:53:25 +0100 Subject: [PATCH 10/11] wip --- Modules/Data/Constants.lua | 3 +- Modules/Data/Ranged.lua | 56 ++++++++++++------------------------ Modules/Data/SpellDamage.lua | 42 +++++++++++---------------- types/types.lua | 1 - 4 files changed, 38 insertions(+), 64 deletions(-) diff --git a/Modules/Data/Constants.lua b/Modules/Data/Constants.lua index 3c351798..027511e6 100755 --- a/Modules/Data/Constants.lua +++ b/Modules/Data/Constants.lua @@ -21,7 +21,7 @@ Data.WARLOCK = 9 Data.DRUID = 11 --- same as wowhead ----@class table +---@class table Data.CreatureType = { BEAST = 1, DRAGONKIN = 2, @@ -656,6 +656,7 @@ Data.Item = { SpellDamageVsCreature = { -- spell [Data.CreatureType.DEMON] = { [23207] = 85, -- Champion of the Dawn + [30708] = 185, -- Illidari-Bane Mageblade [236351] = 89, -- Champion of the Dawn }, [Data.CreatureType.UNDEAD] = { diff --git a/Modules/Data/Ranged.lua b/Modules/Data/Ranged.lua index e565c234..0a9a98ed 100755 --- a/Modules/Data/Ranged.lua +++ b/Modules/Data/Ranged.lua @@ -12,11 +12,7 @@ local DataUtils = ECSLoader:ImportModule("DataUtils") local _Ranged = {} local _, _, classId = UnitClass("player") -local BEAST = Data.CreatureType.BEAST local DEMON = Data.CreatureType.DEMON -local DRAGONKIN = Data.CreatureType.DRAGONKIN -local ELEMENTAL = Data.CreatureType.ELEMENTAL -local MECHANICAL = Data.CreatureType.MECHANICAL local UNDEAD = Data.CreatureType.UNDEAD ---@return number @@ -29,62 +25,48 @@ function Data:GetRangeAttackPower() return melee + posBuff + negBuff end ----@param creature CreatureType ----@return number -function Data:GetRangedAttackPowerVsCreature(creature) - local dmg = 0 +---@return table +function Data:GetRangedAttackPowerVsCreature() + local dmg = {0,0,0,0,0,0,0,0,0} + -- auras local j = 1 repeat local aura = GetBuffDataByIndex("player", j) j = j + 1 if aura and aura.spellId then - if creature == UNDEAD then - if aura.spellId == 58026 then dmg = dmg + 12000 end -- Blessing of the Crusade - elseif creature == DEMON then - if aura.spellId == 11406 then dmg = dmg + 265 end -- Elixir of Demonslaying + for _,type in pairs(Data.CreatureType) do + if Data.Aura.PhysicalDamageVsCreature[type] then + dmg[type] = dmg[type] + (Data.Aura.PhysicalDamageVsCreature[type][aura.spellId] or 0) + end end end until (not aura) for i = 1, 18 do -- items local id, _ = GetInventoryItemID("player", i) - if creature == UNDEAD then - dmg = dmg + (Data.Item.UndeadSlaying[id] or 0) - dmg = dmg + (Data.Item.UndeadDeamonSlaying[id] or 0) - elseif creature == DEMON then - dmg = dmg + (Data.Item.DemonSlaying[id] or 0) - dmg = dmg + (Data.Item.UndeadDeamonSlaying[id] or 0) - elseif creature == DRAGONKIN then - dmg = dmg + (Data.Item.DragonSlaying[id] or 0) - elseif creature == MECHANICAL then - if id == 213319 then dmg = dmg + 30 end -- Machinist's Gloves + for _,type in pairs(Data.CreatureType) do + if Data.Item.PhysicalDamageVsCreature[type] then + dmg[type] = dmg[type] + (Data.Item.PhysicalDamageVsCreature[type][id] or 0) + end end -- enchants local itemLink = GetInventoryItemLink("player", i) if itemLink then local enchant = DataUtils:GetEnchantFromItemLink(itemLink) if enchant then - if creature == UNDEAD then - dmg = dmg + (Data.Enchant.UndeadSlayer[enchant] or 0) - if enchant and enchant == Data.Enchant.Ids.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end - elseif creature == DEMON then - if enchant and enchant == Data.Enchant.Ids.UNDEAD_DEMON_SLAYER_150 then dmg = dmg + 150 end - elseif creature == BEAST then - dmg = dmg + (Data.Enchant.BeastSlayer[enchant] or 0) - elseif creature == ELEMENTAL then - dmg = dmg + (Data.Enchant.ElementalSlayer[enchant] or 0) - if enchant and enchant == Data.Enchant.Ids.LESSER_ELEMENTAL_SLAYER then dmg = dmg + 6 end + for _,type in pairs(Data.CreatureType) do + if Data.Enchant.PhysicalDamageVsCreature[type] then + dmg[type] = dmg[type] + (Data.Enchant.PhysicalDamageVsCreature[type][enchant] or 0) + end end end end end -- sets - if creature == UNDEAD then - if Data:HasUndeadSlayer15() then dmg = dmg + 15 end - elseif creature == DEMON then - if Data:HasDemonSlaying200() then dmg = dmg + 200 end - end + if Data:HasUndeadSlayer15() then dmg[UNDEAD] = dmg[UNDEAD] + 15 end + if Data:HasDemonSlaying200() then dmg[DEMON] = dmg[DEMON] + 200 end + return dmg end diff --git a/Modules/Data/SpellDamage.lua b/Modules/Data/SpellDamage.lua index 8896df96..f9e54d9b 100755 --- a/Modules/Data/SpellDamage.lua +++ b/Modules/Data/SpellDamage.lua @@ -7,11 +7,6 @@ local Data = ECSLoader:ImportModule("Data") ---@type DataUtils local DataUtils = ECSLoader:ImportModule("DataUtils") -local BEAST = Data.CreatureType.BEAST -local DEMON = Data.CreatureType.DEMON -local ELEMENTAL = Data.CreatureType.ELEMENTAL -local UNDEAD = Data.CreatureType.UNDEAD - ---@param school number ---@return number function Data:GetSpellDamage(school) @@ -19,48 +14,45 @@ function Data:GetSpellDamage(school) return DataUtils:Round(spellDmg, 0) end ----@param creature CreatureType ----@return number -function Data:GetSpellPowerVsCreature(creature) - local spellDmg = 0 +---@return table +function Data:GetSpellPowerVsCreature() + local dmg = {0,0,0,0,0,0,0,0,0} + -- auras local j = 1 repeat local aura = GetBuffDataByIndex("player", j) j = j + 1 if aura and aura.spellId then - if creature == UNDEAD then - spellDmg = spellDmg + (Data.Aura.UndeadSpellPower[aura.spellId] or 0) + for _,type in pairs(Data.CreatureType) do + if Data.Aura.SpellDamageVsCreature[type] then + dmg[type] = dmg[type] + (Data.Aura.SpellDamageVsCreature[type][aura.spellId] or 0) + end end end until (not aura) for i = 1, 18 do -- items local id, _ = GetInventoryItemID("player", i) - if creature == UNDEAD then - spellDmg = spellDmg + (Data.Item.IncreaseSpellDamageUndead[id] or 0) - spellDmg = spellDmg + (Data.Item.IncreaseSpellDamageUndeadDemon[id] or 0) - elseif creature == DEMON then - if id == 30787 then spellDmg = spellDmg + 185 end -- Illidari-Bane Mageblade - spellDmg = spellDmg + (Data.Item.IncreaseSpellDamageUndeadDemon[id] or 0) + for _,type in pairs(Data.CreatureType) do + if Data.Item.SpellDamageVsCreature[type] then + dmg[type] = dmg[type] + (Data.Item.SpellDamageVsCreature[type][id] or 0) + end end -- enchants local itemLink = GetInventoryItemLink("player", i) if itemLink then local enchant = DataUtils:GetEnchantFromItemLink(itemLink) if enchant then - if creature == UNDEAD then - spellDmg = spellDmg + (Data.Enchant.UndeadSlayer[enchant] or 0) - spellDmg = spellDmg + (Data.Enchant.IncreaseSpellDamageUndead[enchant] or 0) - elseif creature == BEAST then - spellDmg = spellDmg + (Data.Enchant.BeastSlayer[enchant] or 0) - elseif creature == ELEMENTAL then - spellDmg = spellDmg + (Data.Enchant.ElementalSlayer[enchant] or 0) + for _,type in pairs(Data.CreatureType) do + if Data.Enchant.SpellDamageVsCreature[type] then + dmg[type] = dmg[type] + (Data.Enchant.SpellDamageVsCreature[type][enchant] or 0) + end end end end end - return spellDmg + return dmg end ---@return number diff --git a/types/types.lua b/types/types.lua index c52588c7..48e5fe55 100644 --- a/types/types.lua +++ b/types/types.lua @@ -24,7 +24,6 @@ ---@field refName string ---@field text string ----@alias CreatureType number ---@alias EquipSlot string ---@alias ItemLink string ---@alias Color string From 09b3707ce3ccc80bcbaabd50b8474161beeda44e Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Fri, 6 Mar 2026 17:15:07 +0100 Subject: [PATCH 11/11] wip --- Modules/Data/Constants.lua | 76 +++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/Modules/Data/Constants.lua b/Modules/Data/Constants.lua index 027511e6..5fa4de46 100755 --- a/Modules/Data/Constants.lua +++ b/Modules/Data/Constants.lua @@ -626,6 +626,7 @@ Data.Item = { [18715] = 45, -- Lok'delar, Stave of the Ancient Keepers [19963] = 117, -- Pitchfork of Madness [20487] = 45, -- Lok'delar, Stave of the Ancient Keepers DEP + [23206] = 150, -- Champion of the Dawn [29398] = 39, -- Circle of Banishing [30788] = 93, -- Illidari-Bane Dagger [31745] = 93, -- Illidari-Bane Broadsword @@ -633,6 +634,7 @@ Data.Item = { [228332] = 45, -- Lok'delar, Stave of the Ancient Keepers [231277] = 141, -- Pitchfork of Madness [231864] = 141, -- Pitchfork of Madness + [236352] = 157, -- Champion of the Dawn }, [Data.CreatureType.DRAGONKIN] = { [19961] = 48, -- Gri'lek's Grinder @@ -652,6 +654,42 @@ Data.Item = { [Data.CreatureType.MECHANICAL] = { [213319] = 30, -- Machinist's Gloves }, + [Data.CreatureType.UNDEAD] = { -- ranged/melee + [867] = 30, -- Gloves of Holy Might + [10805] = 30, -- Eater of the Dead + [13017] = 66, -- Hellslayer Battle Axe + [13209] = 81, -- Seal of the Dawn + [18758] = 45, -- Specter's Blade + [23078] = 60, -- Gauntlets of Undead Slaying + [23081] = 60, -- Handwraps of Undead Slaying + [23082] = 60, -- Handguards of Undead Slaying + [23087] = 81, -- Breastplate of Undead Slaying + [23088] = 81, -- Chestguard of Undead Slaying + [23089] = 81, -- Tunic of Undead Slaying + [23090] = 45, -- Bracers of Undead Slaying + [23092] = 45, -- Wristguards of Undead Slaying + [23093] = 45, -- Wristwraps of Undead Slaying + [23206] = 150, -- Champion of the Dawn + [209574] = 15, -- Discarded Tenets of the Silver Hand + [220575] = 39, -- Eater of the Damned + [228030] = 30, -- Malicious Axe + [236352] = 157, -- Champion of the Dawn + [236707] = 108, -- Tunic of Undead Slaying + [236708] = 108, -- Breastplate of Undead Slaying + [236709] = 108, -- Chestguard of Undead Slaying + [236710] = 60, -- Wristguards of Undead Slaying + [236711] = 60, -- Wristwraps of Undead Slaying + [236712] = 60, -- Bracers of Undead Slaying + [236713] = 81, -- Handwraps of Undead Slaying + [236714] = 81, -- Gauntlets of Undead Slaying + [236715] = 81, -- Handguards of Undead Slaying + [236731] = 45, -- Wristwraps of Undead Warding + [236732] = 45, -- Handwraps of Undead Warding + [236733] = 45, -- Tunic of Undead Warding + [236746] = 45, -- Bracers of Undead Warding + [236747] = 45, -- Gauntlets of Undead Warding + [236748] = 45, -- Breastplate of Undead Warding + }, }, SpellDamageVsCreature = { -- spell [Data.CreatureType.DEMON] = { @@ -948,44 +986,6 @@ Data.Item = { [234028] = 2, [234032] = 2, }, - UndeadDemonSlaying = { -- ranged/melee - [23207] = 150, -- Champion of the Dawn - [236352] = 157, -- Champion of the Dawn - }, - UndeadSlaying = { -- ranged/melee - [867] = 30, -- Gloves of Holy Might - [10805] = 30, -- Eater of the Dead - [13017] = 66, -- Hellslayer Battle Axe - [13209] = 81, -- Seal of the Dawn - [18758] = 45, -- Specter's Blade - [23078] = 60, -- Gauntlets of Undead Slaying - [23081] = 60, -- Handwraps of Undead Slaying - [23082] = 60, -- Handguards of Undead Slaying - [23087] = 81, -- Breastplate of Undead Slaying - [23088] = 81, -- Chestguard of Undead Slaying - [23089] = 81, -- Tunic of Undead Slaying - [23090] = 45, -- Bracers of Undead Slaying - [23092] = 45, -- Wristguards of Undead Slaying - [23093] = 45, -- Wristwraps of Undead Slaying - [209574] = 15, -- Discarded Tenets of the Silver Hand - [220575] = 39, -- Eater of the Damned - [228030] = 30, -- Malicious Axe - [236707] = 108, -- Tunic of Undead Slaying - [236708] = 108, -- Breastplate of Undead Slaying - [236709] = 108, -- Chestguard of Undead Slaying - [236710] = 60, -- Wristguards of Undead Slaying - [236711] = 60, -- Wristwraps of Undead Slaying - [236712] = 60, -- Bracers of Undead Slaying - [236713] = 81, -- Handwraps of Undead Slaying - [236714] = 81, -- Gauntlets of Undead Slaying - [236715] = 81, -- Handguards of Undead Slaying - [236731] = 45, -- Wristwraps of Undead Warding - [236732] = 45, -- Handwraps of Undead Warding - [236733] = 45, -- Tunic of Undead Warding - [236746] = 45, -- Bracers of Undead Warding - [236747] = 45, -- Gauntlets of Undead Warding - [236748] = 45, -- Breastplate of Undead Warding - }, } Data.setNames = { AUGURS_REGALIA = "Augur's Regalia",