Skip to content

Commit 7fe6c2f

Browse files
wip
1 parent 6dd9bbc commit 7fe6c2f

File tree

3 files changed

+264
-1
lines changed

3 files changed

+264
-1
lines changed

Modules/Data/Constants.lua

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ Data.MAGE = 8
2020
Data.WARLOCK = 9
2121
Data.DRUID = 11
2222

23+
Data.BEAST = 1
24+
Data.DRAGONKIN = 2
25+
Data.DEMON = 3
26+
Data.ELEMENTAL = 4
27+
Data.GIANT = 5
28+
Data.UNDEAD = 6
29+
Data.HUMANOID = 7
30+
Data.MECHANICAL = 9
31+
Data.UNCATEGORIZED = 10
32+
2333
Data.setNames = {
2434
BATTLEGEAR_OF_MIGHT = "Battlegear of Might",
2535
STORMRAGE_RAIMENT = "Stormrage Raiment",
@@ -50,3 +60,30 @@ Data.gemIds = {
5060
TWO_MP5_GEMS = {"30589", "32225", "24065", "30594", "31865", "32214", "30606", "23121", "24057", "32216", "30603", "30560", "30550"},
5161
ONE_MP5_GEMS = {"23106", "31864", "28465", "23109"}
5262
}
63+
64+
Data.itemIds = {
65+
BEAST_SLAYING_24 = {11628, 11629},
66+
BEAST_SLAYING_30 = {11906, 7756, 3566},
67+
BEAST_SLAYING_33 = {15783, 15782},
68+
BEAST_SLAYING_60 = {7710, 19946},
69+
BEAST_SLAYING_99 = {231272, 231849}, -- sod
70+
DEMON_SLAYING_33 = {10697, 10696},
71+
DEMON_SLAYING_45 = {18715, 20487},
72+
DEMON_SLAYING_141 = {231277, 231864}, --sod
73+
DRAGON_SLAYING_60 = {231274, 231847}, -- sod
74+
DRAGON_SLAYING_141 = {231273, 231846}, -- sod
75+
INCREASE_SPELL_DAM_UNDEAD_26 = {236722, 236739, 236723, 236738, 236724, 236737},
76+
INCREASE_SPELL_DAM_UNDEAD_35 = {23084, 18346},
77+
INCREASE_SPELL_DAM_UNDEAD_35_SOD = {236716, 236734, 236725},
78+
INCREASE_SPELL_DAM_UNDEAD_48 = {23085, 24198},
79+
INCREASE_SPELL_DAM_UNDEAD_48_SOD = {236717, 236735, 236726},
80+
INCREASE_SPELL_DAM_UNDEAD_62 = {236736, 236718, 236727},
81+
UNDEAD_SLAYER_30 = {867, 10805},
82+
UNDEAD_SLAYER_45_SOD = {236746, 236748, 236747, 236732, 236733, 236731},
83+
UNDEAD_SLAYER_45 = {23090, 23092, 23093}, -- without specter's blade
84+
UNDEAD_SLAYER_60_SOD = {236712, 236710, 236711},
85+
UNDEAD_SLAYER_60 = {23078, 23082, 23081},
86+
UNDEAD_SLAYER_81_SOD = {236714, 236715, 236713},
87+
UNDEAD_SLAYER_81 = {23087, 23088, 23089},
88+
UNDEAD_SLAYER_108 = {236708, 236709, 236707}, -- sod
89+
}

Modules/Data/Melee.lua

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,177 @@ function Data:GetMeleeAttackPower()
1414
return melee + posBuff + negBuff
1515
end
1616

17+
---@param creature number
18+
---@return string
19+
function Data:GetMeleeAttackPowerVsCreature(creature)
20+
local dmg = 0
21+
if creature == Data.UNDEAD then
22+
-- auras
23+
if C_UnitAuras.GetPlayerAuraBySpellID(24833) then dmg = dmg + 300 end -- holy mightstone
24+
if C_UnitAuras.GetPlayerAuraBySpellID(17352) then dmg = dmg + 200 end -- Argent Avenger
25+
-- items
26+
for _, i in pairs(Data.itemIds.UNDEAD_SLAYER_30) do
27+
if C_Item.IsEquippedItem(i) then dmg = dmg + 30 end
28+
end
29+
for _, i in pairs(Data.itemIds.UNDEAD_SLAYER_45) do
30+
if C_Item.IsEquippedItem(i) then dmg = dmg + 45 end
31+
end
32+
for _, i in pairs(Data.itemIds.UNDEAD_SLAYER_60) do
33+
if C_Item.IsEquippedItem(i) then dmg = dmg + 60 end
34+
end
35+
for _, i in pairs(Data.itemIds.UNDEAD_SLAYER_81) do
36+
if C_Item.IsEquippedItem(i) then dmg = dmg + 81 end
37+
end
38+
if C_Item.IsEquippedItem(13209) then dmg = dmg + 81 end -- Seal of the Dawn
39+
-- weapons
40+
for i = 16, 17 do
41+
local itemId, _ = GetInventoryItemID("player", i)
42+
if itemId and itemId == 13017 then dmg = dmg + 66 end -- Hellslayer Battle Axe
43+
end
44+
--
45+
if ECS.IsSod then
46+
-- items
47+
for _, i in pairs(Data.itemIds.UNDEAD_SLAYER_45_SOD) do
48+
if C_Item.IsEquippedItem(i) then dmg = dmg + 45 end
49+
end
50+
for _, i in pairs(Data.itemIds.UNDEAD_SLAYER_60_SOD) do
51+
if C_Item.IsEquippedItem(i) then dmg = dmg + 60 end
52+
end
53+
for _, i in pairs(Data.itemIds.UNDEAD_SLAYER_81_SOD) do
54+
if C_Item.IsEquippedItem(i) then dmg = dmg + 81 end
55+
end
56+
for _, i in pairs(Data.itemIds.UNDEAD_SLAYER_108_SOD) do
57+
if C_Item.IsEquippedItem(i) then dmg = dmg + 108 end
58+
end
59+
if C_Item.IsEquippedItem(209574) then dmg = dmg + 15 end -- Discarded Tenets of the Silver Hand
60+
-- weapons
61+
for i = 16, 17 do
62+
local itemId, _ = GetInventoryItemID("player", i)
63+
if itemId then
64+
if itemId == 220575 then dmg = dmg + 39 -- Eater of the Damned
65+
elseif itemId == 228030 then dmg = dmg + 30 end -- Malicious Axe
66+
end
67+
end
68+
end
69+
elseif creature == Data.DEMON then
70+
-- auras
71+
if C_UnitAuras.GetPlayerAuraBySpellID(11406) then dmg = dmg + 265 end -- Elixir of Demonslaying
72+
-- items
73+
for _, i in pairs(Data.itemIds.DEMON_SLAYING_33) do
74+
if C_Item.IsEquippedItem(i) then dmg = dmg + 33 end
75+
end
76+
for _, i in pairs(Data.itemIds.DEMON_SLAYING_45) do
77+
if C_Item.IsEquippedItem(i) then dmg = dmg + 45 end
78+
end
79+
-- weapons
80+
for i = 16, 17 do
81+
local itemId, _ = GetInventoryItemID("player", i)
82+
if itemId then
83+
if itemId == 10698 then dmg = dmg + 78 -- Enchanted Azsharite Felbane Staff
84+
elseif itemId == 13044 then dmg = dmg + 99 -- Demonslayer
85+
elseif itemId == 19963 then dmg = dmg + 117 end -- Pitchfork of Madness
86+
end
87+
end
88+
--
89+
if ECS.IsSod then
90+
-- items
91+
for _, i in pairs(Data.itemIds.DEMON_SLAYING_141) do
92+
if C_Item.IsEquippedItem(i) then dmg = dmg + 141 end
93+
end
94+
-- weapons
95+
for i = 16, 17 do
96+
local itemId, _ = GetInventoryItemID("player", i)
97+
if itemId and itemIds == 228332 then dmg = dmg + 45 end -- Lok'delar, Stave of the Ancient Keepers
98+
end
99+
end
100+
elseif creature == Data.BEAST then
101+
-- items
102+
for _, i in pairs(Data.itemIds.BEAST_SLAYING_24) do
103+
if C_Item.IsEquippedItem(i) then dmg = dmg + 24 end
104+
end
105+
for _, i in pairs(Data.itemIds.BEAST_SLAYING_30) do
106+
if C_Item.IsEquippedItem(i) then dmg = dmg + 30 end
107+
end
108+
for _, i in pairs(Data.itemIds.BEAST_SLAYING_33) do
109+
if C_Item.IsEquippedItem(i) then dmg = dmg + 33 end
110+
end
111+
for _, i in pairs(Data.itemIds.BEAST_SLAYING_60) do
112+
if C_Item.IsEquippedItem(i) then dmg = dmg + 60 end
113+
end
114+
if C_Item.IsEquippedItem(16658) then dmg = dmg + 18 end -- Wildhunter Cloak
115+
if C_Item.IsEquippedItem(13212) then dmg = dmg + 48 end -- Halycon's Spiked Collar
116+
-- weapons
117+
for i = 16, 17 do
118+
local itemId, _ = GetInventoryItemID("player", i)
119+
if itemId then
120+
if itemId == 11907 then dmg = dmg + 72 -- Beastslayer
121+
elseif itemId == 12709 then dmg = dmg + 45 end -- pip's skinner
122+
end
123+
end
124+
--
125+
if ECS.IsSod then
126+
-- items
127+
for _, i in pairs(Data.itemIds.BEAST_SLAYING_99) do
128+
if C_Item.IsEquippedItem(i) then dmg = dmg + 99 end
129+
end
130+
end
131+
elseif creature == Data.DRAGONKIN then
132+
-- weapons
133+
for i = 16, 17 do
134+
local itemId, _ = GetInventoryItemID("player", i)
135+
if itemId then
136+
if itemId == 19961 then dmg = dmg + 48 -- Gri'lek's Grinder
137+
elseif itemId == 19962 then dmg = dmg + 117 end -- Gri'lek's Carver
138+
end
139+
end
140+
--
141+
if ECS.IsSod then
142+
-- items
143+
if C_Item.IsEquippedItem(221457) then
144+
dmg = dmg + 36 -- Libram of Draconic Destruction
145+
end
146+
for _, i in pairs(Data.itemIds.DRAGON_SLAYING_60) do
147+
if C_Item.IsEquippedItem(i) then dmg = dmg + 60 end
148+
end
149+
for _, i in pairs(Data.itemIds.DRAGON_SLAYING_141) do
150+
if C_Item.IsEquippedItem(i) then dmg = dmg + 141 end
151+
end
152+
-- weapons
153+
for i = 16, 17 do
154+
local itemId, _ = GetInventoryItemID("player", i)
155+
if itemId and itemId == 220965 then dmg = dmg + 117 end -- Scalebane Greataxe
156+
end
157+
end
158+
elseif creature == Data.ELEMENTAL then
159+
-- weapons
160+
for i = 16, 17 do
161+
local itemId, _ = GetInventoryItemID("player", i)
162+
if itemId and itemId == 18310 then dmg = dmg + 36 end -- Fiendish Machete
163+
end
164+
--
165+
if ECS.IsSod then
166+
-- weapons
167+
for i = 16, 17 do
168+
local itemId, _ = GetInventoryItemID("player", i)
169+
if itemId then
170+
if itemId == 228056 then dmg = dmg + 36 -- Fiendish Machete
171+
elseif itemId == 228486 then dmg = dmg + 75 end -- Treant's Bane
172+
end
173+
end
174+
end
175+
elseif creature == Data.MECHANICAL then
176+
if ECS.IsSod then
177+
-- items
178+
if C_Item.IsEquippedItem(213319) then dmg = dmg + 30 end -- Machinist's Gloves
179+
end
180+
end
181+
if creature == Data.UNDEAD or creature == Data.DEMON then
182+
-- items
183+
if C_Item.IsEquippedItem(29113) then dmg = dmg + 150 end -- Champion of the Dawn
184+
if ECS.IsSod and C_Item.IsEquippedItem(1219522) then dmg = dmg + 157 end -- Champion of the Dawn
185+
end
186+
end
187+
17188
---@return string
18189
function Data:GetMeleeAttackSpeedMainHand()
19190
local mainHand, _ = UnitAttackSpeed("player")

Modules/Data/SpellDamage.lua

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,61 @@ function Data:GetSpellDamage(school)
1616
return DataUtils:Round(spellDmg, 0)
1717
end
1818

19+
---@param creature number
20+
---@return number
21+
function Data:GetSpellDamageVsCreature(creature)
22+
local spellDmg = 0
23+
if creature == Data.UNDEAD then
24+
-- auras
25+
if C_UnitAuras.GetPlayerAuraBySpellID(24833) then spellDmg = spellDmg + 400 end -- holy mightstone
26+
-- items
27+
if C_Item.IsEquippedItem(23091) then spellDmg = spellDmg + 26 end -- Bracers of Undead Cleansing
28+
for _, i in pairs(Data.itemIds.INCREASE_SPELL_DAM_UNDEAD_35) do
29+
if C_Item.IsEquippedItem(i) then spellDmg = spellDmg + 35 end
30+
end
31+
for _, i in pairs(Data.itemIds.INCREASE_SPELL_DAM_UNDEAD_48) do
32+
if C_Item.IsEquippedItem(i) then spellDmg = spellDmg + 48 end
33+
end
34+
--
35+
if ECS.IsSod then
36+
-- items
37+
for _, i in pairs(Data.itemIds.INCREASE_SPELL_DAM_UNDEAD_62) do
38+
if C_Item.IsEquippedItem(i) then spellDmg = spellDmg + 65 end -- name is different from bonus
39+
end
40+
for _, i in pairs(Data.itemIds.INCREASE_SPELL_DAM_UNDEAD_26) do
41+
if C_Item.IsEquippedItem(i) then spellDmg = spellDmg + 26 end
42+
end
43+
for _, i in pairs(Data.itemIds.INCREASE_SPELL_DAM_UNDEAD_35_SOD) do
44+
if C_Item.IsEquippedItem(i) then spellDmg = spellDmg + 35 end
45+
end
46+
for _, i in pairs(Data.itemIds.INCREASE_SPELL_DAM_UNDEAD_48_SOD) do
47+
if C_Item.IsEquippedItem(i) then spellDmg = spellDmg + 48 end
48+
end
49+
elseif ECS.IsWotlk then
50+
-- auras
51+
if C_UnitAuras.GetPlayerAuraBySpellID(60597) then spellDmg = spellDmg + 12000 end -- Blessing of the Crusade
52+
end
53+
if ECS.IsTbc or ECS.IsWotlk then
54+
-- auras
55+
if C_UnitAuras.GetPlayerAuraBySpellID(28488) then spellDmg = spellDmg + 15 end -- Scourgebane Infusion
56+
end
57+
elseif creature == Data.DEMON then
58+
if ECS.IsTbc or ECS.IsWotlk then
59+
-- items
60+
if C_Item.IsEquippedItem(30787) then spellDmg = spellDmg + 185 end -- Illidari-Bane Mageblade
61+
end
62+
end
63+
if creature == Data.UNDEAD or creature == Data.DEMON then
64+
-- items
65+
if C_Item.IsEquippedItem(29113) then spellDmg = spellDmg + 85 end -- Champion of the Dawn
66+
if ECS.IsSod and C_Item.IsEquippedItem(1219522) then spellDmg = spellDmg + 89 end -- Champion of the Dawn
67+
end
68+
69+
local modifier = _SpellDamage:GetGeneralTalentModifier()
70+
spellDmg = spellDmg * (1 + (modifier / 100))
71+
return DataUtils:Round(spellDmg, 0)
72+
end
73+
1974
---@return number
2075
function _SpellDamage:GetGeneralTalentModifier()
2176
local mod = 0
@@ -49,4 +104,4 @@ end
49104
function Data:GetSpellHasteBonus()
50105
local hasteBonus = GetCombatRatingBonus(CR_HASTE_SPELL)
51106
return DataUtils:Round(hasteBonus, 2) .. "%"
52-
end
107+
end

0 commit comments

Comments
 (0)