From 6b2d47ac83adcd9ad30b14c970e79a0fb22ffb83 Mon Sep 17 00:00:00 2001 From: Publik Date: Sun, 3 Oct 2021 20:31:41 -0500 Subject: [PATCH 1/2] [Gear] implement shard of kyr --- engine/player/unique_gear_shadowlands.cpp | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/engine/player/unique_gear_shadowlands.cpp b/engine/player/unique_gear_shadowlands.cpp index 3881898159e..7cf0665a1da 100644 --- a/engine/player/unique_gear_shadowlands.cpp +++ b/engine/player/unique_gear_shadowlands.cpp @@ -3993,6 +3993,44 @@ void shard_of_zed( special_effect_t& effect ) new dbc_proc_callback_t( effect.player, effect ); */ } + +/**Shard of Kyr + * id=355743 driver Rank 1 + * id=357035 driver Rank 2 (Ominous) + * id=357053 driver Rank 3 (Desolate) + * id=357063 driver Rank 4 (Foreboding) + * id=357074 driver Rank 5 (Portentous) + * id=356305 Accretion buff + */ +void shard_of_kyr( special_effect_t& effect ) +{ + auto buff = buff_t::find( effect.player, "accretion" ); + if ( !buff ) + { + auto per_five_amount = effect.driver()->effectN( 1 ).average( effect.player ); + auto max_amount = effect.driver()->effectN( 2 ).average( effect.player ); + + buff = make_buff( effect.player, "accretion", effect.player->find_spell( 356305 ) ) + ->set_default_value( per_five_amount ); + + effect.custom_buff = buff; + effect.player->register_combat_begin( [ &effect, buff, per_five_amount, max_amount ]( player_t* ) { + buff->trigger(); + make_repeating_event( buff->source->sim, effect.player->find_spell( 356305 )->effectN( 1 ).period(), + [ buff, per_five_amount, max_amount ]() { + if ( buff->up() ) + { + auto new_value = buff->check_value() + per_five_amount; + buff->trigger( 1, std::min( new_value, max_amount ) ); + } + else + { + buff->trigger(); + } + } ); + } ); + } +} } // namespace items namespace set_bonus @@ -4159,6 +4197,12 @@ void register_special_effects() unique_gear::register_special_effect( 357067, items::shard_of_zed ); unique_gear::register_special_effect( 357077, items::shard_of_zed ); + unique_gear::register_special_effect( 355743, items::shard_of_kyr ); + unique_gear::register_special_effect( 357035, items::shard_of_kyr ); + unique_gear::register_special_effect( 357053, items::shard_of_kyr ); + unique_gear::register_special_effect( 357063, items::shard_of_kyr ); + unique_gear::register_special_effect( 357074, items::shard_of_kyr ); + // Disabled effects unique_gear::register_special_effect( 329028, items::DISABLED_EFFECT ); // Light-Infused Armor shield unique_gear::register_special_effect( 333885, items::DISABLED_EFFECT ); // Darkmoon Deck: Putrescence shuffler From 796cec0e671ac018b6ddb4d45151ceaa01e8f9cd Mon Sep 17 00:00:00 2001 From: Publik Date: Sun, 3 Oct 2021 21:02:29 -0500 Subject: [PATCH 2/2] fix buff period --- engine/player/unique_gear_shadowlands.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/player/unique_gear_shadowlands.cpp b/engine/player/unique_gear_shadowlands.cpp index 7cf0665a1da..a47db5f71d5 100644 --- a/engine/player/unique_gear_shadowlands.cpp +++ b/engine/player/unique_gear_shadowlands.cpp @@ -4016,9 +4016,9 @@ void shard_of_kyr( special_effect_t& effect ) effect.custom_buff = buff; effect.player->register_combat_begin( [ &effect, buff, per_five_amount, max_amount ]( player_t* ) { buff->trigger(); - make_repeating_event( buff->source->sim, effect.player->find_spell( 356305 )->effectN( 1 ).period(), + make_repeating_event( buff->source->sim, effect.driver()->effectN( 1 ).period(), [ buff, per_five_amount, max_amount ]() { - if ( buff->up() ) + if ( buff->check() ) { auto new_value = buff->check_value() + per_five_amount; buff->trigger( 1, std::min( new_value, max_amount ) );