Skip to content

Commit 0d68ec6

Browse files
authored
[monk] Implement manual proc attempts for Gift of the Ox Orb spawns. (#11325)
1 parent 56dc496 commit 0d68ec6

2 files changed

Lines changed: 72 additions & 85 deletions

File tree

engine/class_modules/monk/sc_monk.cpp

Lines changed: 71 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -3920,7 +3920,8 @@ gift_of_the_ox_t::gift_of_the_ox_t( monk_t *player )
39203920
heal_trigger(
39213921
new orb_t( player, "gift_of_the_ox_trigger", player->talent.brewmaster.gift_of_the_ox_heal_trigger ) ),
39223922
heal_expire( new orb_t( player, "gift_of_the_ox_expire", player->talent.brewmaster.gift_of_the_ox_heal_expire ) ),
3923-
accumulator( 0.0 )
3923+
accumulator( 0.0 ),
3924+
proc_data( player->talent.brewmaster.gift_of_the_ox )
39243925
{
39253926
// we're just using buff tracking to provide stats.
39263927
// stack changes are all controlled by the events we create, so duration is set
@@ -3936,6 +3937,9 @@ void gift_of_the_ox_t::spawn_orb( int count )
39363937
if ( is_fallback )
39373938
return;
39383939

3940+
for ( size_t i = 0; i < count; ++i )
3941+
player->trigger_aura_applied_callbacks( proc_data, player );
3942+
39393943
int available = as<int>( queue.size() );
39403944
int overflow = std::max( count + available - max_stack(), 0 );
39413945
player->sim->print_debug( "{} adding {} Gift of the Ox Orbs. start={} apply={} overflow={} end={}", player->name(),
@@ -6394,15 +6398,12 @@ void monk_t::init_special_effects()
63946398
if ( talent.brewmaster.celestial_flames->ok() )
63956399
create_proc_callback( { talent.brewmaster.celestial_flames, PF_CAST_SUCCESSFUL,
63966400
static_cast<proc_flag2>( PF2_CAST_GENERIC | PF2_CAST_HEAL ) } )
6397-
->register_callback_trigger_function( dbc_proc_callback_t::trigger_fn_type::CONDITION,
6398-
[ & ]( const dbc_proc_callback_t *, const proc_data_t &, player_t *,
6399-
action_state_t *state, proc_trigger_type_e ) {
6400-
return baseline.brewmaster.brews.contains( state->action );
6401-
} )
6402-
->register_callback_execute_function(
6403-
[ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *, action_state_t * ) {
6404-
buff.celestial_flames->trigger();
6405-
} );
6401+
->register_callback_trigger_function(
6402+
dbc_proc_callback_t::trigger_fn_type::CONDITION,
6403+
[ & ]( const dbc_proc_callback_t *, const proc_data_t &, player_t *, action_state_t *state,
6404+
proc_trigger_type_e ) { return baseline.brewmaster.brews.contains( state->action ); } )
6405+
->register_callback_execute_function( [ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *,
6406+
action_state_t * ) { buff.celestial_flames->trigger(); } );
64066407

64076408
if ( talent.brewmaster.exploding_keg.ok() )
64086409
create_proc_callback( { talent.brewmaster.exploding_keg.spell() } )
@@ -6422,50 +6423,44 @@ void monk_t::init_special_effects()
64226423
return data->id() != action.flurry_of_xuen->id &&
64236424
data->id() != action.empowered_tiger_lightning->id;
64246425
} )
6425-
->register_callback_execute_function(
6426-
[ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *, action_state_t * ) {
6427-
buff.flurry_of_xuen->trigger();
6428-
} );
6426+
->register_callback_execute_function( [ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *,
6427+
action_state_t * ) { buff.flurry_of_xuen->trigger(); } );
64296428

64306429
if ( talent.monk.chi_burst->ok() && specialization() == MONK_WINDWALKER )
64316430
create_proc_callback( { talent.monk.chi_burst.spell() } );
64326431

64336432
if ( talent.brewmaster.spirit_of_the_ox->ok() )
64346433
create_proc_callback( { talent.brewmaster.spirit_of_the_ox.spell() } )
6435-
->register_callback_trigger_function( dbc_proc_callback_t::trigger_fn_type::CONDITION,
6436-
[ & ]( const dbc_proc_callback_t *, const proc_data_t &data, player_t *,
6437-
action_state_t *, proc_trigger_type_e ) {
6438-
return data->id() == baseline.brewmaster.blackout_kick->id();
6439-
} )
6440-
->register_callback_execute_function(
6441-
[ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *, action_state_t * ) {
6442-
buff.gift_of_the_ox->spawn_orb( 1 );
6443-
} );
6434+
->register_callback_trigger_function(
6435+
dbc_proc_callback_t::trigger_fn_type::CONDITION,
6436+
[ & ]( const dbc_proc_callback_t *, const proc_data_t &data, player_t *, action_state_t *,
6437+
proc_trigger_type_e ) { return data->id() == baseline.brewmaster.blackout_kick->id(); } )
6438+
->register_callback_execute_function( [ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *,
6439+
action_state_t * ) { buff.gift_of_the_ox->spawn_orb( 1 ); } );
64446440

64456441
if ( talent.master_of_harmony.aspect_of_harmony->ok() )
64466442
create_proc_callback( { talent.master_of_harmony.aspect_of_harmony_driver,
64476443
static_cast<proc_flag>( PF_ALL_DAMAGE | PF_ALL_HEAL | PF_PERIODIC ), PF2_ALL_HIT } )
6448-
->register_callback_trigger_function(
6449-
dbc_proc_callback_t::trigger_fn_type::TRIGGER,
6450-
[ & ]( const dbc_proc_callback_t *, const proc_data_t &data, player_t *, action_state_t *,
6451-
proc_trigger_type_e ) {
6452-
// TODO: don't hardcode these ids
6453-
constexpr std::array<unsigned, 8> blacklist = {
6454-
216521, // celestial fortune
6455-
178173, // goto expire
6456-
124507, // goto trigger
6457-
387621, // dragonfire brew
6458-
115129, // expel harm damage
6459-
124255, // stagger
6460-
450820, // purified spirit
6461-
450763, // aspect of harmony tick
6462-
};
6463-
if ( range::contains( blacklist, data->id() ) )
6464-
return false;
6465-
if ( data.allow_class_ability_procs )
6466-
return true;
6467-
return false;
6468-
} )
6444+
->register_callback_trigger_function( dbc_proc_callback_t::trigger_fn_type::TRIGGER,
6445+
[ & ]( const dbc_proc_callback_t *, const proc_data_t &data, player_t *,
6446+
action_state_t *, proc_trigger_type_e ) {
6447+
// TODO: don't hardcode these ids
6448+
constexpr std::array<unsigned, 8> blacklist = {
6449+
216521, // celestial fortune
6450+
178173, // goto expire
6451+
124507, // goto trigger
6452+
387621, // dragonfire brew
6453+
115129, // expel harm damage
6454+
124255, // stagger
6455+
450820, // purified spirit
6456+
450763, // aspect of harmony tick
6457+
};
6458+
if ( range::contains( blacklist, data->id() ) )
6459+
return false;
6460+
if ( data.allow_class_ability_procs )
6461+
return true;
6462+
return false;
6463+
} )
64696464
->register_callback_execute_function(
64706465
[ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *, action_state_t *state ) {
64716466
buff.aspect_of_harmony.trigger( state );
@@ -6490,11 +6485,10 @@ void monk_t::init_special_effects()
64906485
if ( talent.conduit_of_the_celestials.courage_of_the_white_tiger->ok() )
64916486
create_proc_callback( { talent.conduit_of_the_celestials.courage_of_the_white_tiger, static_cast<proc_flag>( 0ull ),
64926487
static_cast<proc_flag2>( 0ull ), action.courage_of_the_white_tiger.base } )
6493-
->register_callback_trigger_function( dbc_proc_callback_t::trigger_fn_type::CONDITION,
6494-
[ & ]( const dbc_proc_callback_t *, const proc_data_t &data, player_t *,
6495-
action_state_t *, proc_trigger_type_e ) {
6496-
return data->id() == baseline.monk.tiger_palm->id();
6497-
} );
6488+
->register_callback_trigger_function(
6489+
dbc_proc_callback_t::trigger_fn_type::CONDITION,
6490+
[ & ]( const dbc_proc_callback_t *, const proc_data_t &data, player_t *, action_state_t *,
6491+
proc_trigger_type_e ) { return data->id() == baseline.monk.tiger_palm->id(); } );
64986492

64996493
if ( talent.brewmaster.walk_with_the_ox.ok() )
65006494
{
@@ -6514,11 +6508,10 @@ void monk_t::init_special_effects()
65146508

65156509
if ( talent.shado_pan.stand_ready->ok() )
65166510
create_proc_callback( { talent.shado_pan.stand_ready_buff } )
6517-
->register_callback_trigger_function( dbc_proc_callback_t::trigger_fn_type::CONDITION,
6518-
[ & ]( const dbc_proc_callback_t *, const proc_data_t &, player_t *,
6519-
action_state_t *, proc_trigger_type_e ) {
6520-
return buff.stand_ready->check();
6521-
} )
6511+
->register_callback_trigger_function(
6512+
dbc_proc_callback_t::trigger_fn_type::CONDITION,
6513+
[ & ]( const dbc_proc_callback_t *, const proc_data_t &, player_t *, action_state_t *,
6514+
proc_trigger_type_e ) { return buff.stand_ready->check(); } )
65226515
->register_callback_execute_function(
65236516
[ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *, action_state_t * ) {
65246517
action.flurry_strikes->execute( actions::flurry_strikes_t::STAND_READY );
@@ -6529,10 +6522,8 @@ void monk_t::init_special_effects()
65296522
->register_callback_trigger_function(
65306523
dbc_proc_callback_t::trigger_fn_type::CONDITION,
65316524
hp_percent_trigger( talent.brewmaster.elixir_of_determination->effectN( 1 ) ) )
6532-
->register_callback_execute_function(
6533-
[ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *, action_state_t * ) {
6534-
buff.elixir_of_determination->trigger();
6535-
} );
6525+
->register_callback_execute_function( [ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *,
6526+
action_state_t * ) { buff.elixir_of_determination->trigger(); } );
65366527

65376528
// Doesn't use effect 468 for trigger behaviour, let's just pretend it does (:
65386529
if ( talent.shado_pan.whirling_steel->ok() )
@@ -6546,25 +6537,24 @@ void monk_t::init_special_effects()
65466537
bool end_state = health_percentage() - state->result_amount / max_health() * 100.0 < effect.base_value();
65476538
return start_state && end_state;
65486539
} )
6549-
->register_callback_execute_function(
6550-
[ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *, action_state_t * ) {
6551-
buff.whirling_steel->trigger();
6552-
} );
6540+
->register_callback_execute_function( [ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *,
6541+
action_state_t * ) { buff.whirling_steel->trigger(); } );
65536542

65546543
if ( talent.brewmaster.vital_flame->ok() )
65556544
create_proc_callback( { talent.brewmaster.vital_flame, static_cast<proc_flag>( PF_ALL_DAMAGE | PF_PERIODIC ),
65566545
static_cast<proc_flag2>( PF2_ALL_HIT | PF2_PERIODIC_DAMAGE ) } )
6557-
->register_callback_trigger_function( dbc_proc_callback_t::trigger_fn_type::CONDITION,
6558-
[]( const dbc_proc_callback_t *, const proc_data_t &data, player_t *,
6559-
action_state_t *state, proc_trigger_type_e ) {
6560-
if ( state->action->school != SCHOOL_FIRE && state->action->school != SCHOOL_NATURE )
6561-
return false;
6546+
->register_callback_trigger_function(
6547+
dbc_proc_callback_t::trigger_fn_type::CONDITION,
6548+
[]( const dbc_proc_callback_t *, const proc_data_t &data, player_t *, action_state_t *state,
6549+
proc_trigger_type_e ) {
6550+
if ( state->action->school != SCHOOL_FIRE && state->action->school != SCHOOL_NATURE )
6551+
return false;
65626552

6563-
if ( data.allow_class_ability_procs )
6564-
return true;
6553+
if ( data.allow_class_ability_procs )
6554+
return true;
65656555

6566-
return false;
6567-
} )
6556+
return false;
6557+
} )
65686558
->register_callback_execute_function(
65696559
[ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *, action_state_t *state ) {
65706560
action.vital_flame->base_dd_max = action.vital_flame->base_dd_min = state->result_amount;
@@ -6574,15 +6564,12 @@ void monk_t::init_special_effects()
65746564
if ( talent.brewmaster.bring_me_another_1->ok() )
65756565
create_proc_callback( { talent.brewmaster.bring_me_another_1, PF_CAST_SUCCESSFUL,
65766566
static_cast<proc_flag2>( PF2_CAST_GENERIC | PF2_CAST_HEAL ) } )
6577-
->register_callback_trigger_function( dbc_proc_callback_t::trigger_fn_type::CONDITION,
6578-
[ & ]( const dbc_proc_callback_t *, const proc_data_t &, player_t *,
6579-
action_state_t *state, proc_trigger_type_e ) {
6580-
return baseline.brewmaster.brews.contains( state->action );
6581-
} )
6582-
->register_callback_execute_function(
6583-
[ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *, action_state_t * ) {
6584-
buff.empty_barrel->trigger();
6585-
} );
6567+
->register_callback_trigger_function(
6568+
dbc_proc_callback_t::trigger_fn_type::CONDITION,
6569+
[ & ]( const dbc_proc_callback_t *, const proc_data_t &, player_t *, action_state_t *state,
6570+
proc_trigger_type_e ) { return baseline.brewmaster.brews.contains( state->action ); } )
6571+
->register_callback_execute_function( [ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *,
6572+
action_state_t * ) { buff.empty_barrel->trigger(); } );
65866573

65876574
if ( talent.brewmaster.bring_me_another_3->ok() )
65886575
{
@@ -6609,11 +6596,10 @@ void monk_t::init_special_effects()
66096596

66106597
create_proc_callback( { &buff.refreshing_drink->data(), PF_ALL_DAMAGE_TAKEN,
66116598
static_cast<proc_flag2>( PF2_ALL_HIT | PF2_PERIODIC_DAMAGE ) } )
6612-
->register_callback_trigger_function( dbc_proc_callback_t::trigger_fn_type::TRIGGER,
6613-
[ & ]( const dbc_proc_callback_t *, const proc_data_t &, player_t *,
6614-
action_state_t *, proc_trigger_type_e ) {
6615-
return buff.refreshing_drink->up();
6616-
} )
6599+
->register_callback_trigger_function(
6600+
dbc_proc_callback_t::trigger_fn_type::TRIGGER,
6601+
[ & ]( const dbc_proc_callback_t *, const proc_data_t &, player_t *, action_state_t *,
6602+
proc_trigger_type_e ) { return buff.refreshing_drink->up(); } )
66176603
->register_callback_execute_function(
66186604
[ & ]( const dbc_proc_callback_t *, const spell_data_t *, player_t *, action_state_t * ) {
66196605
buff.refreshing_drink->expire();

engine/class_modules/monk/sc_monk.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ struct gift_of_the_ox_t : monk_buff_t<>
245245
orb_t *heal_expire;
246246
std::queue<orb_event_t *> queue;
247247
double accumulator;
248+
proc_data_t proc_data;
248249

249250
// just using the first orb spawner.
250251
// 124503 also exists, but it just spawns an orb on the opposite side, so no

0 commit comments

Comments
 (0)