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
50 changes: 50 additions & 0 deletions Modules/Data/Constants.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local IsWotlk = ECS.IsWotlk

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

Expand Down Expand Up @@ -802,3 +804,51 @@ Data.setNames = {
VESTMENTS_OF_TRANSCENDENCE = "Vestments of Transcendence",
WINDHAWK_ARMOR = "Windhawk Armor",
}
Data.Talent = {
[Data.DEATHKNIGHT] = {
BLOOD_GORGED = {61274,61275,61276,61277,61278},
VIRULENCE = {48962,49567,49568},
},
[Data.DRUID] = {
BALANCE_OF_POWER = {33592,33596},
INTENSITY_REFLECTION = {17106,17107,17108},
NATURAL_PERFECTION = {33881,33882,33883},
SURVIVAL_OF_THE_FITTEST = {33853,33855,33856},
},
[Data.MAGE] = {
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},
},
[Data.PALADIN] = {
CONVICTION = {20117,20118,20119,20120,20121},
ENLIGHTENED_JUDGEMENTS = {53556,53557},
SANCTITY_OF_BATTLE = {32043,35396,35397},
},
[Data.PRIEST] = {
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},
},
[Data.ROGUE] = {
PRECISION = {13705,13832,13843,13844,13845},
SLEIGHT_OF_HAND = {30892,30893},
},
[Data.SHAMAN] = {
ELEMENTAL_PRECISION = {30672,30673,30674},
NATURES_GUIDANCE = {16180,16196,16198},
THUNDERING_STRIKES = {16255,16302,16303,16304,16305},
},
[Data.WARLOCK] = {
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},
},
}
25 changes: 14 additions & 11 deletions Modules/Data/Defense.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ local Utils = ECSLoader:ImportModule("Utils")
local _Defense = {}

local _, _, classId = UnitClass("player")

local DRUID = Data.DRUID
local PRIEST = Data.PRIEST
local ROGUE = Data.ROGUE
local WARLOCK = Data.WARLOCK
local MAX_SKILL = (UnitLevel("player")) * 5
-- Every 25 defense reduce the chance to be critically hit by 1 %
local DEFENSE_FOR_CRIT_REDUCTION = 25
Expand Down Expand Up @@ -62,27 +65,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 +126,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
17 changes: 10 additions & 7 deletions Modules/Data/MP5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ local Utils = ECSLoader:ImportModule("Utils")
local _MP5 = {}

local _, _, classId = UnitClass("player")
local DRUID = Data.DRUID
local MAGE = Data.MAGE
local PRIEST = Data.PRIEST

---@return number
function Data:GetValueFromAuraTooltip(index,type)
Expand Down Expand Up @@ -178,19 +181,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
20 changes: 12 additions & 8 deletions Modules/Data/Melee.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ local DataUtils = ECSLoader:ImportModule("DataUtils")
local Utils = ECSLoader:ImportModule("Utils")

local _Melee = {}

local _, _, classId = UnitClass("player")
local DEATHKNIGHT = Data.DEATHKNIGHT
local DRUID = Data.DRUID
local ROGUE = Data.ROGUE
local SHAMAN = Data.SHAMAN
local WARRIOR = Data.WARRIOR

---@return number
function Data:GetMeleeAttackPower()
Expand Down Expand Up @@ -61,11 +67,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 +87,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 +210,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
52 changes: 28 additions & 24 deletions Modules/Data/SpellCrit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ local DataUtils = ECSLoader:ImportModule("DataUtils")
local _SpellCrit = {}

local _, _, classId = UnitClass("player")
local DRUID = Data.DRUID
local MAGE = Data.MAGE
local PALADIN = Data.PALADIN
local PRIEST = Data.PRIEST
local SHAMAN = Data.SHAMAN
local WARLOCK = Data.WARLOCK

---@param school number
---@return string
Expand Down Expand Up @@ -53,29 +59,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 +104,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 +116,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
44 changes: 26 additions & 18 deletions Modules/Data/SpellHit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ local DataUtils = ECSLoader:ImportModule("DataUtils")
local Utils = ECSLoader:ImportModule("Utils")

local _SpellHit = {}

local _, _, classId = UnitClass("player")
local DEATHKNIGHT = Data.DEATHKNIGHT
local DRUID = Data.DRUID
local MAGE = Data.MAGE
local PALADIN = Data.PALADIN
local PRIEST = Data.PRIEST
local SHAMAN = Data.SHAMAN
local WARLOCK = Data.WARLOCK

---@param school number
---@param levelDifference number
Expand Down Expand Up @@ -50,44 +58,44 @@ end
function _SpellHit:GetTalentSpellHitBonus(school)
local bonus = 0

if classId == Data.DRUID then
bonus = bonus + 2 * DataUtils:GetActiveTalentSpell({33592,33596}) -- Balance of Power
elseif classId == Data.DEATHKNIGHT then
if classId == DRUID then
bonus = bonus + 2 * DataUtils:GetActiveTalentSpell(Data.Talent[DRUID].BALANCE_OF_POWER)
elseif classId == DEATHKNIGHT then
if ECS.IsWotlk then
bonus = bonus + 1 * DataUtils:GetActiveTalentSpell({48962,49567,49568}) -- Virulence
bonus = bonus + 1 * DataUtils:GetActiveTalentSpell(Data.Talent[DEATHKNIGHT].VIRULENCE)
end
elseif classId == Data.MAGE then
elseif classId == MAGE then
if ECS.IsWotlk then
bonus = bonus + 1 * DataUtils:GetActiveTalentSpell({29438,29439,29440}) -- Elemental Precision
bonus = bonus + 1 * DataUtils:GetActiveTalentSpell({11222,12839,12840}) -- Arcane Focus
bonus = bonus + 1 * DataUtils:GetActiveTalentSpell(Data.Talent[MAGE].ELEMENTAL_PRECISION)
bonus = bonus + 1 * DataUtils:GetActiveTalentSpell(Data.Talent[MAGE].ARCANE_FOCUS)
else
if (school == Data.FIRE_SCHOOL or school == Data.FROST_SCHOOL) then
local coeff = ECS.IsClassic and 2 or 1
bonus = bonus + coeff * DataUtils:GetActiveTalentSpell({29438,29439,29440}) -- Elemental Precision
bonus = bonus + coeff * DataUtils:GetActiveTalentSpell(Data.Talent[MAGE].ELEMENTAL_PRECISION)
elseif school == Data.ARCANE_SCHOOL then
bonus = bonus + 2 * DataUtils:GetActiveTalentSpell({11222,12839,12840,12841,12842}) -- Arcane Focus
bonus = bonus + 2 * DataUtils:GetActiveTalentSpell(Data.Talent[MAGE].ARCANE_FOCUS)
end
end
elseif classId == Data.PALADIN then
elseif classId == PALADIN then
if ECS.IsWotlk then
bonus = bonus + 2 * DataUtils:GetActiveTalentSpell({53556,53557}) -- Enlightened Judgements
bonus = bonus + 2 * DataUtils:GetActiveTalentSpell(Data.Talent[PALADIN].ENLIGHTENED_JUDGEMENTS)
end
elseif classId == Data.PRIEST then
elseif classId == PRIEST then
if school == Data.SHADOW_SCHOOL then
local coeff = ECS.IsWotlk and 1 or 2
bonus = bonus + coeff * DataUtils:GetActiveTalentSpell({15260,15327,15328}) -- Shadow Focus
bonus = bonus + coeff * DataUtils:GetActiveTalentSpell(Data.Talent[PRIEST].SHADOW_FOCUS)
end
elseif classId == Data.SHAMAN then
elseif classId == SHAMAN then
if (school == Data.FIRE_SCHOOL or school == Data.FROST_SCHOOL or school == Data.NATURE_SCHOOL) then
local coeff = ECS.IsWotlk and 1 or 2
bonus = bonus + coeff * DataUtils:GetActiveTalentSpell({30672,30673,30674}) -- Elemental Precision
bonus = bonus + coeff * DataUtils:GetActiveTalentSpell(Data.Talent[SHAMAN].ELEMENTAL_PRECISION)
end
if ECS.IsClassic then
bonus = bonus + 1 * DataUtils:GetActiveTalentSpell({16180,16196,16198}) -- Nature's Guidance
bonus = bonus + 1 * DataUtils:GetActiveTalentSpell(Data.Talent[SHAMAN].NATURES_GUIDANCE)
end
elseif classId == Data.WARLOCK then
elseif classId == WARLOCK then
if ECS.IsWotlk then
bonus = bonus + 1 * DataUtils:GetActiveTalentSpell({18174,18175,18176}) -- Suppression
bonus = bonus + 1 * DataUtils:GetActiveTalentSpell(Data.Talent[WARLOCK].SUPPRESSION)
end
end

Expand Down
Loading