Skip to content

Commit

Permalink
Merge pull request #3860 from Spike2D/thewarwithin
Browse files Browse the repository at this point in the history
[Prot Warrior] - Spell Block added + Mitigation changes.
  • Loading branch information
Hekili authored Sep 26, 2024
2 parents 4accb28 + 268be58 commit 34f88c5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 13 deletions.
1 change: 1 addition & 0 deletions TheWarWithin/Priorities/WarriorProtection.simc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ actions+=/pummel
actions+=/charge,if=time=0|movement.distance>8
actions+=/use_items
actions+=/avatar,if=buff.thunder_blast.down|buff.thunder_blast.stack<=2
actions+=/spell_block,use_off_gcd=1,if=tanking&incoming_magic_damage_5s>spell_block_damage_taken&health.pct<=spell_block_health_pct&!(buff.spell_reflection_defense.up)
actions+=/shield_wall,use_off_gcd=1,if=tanking&incoming_damage_5s>shield_wall_damage_taken&health.pct<=shield_wall_health_pct&!(buff.shield_wall.up|buff.last_stand.up|buff.rallying_cry.up|buff.potion.up)
actions+=/blood_fury
actions+=/berserking
Expand Down
54 changes: 41 additions & 13 deletions TheWarWithin/WarriorProtection.lua
Original file line number Diff line number Diff line change
Expand Up @@ -718,23 +718,29 @@ spec:RegisterHook( "reset_precast", function ()
end )

spec:RegisterStateExpr( "last_stand_damage_taken", function ()
return health.max * ( ( settings.last_stand_amount or 0 ) * 0.01 ) * ( solo and 0.5 or 1 )
return ( settings.last_stand_amount or 0 ) * health.max * 0.01
end )
spec:RegisterStateExpr( "last_stand_health_pct", function ()
return ( settings.last_stand_health or 0 )
end )
spec:RegisterStateExpr( "rallying_cry_damage_taken", function ()
return health.max * ( ( settings.rallying_cry_amount or 0 ) * 0.01 ) * ( solo and 0.5 or 1 )
return ( settings.rallying_cry_amount or 0 ) * health.max * 0.01
end )
spec:RegisterStateExpr( "rallying_cry_health_pct", function ()
return ( settings.rallying_cry_health or 0 )
end )
spec:RegisterStateExpr( "shield_wall_damage_taken", function ()
return health.max * ( ( settings.shield_wall_amount or 0 ) * 0.01 ) * ( solo and 0.5 or 1 )
return ( settings.shield_wall_amount or 0 ) * health.max * 0.01
end )
spec:RegisterStateExpr( "shield_wall_health_pct", function ()
return ( settings.shield_wall_health or 0 )
end )
spec:RegisterStateExpr( "spell_block_damage_taken", function ()
return ( settings.spell_block_amount or 0 ) * health.max * 0.01
end )
spec:RegisterStateExpr( "spell_block_health_pct", function ()
return ( settings.spell_block_health or 0 )
end )
spec:RegisterStateExpr( "victory_rush_health_pct", function ()
return ( settings.victory_rush_health or 0 )
end )
Expand Down Expand Up @@ -1933,19 +1939,19 @@ spec:RegisterSetting( "reserve_rage", 35, { -- Ignore Pain cost is 35, Shield Bl
width = "full",
} )

spec:RegisterSetting( "shield_wall_amount", 50, {
spec:RegisterSetting( "shield_wall_amount", 20, {
name = "|T132362:0|t Shield Wall Damage Required",
desc = "When set above zero, the priority can recommend |T132362:0|t Shield Wall if you have taken this much damage in the past 5 seconds, as a percentage of your maximum health.\n\n"
.. "If set to |cFFFFD10050%|r and your maximum health is 50,000, then Shield Wall can be recommended when you've taken 25,000 damage in the past 5 seconds.\n\n"
.. "This value is reduced by 50% when playing solo.",
.. "By default, your Defensives toggle must also be enabled.",
type = "range",
min = 0,
max = 200,
step = 1,
width = "full",
} )

spec:RegisterSetting( "shield_wall_health", 50, {
spec:RegisterSetting( "shield_wall_health", 75, {
name = "|T132362:0|t Shield Wall Health Percentage",
desc = "When set above zero, the priority can recommend |T132362:0|t Shield Wall if your current health has fallen below this percentage.",
type = "range",
Expand All @@ -1955,19 +1961,19 @@ spec:RegisterSetting( "shield_wall_health", 50, {
width = "full",
} )

spec:RegisterSetting( "rallying_cry_amount", 50, {
spec:RegisterSetting( "rallying_cry_amount", 25, {
name = "|T132351:0|t Rallying Cry Damage Required",
desc = "When set above zero, the priority can recommend |T132351:0|t Rallying Cry if you have taken this much damage in the past 5 seconds, as a percentage of your maximum health.\n\n"
.. "If set to |cFFFFD10050%|r and your maximum health is 50,000, then Rallying Cry can be recommended when you've taken 25,000 damage in the past 5 seconds.\n\n"
.. "This value is reduced by 50% when playing solo.",
.. "By default, your Defensives toggle must also be enabled.",
type = "range",
min = 0,
max = 200,
step = 1,
width = "full",
} )

spec:RegisterSetting( "rallying_cry_health", 50, {
spec:RegisterSetting( "rallying_cry_health", 80, {
name = "|T132351:0|t Rallying Cry Health Percentage",
desc = "When set above zero, the priority can recommend |T132351:0|t Rallying Cry if your current health has fallen below this percentage.",
type = "range",
Expand All @@ -1989,11 +1995,11 @@ spec:RegisterSetting( "rallying_cry_health", 50, {
width = "full"
} ) ]]--

spec:RegisterSetting( "last_stand_amount", 50, {
spec:RegisterSetting( "last_stand_amount", 25, {
name = "|T135871:0|t Last Stand Damage Required",
desc = "When set above zero, the priority can recommend |T135871:0|t Last Stand if you have taken this much damage in the past 5 seconds, as a percentage of your maximum health.\n\n"
.. "If set to |cFFFFD10050%|r and your maximum health is 50,000, then Last Stand can be recommended when you've taken 25,000 damage in the past 5 seconds.\n\n"
.. "This value is reduced by 50% when playing solo.",
.. "By default, your Defensives toggle must also be enabled.",
type = "range",
min = 0,
max = 200,
Expand All @@ -2002,7 +2008,7 @@ spec:RegisterSetting( "last_stand_amount", 50, {
disabled = function() return state.settings.last_stand_offensively end,
} )

spec:RegisterSetting( "last_stand_health", 50, {
spec:RegisterSetting( "last_stand_health", 70, {
name = "|T135871:0|t Last Stand Health Percentage",
desc = "When set above zero, the priority can recommend |T135871:0|t Last Stand if your current health has fallen below this percentage.",
type = "range",
Expand All @@ -2013,6 +2019,28 @@ spec:RegisterSetting( "last_stand_health", 50, {
disabled = function() return state.settings.last_stand_offensively end,
} )

spec:RegisterSetting( "spell_block_amount", 25, {
name = "|T132358:0|t Spell Block Damage Required",
desc = "When set above zero, the priority can recommend |T132358:0|t Spell Block if you have taken this much damage in the past 5 seconds, as a percentage of your maximum health.\n\n"
.. "If set to |cFFFFD10050%|r and your maximum health is 50,000, then Spell Block can be recommended when you've taken 25,000 damage in the past 5 seconds.\n\n"
.. "By default, your Defensives toggle must also be enabled.",
type = "range",
min = 0,
max = 200,
step = 1,
width = "full",
} )

spec:RegisterSetting( "spell_block_health", 75, {
name = "|T132358:0|t Spell Block Health Percentage",
desc = "When set above zero, the priority can recommend |T132358:0|t Spell Block if your current health has fallen below this percentage.",
type = "range",
min = 0,
max = 100,
step = 1,
width = "full",
} )

spec:RegisterSetting( "victory_rush_health", 75, {
name = "|T589768:0|t Victory Rush Health Threshold",
desc = "When set above zero, the addon may recommend |T589768:0|t Victory Rush when your health falls below this percentage.",
Expand Down Expand Up @@ -2050,4 +2078,4 @@ spec:RegisterOptions( {
} )


spec:RegisterPack( "Protection Warrior", 20240924, [[Hekili:nV1wVTTos4Fl9fJySPo(sCS7bX5HTalqlW2Db8bN9njrlrBRn6gOOCpzHH(TVdj1fsAs6lPT7cuKMipCMV5cNzi1yVjE)U36ief79TPJN(44pn9Xrtwo)tZEYBn9TcS36cu4RODWVKHsHF(pj5uCinopRo4FHiK4CcJM3sYrrmEvMxrcb62tPfL)2dpSlMUVAZOW80hkJtRsqSLgsqBPS)o8bV1BQItOFjZBJjGSC2cGNf4qVVTygW14OiSGuCzO3AgPFC8N(40h)T6G)EmnEhN)L1bOSO6GVKwGJIZ2vh8hXH0CYB1b)T4)ehv)16Vkw6Ypoz(91balg)jGfRJt)CDqbtRIPa1vfmiv2t)cHO(99yU6d)a0V4mWeqY3gNakoIBCkhvqWGsVbr)lREa(jnb7xsrzH47P572LGxbwWV6I495vuMGBOb(KIQ0uCI8tc3Ji7W3hVDfnofVA8XJP5hWP4m6OOyH4EzP8cQkX(XuCAP8drhqueHXLnvB3ocCyzryI)MeujWN8VND8OHpayF4RpVAQmNk3hJtI8)okj5EMOY3U1Fxy0QjCiIYEfCgdIZaDf(f)iukez5pV8fP11(uk6vC2G9yucD)OIq6ZRKjs8CF45d(WDCWj9PJQkAqmdOCZEu)ZiafVXeFi5T(NwKZ0b4VhkRpBsYZJ83wbroYpftkXeMUOyfjHOma35ecy)L)KK4D7P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