tjc12821

Untitled

Jul 25th, 2015
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.96 KB | None | 0 0
  1.   virtual void tick( dot_t* d )
  2.   {
  3.     warlock_spell_t::tick( d );
  4.  
  5.     if ( p() -> spec.nightfall -> ok() && d -> state -> target == p() -> latest_corruption_target && ! periodic_hit ) //5.4 only the latest corruption procs it
  6.     {
  7.  
  8.       double nightfall_chance = p() -> spec.nightfall -> effectN( 1 ).percent() / 10;
  9.  
  10.       if ( p() -> sets.has_set_bonus( WARLOCK_AFFLICTION, T17, B2 ) && td( d -> state -> target ) -> dots_drain_soul -> is_ticking() && td( d -> state -> target ) -> dots_agony -> is_ticking() && td( d -> state -> target ) -> dots_unstable_affliction -> is_ticking() ) //Caster Has T17 2pc and UA/Agony are ticking as well on the target
  11.       {
  12.         nightfall_chance += p() -> sets.set( WARLOCK_AFFLICTION, T17, B2 ) -> effectN( 1 ).percent();
  13.       }
  14.  
  15.       if ( rng().roll( nightfall_chance ) )
  16.       {
  17.         if ( p() -> double_nightfall == 4 )
  18.         {
  19.           p() -> resource_gain( RESOURCE_SOUL_SHARD, 2, p() -> gains.nightfall );
  20.           p() -> double_nightfall = 0;
  21.         }
  22.         else
  23.         {
  24.           p() -> resource_gain( RESOURCE_SOUL_SHARD, 1, p() -> gains.nightfall );
  25.           ++p() -> double_nightfall;
  26.         }
  27.         // If going from 0 to 1 shard was a surprise, the player would have to react to it
  28.         if ( p() -> resources.current[RESOURCE_SOUL_SHARD] == 1 )
  29.           p() -> shard_react = p() -> sim -> current_time() + p() -> total_reaction_time();
  30.         else if ( p() -> resources.current[RESOURCE_SOUL_SHARD] >= 1 )
  31.           p() -> shard_react = p() -> sim -> current_time();
  32.         else
  33.           p() -> shard_react = timespan_t::max();
  34.  
  35.  
  36.         if ( p() -> sets.has_set_bonus( WARLOCK_AFFLICTION, T17, B4 ) ) //if we ticked, then reduce time till next DS goes off CD by 10 seconds
  37.         {
  38.           timespan_t cd_reduction = p() -> sets.set( WARLOCK_AFFLICTION, T17, B4 ) -> effectN( 1 ).time_value();
  39.  
  40.           p() -> cooldowns.dark_soul -> adjust(- cd_reduction);
  41.         }
  42.       }
  43.     }
Advertisement
Add Comment
Please, Sign In to add comment