tjc12821

Untitled

Jul 30th, 2018
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.09 KB | None | 0 0
  1.     struct seed_of_corruption_t : public affliction_spell_t
  2.     {
  3.       struct seed_of_corruption_aoe_t : public affliction_spell_t
  4.       {
  5.         bool deathbloom; //azerite_trait
  6.         corruption_t* corruption;
  7.         seed_of_corruption_aoe_t( warlock_t* p ) :
  8.           affliction_spell_t( "seed_of_corruption_aoe", p, p -> find_spell( 27285 ) ),
  9.           corruption( new corruption_t( p, "" ) )
  10.         {
  11.           aoe = -1;
  12.           dual = true;
  13.           background = true;
  14.           deathbloom = false;
  15.  
  16.           p->spells.seed_of_corruption_aoe = this;
  17.  
  18.           corruption->background = true;
  19.           corruption->dual = true;
  20.           corruption->base_costs[RESOURCE_MANA] = 0;
  21.         }
  22.  
  23.         double bonus_da(const action_state_t* s) const override
  24.         {
  25.           double da = affliction_spell_t::bonus_da(s);
  26.           if(deathbloom)
  27.             da += p()->azerite.deathbloom.value();
  28.           return da;
  29.         }
  30.  
  31.         void impact( action_state_t* s ) override
  32.         {
  33.           affliction_spell_t::impact( s );
  34.  
  35.           if ( result_is_hit( s->result ) )
  36.           {
  37.             warlock_td_t* tdata = this->td( s->target );
  38.  
  39.             if ( tdata->dots_seed_of_corruption->is_ticking() && tdata->soc_threshold > 0 )
  40.             {
  41.               tdata->soc_threshold = 0;
  42.               tdata->dots_seed_of_corruption->cancel();
  43.             }
  44.  
  45.             corruption->set_target( s->target );
  46.             corruption->execute();
  47.           }
  48.         }
  49.       };
  50.  
  51.       double threshold_mod;
  52.       double sow_the_seeds_targets;
  53.       seed_of_corruption_aoe_t* explosion;
  54.  
  55.       seed_of_corruption_t( warlock_t* p, const std::string& options_str ) :
  56.         affliction_spell_t( "seed_of_corruption", p, p -> find_spell( 27243 ) ),
  57.           threshold_mod( 3.0 ),
  58.           sow_the_seeds_targets( p->talents.sow_the_seeds->effectN( 1 ).base_value() ),
  59.           explosion( new seed_of_corruption_aoe_t( p ) )
  60.       {
  61.         parse_options( options_str );
  62.         may_crit = false;
  63.         base_tick_time = dot_duration;
  64.         hasted_ticks = false;
  65.         add_child( explosion );
  66.         if ( p->talents.sow_the_seeds->ok() )
  67.           aoe = 2;
  68.       }
  69.  
  70.       void init() override
  71.       {
  72.         affliction_spell_t::init();
  73.         snapshot_flags |= STATE_SP;
  74.       }
  75.  
  76.       void execute() override
  77.       {
  78.         if ( p()->sets->has_set_bonus( WARLOCK_AFFLICTION, T21, B4 ) )
  79.           p()->active.tormented_agony->execute();
  80.  
  81.         affliction_spell_t::execute();
  82.       }
  83.  
  84.       void impact( action_state_t* s ) override
  85.       {
  86.         if ( result_is_hit( s->result ) )
  87.         {
  88.           td( s->target )->soc_threshold = s->composite_spell_power() * ( data().effectN(1).base_value() / 100.0 );
  89.         }
  90.         affliction_spell_t::impact( s );
  91.       }
  92.  
  93.       void last_tick( dot_t* d ) override
  94.       {
  95.         affliction_spell_t::last_tick( d );
  96.  
  97.         if (!d->end_event)
  98.         {
  99.           explosion->deathbloom = true;
  100.         }
  101.         explosion->set_target( d->target );
  102.         explosion->execute();
  103.       }
  104.     };
Advertisement
Add Comment
Please, Sign In to add comment