Skip to content

Commit e583462

Browse files
committed
[DK] More accurate 11.1 pet spawn behavior
1 parent 1f5c034 commit e583462

File tree

1 file changed

+47
-8
lines changed

1 file changed

+47
-8
lines changed

engine/class_modules/sc_death_knight.cpp

+47-8
Original file line numberDiff line numberDiff line change
@@ -1703,7 +1703,6 @@ struct death_knight_t : public parse_player_effects_t
17031703
double average_cs_travel_time = 0.4;
17041704
timespan_t first_ams_cast = 20_s;
17051705
double horsemen_ams_absorb_percent = 0.6;
1706-
bool disable_ghoul_spawn_stun = false;
17071706
} options;
17081707

17091708
// Runes
@@ -2524,6 +2523,16 @@ struct death_knight_pet_t : public pet_t
25242523
}
25252524
}
25262525

2526+
void trigger_pet_movement( double dist )
2527+
{
2528+
if ( dist == 0 )
2529+
return;
2530+
2531+
this->trigger_movement( dist, movement_direction_type::TOWARDS );
2532+
auto dur = this->time_to_move();
2533+
make_event( *sim, dur, [ &, dur ] { update_movement( dur ); } );
2534+
}
2535+
25272536
void apply_affecting_auras( action_t& action ) override
25282537
{
25292538
player_t::apply_affecting_auras( action );
@@ -2705,6 +2714,14 @@ struct pet_action_t : public parse_action_effects_t<Base>
27052714
}
27062715
}
27072716
}
2717+
2718+
bool ready() override
2719+
{
2720+
if ( this->player->is_moving() )
2721+
return false;
2722+
2723+
return action_base_t::ready();
2724+
}
27082725
};
27092726

27102727
// ==========================================================================
@@ -2914,13 +2931,8 @@ struct base_ghoul_pet_t : public death_knight_pet_t
29142931
resources.base_regen_per_second[ RESOURCE_ENERGY ] = 10;
29152932
}
29162933

2917-
void arise() override
2934+
void trigger_summon_stun( timespan_t dur )
29182935
{
2919-
death_knight_pet_t::arise();
2920-
if ( dk()->options.disable_ghoul_spawn_stun )
2921-
return;
2922-
2923-
timespan_t duration = dk()->pet_spell.pet_stun->duration();
29242936
if ( precombat_spawn_adjust > 0_s && precombat_spawn )
29252937
{
29262938
duration = duration - precombat_spawn_adjust;
@@ -2934,13 +2946,32 @@ struct base_ghoul_pet_t : public death_knight_pet_t
29342946
}
29352947
}
29362948

2949+
void arise() override
2950+
{
2951+
death_knight_pet_t::arise();
2952+
if ( name_str == "army_ghoul" || !dk()->is_ptr() )
2953+
{
2954+
timespan_t duration = dk()->pet_spell.pet_stun->duration();
2955+
trigger_summon_stun( duration );
2956+
}
2957+
else
2958+
{
2959+
double dist = precombat_spawn ? 0 : rng().range( -dk()->spell.apocalypse_duration->effectN( 1 ).radius(),
2960+
dk()->spell.apocalypse_duration->effectN( 1 ).radius() );
2961+
trigger_pet_movement( std::max( 0.0, dk()->base.distance + dist ) );
2962+
}
2963+
}
2964+
29372965
resource_e primary_resource() const override
29382966
{
29392967
return RESOURCE_ENERGY;
29402968
}
29412969

29422970
timespan_t available() const override
29432971
{
2972+
if ( this->is_moving() )
2973+
return this->time_to_move();
2974+
29442975
double energy = resources.current[ RESOURCE_ENERGY ];
29452976
timespan_t time_to_next =
29462977
timespan_t::from_seconds( ( 40 - energy ) / resource_regen_per_second( RESOURCE_ENERGY ) );
@@ -4575,6 +4606,15 @@ struct abomination_pet_t : public death_knight_pet_t
45754606
tww1_4pc_proc = true;
45764607
owner_coeff.ap_from_ap = 2.4;
45774608
resource_regeneration = regen_type::DISABLED;
4609+
base_movement_speed = 3.75; // Abomination is SLOWWWW
4610+
}
4611+
4612+
void arise() override
4613+
{
4614+
death_knight_pet_t::arise();
4615+
// Assume precombat abominations have to walk far further than normal
4616+
double dist = precombat_spawn ? 15 : rng().range( 0, dk()->talent.unholy.raise_abomination->effectN( 1 ).radius() );
4617+
trigger_pet_movement( dk()->base.distance + dist );
45784618
}
45794619

45804620
resource_e primary_resource() const override
@@ -11458,7 +11498,6 @@ void death_knight_t::create_options()
1145811498
add_option(
1145911499
opt_timespan( "deathknight.first_ams_cast", options.first_ams_cast, timespan_t::zero(), timespan_t::max() ) );
1146011500
add_option( opt_float( "deathknight.horsemen_ams_absorb_percent", options.horsemen_ams_absorb_percent, 0.0, 1.0 ) );
11461-
add_option( opt_bool( "deathknight.disable_ghoul_spawn_stun", options.disable_ghoul_spawn_stun ) );
1146211501
}
1146311502

1146411503
void death_knight_t::copy_from( player_t* source )

0 commit comments

Comments
 (0)