Skip to content

Commit

Permalink
Merge pull request #2921 from Supernuss/wrath
Browse files Browse the repository at this point in the history
Classes: Fix DV/DC proc and unlist proc trinkets
  • Loading branch information
zmsl authored Nov 18, 2023
2 parents 94dfafb + 8b3db4b commit 7ae5de6
Show file tree
Hide file tree
Showing 4 changed files with 191 additions and 67 deletions.
50 changes: 6 additions & 44 deletions Classes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3497,6 +3497,7 @@ all:RegisterAbility( "grim_toll", {
cast = 0,
cooldown = 45,
gcd = "off",
unlisted = true,

item = 40256,
aura = 60437
Expand All @@ -3511,6 +3512,7 @@ all:RegisterAbility( "mjolnir_runestone", {
cast = 0,
cooldown = 45,
gcd = "off",
unlisted = true,

item = 45931,
aura = 65019
Expand All @@ -3525,6 +3527,7 @@ all:RegisterAbility( "dark_matter", {
cast = 0,
cooldown = 45,
gcd = "off",
unlisted = true,

item = 46038,
aura = 65024
Expand All @@ -3539,6 +3542,7 @@ all:RegisterAbility( "whispering_fanged_skull", {
cast = 0,
cooldown = 45,
gcd = "off",
unlisted = true,

item = 50342,
aura = 71401
Expand All @@ -3548,61 +3552,19 @@ all:RegisterAbility( "whispering_fanged_skull_heroic", {
cast = 0,
cooldown = 45,
gcd = "off",
unlisted = true,

item = 50343,
aura = 71541
})
all:RegisterAura( "icy_rage", {
id = 67702,
id = 71401,
duration = 15,
max_stack = 1,
copy = { 71401, 71541 }
})

all:RegisterAbility( "deaths_verdict", {
cast = 0,
cooldown = 45,
gcd = "off",

item = 47115,
aura = 67702
})
all:RegisterAbility( "deaths_verdict_heroic", {
suffix = strformat( "(%s)", ITEM_HEROIC ),
cast = 0,
cooldown = 45,
gcd = "off",

item = 47131,
aura = 67702
})
all:RegisterAbility( "deaths_choice", {
cast = 0,
cooldown = 45,
gcd = "off",

item = 47303,
aura = 67771
})
all:RegisterAbility( "deaths_choice_heroic", {
suffix = strformat( "(%s)", ITEM_HEROIC ),
cast = 0,
cooldown = 45,
gcd = "off",

item = 47464,
aura = 67702
})
all:RegisterAura( "deaths_verdict", {
id = 67702,
duration = 15,
max_stack = 1
})
all:RegisterAura( "deaths_verdict_heroic", {
id = 67771,
duration = 15,
max_stack = 1
})

-- x.x - Heirloom Trinket(s)
all:RegisterAbility( "touch_of_the_void", {
Expand Down
3 changes: 2 additions & 1 deletion State.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3653,7 +3653,7 @@ do

end

local alias
local alias = nil
local mode = aura.aliasMode or "first"

for i, v in ipairs( aura.alias ) do
Expand All @@ -3666,6 +3666,7 @@ do
end

if not alias and mode == "first" and child.up then return child[ k ] end
if mode == "latest" and ( not alias or child.last_application > alias.last_application ) then alias = child end

if child.up then
if mode == "shortest" and ( not alias or child.remains < alias.remains ) then alias = child
Expand Down
138 changes: 138 additions & 0 deletions Wrath/Classes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,76 @@ RegisterEvent( "PLAYER_ENTERING_WORLD", ns.updateGlyphs )
all = class.specs[ 0 ]


all:RegisterAuras({
-- Phase 4
-- Death's Verdict/Choice Buffs
paragon_str = {
id = 67708,
duration = 15,
max_stack = 1,
copy = {67708, 67773}
},
paragon_agi = {
id = 67703,
duration = 15,
max_stack = 1,
copy = {67703, 67772}
},
-- When you deal damage you have a chance to gain Paragon, increasing your Strength or Agility by 450/510 for 15 sec. Your highest stat is always chosen.
paragon = {
--id = 67771,
alias = { "paragon_agi", "paragon_str" },
aliasMode = "latest",
aliasType = "buff",
},

-- DBW Buffs
aim_of_the_iron_dwarves = {
-- crit: DK, Hunter, Paladin
id = 71491,
duration = 30,
copy= {71491,71559},
},
agility_of_the_vrykul = {
-- agi: Druid, Hunter, Rogue, Shaman
id = 71485,
duration = 30,
copy= {71485,71556},
},
power_of_the_taunka = {
-- ap: Hunter, Rogue, Shaman
id = 71486,
duration = 30,
copy= {71486,71558},
},
precision_of_the_iron_dwarves = {
-- arp: Rogue, Shaman, Warrior
id = 71487,
duration = 30,
copy= {71487,71557},
},
speed_of_the_vrykul = {
-- haste: DK, Druid, Paladin
id = 71492,
duration = 30,
copy= {71492,71560},
},
strength_of_the_taunka = {
-- str: DK, Paladin, Warrior
id = 71484,
duration = 30,
copy= {71484,71561},
},
-- Your attacks have a chance to awaken the powers of the races of Northrend, temporarily transforming you and increasing your combat capabilities for 30 sec.
deathbringers_will = {
alias = {"aim_of_the_iron_dwarves", "agility_of_the_vrykul", "power_of_the_taunka", "precision_of_the_iron_dwarves", "speed_of_the_vrykul", "strength_of_the_taunka"},
aliasMode = "latest",
aliasType = "buff",
},


})

all:RegisterAbilities( {
-- Phase 4

Expand Down Expand Up @@ -161,6 +231,74 @@ all:RegisterAbilities( {
}
}
},
deathbringers_will = {
cast = 0,
cooldown = 105,
gcd = "off",
unlisted = true,

items = {50362, 50363},
item = function()
if equipped[ 50362 ] then return 50362 end
return 50363
end,

handler = function()
applyBuff( "deathbringers_will" )
end,

aura = "deathbringers_will",

},

deaths_verdict = {
cast = 0,
cooldown = 45,
gcd = "off",
unlisted = true,

items = {47115, 47131},
item = function()
if equipped[ 47115 ] then return 47115 end
return 47131
end,

handler = function()
if stat.strength >= stat.agility then
applyBuff( "paragon_str" )
else
applyBuff( "paragon_agi" )
end
end,

aura = "paragon",

},

deaths_choice = {
cast = 0,
cooldown = 45,
gcd = "off",
unlisted = true,

items = {47303, 47464},
item = function()
if equipped[ 47303 ] then return 47303 end
return 47464
end,


handler = function()
if stat.strength >= stat.agility then
applyBuff( "paragon_str" )
else
applyBuff( "paragon_agi" )
end
end,

aura = "paragon",

},

ephemeral_snowflake = {
cast = 0,
Expand Down
67 changes: 45 additions & 22 deletions Wrath/Druid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ spec:RegisterStateExpr("should_rake", function()
end

local r, s = calc_rake_dpe()
return r >= s or (not settings.optimize_rake)
return r >= s
end)

spec:RegisterStateExpr("is_training_dummy", function()
Expand Down Expand Up @@ -477,13 +477,23 @@ spec:RegisterStateExpr("excess_e", function()
pending_actions.mangle_cat.refresh_cost = 0
end

if buff.savage_roar.up then
if buff.savage_roar.up and combo_points.current > 0 then
pending_actions.savage_roar.refresh_time = query_time + buff.savage_roar.remains
pending_actions.savage_roar.refresh_cost = 25 * (berserk_expected_at(query_time, query_time + buff.savage_roar.remains) and 0.5 or 1)
else
pending_actions.savage_roar.refresh_time = 0
pending_actions.savage_roar.refresh_cost = 0
end

if pending_actions.rip.refresh_time > 0 and pending_actions.savage_roar.refresh_time > 0 then
if pending_actions.rip.refresh_time < pending_actions.savage_roar.refresh_time then
pending_actions.savage_roar.refresh_time = 0
pending_actions.savage_roar.refresh_cost = 0
else
pending_actions.rip.refresh_time = 0
pending_actions.rip.refresh_cost = 0
end
end
else
if buff.savage_roar.up then
pending_actions.savage_roar.refresh_time = query_time + buff.savage_roar.remains
Expand Down Expand Up @@ -550,23 +560,45 @@ spec:RegisterStateExpr("excess_e", function()
local earliest_proc_end = 0
if settings.optimize_trinkets and debuff.rip.up then
for entry in pairs(trinket) do
local t_proc_end = 0
if tonumber(entry) then
local t = trinket[entry]
if t.proc and t.ability and action[t.ability] and action[t.ability].aura > 0 and buff[action[t.ability].aura] then
local t_cooldown = action[t.ability].cooldown
local t_earliest_proc = max(0, buff[action[t.ability].aura].last_application + t_cooldown)
if t_cooldown > 0 and buff[action[t.ability].aura].last_application > 0 and (earliest_proc == 0 or t_earliest_proc < earliest_proc) then
earliest_proc = t_earliest_proc
earliest_proc_end = t_earliest_proc + buff[action[t.ability].aura].duration
trinket_entry = t
if t.proc and t.ability then
local t_action = action[t.ability]
if t_action and t_action.cooldown > 0 then
local t_buff = nil

-- Find the trinket buff to inspect
local aura_type = type(t_action.aura)
local auras_type = type(t_action.auras)
if aura_type == "number" and t_action.aura > 0
or aura_type == "string" and #t_action.aura > 0 then
t_buff = buff[t_action.aura]
elseif auras_type == "table" then
for a in pairs(t_action.auras) do
if buff[a].up then
t_buff = buff[a]
break
elseif t_buff == nil
or buff[a].last_application > t_buff.last_application then
t_buff = buff[a]
end
end
end

if t_buff then
local t_earliest_proc = t_buff.last_application > 0 and (t_buff.last_application + t_action.cooldown) or 0
if t_earliest_proc > 0 and (earliest_proc == 0 or t_earliest_proc < earliest_proc) then
earliest_proc = t_earliest_proc
earliest_proc_end = t_earliest_proc + t_buff.duration
end
trinket_active = trinket_active or t_buff.up
Hekili:Debug(tostring(t.ability).." trinket proc at approximately "..tostring(earliest_proc - query_time))
end
end

trinket_active = trinket_active or buff[action[t.ability].aura].up
end
end
end

if (not trinket_active) and earliest_proc > 0 and earliest_proc < time_to_cap and earliest_proc_end <= time_to_end then
floating_energy = max(floating_energy, 100)
Hekili:Debug("(excess_e) Pooling to "..tostring(floating_energy).." for trinket proc at approximately "..tostring(earliest_proc - query_time))
Expand Down Expand Up @@ -2947,15 +2979,6 @@ spec:RegisterSetting( "max_ff_energy", 15, {
step = 1,
} )

spec:RegisterSetting( "optimize_rake", false, {
type = "toggle",
name = strformat( "Optimize %s", Hekili:GetSpellLinkWithTexture( spec.abilities.rake.id ) ),
desc = strformat( "If checked, %s will only be suggested if it will do more damage than %s or if there is no active %s bleed. " ..
"Recommendation: Checked, if stacking Armor Penetration\n\n" ..
"Default: Unchecked", Hekili:GetSpellLinkWithTexture( spec.abilities.rake.id ), Hekili:GetSpellLinkWithTexture( spec.abilities.shred.id ), spec.abilities.rake.name ),
width = "full",
} )

spec:RegisterSetting( "optimize_trinkets", false, {
type = "toggle",
name = "Optimize Trinkets",
Expand Down

0 comments on commit 7ae5de6

Please sign in to comment.