tjc12821

Untitled

Jul 25th, 2015
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.70 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.         p() -> resource_gain( RESOURCE_SOUL_SHARD, 1, p() -> gains.nightfall );
  18.  
  19.         // If going from 0 to 1 shard was a surprise, the player would have to react to it
  20.         if ( p() -> resources.current[RESOURCE_SOUL_SHARD] == 1 )
  21.           p() -> shard_react = p() -> sim -> current_time() + p() -> total_reaction_time();
  22.         else if ( p() -> resources.current[RESOURCE_SOUL_SHARD] >= 1 )
  23.           p() -> shard_react = p() -> sim -> current_time();
  24.         else
  25.           p() -> shard_react = timespan_t::max();
  26.  
  27.  
  28.         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
  29.         {
  30.           timespan_t cd_reduction = p() -> sets.set( WARLOCK_AFFLICTION, T17, B4 ) -> effectN( 1 ).time_value();
  31.  
  32.           p() -> cooldowns.dark_soul -> adjust(- cd_reduction);
  33.         }
  34.       }
  35.     }
Advertisement
Add Comment
Please, Sign In to add comment