## Brewmaster Monk
## July 31, 2021
## Changes:
## - 9.1 includes Purifying Brew entries related to Invoke Niuzao that do not using spec settings. Provide feedback on GitHub.
## - Disregard new target.cooldown.pause_action.remains conditions that don't have an in-game equivalent.
## - Make settings.ox_walker support using SCK on fewer than 3 enemies with conduit.walk_with_the_ox.
## Executed before combat begins. Accepts non-harmful actions only.
actions.precombat+=/fleshcraft
actions.precombat+=/bottled_flayedwing_toxin
actions.precombat+=/fleshcraft
actions.precombat+=/chi_burst
actions.precombat+=/chi_wave
## Executed every time the actor is available.
actions=spear_hand_strike
actions+=/purifying_brew,if=settings.purify_for_celestial&(time_to_max_charges<gcd.max|buff.purified_chi.up&buff.purified_chi.remains<1.5*gcd.max)|cooldown.celestial_brew.remains<2*gcd.max&charges_fractional>1.5
actions+=/celestial_brew,if=buff.purified_chi.up
actions+=/dampen_harm,if=health.pct<75&incoming_damage_3s>health.max*(0.2+(0.2*group))&buff.fortifying_brew.down
actions+=/fortifying_brew,if=health.pct<50&incoming_damage_3s>health.max*(0.2+(0.2*group))&(buff.dampen_harm.down)
actions+=/spear_hand_strike,if=target.debuff.casting.react
actions+=/use_item,name=ashvanes_razor_coral,if=debuff.razor_coral_debuff.down|debuff.conductive_ink_debuff.up&target.health.pct<31|time_to_die<20
actions+=/use_item,name=dreadfire_vessel
actions+=/use_items
actions+=/potion
actions+=/blood_fury
actions+=/berserking
actions+=/lights_judgment
actions+=/fireblood
actions+=/ancestral_call
actions+=/bag_of_tricks
actions+=/invoke_niuzao_the_black_ox,if=target.time_to_die>6&cooldown.purifying_brew.charges_fractional<2
actions+=/touch_of_death,if=target.health.pct<=15|target.health.current<health.max
actions+=/weapons_of_order
actions+=/fallen_order
actions+=/bonedust_brew
# Use configured purify_stagger_currhp from Brewmaster options.
actions+=/purifying_brew,if=settings.purify_stagger_currhp>0&group&stagger.pct>=settings.purify_stagger_currhp
# Use configured purify_stagger_currhp from Brewmaster options.
actions+=/purifying_brew,if=settings.purify_stagger_currhp>0&solo&stagger.pct>=settings.purify_stagger_currhp*0.5
# Use configured purify_stagger_maxhp from Brewmaster options.
actions+=/purifying_brew,if=settings.purify_stagger_maxhp>0&group&stagger.pct>=settings.purify_stagger_maxhp
# Use configured purify_stagger_maxhp from Brewmaster options.
actions+=/purifying_brew,if=settings.purify_stagger_maxhp>0&solo&stagger.pct>=settings.purify_stagger_maxhp*0.5
# Cast PB during the Niuzao window, but only if recently hit.
actions+=/purifying_brew,if=stagger.amounttototalpct>=0.7&(cooldown.invoke_niuzao_the_black_ox.remains<5|buff.invoke_niuzao_the_black_ox.up)
# Stagger % of 20 will kill you in 2.5 seconds without healing or purifying. Used when purify_stagger_currhp and maxhp are disabled.
actions+=/purifying_brew,if=settings.purify_stagger_currhp=0&settings.purify_stagger_maxhp=0&group&stagger.pct>20
# Stagger % of 10 will kill you in 5 seconds without healing or purifying. Used when purify_stagger_currhp and maxhp are disabled.
actions+=/purifying_brew,if=settings.purify_stagger_currhp=0&settings.purify_stagger_maxhp=0&solo&stagger.pct>10
# Dump PB charges towards the end of Niuzao: anything is better than nothing.
actions+=/purifying_brew,if=buff.invoke_niuzao_the_black_ox.up&buff.invoke_niuzao_the_black_ox.remains<8
# Avoid capping charges, but pool charges shortly before Niuzao comes up and allow dumping to avoid capping during Niuzao.
actions+=/purifying_brew,if=cooldown.purifying_brew.charges_fractional>=1.8&(cooldown.invoke_niuzao_the_black_ox.remains>10|buff.invoke_niuzao_the_black_ox.up)
# Black Ox Brew is currently used to either replenish brews based on less than half a brew charge available, or low energy to enable Keg Smash
actions+=/black_ox_brew,if=cooldown.purifying_brew.charges_fractional<0.5
actions+=/black_ox_brew,if=(energy+(energy.regen*cooldown.keg_smash.remains))<40&buff.blackout_combo.down&cooldown.keg_smash.up
# Healing Elixir
actions+=/expel_harm,if=health.pct<5*healing_sphere.count|(healing_sphere.count>=3&health.pct<50)
actions+=/healing_elixir,if=health.pct<33
actions+=/fleshcraft,if=cooldown.bonedust_brew.remains<4&soulbind.pustule_eruption.enabled
# Offensively, the APL prioritizes KS on cleave, BoS else, with energy spenders and cds sorted below
actions+=/keg_smash,if=spell_targets>=2
actions+=/faeline_stomp,if=spell_targets>=2
# Cast KS at top prio during WoO buff.
actions+=/keg_smash,if=buff.weapons_of_order.up
# Celestial Brew priority whenever it took significant damage and ironskin brew buff is missing (adjust the health.max coefficient according to intensity of damage taken), and to dump excess charges before BoB.
actions+=/celestial_brew,if=tanking&buff.blackout_combo.down&incoming_damage_2999ms>(health.max*0.05+stagger.last_tick_damage_4)&buff.elusive_brawler.stack<2
actions+=/celestial_brew,if=tanking&buff.purified_chi.up&(buff.purified_chi.remains<1.5*gcd|cooldown.purifying_brew.remains>buff.purified_chi.remains)
actions+=/detox
actions+=/rushing_jade_wind,if=spell_targets>=2&buff.rushing_jade_wind.down
actions+=/tiger_palm,if=talent.rushing_jade_wind.enabled&buff.blackout_combo.up&buff.rushing_jade_wind.up
actions+=/breath_of_fire,if=buff.charred_passions.down&runeforge.charred_passions.equipped
actions+=/blackout_kick
actions+=/keg_smash
actions+=/chi_burst,if=cooldown.faeline_stomp.remains>2&spell_targets>=2
actions+=/faeline_stomp
actions+=/expel_harm,if=buff.gift_of_the_ox.stack>=3
actions+=/touch_of_death
actions+=/rushing_jade_wind,if=buff.rushing_jade_wind.down
actions+=/spinning_crane_kick,if=buff.charred_passions.up
actions+=/concentrated_flame,if=dot.concentrated_flame.remains=0
actions+=/breath_of_fire,if=buff.blackout_combo.down&(buff.bloodlust.down|(buff.bloodlust.up&dot.breath_of_fire_dot.refreshable))
actions+=/heart_essence,if=!essence.the_crucible_of_flame.major
actions+=/chi_burst
actions+=/chi_wave
actions+=/exploding_keg
# Expel Harm has higher DPET than TP when you have at least 2 orbs.
actions+=/expel_harm,if=buff.gift_of_the_ox.stack>=2
# Cast SCK if enough enemies are around, or if WWWTO is enabled. This is a slight defensive loss over using TP but generally reduces sim variance more than anything else.
actions+=/spinning_crane_kick,if=!runeforge.shaohaos_might.equipped&(active_enemies>=3|settings.ox_walker&conduit.walk_with_the_ox.enabled)&cooldown.keg_smash.remains>gcd&(energy+(energy.regen*(cooldown.keg_smash.remains+execute_time)))>=65&(!talent.spitfire.enabled|!runeforge.charred_passions.equipped)
actions+=/tiger_palm,if=!talent.blackout_combo&cooldown.keg_smash.remains>gcd&(energy+(energy.regen*(cooldown.keg_smash.remains+gcd)))>=65
actions+=/arcane_torrent,if=energy<31
actions+=/fleshcraft,if=soulbind.volatile_solvent.enabled
actions+=/rushing_jade_wind