From 23c6d52551e0dcc5e6639e7a7cbaef1a6a767197 Mon Sep 17 00:00:00 2001 From: HawkCorrigan Date: Mon, 4 Nov 2024 00:40:18 +0100 Subject: [PATCH 1/9] [ele] fix AoE overloads via Asc --- engine/class_modules/sc_shaman.cpp | 78 ++++++++++++++++++++++-------- 1 file changed, 58 insertions(+), 20 deletions(-) diff --git a/engine/class_modules/sc_shaman.cpp b/engine/class_modules/sc_shaman.cpp index f5bc80766c0..2c88f59fd3f 100644 --- a/engine/class_modules/sc_shaman.cpp +++ b/engine/class_modules/sc_shaman.cpp @@ -774,6 +774,13 @@ struct shaman_t : public player_t std::array magma_chamber; proc_t* ascendance_tempest_overload; + proc_t* ascendance_lightning_bolt_overload; + proc_t* ascendance_chain_ligtning_overload; + proc_t* ascendance_lava_burst_overload; + proc_t* ascendance_earth_shock_overload; + proc_t* ascendance_elemental_blast_overload; + proc_t* ascendance_icefury_overload; + proc_t* ascendance_earthquake_overload; proc_t* potm_tempest_overload; proc_t* surge_of_power_lightning_bolt; proc_t* surge_of_power_sk_lightning_bolt; @@ -2202,18 +2209,6 @@ struct shaman_action_t : public Base return m; } - double composite_crit_chance_multiplier() const override - { - double m = ab::composite_crit_chance_multiplier(); - - if ( affected_by_ele_tww1_4pc_cc ) - { - m *= 1.0 + p()->buff.tww1_4pc_ele->value(); - } - - return m; - } - double composite_crit_damage_bonus_multiplier() const override { double m = ab::composite_crit_damage_bonus_multiplier(); @@ -2821,6 +2816,17 @@ struct shaman_spell_t : public shaman_spell_base_t return m; } + double composite_crit_chance() const override + { + double cc = shaman_spell_base_t::composite_crit_chance(); + + if ( affected_by_ele_tww1_4pc_cc ) + { + cc += p()->buff.tww1_4pc_ele->value(); + } + return cc; + } + double execute_time_pct_multiplier() const override { auto mul = base_t::execute_time_pct_multiplier(); @@ -2861,11 +2867,35 @@ struct shaman_spell_t : public shaman_spell_base_t { trigger_elemental_overload( s ); - if ( p()->buff.ascendance->up() ) - { - if ( id == 452201 ) - { - p()->proc.ascendance_tempest_overload->occur(); + if ( p()->buff.ascendance->up() && s->chain_target == 0 ) + { + switch ( id ) //needs refactoring. bind it at overload spell initialization + { + case 452201: + p()->proc.ascendance_tempest_overload->occur(); + break; + case 51505: + p()->proc.ascendance_lava_burst_overload->occur(); + break; + case 8042: + p()->proc.ascendance_earth_shock_overload->occur(); + break; + case 210714: + p()->proc.ascendance_icefury_overload->occur(); + break; + case 188196: + p()->proc.ascendance_lightning_bolt_overload->occur(); + break; + case 117014: + p()->proc.ascendance_elemental_blast_overload->occur(); + break; + case 61882: + case 462620: + p()->proc.ascendance_earthquake_overload->occur(); + break; + case 188443: + p()->proc.ascendance_chain_ligtning_overload->occur(); + break; } trigger_elemental_overload( s, 1.0 ); @@ -13057,9 +13087,9 @@ void shaman_t::create_buffs() ->set_default_value_from_effect( 2 ); // Damage bonus as default value buff.tww1_4pc_ele = - make_buff( this, "maelstrom_surge", sets->set( SHAMAN_ELEMENTAL, TWW1, B4 )->effectN( 1 ).trigger() ) - ->set_default_value_from_effect( 1 ) - ->set_trigger_spell( sets->set( SHAMAN_ELEMENTAL, TWW1, B4 ) ); + make_buff( this, "maelstrom_surge", sets->set( SHAMAN_ELEMENTAL, TWW1, B4 )->effectN( 1 ).trigger() ) + ->set_default_value_from_effect( 1 ) + ->set_trigger_spell( sets->set( SHAMAN_ELEMENTAL, TWW1, B4 ) ); buff.primordial_wave = make_buff( this, "primordial_wave", find_spell( 327164 ) ) ->set_default_value( talent.primordial_wave->effectN( specialization() == SHAMAN_ELEMENTAL ? 3 : 4 ).percent() ) @@ -13354,6 +13384,14 @@ void shaman_t::init_procs() proc.deeply_rooted_elements = get_proc( "Deeply Rooted Elements" ); proc.ascendance_tempest_overload = get_proc( "Ascendance: Tempest" ); + proc.ascendance_lightning_bolt_overload = get_proc( "Ascendance: Lightning" ); + proc.ascendance_chain_ligtning_overload = get_proc( "Ascendance: Chain Lightning" ); + proc.ascendance_lava_burst_overload = get_proc( "Ascendance: Lava Burst" ); + proc.ascendance_earth_shock_overload = get_proc( "Ascendance: Earth Shock" ); + proc.ascendance_elemental_blast_overload = get_proc( "Ascendance: Elemental Blast" ); + proc.ascendance_icefury_overload = get_proc( "Ascendance: Icefury" ); + proc.ascendance_earthquake_overload = get_proc( "Ascendance: Earthquake" ); + proc.potm_tempest_overload = get_proc( "PotM: Tempest" ); proc.surge_of_power_lightning_bolt = get_proc( "Surge of Power: Lightning Bolt" ); proc.surge_of_power_sk_lightning_bolt = get_proc( "Surge of Power: SK Lightning Bolt" ); From 1530c622c4f3ebddfdd60ccc5fd6448264a088c2 Mon Sep 17 00:00:00 2001 From: HawkCorrigan Date: Sat, 23 Nov 2024 18:04:30 +0100 Subject: [PATCH 2/9] [ele] add DRE during Asc bugs --- engine/class_modules/sc_shaman.cpp | 43 ++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/engine/class_modules/sc_shaman.cpp b/engine/class_modules/sc_shaman.cpp index 769250a3d50..c45a79a2daf 100644 --- a/engine/class_modules/sc_shaman.cpp +++ b/engine/class_modules/sc_shaman.cpp @@ -487,6 +487,8 @@ struct shaman_t : public player_t action_t* flame_shock_lmt; action_t* flame_shock; action_t* elemental_blast; + action_t* lava_burst; + action_t* lava_burst_ol; action_t* lightning_rod; action_t* tempest_strikes; @@ -8704,10 +8706,13 @@ struct ascendance_t : public shaman_spell_t { ascendance_damage_t* ascendance_damage; lava_burst_t* lvb; + lava_burst_overload_t* lvb_ol; ascendance_t( shaman_t* player, util::string_view name_str, util::string_view options_str = {} ) : shaman_spell_t( name_str, player, player->spell.ascendance ), - ascendance_damage( nullptr ), lvb( nullptr ) + ascendance_damage( nullptr ), + lvb( nullptr ), + lvb_ol( nullptr ) { parse_options( options_str ); harmful = false; @@ -8727,7 +8732,7 @@ struct ascendance_t : public shaman_spell_t void init() override { shaman_spell_t::init(); - + lvb_ol = new lava_burst_overload_t( p(), spell_variant::NORMAL, nullptr ); if ( p()->specialization() == SHAMAN_ELEMENTAL ) { if ( auto trigger_spell = p()->find_action( "lava_burst_ascendance" ) ) @@ -8865,6 +8870,37 @@ struct ascendance_dre_t : public ascendance_t } } } + + void execute() override + { + if ( p()->specialization() == SHAMAN_ENHANCEMENT || !p()->bugs ) + { + ascendance_t::execute(); + return; + } + + if (!p()->buff.ascendance->up()) + { + ascendance_t::execute(); + return; + } + + //for Elemental, the damage portion of Asc is not executed. this is intented to model a bug + + for ( size_t i = 0; i < 6; i++ ) + { + p()->trigger_maelstrom_gain( lvb->maelstrom_gain ); + p()->trigger_maelstrom_gain( lvb_ol->maelstrom_gain ); + + double ol_chance = overload_chance( execute_state ); + + if ( !rng().roll( ol_chance ) ) + { + p()->trigger_maelstrom_gain( lvb_ol->maelstrom_gain ); + } + } + + } }; // Stormkeeper Spell ======================================================== @@ -11021,6 +11057,9 @@ void shaman_t::create_actions() action.flame_shock->background = true; action.flame_shock->cooldown = get_cooldown( "flame_shock_secondary" ); action.flame_shock->base_costs[ RESOURCE_MANA ] = 0; + + action.lava_burst = new lava_burst_t( this, spell_variant::NORMAL ); + action.lava_burst_ol = new lava_burst_overload_t( this, spell_variant::NORMAL, nullptr ); } // shaman_t::create_options ================================================= From 64cc70dd33a01f033fe5b1c3ec50a6e43d346b90 Mon Sep 17 00:00:00 2001 From: HawkCorrigan Date: Sat, 23 Nov 2024 18:06:05 +0100 Subject: [PATCH 3/9] [ele] add Storm Frenzy bug --- engine/class_modules/sc_shaman.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/engine/class_modules/sc_shaman.cpp b/engine/class_modules/sc_shaman.cpp index c45a79a2daf..73cb5aa3205 100644 --- a/engine/class_modules/sc_shaman.cpp +++ b/engine/class_modules/sc_shaman.cpp @@ -2358,9 +2358,9 @@ struct shaman_action_t : public Base } if ( affected_by_storm_frenzy && !this->background && exec_type == spell_variant::NORMAL && - !( affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up() ) && !ab::background ) + !( affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up() ) && !ab::background && !bugs) { - this->p()->buff.storm_frenzy->decrement(); + p()->buff.storm_frenzy->decrement(); } } @@ -2369,6 +2369,12 @@ struct shaman_action_t : public Base ab::impact( state ); p()->trigger_stormbringer( state ); + + if ( affected_by_storm_frenzy && !this->background && exec_type == spell_variant::NORMAL && + !( affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up() ) && !ab::background && bugs ) + { + p()->buff.storm_frenzy->decrement(); + } } void schedule_execute( action_state_t* execute_state = nullptr ) override From 51311dd8be1396cfb59f908c36e33ec9b834bb1a Mon Sep 17 00:00:00 2001 From: HawkCorrigan Date: Sat, 23 Nov 2024 18:12:57 +0100 Subject: [PATCH 4/9] [ele] add AD bug --- engine/class_modules/sc_shaman.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/engine/class_modules/sc_shaman.cpp b/engine/class_modules/sc_shaman.cpp index 73cb5aa3205..38aa3c51f97 100644 --- a/engine/class_modules/sc_shaman.cpp +++ b/engine/class_modules/sc_shaman.cpp @@ -2358,7 +2358,7 @@ struct shaman_action_t : public Base } if ( affected_by_storm_frenzy && !this->background && exec_type == spell_variant::NORMAL && - !( affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up() ) && !ab::background && !bugs) + !( affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up() ) && !ab::background && !p()->bugs) { p()->buff.storm_frenzy->decrement(); } @@ -2371,7 +2371,7 @@ struct shaman_action_t : public Base p()->trigger_stormbringer( state ); if ( affected_by_storm_frenzy && !this->background && exec_type == spell_variant::NORMAL && - !( affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up() ) && !ab::background && bugs ) + !( affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up() ) && !ab::background && p()->bugs ) { p()->buff.storm_frenzy->decrement(); } @@ -12974,7 +12974,12 @@ void shaman_t::trigger_arc_discharge( const action_state_t* state ) } ); } - buff.arc_discharge->decrement(); + + if ( specialization() == SHAMAN_ENHANCEMENT || !bugs || state->action->execute_time() != + timespan_t::zero()) + { + buff.arc_discharge->decrement(); + } } //Flowing Spirits logic is real round-about all around the module, when Windfury procs it, it reports From c92b5ee339baf91e198ae87ee72eda57ea9c43d7 Mon Sep 17 00:00:00 2001 From: HawkCorrigan Date: Sat, 23 Nov 2024 18:41:11 +0100 Subject: [PATCH 5/9] [ele] add FS application behavior to the bugged Asc case --- engine/class_modules/sc_shaman.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/class_modules/sc_shaman.cpp b/engine/class_modules/sc_shaman.cpp index 38aa3c51f97..dc578f11286 100644 --- a/engine/class_modules/sc_shaman.cpp +++ b/engine/class_modules/sc_shaman.cpp @@ -8892,9 +8892,14 @@ struct ascendance_dre_t : public ascendance_t } //for Elemental, the damage portion of Asc is not executed. this is intented to model a bug - + auto tl = target_list(); for ( size_t i = 0; i < 6; i++ ) { + for ( size_t i = 0; as( data().effectN( 7 ).base_value()); ++i ) + { + int index = rng().range( tl.size() ); + p()->trigger_secondary_flame_shock( tl[ index ], spell_variant::ASCENDANCE ); + } p()->trigger_maelstrom_gain( lvb->maelstrom_gain ); p()->trigger_maelstrom_gain( lvb_ol->maelstrom_gain ); From da5681aea3fa534e6e15ce2fa1bbee6d9a9d7710 Mon Sep 17 00:00:00 2001 From: HawkCorrigan Date: Sat, 23 Nov 2024 19:05:49 +0100 Subject: [PATCH 6/9] [ele] model the free LB during/right after SK when you have Rolling Stacks --- engine/class_modules/sc_shaman.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/class_modules/sc_shaman.cpp b/engine/class_modules/sc_shaman.cpp index dc578f11286..aeb42d489a0 100644 --- a/engine/class_modules/sc_shaman.cpp +++ b/engine/class_modules/sc_shaman.cpp @@ -7058,7 +7058,11 @@ struct lightning_bolt_t : public shaman_spell_t if ( !p()->sk_during_cast ) { - p()->buff.stormkeeper->decrement(); + if ( p()->buff.stormkeeper->stack() == 3 && + ( !p()->bugs || ( p()->buff.stormkeeper->remains() > p()->buff.stormkeeper->buff_duration() * 0.97 ) ) ) + { + p()->buff.stormkeeper->decrement(); + } } p()->sk_during_cast = false; From 155fe537f3f4db18b75c1e99772659f6ebb0f49b Mon Sep 17 00:00:00 2001 From: HawkCorrigan Date: Sat, 23 Nov 2024 19:20:02 +0100 Subject: [PATCH 7/9] [ele] trigger ancestors on background FSs --- engine/class_modules/sc_shaman.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/engine/class_modules/sc_shaman.cpp b/engine/class_modules/sc_shaman.cpp index aeb42d489a0..bef751d673b 100644 --- a/engine/class_modules/sc_shaman.cpp +++ b/engine/class_modules/sc_shaman.cpp @@ -2729,7 +2729,7 @@ struct shaman_spell_base_t : public shaman_action_t this->p()->consume_maelstrom_weapon( this->execute_state, mw_consumed_stacks ); - if ( this->exec_type == spell_variant::NORMAL && !this->background ) + if ( this->exec_type == spell_variant::NORMAL && (!this->background || this->execute_state->action->id == 188389)) { this->p()->trigger_ancestor( ancestor_trigger, this->execute_state ); } @@ -8742,7 +8742,6 @@ struct ascendance_t : public shaman_spell_t void init() override { shaman_spell_t::init(); - lvb_ol = new lava_burst_overload_t( p(), spell_variant::NORMAL, nullptr ); if ( p()->specialization() == SHAMAN_ELEMENTAL ) { if ( auto trigger_spell = p()->find_action( "lava_burst_ascendance" ) ) @@ -8865,6 +8864,8 @@ struct ascendance_dre_t : public ascendance_t lvb = new lava_burst_t( p(), spell_variant::DEEPLY_ROOTED_ELEMENTS ); add_child( lvb ); } + + lvb_ol = debug_cast(p()->find_action("lava_burst_overload")); } if ( p()->specialization() == SHAMAN_ENHANCEMENT ) @@ -8894,16 +8895,17 @@ struct ascendance_dre_t : public ascendance_t ascendance_t::execute(); return; } - + //for Elemental, the damage portion of Asc is not executed. this is intented to model a bug auto tl = target_list(); - for ( size_t i = 0; i < 6; i++ ) - { - for ( size_t i = 0; as( data().effectN( 7 ).base_value()); ++i ) - { - int index = rng().range( tl.size() ); - p()->trigger_secondary_flame_shock( tl[ index ], spell_variant::ASCENDANCE ); - } + auto fs_cap = p()->action.ascendance->data().effectN( 7 ).base_value(); + for ( size_t i = 0; i < fs_cap; i++ ) + { + + int index = rng().range( tl.size() ); + p()->trigger_secondary_flame_shock( tl[ index ], spell_variant::ASCENDANCE ); + + p()->trigger_maelstrom_gain( lvb->maelstrom_gain ); p()->trigger_maelstrom_gain( lvb_ol->maelstrom_gain ); @@ -8913,6 +8915,7 @@ struct ascendance_dre_t : public ascendance_t { p()->trigger_maelstrom_gain( lvb_ol->maelstrom_gain ); } + } } @@ -11072,9 +11075,6 @@ void shaman_t::create_actions() action.flame_shock->background = true; action.flame_shock->cooldown = get_cooldown( "flame_shock_secondary" ); action.flame_shock->base_costs[ RESOURCE_MANA ] = 0; - - action.lava_burst = new lava_burst_t( this, spell_variant::NORMAL ); - action.lava_burst_ol = new lava_burst_overload_t( this, spell_variant::NORMAL, nullptr ); } // shaman_t::create_options ================================================= From b44dfdb106568aa9b3807225df670e00a9f6b412 Mon Sep 17 00:00:00 2001 From: HawkCorrigan Date: Mon, 25 Nov 2024 22:10:11 +0100 Subject: [PATCH 8/9] ele] model LB consumption behavior properly --- engine/class_modules/sc_shaman.cpp | 35 ++++++++++++++++-------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/engine/class_modules/sc_shaman.cpp b/engine/class_modules/sc_shaman.cpp index bef751d673b..eb861d00f62 100644 --- a/engine/class_modules/sc_shaman.cpp +++ b/engine/class_modules/sc_shaman.cpp @@ -2346,22 +2346,26 @@ struct shaman_action_t : public Base { p()->buff.flurry->trigger( p()->buff.flurry->max_stack() ); } - - if ( ( affected_by_ns_cast_time || affected_by_ns_cost ) && !(affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up()) && !ab::background) + if (!p()->buff.stormkeeper->up() || !affected_by_stormkeeper_cast_time) { - p()->buff.natures_swiftness->decrement(); - } + if ( ( affected_by_ns_cast_time || affected_by_ns_cost ) && !ab::background ) + { + p()->buff.natures_swiftness->decrement(); + } - if ( ( affected_by_ans_cast_time || affected_by_ans_cost ) && !(affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up()) && !ab::background) - { - p()->buff.ancestral_swiftness->decrement(); + if ( ( affected_by_ans_cast_time || affected_by_ans_cost ) && + !( affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up() ) && !ab::background ) + { + p()->buff.ancestral_swiftness->decrement(); + } + + if ( affected_by_arc_discharge && p()->buff.arc_discharge->up() && !ab::background && p()->specialization() == SHAMAN_ELEMENTAL) + { + p()->buff.arc_discharge->decrement(); + } } - if ( affected_by_storm_frenzy && !this->background && exec_type == spell_variant::NORMAL && - !( affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up() ) && !ab::background && !p()->bugs) - { - p()->buff.storm_frenzy->decrement(); - } + } void impact( action_state_t* state ) override @@ -2370,8 +2374,8 @@ struct shaman_action_t : public Base p()->trigger_stormbringer( state ); - if ( affected_by_storm_frenzy && !this->background && exec_type == spell_variant::NORMAL && - !( affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up() ) && !ab::background && p()->bugs ) + if ( affected_by_storm_frenzy && exec_type == spell_variant::NORMAL && + !p()->buff.stormkeeper->up()&& !ab::background ) { p()->buff.storm_frenzy->decrement(); } @@ -12984,8 +12988,7 @@ void shaman_t::trigger_arc_discharge( const action_state_t* state ) } - if ( specialization() == SHAMAN_ENHANCEMENT || !bugs || state->action->execute_time() != - timespan_t::zero()) + if ( specialization() == SHAMAN_ENHANCEMENT ) { buff.arc_discharge->decrement(); } From f1205de655a97b514368d74207bf0aa4c8f2020f Mon Sep 17 00:00:00 2001 From: HawkCorrigan Date: Tue, 26 Nov 2024 01:50:47 +0100 Subject: [PATCH 9/9] [ele] SK should be reduced below 2 at some point --- engine/class_modules/sc_shaman.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/class_modules/sc_shaman.cpp b/engine/class_modules/sc_shaman.cpp index eb861d00f62..528d3a08fde 100644 --- a/engine/class_modules/sc_shaman.cpp +++ b/engine/class_modules/sc_shaman.cpp @@ -7062,8 +7062,10 @@ struct lightning_bolt_t : public shaman_spell_t if ( !p()->sk_during_cast ) { - if ( p()->buff.stormkeeper->stack() == 3 && - ( !p()->bugs || ( p()->buff.stormkeeper->remains() > p()->buff.stormkeeper->buff_duration() * 0.97 ) ) ) + auto rem = p()->buff.stormkeeper->remains(); + auto dur = p()->buff.stormkeeper->buff_duration(); + if ( p()->buff.stormkeeper->stack() != 3 || + rem < dur * 0.97) { p()->buff.stormkeeper->decrement(); }