Skip to content
Open
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
70 changes: 70 additions & 0 deletions Modules/Data/Constants.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
-- keep-sorted start case=no
local IsWotlk = ECS.IsWotlk
-- keep-sorted end

---@class Data
local Data = ECSLoader:ImportModule("Data")

Expand Down Expand Up @@ -802,3 +806,69 @@ Data.setNames = {
VESTMENTS_OF_TRANSCENDENCE = "Vestments of Transcendence",
WINDHAWK_ARMOR = "Windhawk Armor",
}
Data.Talent = {
-- keep-sorted start block=yes
[Data.DEATHKNIGHT] = {
-- keep-sorted start
BLOOD_GORGED = {61274,61275,61276,61277,61278},
VIRULENCE = {48962,49567,49568},
-- keep-sorted end
},
[Data.DRUID] = {
-- keep-sorted start
BALANCE_OF_POWER = {33592,33596},
INTENSITY_REFLECTION = {17106,17107,17108},
NATURAL_PERFECTION = {33881,33882,33883},
SURVIVAL_OF_THE_FITTEST = {33853,33855,33856},
-- keep-sorted end
},
[Data.MAGE] = {
-- keep-sorted start
ARCANE_FOCUS = (IsWotlk and {11222,12839,12840} or {11222,12839,12840,12841,12842}),
ARCANE_INSTABILITY = {15058,15059,15060},
ARCANE_MEDITATION = {14521,18463,18464},
CRITICAL_MASS = {11115,11367,11368},
ELEMENTAL_PRECISION = {29438,29439,29440},
PYROMANIAC = {34293,34295,34296},
-- keep-sorted end
},
[Data.PALADIN] = {
-- keep-sorted start
CONVICTION = {20117,20118,20119,20120,20121},
ENLIGHTENED_JUDGEMENTS = {53556,53557},
SANCTITY_OF_BATTLE = {32043,35396,35397},
-- keep-sorted end
},
[Data.PRIEST] = {
-- keep-sorted start
HOLY_POWER = {5923,5924,5925,5926,25829},
HOLY_SPECIALIZATION = {14889,15008,15009,15010,15011},
MEDITATION = {14521,14776,14777},
SHADOW_FOCUS = {15260,15327,15328},
SHADOW_RESILIENCE = {14910,33371},
-- keep-sorted end
},
[Data.ROGUE] = {
-- keep-sorted start
PRECISION = {13705,13832,13843,13844,13845},
SLEIGHT_OF_HAND = {30892,30893},
-- keep-sorted end
},
[Data.SHAMAN] = {
-- keep-sorted start
ELEMENTAL_PRECISION = {30672,30673,30674},
NATURES_GUIDANCE = {16180,16196,16198},
THUNDERING_STRIKES = {16255,16302,16303,16304,16305},
-- keep-sorted end
},
[Data.WARLOCK] = {
-- keep-sorted start
BACKLASH = {34935,34938,34939},
DEMONIC_RESILIENCE = {30319,30320,30321},
DEMONIC_TACTICS = {30242,30245,30246,30247,30248},
DEVASTATION = {18130,18131,18132,18133,18134},
SUPPRESSION = {18174,18175,18176},
-- keep-sorted end
},
-- keep-sorted end
}
32 changes: 18 additions & 14 deletions Modules/Data/Defense.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ local DataUtils = ECSLoader:ImportModule("DataUtils")
---@type Utils
local Utils = ECSLoader:ImportModule("Utils")

local _Defense = {}

-- keep-sorted start case=no
local _, _, classId = UnitClass("player")

local MAX_SKILL = (UnitLevel("player")) * 5
local _Defense = {}
-- Every 25 defense reduce the chance to be critically hit by 1 %
local DEFENSE_FOR_CRIT_REDUCTION = 25
local DRUID = Data.DRUID
local MAX_SKILL = (UnitLevel("player")) * 5
local PRIEST = Data.PRIEST
local ROGUE = Data.ROGUE
local WARLOCK = Data.WARLOCK
-- keep-sorted end

---@return number
function Data:GetArmorValue()
Expand Down Expand Up @@ -62,27 +66,27 @@ function _Defense:GetCritReduction()
end
local critReducingFromResilience = GetCombatRatingBonus(15)

if classId == Data.DRUID then
if classId == DRUID then
local coeff = ECS.IsWotlk and 2 or 1
meleeCritReduction = meleeCritReduction + coeff * DataUtils:GetActiveTalentSpell({33853,33855,33856}) -- Survival of the Fittest
elseif classId == Data.PRIEST then
meleeCritReduction = meleeCritReduction + coeff * DataUtils:GetActiveTalentSpell(Data.Talent[DRUID].SURVIVAL_OF_THE_FITTEST)
elseif classId == PRIEST then
if ECS.IsTBC then
spellCritReduction = spellCritReduction + 2 * DataUtils:GetActiveTalentSpell({14910,33371}) -- shadow resilience
spellCritReduction = spellCritReduction + 2 * DataUtils:GetActiveTalentSpell(Data.Talent[PRIEST].SHADOW_RESILIENCE)
end
elseif classId == Data.ROGUE then
local mod = 1 * DataUtils:GetActiveTalentSpell({30892,30893}) -- Sleight of Hand
elseif classId == ROGUE then
local mod = 1 * DataUtils:GetActiveTalentSpell(Data.Talent[ROGUE].SLEIGHT_OF_HAND)
meleeCritReduction = meleeCritReduction + mod
rangedCritReduction = rangedCritReduction + mod
elseif classId == Data.WARLOCK then
elseif classId == WARLOCK then
if not ECS.IsClassic then
local mod = 1 * DataUtils:GetActiveTalentSpell({30319,30320,30321}) -- Demonic Resilience
local mod = 1 * DataUtils:GetActiveTalentSpell(Data.Talent[WARLOCK].DEMONIC_RESILIENCE)
meleeCritReduction = meleeCritReduction + mod
rangedCritReduction = rangedCritReduction + mod
end
end

if ECS.IsSoD then
if classId == Data.DRUID or classId == Data.ROGUE then
if classId == DRUID or classId == ROGUE then
local chestRune = DataUtils.GetRuneForEquipSlot(Utils.CHAR_EQUIP_SLOTS.Chest)
if chestRune and (chestRune == 6710 or chestRune == 6972) then
meleeCritReduction = meleeCritReduction + 6 -- survival of the fittest / Just a Flesh Wound
Expand Down Expand Up @@ -123,7 +127,7 @@ function _Defense:GetEnemyMissChance(enemyLevel)
local miss
if ECS.IsWotlk then
local defense = math.floor(GetCombatRatingBonus(CR_DEFENSE_SKILL));
local enemyMissCoef = classId == Data.DRUID and 0.972 or 0.956; -- 0.972 for bears
local enemyMissCoef = classId == DRUID and 0.972 or 0.956; -- 0.972 for bears
local baseMissChance = 5 - (enemyAttackRating - select(1, UnitDefense("player"))) * 0.04; -- vs lvl 80
if defense > 0 then -- avoid possible division by 0
local enemyMissChance = baseMissChance + 1 / (0.0625 + enemyMissCoef / (defense * 0.04))
Expand Down
22 changes: 13 additions & 9 deletions Modules/Data/MP5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ local DataUtils = ECSLoader:ImportModule("DataUtils")
---@type Utils
local Utils = ECSLoader:ImportModule("Utils")

local _MP5 = {}

-- keep-sorted start case=no
local _, _, classId = UnitClass("player")
local _MP5 = {}
local DRUID = Data.DRUID
local MAGE = Data.MAGE
local PRIEST = Data.PRIEST
-- keep-sorted end

---@return number
function Data:GetValueFromAuraTooltip(index,type)
Expand Down Expand Up @@ -178,19 +182,19 @@ end
function _MP5:GetTalentModifier()
local mod = 0

if classId == Data.PRIEST then
if classId == PRIEST then
local coeff = ECS.IsTBC and 0.1 or (ECS.IsWotlk and 0.5/3 or 0.05)
mod = mod + coeff * DataUtils:GetActiveTalentSpell({14521,14776,14777}) -- meditation
elseif classId == Data.MAGE then
mod = mod + coeff * DataUtils:GetActiveTalentSpell(Data.Talent[PRIEST].MEDITATION)
elseif classId == MAGE then
local coeff = ECS.IsTBC and 0.1 or (ECS.IsWotlk and 0.5/3 or 0.05)
mod = mod + coeff * DataUtils:GetActiveTalentSpell({14521,18463,18464}) -- arcane meditation
mod = mod + coeff * DataUtils:GetActiveTalentSpell(Data.Talent[MAGE].ARCANE_MEDITATION)

if ECS.IsWotlk then
mod = mod + 0.5/3 * DataUtils:GetActiveTalentSpell({34293,34295,34296}) -- pyromaniac
mod = mod + 0.5/3 * DataUtils:GetActiveTalentSpell(Data.Talent[MAGE].PYROMANIAC)
end
elseif classId == Data.DRUID then
elseif classId == DRUID then
local coeff = ECS.IsTBC and 0.1 or (ECS.IsWotlk and 0.5/3 or 0.05)
mod = mod + coeff * DataUtils:GetActiveTalentSpell({17106,17107,17108}) -- intensity/reflection
mod = mod + coeff * DataUtils:GetActiveTalentSpell(Data.Talent[DRUID].INTENSITY_REFLECTION)
end
return mod
end
23 changes: 14 additions & 9 deletions Modules/Data/Melee.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ local DataUtils = ECSLoader:ImportModule("DataUtils")
---@type Utils
local Utils = ECSLoader:ImportModule("Utils")

local _Melee = {}
-- keep-sorted start case=no
local _, _, classId = UnitClass("player")
local _Melee = {}
local DEATHKNIGHT = Data.DEATHKNIGHT
local DRUID = Data.DRUID
local ROGUE = Data.ROGUE
local SHAMAN = Data.SHAMAN
local WARRIOR = Data.WARRIOR
-- keep-sorted end

---@return number
function Data:GetMeleeAttackPower()
Expand Down Expand Up @@ -61,11 +68,9 @@ function _Melee:GetHitTalentBonus()
local mod = 0
if ECS.IsClassic then
if classId == Data.SHAMAN then
-- Nature's Guidance
mod = 1 * DataUtils:GetActiveTalentSpell({16180,16196,16198})
mod = 1 * DataUtils:GetActiveTalentSpell(Data.Talent[SHAMAN].NATURES_GUIDANCE)
elseif classId == Data.ROGUE then
-- precision
mod = 1 * DataUtils:GetActiveTalentSpell({13705,13832,13843,13844,13845})
mod = 1 * DataUtils:GetActiveTalentSpell(Data.Talent[ROGUE].PRECISION)
end
end

Expand All @@ -83,7 +88,7 @@ function _Melee.GetHitFromRunes()
local finger1Rune = DataUtils.GetRuneForEquipSlot(Utils.CHAR_EQUIP_SLOTS.Finger1)
local finger2Rune = DataUtils.GetRuneForEquipSlot(Utils.CHAR_EQUIP_SLOTS.Finger2)

if classId == Data.DRUID and (finger1Rune == 7520 or finger2Rune == 7520) and DataUtils:IsShapeshifted() then
if classId == DRUID and (finger1Rune == 7520 or finger2Rune == 7520) and DataUtils:IsShapeshifted() then
mod = mod + 3 -- 3% from Feral Combat Specialization Rune
end

Expand Down Expand Up @@ -206,15 +211,15 @@ end
function Data:GetArmorPenetration()
local armorPenetration = GetArmorPenetration()

if ECS.IsWotlk and classId == Data.WARRIOR then
if ECS.IsWotlk and classId == WARRIOR then
local _, isActive = GetShapeshiftFormInfo(1)
if isActive then
armorPenetration = armorPenetration + 10 -- 10% from Battle Stance
end
end

if classId == Data.DEATHKNIGHT then
armorPenetration = armorPenetration + 2 * DataUtils:GetActiveTalentSpell({61274,61275,61276,61277,61278}) -- Blood Gorged
if classId == DEATHKNIGHT then
armorPenetration = armorPenetration + 2 * DataUtils:GetActiveTalentSpell(Data.Talent[DEATHKNIGHT].BLOOD_GORGED)
end

return DataUtils:Round(armorPenetration, 2) .. "%"
Expand Down
57 changes: 31 additions & 26 deletions Modules/Data/SpellCrit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ local Data = ECSLoader:ImportModule("Data")
---@type DataUtils
local DataUtils = ECSLoader:ImportModule("DataUtils")

local _SpellCrit = {}

-- keep-sorted start case=no
local _, _, classId = UnitClass("player")
local _SpellCrit = {}
local DRUID = Data.DRUID
local MAGE = Data.MAGE
local PALADIN = Data.PALADIN
local PRIEST = Data.PRIEST
local SHAMAN = Data.SHAMAN
local WARLOCK = Data.WARLOCK
-- keep-sorted end

---@param school number
---@return string
Expand Down Expand Up @@ -53,29 +60,29 @@ end
function _SpellCrit:GetGeneralTalentModifier()
local mod = 0

if classId == Data.MAGE then
if classId == MAGE then
if not ECS.IsClassic then
mod = mod + 1 * DataUtils:GetActiveTalentSpell({15058,15059,15060}) -- Arcane Instability
mod = mod + 1 * DataUtils:GetActiveTalentSpell(Data.Talent[MAGE].ARCANE_INSTABILITY)
end
elseif classId == Data.DRUID then
elseif classId == DRUID then
if ECS.IsWotlk then
mod = mod + 1 * DataUtils:GetActiveTalentSpell({33881,33882,33883}) -- Natural Perfection
mod = mod + 1 * DataUtils:GetActiveTalentSpell(Data.Talent[DRUID].NATURAL_PERFECTION)
end
elseif classId == Data.WARLOCK then
elseif classId == WARLOCK then
if ECS.IsWotlk then
mod = mod + 2 * DataUtils:GetActiveTalentSpell({30242,30245,30246,30247,30248}) -- Demonic Tactics
mod = mod + 1 * DataUtils:GetActiveTalentSpell({34935,34938,34939}) -- Backlash
mod = mod + 2 * DataUtils:GetActiveTalentSpell(Data.Talent[WARLOCK].DEMONIC_TACTICS)
mod = mod + 1 * DataUtils:GetActiveTalentSpell(Data.Talent[WARLOCK].BACKLASH)
end

mod = mod + 1 * DataUtils:GetActiveTalentSpell({18130,18131,18132,18133,18134}) -- Devastation
elseif classId == Data.SHAMAN then
mod = mod + 1 * DataUtils:GetActiveTalentSpell(Data.Talent[WARLOCK].DEVASTATION)
elseif classId == SHAMAN then
if ECS.IsWotlk then
mod = mod + 1 * DataUtils:GetActiveTalentSpell({16255,16302,16303,16304,16305}) -- Thundering Strikes
mod = mod + 1 * DataUtils:GetActiveTalentSpell(Data.Talent[SHAMAN].THUNDERING_STRIKES)
end
elseif classId == Data.PALADIN then
elseif classId == PALADIN then
if ECS.IsWotlk then
mod = mod + 1 * DataUtils:GetActiveTalentSpell({20117,20118,20119,20120,20121}) -- Conviction
mod = mod + 1 * DataUtils:GetActiveTalentSpell({32043,35396,35397}) -- Sanctity of Battle
mod = mod + 1 * DataUtils:GetActiveTalentSpell(Data.Talent[PALADIN].CONVICTION)
mod = mod + 1 * DataUtils:GetActiveTalentSpell(Data.Talent[PALADIN].SANCTITY_OF_BATTLE)
end
end

Expand All @@ -98,12 +105,10 @@ end
function _SpellCrit:GetTalentModifierHolyCrit()
local mod = 0

if classId == Data.PRIEST then
-- Holy Specialization
mod = 1 * DataUtils:GetActiveTalentSpell({14889,15008,15009,15010,15011})
elseif classId == Data.PALADIN then
-- Holy Power
mod = 1 * DataUtils:GetActiveTalentSpell({5923,5924,5925,5926,25829})
if classId == PRIEST then
mod = 1 * DataUtils:GetActiveTalentSpell(Data.Talent[PRIEST].HOLY_SPECIALIZATION)
elseif classId == PALADIN then
mod = 1 * DataUtils:GetActiveTalentSpell(Data.Talent[PALADIN].HOLY_POWER)
end
return mod
end
Expand All @@ -112,16 +117,16 @@ end
function _SpellCrit:GetTalentModifierFireCrit()
local mod = 0

if classId == Data.MAGE then
mod = mod + 2 * DataUtils:GetActiveTalentSpell({11115,11367,11368}) -- Critical Mass
if classId == MAGE then
mod = mod + 2 * DataUtils:GetActiveTalentSpell(Data.Talent[MAGE].CRITICAL_MASS)

if ECS.IsWotlk then
mod = mod + 1 * DataUtils:GetActiveTalentSpell({34293,34295,34296}) -- Pyromaniac
mod = mod + 1 * DataUtils:GetActiveTalentSpell(Data.Talent[MAGE].PYROMANIAC)
end
elseif classId == Data.WARLOCK then
elseif classId == WARLOCK then
if ECS.IsClassic then
-- Devastation (while this increases the crit chance of "Destruction spells" there are no fire spells, which are not destruction spells)
mod = mod + 1 * DataUtils:GetActiveTalentSpell({18130,18131,18132,18133,18134})
mod = mod + 1 * DataUtils:GetActiveTalentSpell(Data.Talent[WARLOCK].DEVASTATION)
end
end

Expand Down
Loading
Loading