tjc12821

Untitled

Feb 16th, 2018
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.97 KB | None | 0 0
  1.       if ( p()->talents.soul_conduit->ok() )
  2.       {
  3.  
  4.           if( p()->specialization() == WARLOCK_DEMONOLOGY )
  5.           {
  6.               struct demo_sc_event: public player_event_t
  7.               {
  8.                 gain_t* shard_gain;
  9.                 warlock_t* pl;
  10.                 int shards_used;
  11.  
  12.  
  13.                 demo_sc_event( warlock_t* p, int c ):
  14.                   player_event_t( *p, timespan_t::from_millis(100) ), shard_gain( p -> gains.soul_conduit ), pl(p), shards_used(c)
  15.                 {
  16.                 }
  17.                 virtual const char* name() const override
  18.                 { return "demonology_sc_event"; }
  19.                 virtual void execute() override
  20.                 {
  21.                     double soul_conduit_rng = pl->talents.soul_conduit->effectN( 1 ).percent() + pl->spec.destruction->effectN( 4 ).percent();
  22.  
  23.                     // double last_res_cost = pl->last_foreground_action->last_resource_cost;
  24.  
  25.                     for ( int i = 0; i < shards_used; i++ )
  26.                     {
  27.                         if ( rng().roll( soul_conduit_rng ) )
  28.                         {
  29.                             pl->resource_gain( RESOURCE_SOUL_SHARD, 1.0, pl->gains.soul_conduit );
  30.                             pl->procs.soul_conduit->occur();
  31.                         }
  32.                     }
  33.  
  34.                 }
  35.               };
  36.  
  37.               make_event<demo_sc_event>( *p()->sim, p(), last_resource_cost);
  38.  
  39.  
  40.           }
  41.           else
  42.           {
  43.               double soul_conduit_rng = p()->talents.soul_conduit->effectN( 1 ).percent() + p()->spec.destruction->effectN( 4 ).percent();
  44.  
  45.               for ( int i = 0; i < last_resource_cost; i++ )
  46.               {
  47.                   if ( rng().roll( soul_conduit_rng ) )
  48.                   {
  49.                       p()->resource_gain( RESOURCE_SOUL_SHARD, 1.0, p()->gains.soul_conduit );
  50.                       p()->procs.soul_conduit->occur();
  51.                   }
  52.               }
  53.           }
  54.       }
Advertisement
Add Comment
Please, Sign In to add comment