-
Notifications
You must be signed in to change notification settings - Fork 767
Expand file tree
/
Copy pathunique_gear_midnight.cpp
More file actions
4421 lines (3673 loc) · 155 KB
/
Copy pathunique_gear_midnight.cpp
File metadata and controls
4421 lines (3673 loc) · 155 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ==========================================================================
// Dedmonwakeen's Raid DPS/TPS Simulator.
// Send questions to natehieter@gmail.com
// ==========================================================================
#include "unique_gear_midnight.hpp"
#include "action/absorb.hpp"
#include "action/action.hpp"
#include "action/dot.hpp"
#include "buff/buff.hpp"
#include "dbc/data_enums.hh"
#include "dbc/item_database.hpp"
#include "dbc/spell_data.hpp"
#include "item/item.hpp"
#include "player/actor_target_data.hpp"
#include "player/consumable.hpp"
#include "player/darkmoon_deck.hpp"
#include "player/ground_aoe.hpp"
#include "player/pet_spawner.hpp"
#include "set_bonus.hpp"
#include "sim/cooldown.hpp"
#include "sim/proc_rng.hpp"
#include "sim/sim.hpp"
#include "unique_gear.hpp"
#include "unique_gear_helper.hpp"
namespace unique_gear::midnight
{
std::vector<unsigned> __mid_special_effect_ids;
wowv_t version_min = { 12 };
wowv_t version_max = { UINT8_MAX };
void reset_version_check()
{ version_min = { 12 }; version_max = { UINT8_MAX }; }
void set_min_version( wowv_t build )
{ version_min = build; }
void set_max_version( wowv_t build )
{ version_max = build; }
// from item_naming.inc
enum gem_color_e : unsigned
{
GEM_PERIDOT = 14262,
GEM_GARNET = 14276,
GEM_LAPIS = 14277,
GEM_AMETHYST = 14278,
GEM_DIAMOND = 14279
};
static constexpr unsigned __gem_colors[] = { GEM_PERIDOT, GEM_GARNET, GEM_LAPIS, GEM_AMETHYST };
static constexpr util::span<const unsigned> gem_colors = util::make_span( __gem_colors );
// can be called via unqualified lookup
void register_special_effect( unsigned spell_id, custom_cb_t init_callback, bool fallback = false, bool passive = false )
{
unique_gear::register_special_effect( spell_id, init_callback, fallback, passive, version_min, version_max );
__mid_special_effect_ids.push_back( spell_id );
}
void register_special_effect( std::initializer_list<unsigned> spell_ids, custom_cb_t init_callback,
bool fallback = false, bool passive = false )
{
for ( auto id : spell_ids )
register_special_effect( id, init_callback, fallback, passive );
}
namespace consumables
{
// Food
static constexpr unsigned food_coeff_spell_id = 1219179;
using selector_fn = std::function<stat_e( const player_t*, util::span<const stat_e> )>;
struct selector_food_buff_t : public consumable_buff_t<stat_buff_t>
{
double amount;
bool highest;
selector_food_buff_t( const special_effect_t& e, bool b )
: consumable_buff_t( e.player, e.name(), e.driver() ), highest( b )
{
amount = e.stat_amount;
}
void start( int s, double v, timespan_t d ) override
{
auto stat = highest ? util::highest_stat( player, secondary_ratings )
: util::lowest_stat( player, secondary_ratings );
if( !manual_stats_added )
add_stat( stat, amount );
consumable_buff_t::start( s, v, d );
}
};
custom_cb_t selector_food( unsigned id, bool highest, bool major = true )
{
return [ = ]( special_effect_t& effect ) {
effect.spell_id = id;
auto coeff = effect.player->find_spell( food_coeff_spell_id );
effect.stat_amount = coeff->effectN( 4 ).average( effect );
if ( !major )
effect.stat_amount *= coeff->effectN( 1 ).base_value() * 0.1;
effect.custom_buff = new selector_food_buff_t( effect, highest );
};
}
custom_cb_t primary_food( unsigned id, stat_e stat, size_t primary_idx = 3, bool major = true )
{
return [ = ]( special_effect_t& effect ) {
effect.spell_id = id;
auto coeff = effect.player->find_spell( food_coeff_spell_id );
auto buff = create_buff<consumable_buff_t<stat_buff_t>>( effect.player, effect.driver() );
if ( primary_idx )
{
auto _amt = coeff->effectN( primary_idx ).average( effect );
if ( !major )
_amt *= coeff->effectN( 1 ).base_value() * 0.1;
buff->add_stat( effect.player->convert_hybrid_stat( stat ), _amt );
}
if ( primary_idx == 3 )
{
auto _amt = coeff->effectN( 8 ).average( effect );
if ( !major )
_amt *= coeff->effectN( 1 ).base_value() * 0.1;
buff->add_stat( STAT_STAMINA, _amt );
}
effect.custom_buff = buff;
};
}
custom_cb_t secondary_food( unsigned id, stat_e stat1, stat_e stat2 = STAT_NONE )
{
return [ = ]( special_effect_t& effect ) {
effect.spell_id = id;
auto coeff = effect.player->find_spell( food_coeff_spell_id );
auto buff = create_buff<consumable_buff_t<stat_buff_t>>( effect.player, effect.driver() );
if ( stat2 == STAT_NONE )
{
auto _amt = coeff->effectN( 4 ).average( effect );
buff->add_stat( stat1, _amt );
}
else
{
auto _amt = coeff->effectN( 5 ).average( effect );
buff->add_stat( stat1, _amt );
buff->add_stat( stat2, _amt );
}
effect.custom_buff = buff;
};
}
// Potions
// Draught of Rampant Abandon
// 1236998 driver & buff
// 1237154 AoE trigger (NYI)
void draught_of_rampant_abandon( special_effect_t& effect )
{
effect.custom_buff = create_buff<stat_buff_t>( effect.player, effect.driver(), effect.item )
// TODO: RPPM is for the AoE trigger (NYI), disabling for now
->set_rppm( rppm_scale_e::RPPM_DISABLE );
}
// Potion of Recklessness
// 1236994 - driver & buff
void potion_of_recklessness( special_effect_t& effect )
{
// The potion grants a positive buff to your highest secondary stat and
// a negative buff to your lowest secondary stat.
struct recklessness_t : public generic_proc_t
{
std::unordered_map<stat_e, buff_t*> pos_map, neg_map;
recklessness_t( const special_effect_t& e ) : generic_proc_t( e, e.driver()->name_cstr(), e.driver() )
{
quiet = true;
// create and populate bonus/penalty maps. penalties will get '_penalty' suffix and ' Penalty' for reporting
create_all_stat_buffs( e, &data(), 0.0,
[]( std::string n, const spelleffect_data_t& e ) {
return e.m_coefficient() < 0.0 ? fmt::format( "{}_penalty", n ) : n;
},
[ this ]( stat_e s, buff_t* b ) {
if ( static_cast<stat_buff_t*>( b )->stats.front().amount < 0.0 )
neg_map[ s ] = b->set_name_reporting( b->name_str_reporting + " Penalty" );
else
pos_map[ s ] = b;
} );
}
void execute() override
{
generic_proc_t::execute();
pos_map[ util::highest_stat( player, secondary_ratings ) ]->trigger();
neg_map[ util::lowest_stat( player, secondary_ratings ) ]->trigger();
}
};
effect.disable_buff();
effect.execute_action = create_proc_action<recklessness_t>( "potion_of_recklessness", effect );
}
// Potion of Zealotry
// 1238443 Driver & buff
// 1237886 Damage Taken Debuff
// 1237158 Damage
// TODO: Does the debuff trigger before, or after the damage? Order will affect damage output
void potion_of_zealotry( special_effect_t& effect )
{
struct burst_of_zealotry_t : public generic_proc_t
{
const special_effect_t& effect;
player_t* last_target;
burst_of_zealotry_t( const special_effect_t& e )
: generic_proc_t( e, "burst_of_zealotry", 1237158 ), effect( e ), last_target( nullptr )
{
base_dd_min = base_dd_max = e.driver()->effectN( 3 ).average( e );
target_debuff = e.driver()->effectN( 1 ).trigger();
}
double composite_da_multiplier( const action_state_t* s ) const override
{
double m = generic_proc_t::composite_da_multiplier( s );
if ( auto debuff = find_debuff( s->target ) )
m *= 1.0 + debuff->check() * effect.driver()->effectN( 4 ).percent();
return m;
}
void impact( action_state_t* s ) override
{
generic_proc_t::impact( s );
if ( s->target != last_target )
{
last_target = s->target;
for ( auto& t : target_list() )
if ( auto debuff = find_debuff( t ) )
debuff->expire();
}
get_debuff( s->target )->trigger();
}
};
auto buff = create_buff<buff_t>( effect.player, "potion_of_zealotry", effect.driver() )->set_rppm( RPPM_DISABLE );
auto burst_of_zealotry = new special_effect_t( effect.player );
burst_of_zealotry->name_str = "burst_of_zealotry_proc";
burst_of_zealotry->spell_id = effect.driver()->id();
burst_of_zealotry->cooldown_ = 0_ms; // Cooldown handled by the main special effect
burst_of_zealotry->execute_action = create_proc_action<burst_of_zealotry_t>( "burst_of_zealotry", effect );
effect.player->special_effects.push_back( burst_of_zealotry );
auto zealotry_cb = new dbc_proc_callback_t( effect.player, *burst_of_zealotry );
zealotry_cb->activate_with_buff( buff, true );
effect.custom_buff = buff;
}
// 1262056 r1 driver
// 1262108 r1 dot
// 1262111 r2 driver
// 1262109 r2 dot
void laced_zoomshots( special_effect_t& effect )
{
effect.player->sim->error( UNVERIFIED_IMPLEMENTATION,
"Laced Zoomshots: Implemented using spell data which indicates it procs from all damage, not just auto-attacks. "
"This has not be verified in-game." );
effect.execute_action = create_proc_action<generic_proc_t>( "laced_zoomshots", effect, effect.trigger() );
new dbc_proc_callback_t( effect.player, effect );
}
// 1237009 r1 driver
// 1237010 r1 damage
// 1237012 r2 driver
// 1237013 r2 damage
void smugglers_enchanted_edge( special_effect_t& effect )
{
effect.player->sim->error( UNVERIFIED_IMPLEMENTATION,
"Smuggler's Enchanted Edge: Implemented assuming that coating both weapons will results in two indepedent procs. "
"This has not be verified in-game." );
auto dam = create_proc_action<generic_proc_t>( "smugglers_enchanted_edge", effect, effect.trigger() );
dam->base_dd_min = dam->base_dd_max = effect.driver()->effectN( 1 ).average( effect );
effect.execute_action = dam;
new dbc_proc_callback_t( effect.player, effect );
}
// 1262120 r1 driver
// 1262140 r1 missile
// 1262142 r1 aoe
// 1262141 r2 driver
// 1262147 r2 missile
// 1262146 r2 aoe
void weighted_boomshots( special_effect_t& effect )
{
auto missile = create_proc_action<generic_proc_t>( "weighted_boomshots_missile", effect, effect.trigger() );
// assumed to not split so use generic_proc_t and just set aoe = -1;
auto aoe = create_proc_action<generic_proc_t>( "weighted_boomshots", effect, missile->data().effectN( 1 ).trigger() );
aoe->aoe = -1;
missile->stats = aoe->stats; // just report the damage
missile->impact_action = aoe;
effect.execute_action = missile;
new dbc_proc_callback_t( effect.player, effect );
}
} // namespace consumables
namespace enchants
{
// Powerful Eversong Diamond
// 1258209 driver
void powerful_eversong_diamond( special_effect_t& effect )
{
auto pct = effect.driver()->effectN( 1 ).base_value() * unique_gem_list( effect.player, gem_colors ).size();
effect.player->register_passive_item_effect_override( effect.driver()->effectN( 2 ), pct );
effect.player->register_passive_item_effect_override( effect.driver()->effectN( 3 ), pct );
effect.player->parse_passive_item_effect( effect.driver() );
}
// Strength of Halazzi
// 1236733 Rank 1 Driver
// 1236734 Rank 2 Driver
// 1241721 RPPM
// 1241784 Damage
void strength_of_halazzi( special_effect_t& effect )
{
effect.player->sim->error( IMPLEMENTATION_NOTES,
"Strength of the Halazzi: Currently not penalized by tank role multiplier in-game, and implemented to match." );
auto proc_data = effect.trigger()->effectN( 1 ).trigger();
auto proc_value = effect.driver()->effectN( 1 ).average( effect );
assert( proc_data->effectN( 1 ).subtype() == A_PERIODIC_DAMAGE );
auto damage = create_proc_action<generic_proc_t>( "halazzis_claws", effect, proc_data );
damage->base_td += proc_value;
// skip setup if callback has been created by already having another copy of the enchant
if ( find_special_effect( effect.player, effect.trigger()->id() ) )
return;
// No Role Mult currently
// damage->base_ta_multiplier *= role_mult( effect );
effect.execute_action = damage;
effect.spell_id = effect.trigger()->id();
new dbc_proc_callback_t( effect.player, effect );
}
// 1236739 r1 driver
// 1236740 r2 driver
// 1241728 rppm
// 1242127 dot
// 1277263 unknonw (vfx?)
// 1242129 aoe
void flames_of_the_sindorei( special_effect_t& effect )
{
struct phoenix_fire_t : public generic_proc_t
{
action_t* aoe;
phoenix_fire_t( const special_effect_t& e, action_t* aoe )
: generic_proc_t( e, "phoenix_fire", e.trigger()->effectN( 1 ).trigger() ), aoe( aoe )
{
assert( data().effectN( 1 ).subtype() == A_PERIODIC_DAMAGE );
}
void last_tick( dot_t* d ) override
{
generic_proc_t::last_tick( d );
aoe->execute_on_target( d->target );
}
};
auto dot_value = effect.driver()->effectN( 1 ).average( effect );
auto aoe_value = effect.driver()->effectN( 2 ).average( effect );
auto aoe = create_proc_action<generic_aoe_proc_t>( "phoenix_fire_aoe", effect, 1242129 );
aoe->name_str_reporting = "AoE";
aoe->base_dd_min += aoe_value;
aoe->base_dd_max += aoe_value;
auto dot = create_proc_action<phoenix_fire_t>( "phoenix_fire", effect, aoe );
dot->base_td += dot_value;
// skip setup if callback has been created by already having another copy of the enchant
if ( find_special_effect( effect.player, effect.trigger()->id() ) )
return;
dot->add_child( aoe );
effect.execute_action = dot;
effect.spell_id = effect.trigger()->id();
new dbc_proc_callback_t( effect.player, effect );
}
void stat_weapon_enchant( special_effect_t& effect )
{
auto proc_value = effect.driver()->effectN( 1 ).average( effect );
auto proc_data = effect.trigger()->effectN( 1 ).trigger();
auto proc_subtype = proc_data->effectN( 1 ).subtype();
assert( proc_value && ( proc_subtype == A_MOD_RATING || proc_subtype == A_MOD_STAT ) );
auto buff = create_buff<stat_buff_t>( effect.player, proc_data )
->add_stat_from_effect_type( proc_subtype, proc_value );
// skip setup if callback has been created by already having another copy of the enchant
if ( find_special_effect( effect.player, effect.trigger()->id() ) )
return;
effect.custom_buff = buff;
effect.spell_id = effect.trigger()->id();
new dbc_proc_callback_t( effect.player, effect );
}
// Eyes of the Eagle
// 1236700 Driver rank 1
// 1236701 Driver rank 2
void eyes_of_the_eagle( special_effect_t& effect )
{
effect.player->parse_passive_item_effect( effect.driver() );
}
// 1262295 r1 driver
// 1262294 r1 buff
// 1262298 r2 driver
// 1262299 r2 buff
void smugglers_lynxeye( special_effect_t& effect )
{
effect.custom_buff = create_buff<stat_buff_t>( effect.player, effect.trigger(), effect.item );
new dbc_proc_callback_t( effect.player, effect );
}
// 1262337 r1 driver
// 1262336 r1 buff
// 1262339 r2 driver
// 1262338 r2 buff
void farstriders_hawkeye( special_effect_t& effect )
{
effect.custom_buff = create_buff<stat_buff_t>( effect.player, effect.trigger(), effect.item );
new dbc_proc_callback_t( effect.player, effect );
}
} // namespace enchants
namespace embellishments
{
// 1283697 Driver
// 1229511 rppm
// 1229746 buff
void arcanoweave_lining( special_effect_t& effect )
{
// EffectN 2 percent goes to the player
// EffectN 3 percent goes to the ally
auto buff_amount = effect.driver()->effectN( 1 ).average( effect ) * effect.driver()->effectN( 2 ).percent();
auto buff = create_buff<stat_buff_t>( effect.player, effect.player->find_spell( 1229746 ) )
->add_stat_from_effect_type( A_MOD_STAT, buff_amount );
// skip setup if callback has been created by already having another copy of the embellishment
if ( find_special_effect( effect.player, effect.trigger()->id() ) )
return;
struct arcanoweave_lining_cb_t : public dbc_proc_callback_t
{
stat_buff_t* buff;
double ally_conversion_multiplier;
arcanoweave_lining_cb_t( const special_effect_t& e, stat_buff_t* personal_buff )
: dbc_proc_callback_t( e.player, e ),
buff( personal_buff ),
ally_conversion_multiplier( e.driver()->effectN( 3 ).percent() / e.driver()->effectN( 2 ).percent() )
{}
buff_t* create_debuff( player_t* t ) override
{
// don't cache in ctor so we can grab double value for double embellishment
auto ally_stat_amount = buff->stats.front().amount * ally_conversion_multiplier;
return make_buff<stat_buff_t>( actor_pair_t( t, listener ), "arcanoweave_insight_ally", &buff->data() )
->set_stat_from_effect_type( A_MOD_STAT, ally_stat_amount )
->set_name_reporting( "Ally" );
}
void execute( const spell_data_t*, player_t*, action_state_t* ) override
{
buff->trigger();
if ( effect.player->sim->player_non_sleeping_list.size() > 1 && !effect.player->sim->single_actor_batch )
{
auto allies = effect.player->sim->player_non_sleeping_list.data(); // make a copy
range::erase_remove( allies, [ p = effect.player ]( player_t* t ) { return t->is_pet() || t == p; } );
if ( !allies.empty() )
get_debuff( rng().range( allies ) )->trigger();
}
}
};
effect.spell_id = effect.trigger()->id();
new arcanoweave_lining_cb_t( effect, buff );
}
// 1241711 driver
// 1230364 rppm driver
// 1230366 buff
void sunfire_silk_lining( special_effect_t& effect )
{
auto stat_amount = effect.driver()->effectN( 1 ).average( effect );
auto buff = create_buff<stat_buff_t>( effect.player, effect.trigger()->effectN( 1 ).trigger() )
->add_stat_from_effect_type( A_MOD_STAT, stat_amount );
// skip setup if callback has been created by already having another copy of the embellishment
if ( find_special_effect( effect.player, effect.trigger()->id() ) )
return;
effect.custom_buff = buff;
effect.spell_id = effect.trigger()->id();
new dbc_proc_callback_t( effect.player, effect );
}
// 1244238 driver
// 1259213 rppm driver
// 1259216 damage missile
// 1259218 damage
// 1259229 buff missile
// 1259230 buff
void devouring_banding( special_effect_t& effect )
{
auto proc_damage = effect.driver()->effectN( 1 ).average( effect );
struct seized_power_t : public generic_proc_t
{
std::unordered_map<stat_e, buff_t*> buffs;
seized_power_t( const special_effect_t& e, std::unordered_map<stat_e, buff_t*> map )
: generic_proc_t( e, "seized_power", 1259229 ), buffs( std::move( map ) )
{
quiet = true;
}
void impact( action_state_t* ) override
{
auto stat = util::highest_stat( player, secondary_ratings );
for ( auto [ s, b ] : buffs )
{
if ( s == stat )
b->trigger();
else
b->expire();
}
}
};
// 1259213 damage driver
// 1259216 missile
// 1259218 damage
struct devouring_bolt_t : public generic_proc_t
{
devouring_bolt_t( const special_effect_t& e ) : generic_proc_t( e, "devouring_bolt_missile", 1259216 )
{
dual = true;
impact_action = create_proc_action<generic_proc_t>( "devouring_bolt", e, data().effectN( 1 ).trigger() );
stats = impact_action->stats; // report the damage only
}
};
std::unordered_map<stat_e, buff_t*> buffs;
create_all_stat_buffs( effect, effect.player->find_spell( 1259230 ), 0, [ &buffs ]( stat_e s, buff_t* b ) {
buffs[ s ] = b;
} );
auto damage = create_proc_action<devouring_bolt_t>( "devouring_bolt_missile", effect );
damage->base_dd_min += proc_damage;
damage->base_dd_max += proc_damage;
// skip setup if callback has been created by already having another copy of the enchant
if ( find_special_effect( effect.player, effect.trigger()->id() ) )
return;
auto buff_action = create_proc_action<seized_power_t>( "seized_power", effect, buffs );
damage->base_multiplier *= role_mult( effect );
effect.spell_id = effect.trigger()->id();
// TODO: Can this proc off of self damage?
effect.player->callbacks.register_callback_trigger_function(
effect.spell_id, dbc_proc_callback_t::trigger_fn_type::CONDITION, []( auto, const auto&, player_t* t, auto, auto ) {
return t->is_enemy();
} );
effect.player->callbacks.register_callback_execute_function(
effect.spell_id, [ damage, buff_action ]( auto, auto, player_t* t, auto ) {
assert( t->is_enemy() );
damage->execute_on_target( t );
buff_action->execute_on_target( t );
} );
new dbc_proc_callback_t( effect.player, effect );
}
// 1259060 equip driver
// 1244243 rppm driver
// 1259061 buff
void blessed_pango_charm( special_effect_t& effect )
{
auto stat_amount = effect.driver()->effectN( 1 ).average( effect );
auto buff = create_buff<stat_buff_t>( effect.player, effect.player->find_spell( 1259061 ) )
->add_stat_from_effect_type( A_MOD_RATING, stat_amount );
// skip setup if callback has been created by already having another copy of the enchant
if ( find_special_effect( effect.player, effect.trigger()->id() ) )
return;
effect.spell_id = effect.trigger()->id();
effect.custom_buff = buff;
new dbc_proc_callback_t( effect.player, effect );
}
// 1244276 driver
// 1259124 rppm driver
// 1259127 heal coeff?
// 1259128 damage
// 1259130 heal
void primal_spore_binding( special_effect_t& effect )
{
effect.player->sim->error( UNVERIFIED_IMPLEMENTATION,
"Primal Spore Binding: What determines if you get a damage proc vs healing proc is unknown." );
auto damage_amount = effect.driver()->effectN( 1 ).average( effect );
auto heal_amount = effect.driver()->effectN( 2 ).average( effect );
auto damage = create_proc_action<generic_aoe_proc_t>( "primal_spore_explosion", effect, 1259128 );
damage->base_dd_min += damage_amount;
damage->base_dd_max += damage_amount;
auto heal =
create_proc_action<base_generic_aoe_proc_t<proc_heal_t>>( "primal_spore_explosion_heal", effect, 1259130 );
heal->base_dd_min += heal_amount;
heal->base_dd_max += heal_amount;
heal->name_str_reporting = "Heal";
// skip setup if callback has been created by already having another copy of the enchant
if ( find_special_effect( effect.player, effect.trigger()->id() ) )
return;
damage->base_multiplier *= role_mult( effect );
heal->base_multiplier *= role_mult( effect );
effect.spell_id = effect.trigger()->id();
effect.player->callbacks.register_callback_execute_function(
effect.spell_id, [ damage, heal ]( auto, auto, player_t* t, auto ) {
if ( t->is_enemy() )
damage->execute_on_target( t );
else
heal->execute_on_target( t );
} );
new dbc_proc_callback_t( effect.player, effect );
}
// 1251906 driver
// 1252383 rppm driver
// 1252389 dot
void prismatic_focusing_iris( special_effect_t& effect )
{
auto dot_damage = effect.driver()->effectN( 1 ).average( effect );
auto dot =
create_proc_action<generic_proc_t>( "prismatic_focusing_iris", effect, effect.trigger()->effectN( 1 ).trigger() );
dot->base_td += dot_damage;
// skip setup if callback has been created by already having another copy of the enchant
if ( find_special_effect( effect.player, effect.trigger()->id() ) )
return;
auto pct_per_gem = effect.driver()->effectN( 3 ).percent();
dot->base_td_multiplier *= 1.0 + ( pct_per_gem * unique_gem_list( effect.player, gem_colors ).size() );
// Feb 23 2026 - tank mod is not being applied in game
// dot->base_td_multiplier *= role_mult( effect );
dot->base_td_multiplier *= bandolier_mul( effect.player );
effect.spell_id = effect.trigger()->id();
effect.execute_action = dot;
new dbc_proc_callback_t( effect.player, effect );
}
// Thalassian Phoenix Torque
// 1251815 Driver
// 1251907 Damage
// 1251908 Heal
void thalassian_phoenix_torque( special_effect_t& effect )
{
auto pct_per_gem = effect.driver()->effectN( 2 ).percent();
auto damage = create_proc_action<generic_proc_t>( "phoenix_flames", effect, 1251907 );
damage->base_dd_min = damage->base_dd_max = effect.driver()->effectN( 1 ).average( effect );
damage->base_multiplier *= 1.0 + ( pct_per_gem * unique_gem_list( effect.player, gem_colors ).size() );
damage->base_multiplier *= role_mult( effect );
damage->base_multiplier *= bandolier_mul( effect.player );
auto heal = create_proc_action<generic_heal_t>( "phoenix_flames_heal", effect, 1251908 );
heal->name_str_reporting = "Heal";
heal->base_dd_min = heal->base_dd_max = effect.driver()->effectN( 2 ).average( effect );
heal->base_multiplier *= 1.0 + ( pct_per_gem * unique_gem_list( effect.player, gem_colors ).size() );
heal->base_multiplier *= role_mult( effect );
heal->base_multiplier *= bandolier_mul( effect.player );
effect.player->callbacks.register_callback_execute_function(
effect.spell_id, [ damage, heal ]( auto, auto, player_t* t, auto ) {
if ( t->is_enemy() )
damage->execute_on_target( t );
else
heal->execute_on_target( t );
} );
new dbc_proc_callback_t( effect.player, effect );
}
// Signet of Azerothian Blessings
// 1251902 Driver
// 1252202 Buff
void signet_of_azerothian_blessings( special_effect_t& effect )
{
auto base_value = effect.driver()->effectN( 1 ).average( effect );
std::unordered_map<stat_e, double> values = { { STAT_HASTE_RATING, 1.0 },
{ STAT_CRIT_RATING, 1.0 },
{ STAT_MASTERY_RATING, 1.0 },
{ STAT_VERSATILITY_RATING, 1.0 } };
std::unordered_map<stat_e, gem_color_e> gems = { { STAT_HASTE_RATING, GEM_PERIDOT },
{ STAT_CRIT_RATING, GEM_GARNET },
{ STAT_MASTERY_RATING, GEM_AMETHYST },
{ STAT_VERSATILITY_RATING, GEM_LAPIS } };
auto buff = create_buff<stat_buff_t>( effect.player, effect.driver()->effectN( 1 ).trigger() );
for ( auto stat : secondary_ratings )
{
int count = 0;
for( auto gem : equipped_gem_list( effect.player, gem_colors ) )
if ( gem == gems.at( stat ) )
count++;
values.at( stat ) =
base_value * ( 1.0 + count * effect.driver()->effectN( 2 ).percent() ) * bandolier_mul( effect.player );
buff->add_stat( stat, values.at( stat ) );
}
effect.custom_buff = buff;
new dbc_proc_callback_t( effect.player, effect );
}
// Loa Worshiper's Band
// 1251904 Driver
// 1252524 Capybara Buff - Always Available
// 1257183 Nalorakk Buff - Garnet
// 1252832 Nalorakk Periodic Trigger - Garnet
// 1252814 Halazzi Damage - Amethyst
// 1252817 Janalai Damage - Lapis
// 1252818 Akilzon Buff - Peridot
// TODO: Does bandolier do anything special for this?
void loa_worshipers_band( special_effect_t& effect )
{
enum loa_e : unsigned
{
LOA_CAPYBARA,
LOA_NALORAKK,
LOA_HALAZZI,
LOA_JANALAI,
LOA_AKILZON,
LOA_MAX
};
struct loa_worshipers_band_cb_t final : public dbc_proc_callback_t
{
buff_t* capybara;
buff_t* nalorakk;
action_t* halazzi;
action_t* janalai;
buff_t* akilzon;
std::vector<loa_e> loas;
loa_worshipers_band_cb_t( const special_effect_t& e )
: dbc_proc_callback_t( e.player, e ),
capybara( nullptr ),
nalorakk( nullptr ),
halazzi( nullptr ),
janalai( nullptr ),
akilzon( nullptr )
{
// Capybara is always available, even with no gems socketed.
loas.push_back( LOA_CAPYBARA );
double capy_value = effect.driver()->effectN( 2 ).average( effect );
capy_value *= bandolier_mul( effect.player );
capybara = create_buff<stat_buff_t>( e.player, e.player->find_spell( 1252524 ) )
->add_stat_from_effect_type( A_MOD_STAT, capy_value );
if ( range::contains( unique_gem_list( e.player, gem_colors ), GEM_GARNET ) )
{
loas.push_back( LOA_NALORAKK );
auto periodic_spell = e.player->find_spell( 1252832 );
auto nalorakk_spell = periodic_spell->effectN( 1 ).trigger();
double nalo_value = nalorakk_spell->effectN( 1 ).average( e );
nalo_value *= bandolier_mul( effect.player );
auto nalorakk_stat = create_buff<stat_buff_t>( e.player, "nalorakks_call_to_war_crit", nalorakk_spell )
->set_stat_from_effect_type( A_MOD_RATING, nalo_value )
->set_name_reporting( "Crit" );
nalorakk = create_buff<buff_t>( e.player, periodic_spell )
->set_tick_callback( [ nalorakk_stat ]( buff_t*, int, timespan_t ) {
nalorakk_stat->trigger();
} );
}
if ( range::contains( unique_gem_list( e.player, gem_colors ), GEM_AMETHYST ) )
{
loas.push_back( LOA_HALAZZI );
double halazzi_value = effect.driver()->effectN( 3 ).average( effect );
halazzi_value *= bandolier_mul( effect.player );
halazzi = create_proc_action<generic_proc_t>( "claws_of_halazzi", e, 1252814 );
halazzi->base_dd_min = halazzi->base_dd_max = halazzi_value;
// halazzi->base_multiplier *= role_mult( e ); - Role Mult currently not applied to Loa Worshiper's Band
}
if ( range::contains( unique_gem_list( e.player, gem_colors ), GEM_LAPIS ) )
{
loas.push_back( LOA_JANALAI );
double janalai_value = effect.driver()->effectN( 4 ).average( effect );
janalai_value *= bandolier_mul( effect.player );
janalai = create_proc_action<generic_proc_t>( "janalais_flames", e, 1252817 );
janalai->base_dd_min = janalai->base_dd_max = janalai_value;
janalai->aoe = -1;
// janalai->base_multiplier *= role_mult( e ); - Role Mult currently not applied to Loa Worshiper's Band
}
if ( range::contains( unique_gem_list( e.player, gem_colors ), GEM_PERIDOT ) )
{
loas.push_back( LOA_AKILZON );
const spell_data_t* akilzon_spell = e.player->find_spell( 1252818 );
double akilzon_value = akilzon_spell->effectN( 1 ).average( e );
akilzon_value *= bandolier_mul( effect.player );
// Akilzon buff has the values in the buff itself.
akilzon = create_buff<stat_buff_t>( e.player, akilzon_spell )
->add_stat_from_effect( 1, akilzon_value );
}
}
void execute( const spell_data_t*, player_t* t, action_state_t* ) override
{
auto loa = rng().range( loas );
switch (loa)
{
case LOA_CAPYBARA:
capybara->trigger();
break;
case LOA_NALORAKK:
nalorakk->trigger();
break;
case LOA_HALAZZI:
halazzi->execute_on_target( t );
break;
case LOA_JANALAI:
janalai->execute_on_target( t );
break;
case LOA_AKILZON:
akilzon->trigger();
break;
default:
break;
}
}
};
new loa_worshipers_band_cb_t( effect );
}
// 1261968 driver
// 1262512 rppm
// 1262515 damage
// 1262513 heal
void b0p_curator_of_booms( special_effect_t& effect )
{
effect.player->sim->error( UNVERIFIED_IMPLEMENTATION,
"B0P Curator of Booms: Implemented assuming procs on enemies will only fire damaging bombs, "
"and procs on allies will only fire healing bombs. Each proc will randomly do 20%-100% of maximum amount. "
"This has not be verified in-game." );
auto damage_eff = effect.driver()->effectN( 2 );
auto heal_eff = effect.driver()->effectN( 3 );
auto max_bombs = as<int>( effect.driver()->effectN( 1 ).base_value() );
auto damage = create_proc_action<generic_proc_t>( "big_boom", effect, damage_eff.trigger() );
damage->base_dd_min += damage_eff.average( effect );
damage->base_dd_max += damage_eff.average( effect );
auto heal = create_proc_action<generic_heal_t>( "big_boom_heal", effect, heal_eff.trigger() );
heal->name_str_reporting = "Heal";
heal->base_dd_min += heal_eff.average( effect );
heal->base_dd_max += heal_eff.average( effect );
// skip setup if callback has been created by already having another copy of the embellishment
if ( find_special_effect( effect.player, effect.trigger()->id() ) )
return;
effect.spell_id = effect.trigger()->id();
effect.player->callbacks.register_callback_execute_function(
effect.spell_id, [ damage, heal, max_bombs ]( const dbc_proc_callback_t* cb, auto, player_t* t, auto ) {
auto _bombs = cb->rng().range( max_bombs ) + 1;
auto _mul = as<double>( _bombs ) / max_bombs;
cb->listener->sim->print_debug( "{} launching {} BIG BOMBS", *cb->listener, _bombs );
if ( t->is_enemy() )
{
auto orig_mul = damage->base_multiplier;
damage->base_multiplier *= _mul;
damage->execute_on_target( t );
damage->base_multiplier = orig_mul;
}
else
{
auto orig_mul = heal->base_multiplier;
heal->base_multiplier *= _mul;
heal->execute_on_target( t );
heal->base_multiplier = orig_mul;
}
} );
new dbc_proc_callback_t( effect.player, effect );
}
// 1246309 on-use
// 1279407 damage
void b1p_scorcher_of_souls( special_effect_t& effect )
{
struct b1p_scorcher_of_souls_t : public generic_proc_t
{
b1p_scorcher_of_souls_t( const special_effect_t& e ) : generic_proc_t( e, "b1p_scorcher_of_souls", e.driver() )
{
// no split or increase # target so use generic_proc_t with aoe = -1
tick_action = create_proc_action<generic_proc_t>( "b1p_scorcher_of_souls_tick", e, e.trigger() );
tick_action->aoe = -1;
}