diff --git a/engine/class_modules/sc_mage.cpp b/engine/class_modules/sc_mage.cpp index 960e4c6581a..6792edee497 100644 --- a/engine/class_modules/sc_mage.cpp +++ b/engine/class_modules/sc_mage.cpp @@ -406,6 +406,7 @@ struct mage_t final : public player_t proc_t* freezing_applied; proc_t* freezing_expired; proc_t* freezing_overflow; + proc_t* icicle_from_set_bonus; } procs; struct accumulated_rngs_t @@ -4206,6 +4207,7 @@ struct glacial_spike_t final : public frost_mage_spell_t action_t* duality_pyroblast = nullptr; int freezing_consume; shatter_source_t* shatter_source; + real_ppm_t* rppm_set_bonus = nullptr; glacial_spike_t( std::string_view n, mage_t* p, std::string_view options_str ) : frost_mage_spell_t( n, p, p->find_spell( 199786 ) ), @@ -4235,6 +4237,9 @@ struct glacial_spike_t final : public frost_mage_spell_t if ( p->spec.shatter->ok() ) add_child( p->action.shatter.glacial_spike ); + + if ( p->sets->has_set_bonus( MAGE_FROST, MID2, B4 ) ) + rppm_set_bonus = p->get_rppm( "glacial_spike_set_bonus", p->sets->set( MAGE_FROST, MID2, B4 ) ); } void init_finished() override @@ -4249,7 +4254,16 @@ struct glacial_spike_t final : public frost_mage_spell_t { frost_mage_spell_t::execute(); p()->buffs.glacial_spike->decrement(); - p()->state.icicles = 0; + + // The buff can be up without actually having a full stack of Icicles (e.g., granted directly + // by the 12.1 set bonus), in which case casting Glacial Spike does not consume any icicles below 5, + // but does actually consume them at exactly 5 icicles, thus munching the one you would've gotten. + int max_icicles = as( p()->talents.icicles->effectN( 2 ).base_value() ); + if ( p()->state.icicles == max_icicles ) + p()->state.icicles = 0; + + if ( rppm_set_bonus && rppm_set_bonus->trigger() ) + p()->buffs.glacial_spike->trigger(); p()->trigger_brain_freeze( bf_chance, proc_brain_freeze, 150_ms ); p()->trigger_fof( fof_chance, proc_fof ); @@ -6488,6 +6502,7 @@ void mage_t::init_procs() procs.freezing_applied = get_proc( "Freezing applied" ); procs.freezing_expired = get_proc( "Freezing expired" ); procs.freezing_overflow = get_proc( "Freezing overflow" ); + procs.icicle_from_set_bonus = get_proc( "Icicle from 12.1 2pc Set Bonus" ); break; default: break; @@ -7061,6 +7076,21 @@ int mage_t::trigger_shatter( player_t* target, action_t* action, int max_consump debuff->refresh(); } + if ( consume_stacks > 0 && sets->has_set_bonus( MAGE_FROST, MID2, B2 ) ) + { + double chance = sets->set( MAGE_FROST, MID2, B2 )->effectN( 2 ).percent(); + for ( int i = 0; i < consume_stacks; i++ ) + { + if ( rng().roll( chance ) ) + { + procs.icicle_from_set_bonus->occur(); + // Icicles generated this way cannot grant the Glacial Spike buff on their own (bug?), + // the player still has to wait for the cyclic icicles proc to gain the buff + trigger_icicle( 1, false ); + } + } + } + return shatter_stacks; }