Skip to content
Draft
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
207 changes: 205 additions & 2 deletions Modules/Data/Constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ Data.MAGE = 8
Data.WARLOCK = 9
Data.DRUID = 11

--- same as wowhead
---@class table<number>
Data.CreatureType = {
BEAST = 1,
DRAGONKIN = 2,
DEMON = 3,
ELEMENTAL = 4,
-- GIANT = 5,
UNDEAD = 6,
HUMANOID = 7,
MECHANICAL = 9,
}

Data.Aura = {
AllowCastingManaRegeneration = {
[6117] = (ECS.IsWotlk and 0.5 or 0.3), -- Mage Armor rank 1
Expand All @@ -46,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
Expand Down Expand Up @@ -351,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
Expand Down Expand Up @@ -422,7 +454,7 @@ Data.Aura = {
[1227200] = 20, -- Wickedness
[1236220] = -50, -- Slow
},
}
}
Data.Enchant = {
BlockValue = {
[2583] = 15, -- Presence of Might
Expand All @@ -434,6 +466,51 @@ Data.Enchant = {
Ids = {
BIZNICK_SCOPE = 2523, -- 3% Hit from Biznicks 247x128 Accurascope
},
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
[2565] = 4, -- Enchant Bracer - Mana Regeneration
Expand Down Expand Up @@ -520,7 +597,131 @@ Data.Gem = {
[42146] = 17, -- Lustrous Dragon's Eye
},
}
Data.Item = {
Data.Item = {
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
[23206] = 150, -- Champion of the Dawn
[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
[236352] = 157, -- Champion of the Dawn
},
[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
},
[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] = {
[23207] = 85, -- Champion of the Dawn
[30708] = 185, -- Illidari-Bane Mageblade
[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,
[233505] = true,
Expand Down Expand Up @@ -789,6 +990,7 @@ Data.Item = {
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",
Expand All @@ -799,6 +1001,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",
}
25 changes: 25 additions & 0 deletions Modules/Data/ItemSets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -144,6 +156,19 @@ function Data:GetSetBonusModifierMP5()
return mod
end

---@return boolean
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 boolean
function Data:HasUndeadSlayer15()
return Data:IsSetBonusActive(setNames.CHAIN_OF_THE_SCARLET_CRUSADE, 5)
end

---@return number
function Data:GetSetBonusValueMP5()
local bonus = 0
Expand Down
57 changes: 56 additions & 1 deletion Modules/Data/Melee.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
local GetBuffDataByIndex = C_UnitAuras.GetBuffDataByIndex
local GetInventoryItemID = GetInventoryItemID
local GetInventoryItemLink = GetInventoryItemLink
local pairs = pairs

---@class Data
local Data = ECSLoader:ImportModule("Data")
---@type DataUtils
Expand All @@ -7,14 +12,64 @@ 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()
local melee, posBuff, negBuff = UnitAttackPower("player")
return melee + posBuff + negBuff
end

---@return number
---@return table<CreatureType,number>
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
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)
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
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 Data:HasUndeadSlayer15() then dmg[UNDEAD] = dmg[UNDEAD] + 15 end
if Data:HasDemonSlaying200() then dmg[DEMON] = dmg[DEMON] + 200 end

return dmg
end

---@return string
function Data:GetMeleeAttackSpeedMainHand()
local mainHand, _ = UnitAttackSpeed("player")
return DataUtils:Round(mainHand, 2)
Expand Down
Loading
Loading