/
bg2fp_effect_batches.tpa
1361 lines (1225 loc) · 71.9 KB
/
bg2fp_effect_batches.tpa
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
///// \\\\\
///// elven sleep/charm resistance \\\\\
///// \\\\\
DEFINE_PATCH_FUNCTION cd_elven_sleep_charm_resistance BEGIN
READ_ASCII 0x00 sig (3)
SET abil_length = 0
PATCH_IF ("%sig%" STRING_COMPARE_CASE "ITM" = 0) BEGIN
SET abil_length = 0x38
END ELSE
PATCH_IF ("%sig%" STRING_COMPARE_CASE "SPL" = 0) BEGIN
SET abil_length = 0x28
END
PATCH_IF abil_length = 0 BEGIN
PATCH_WARN ~WARNING: file type not recognized on %SOURCE_FILE% for cd_elven_sleep_charm_resistance macro.~
END ELSE BEGIN
READ_LONG 0x64 abil_off ELSE 0
READ_SHORT 0x68 abil_num ELSE 0
READ_LONG 0x6a fx_off ELSE 0
SET fx_delta = 0
FOR (index = 0 ; index < abil_num ; ++index) BEGIN // start iterating through abilities
READ_SHORT (abil_off + 0x1e + (abil_length * index)) abil_fx_num
WRITE_SHORT (abil_off + 0x20 + (abil_length * index)) THIS + fx_delta
READ_SHORT (abil_off + 0x20 + (abil_length * index)) abil_fx_idx
SET patch_sleep = 0
SET patch_charm = 0
FOR (index2 = 0 ; index2 < abil_fx_num ; ++index2) BEGIN
READ_SHORT (fx_off + (0x30 * (abil_fx_idx + index2))) opcode
PATCH_IF (((opcode = 39) AND (patch_sleep = 0)) OR ((opcode = 5) AND (patch_charm = 0))) BEGIN // if there's a sleep or charm opcode that hasn't been patched already
READ_BYTE (fx_off + 0x02 + (0x30 * (abil_fx_idx + index2))) target
READ_BYTE (fx_off + 0x12 + (0x30 * (abil_fx_idx + index2))) prob1
READ_BYTE (fx_off + 0x13 + (0x30 * (abil_fx_idx + index2))) prob2
PATCH_IF (opcode = 5) BEGIN // if charm
SET new_fx = 16
SPRINT eff_file cdelfcm
SET patch_charm = 1
END ELSE BEGIN // sleep
SET new_fx = 8
SPRINT eff_file cdelfsl
SET patch_sleep = 1
END
PATCH_IF prob1 > 99 BEGIN SET prob1 = 99 END // prob1's ceiling is actually 99, not 100
PATCH_FOR_EACH race IN 2 3 BEGIN
SET prob1_new = ((((((prob1 + 1) - prob2) * (21 - (race * 6))) / 10) + prob2) - 1) // 90/30% of original, +1/-1 to signify the bounds are inclusive
FOR (index3 = 0 ; index3 < ((new_fx / 2)) ; ++index3) BEGIN
INSERT_BYTES (fx_off + (0x30 * abil_fx_idx)) 0x30 // insert new effect
WRITE_SHORT (fx_off + (0x30 * abil_fx_idx)) 177 // use eff file
WRITE_BYTE (fx_off + 0x02 + (0x30 * abil_fx_idx)) target // preserve target
WRITE_LONG (fx_off + 0x04 + (0x30 * abil_fx_idx)) race // elf or half elf
WRITE_LONG (fx_off + 0x08 + (0x30 * abil_fx_idx)) 4 // from race.ids
WRITE_BYTE (fx_off + 0x12 + (0x30 * abil_fx_idx)) prob1_new // calculated above
WRITE_BYTE (fx_off + 0x13 + (0x30 * abil_fx_idx)) prob2 // base prob
WRITE_ASCIIE (fx_off + 0x14 + (0x30 * abil_fx_idx)) ~%eff_file%%index3%~ // eff file
END
END
SET fx_delta += new_fx
SET index2 += new_fx
SET abil_fx_num += new_fx
END
END
WRITE_SHORT (abil_off + 0x1e + (abil_length * index)) abil_fx_num
END
END
END
///// \\\\\
///// arrays for batch effects \\\\\
///// \\\\\
/*
The cd_apply_batch function, defined below, requires a macro name. That macro needs to define
three arrays for the function:
* cd_immunity_batches_key
If any effect in this array is present on the item/creature/spell being patches, it will proceed with
adding extra effects and deleting effects, as defined by the next two arrays. If you have mutiple
effects defined here, it will match any of them and add any missing.
* cd_immunity_batches_extras
This array contains all of the subsiduary effects that should accompany the effects in the key area.
* cd_immunity_batches_deletes
If a key is found, any effect matching this array will be deleted.
If a key is found, the function will then proceed back through the file being patched and add--if they
are not present--all of the effects not found in the _key and _extras arrays. It will also, only with
a key effect matched, delete any effects listed in the _deletes array.
Note that since it's a macro, you can conditionally define your arrays. The free action batch will
remove stun immunity unless a particular component from the Fixpack is installed, for example. Remember
that's it's being run in a patch context, so you'll need to use PATCH actions instead of ACTIONs.
An example use--the cd_full_dispel_arrays uses a dispel magic opcode (58) as the lone key element. If
found, the function will delete a variety of old item removal opcodes defined in the _deletes array,
and add (if not already present) the series of effects that cure feeblemind and deafness.
In general, try to avoid explicit spell blockages with 206 opcodes. If you can block the relevant
effects with other immunities, do so, as it's a more robust and extensible solution. In some cases
they are needed --e.g. the slow immunity batch blocks slow spells outright, as most come paired
with AC and THAC0 penalties which can't be blocked via opcode without serious collateral damage.
* Format of all arrays are opcode, parameter1, parameter2, resref, timing, duration
* Timing and duration are only used for new fx writes
* Use -1 in a field (or "same" in string fields) if the match value for that field doesn't matter.
* Always map the effect to zero.
*/
// free action should always be supplemented by other macros to supplement the basic immunities it adds
// unlike other batches, do *not* use this one in a regexp--it'll turn a small web immunity into fullblown FA.
DEFINE_PATCH_MACRO ~cd_immunity_free_action_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 16, "same", "-10", "-10", "same" => 1 // immunity to haste
101, "-10", 40, "same", "-10", "-10", "same" => 1 // immunity to slow
101, "-10", 109, "same", "-10", "-10", "same" => 1 // immunity to paralyzation
101, "-10", 126, "same", "-10", "-10", "last" => 1 // immunity to movement rate bonus
101, "-10", 154, "same", "-10", "-10", "same" => 1 // immunity to entangle
101, "-10", 157, "same", "-10", "-10", "same" => 1 // immunity to web
101, "-10", 158, "same", "-10", "-10", "same" => 1 // immunity to grease
101, "-10", 175, "same", "-10", "-10", "same" => 1 // immunity to hold
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
46, "-10", "-10", "same", 1, 0, "same" => 1 // unstun
162, "-10", "-10", "same", 1, 0, "same" => 1 // remove paralysis
163, "-10", "-10", "same", 1, 0, "same" => 1 // free action
126, 100, 2, "same", "-10", "-10", "first" => 1 // set movement rate to 100%
// 206, "-1", "-10", "spcl522", "-10", "-10", "same" => 1 // immunity to defensive spin (no longer needed now that DS uses op 176)
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
142, "-10", 19, "same", "-10", "-10", "same" => 1 // free action icon
240, "-10", 13, "same", "-10", "-10", "same" => 1 // remove held icon
240, "-10", 38, "same", "-10", "-10", "same" => 1 // remove haste icon
240, "-10", 41, "same", "-10", "-10", "same" => 1 // remove slow icon
240, "-10", 55, "same", "-10", "-10", "same" => 1 // remove stun icon
240, "-10", 129, "same", "-10", "-10", "same" => 1 // remove web icon
240, "-10", 144, "same", "-10", "-10", "same" => 1 // remove entangled icon
240, "-10", 145, "same", "-10", "-10", "same" => 1 // remove grease icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN
101, "-10", 185, "same", "-10", "-10", "same" => 1 // immunity to 'special' hold
END
PATCH_IF ((MOD_IS_INSTALLED ~BG2FIXPACK/SETUP-BG2FIXPACK.TP2~ ~114~) OR (bonus_var_1 = 1)) BEGIN // obc: free action protects against stun
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 45, "same", "-10", "-10", "same" => 1 // immunity to stun
END
END ELSE BEGIN // otherwise nuke stun stuff
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN
101, "-10", 45, "same", "-10", "-10", "same" => 1 // stun immunity
101, "-10", 210, "same", "-10", "-10", "same" => 1 // pw: stun immunity
169, "-10", 55, "same", "-10", "-10", "same" => 1 // prevent stun icon
267, 1280, "-10", "same", "-10", "-10", "same" => 1 // prevent stunned string
267, 14043, "-10", "same", "-10", "-10", "same" => 1 // prevent stun string
END
END
END
// turns entangle immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_entangle_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 154, "same", "-10", "-10", "same" => 1 // immunity to entangle
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
206, "-1", "-10", "spin688", "-10", "-10", "same" => 1 // protection from spell, plant growth
206, "-1", "-10", "sppr105", "-10", "-10", "same" => 1 // protection from spell, entangle
206, "-1", "-10", "spwm111", "-10", "-10", "same" => 1 // protection from spell, plant growth
206, "-1", "-10", "cdhgnya1", "-10", "-10", "same" => 1 // protection from spell, nyalee
206, "-1", "-10", "cdmound", "-10", "-10", "same" => 1 // protection from spell, shambling mound
206, "-1", "-10", "cdsw1h58", "-10", "-10", "same" => 1 // protection from spell, ss of mask
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 144, "same", "-10", "-10", "same" => 1 // prevent entangled icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns grease immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_grease_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 158, "same", "-10", "-10", "same" => 1 // immunity to grease
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN END // nothing w/o cosmetic
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 145, "same", "-10", "-10", "same" => 1 // prevent grease icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns slow immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_slow_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 40, "same", "-10", "-10", "same" => 1 // immunity to slow
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
206, "-1", "-10", "spwm164", "-10", "-10", "same" => 1 // protection from spell, slow
206, "-1", "-10", "spin977", "-10", "-10", "same" => 1 // protection from spell, golem slow
206, "-1", "-10", "spin983", "-10", "-10", "same" => 1 // protection from spell, slow
206, "-1", "-10", "spwish25", "-10", "-10", "same" => 1 // protection from spell, slow
206, "-1", "-10", "spwi312", "-10", "-10", "same" => 1 // protection from spell, slow
206, "-1", "-10", "spin575", "-10", "-10", "same" => 1 // protection from spell, vortex web
267, 14000, "-10", "same", "-10", "-10", "same" => 1 // protection from string "slow"
267, 14668, "-10", "same", "-10", "-10", "same" => 1 // protection from string "slowed"
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 41, "same", "-10", "-10", "same" => 1 // prevent slow icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns confusion immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_confusion_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 128, "same", "-10", "-10", "same" => 1 // immunity to confusion
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
296, "-10", "-10", "spconfus", "-10", "-10", "same" => 1 // confusion visuals
267, 14782, "-10", "same", "-10", "-10", "same" => 1 // protection from string "confused"
267, 14791, "-10", "same", "-10", "-10", "same" => 1 // protection from string "Rigid Thinking"
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 2, "same", "-10", "-10", "same" => 1 // prevent rigid thinking icon
169, "-10", 3, "same", "-10", "-10", "same" => 1 // prevent confused icon
169, "-10", 47, "same", "-10", "-10", "same" => 1 // prevent chaos icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns level drain immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_level_drain_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 216, "same", "-10", "-10", "same" => 1 // immunity to level drain
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 41495, "-10", "same", "-10", "-10", "same" => 1 // protection from string "one level drained"
267, 40968, "-10", "same", "-10", "-10", "same" => 1 // protection from string "two levels drained"
267, 40969, "-10", "same", "-10", "-10", "same" => 1 // protection from string "three levels drained"
267, 40979, "-10", "same", "-10", "-10", "same" => 1 // protection from string "four levels drained"
267, 41616, "-10", "same", "-10", "-10", "same" => 1 // protection from string "five levels drained"
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 59, "same", "-10", "-10", "same" => 1 // prevent level drain icon
142, "-10", 90, "same", "-10", "-10", "same" => 1 // display npp icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns special-hold immunity into all-hold immunity
// should run cd_immunity_hold_arrays after this
DEFINE_PATCH_MACRO ~cd_immunity_hold_special_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 185, "same", "-10", "-10", "same" => 1 // immunity to 'special' hold
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
101, "-10", 109, "same", "-10", "-10", "same" => 1 // immunity to paralyzation
101, "-10", 175, "same", "-10", "-10", "same" => 1 // immunity to hold
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns hold immunity into full immunity
// should run cd_immunity_hold_special_arrays before this
DEFINE_PATCH_MACRO ~cd_immunity_hold_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 109, "same", "-10", "-10", "same" => 1 // immunity to paralyzation
101, "-10", 175, "same", "-10", "-10", "same" => 1 // immunity to hold
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 14102, "-10", "same", "-10", "-10", "same" => 1 // protection from string "held"
296, "-10", "-10", "spmindat", "-10", "-10", "same" => 1 // protection from animation
296, "-10", "-10", "spflayer", "-10", "-10", "same" => 1 // protection from animation
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 13, "same", "-10", "-10", "same" => 1 // prevent hold icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns fear immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_fear_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN // these three go last so they don't block their own extras effects
101, "-10", 23, "same", "-10", "-10", "last" => 1 // immunity to reset morale
101, "-10", 24, "same", "-10", "-10", "last" => 1 // immunity to horror
101, "-10", 106, "same", "-10", "-10", "last" => 1 // immunity to morale break modifier
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
23, "-10", "-10", "same", 1, 0, "first" => 1 // reset morale
161, "-10", "-10", "same", 1, 0, "same" => 1 // remove fear
267, 14007, "-10", "same", "-10", "-10", "same" => 1 // protection from string "panic"
267, 17427, "-10", "same", "-10", "-10", "same" => 1 // protection from string "panic"
296, "-10", "-10", "cdhorror", "-10", "-10", "same" => 1 // protection from animation
106, 1, 1, "same", 1, 0, "first" => 1 // morale break
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 36, "same", "-10", "-10", "same" => 1 // prevent panic icon
240, "-10", 36, "same", "-10", "-10", "same" => 1 // remove panic icon
142, "-10", 37, "same", "-10", "-10", "same" => 1 // display resist fear icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns charm immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_charm_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 5, "same", "-10", "-10", "same" => 1 // immunity to charm
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 8364, "-10", "same", "-10", "-10", "same" => 1 // protection from string "dominated"
267, 14672, "-10", "same", "-10", "-10", "same" => 1 // protection from string "charmed"
267, 14780, "-10", "same", "-10", "-10", "same" => 1 // protection from string "dire charmed"
296, "-10", "-10", "spnwchrm", "-10", "-10", "same" => 1 // protection from animation
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 0, "same", "-10", "-10", "same" => 1 // prevent charm icon
169, "-10", 1, "same", "-10", "-10", "same" => 1 // prevent dire charm icon
169, "-10", 43, "same", "-10", "-10", "same" => 1 // prevent domination icon
142, "-10", 52, "same", "-10", "-10", "same" => 1 // display mind shield icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns haste immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_haste_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 16, "same", "-10", "-10", "same" => 1 // immunity to haste
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 14023, "-10", "same", "-10", "-10", "same" => 1 // protection from string "hasted"
206, 0, "-10", "spin572", "-10", "-10", "same" => 1 // protection from spell, haste
206, 0, "-10", "spin828", "-10", "-10", "same" => 1 // protection from spell, haste
206, 0, "-10", "spra301", "-10", "-10", "same" => 1 // protection from spell, haste
206, 0, "-10", "spwi305", "-10", "-10", "same" => 1 // protection from spell, haste
// explicit blocking of imp haste (spwi613) not needed as its relevant effects are blocked with other immunities in the batch
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 38, "same", "-10", "-10", "same" => 1 // prevent haste icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns disease immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_disease_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 78, "same", "-10", "-10", "same" => 1 // immunity to disease
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 39752, "-10", "same", "-10", "-10", "same" => 1 // protection from string "stricken by a foul disease"
267, 54337, "-10", "same", "-10", "-10", "same" => 1 // protection from string "diseased"
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 7, "same", "-10", "-10", "same" => 1 // prevent diseased icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns poison immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_poison_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 25, "same", "-10", "-10", "same" => 1 // immunity to poison
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 14662, "-10", "same", "-10", "-10", "same" => 1 // protection from string "poisoned"
267, 14017, "-10", "same", "-10", "-10", "same" => 1 // protection from string "poison"
206, "-1", "-10", "spin673", "-10", "-10", "same" => 1 // protection from spell, cloudkill (via spore)
206, "-1", "-10", "spwi016", "-10", "-10", "same" => 1 // protection from spell, cloudkill (via trap)
206, "-1", "-10", "spwi502", "-10", "-10", "same" => 1 // protection from spell, cloudkill (via arcane magic)
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 6, "same", "-10", "-10", "same" => 1 // prevent poison icon
169, "-10", 137, "same", "-10", "-10", "same" => 1 // prevent bleeding icon
142, "-10", 30, "same", "-10", "-10", "same" => 1 // display protection from poison icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns poison resistance (immunity to both disease damage and poison damage) immunity into full immunity
// must run this with all_or set to all
DEFINE_PATCH_MACRO ~cd_immunity_poison_resistance_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 78, "same", "-10", "-10", "same" => 1 // immunity to disease
101, "-10", 25, "same", "-10", "-10", "same" => 1 // immunity to poison
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
173, 100, 0, "same", "-10", "-10", "same" => 1 // 100% reduced damage from poison
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns web immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_web_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 157, "same", "-10", "-10", "same" => 1 // immunity to web
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 14102, "-10", "same", "-10", "-10", "same" => 1 // protection from string "held"
101, "-10", 109, "same", "-10", "-10", "last" => 1 // immunity to paralyze
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 129, "same", "-10", "-10", "same" => 1 // prevent webbed icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns spell level immunities into full immunities (level 1)
DEFINE_PATCH_MACRO ~cd_immunity_spell_level_1_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
102, 1, "-10", "same", "-10", "-10", "same" => 1 // immunity to spell level 1
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
206, "-1", "-10", "sppr105", "-10", "-10", "same" => 1 // protection from spell
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns spell level immunities into full immunities (level 2)
DEFINE_PATCH_MACRO ~cd_immunity_spell_level_2_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
102, 2, "-10", "same", "-10", "-10", "same" => 1 // immunity to spell level 2
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
206, "-1", "-10", "spwi215", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spwi213", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "sppr211", "-10", "-10", "same" => 1 // protection from spell
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns spell level immunities into full immunities (level 3)
DEFINE_PATCH_MACRO ~cd_immunity_spell_level_3_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
102, 3, "-10", "same", "-10", "-10", "same" => 1 // immunity to spell level 3
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
206, "-1", "-10", "spwi312", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spwi313", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "sppr314", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "sppr313", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "sppr304", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "sppr302", "-10", "-10", "same" => 1 // protection from spell
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns spell level immunities into full immunities (level 4)
DEFINE_PATCH_MACRO ~cd_immunity_spell_level_4_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
102, 4, "-10", "same", "-10", "-10", "same" => 1 // immunity to spell level 4
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN END // nothing here yet
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns spell level immunities into full immunities (level 5)
DEFINE_PATCH_MACRO ~cd_immunity_spell_level_5_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
102, 5, "-10", "same", "-10", "-10", "same" => 1 // immunity to spell level 5
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
206, "-1", "-10", "spwi502", "-10", "-10", "same" => 1 // protection from spell
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns spell level immunities into full immunities (level 6)
DEFINE_PATCH_MACRO ~cd_immunity_spell_level_6_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
102, 6, "-10", "same", "-10", "-10", "same" => 1 // immunity to spell level 6
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
206, "-1", "-10", "spwi614", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "sppr603d", "-10", "-10", "same" => 1 // protection from spell
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns spell level immunities into full immunities (level 7)
DEFINE_PATCH_MACRO ~cd_immunity_spell_level_7_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
102, 7, "-10", "same", "-10", "-10", "same" => 1 // immunity to spell level 7
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
206, "-1", "-10", "spwi712", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "sppr725d", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "sppr719", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "sppr718", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "sppr706", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "sppr705", "-10", "-10", "same" => 1 // protection from spell
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns spell level immunities into full immunities (level 8)
DEFINE_PATCH_MACRO ~cd_immunity_spell_level_8_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
102, 8, "-10", "same", "-10", "-10", "same" => 1 // immunity to spell level 8
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
206, "-1", "-10", "spwi817", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spwi816", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spwi811", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spwi810", "-10", "-10", "same" => 1 // protection from spell
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns spell level immunities into full immunities (level 9)
DEFINE_PATCH_MACRO ~cd_immunity_spell_level_9_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
102, 9, "-10", "same", "-10", "-10", "same" => 1 // immunity to spell level 9
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
206, "-1", "-10", "spwish35", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spwish32", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spwish27", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spwish25", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spwi911", "-10", "-10", "same" => 1 // protection from spell
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns blind effect into full blindness
// always needs to be run in tandem with cd_full_blindness_eff_arrays
DEFINE_PATCH_MACRO ~cd_full_blindness_opcode_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
74, "-10", "-10", "same", "-10", "-10", "same" => 1 // blindness
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
139, 14674, "-10", "same", 1, 0, "same" => 1 // display 'blinded' string
142, "-10", 8, "same", "-10", "-10", "same" => 1 // display 'blinded' icon
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN // alternate blinded strings, trying to consolidate on one
139, 14071, "-10", "same", 1, 0, "same" => 1 // display 'blindness' string
139, 1474, "-10", "same", 1, 0, "same" => 1 // display 'blindness' string
139, 12015, "-10", "same", 1, 0, "same" => 1 // display 'blindness' string
139, 12948, "-10", "same", 1, 0, "same" => 1 // display 'blindness' string
139, 13017, "-10", "same", 1, 0, "same" => 1 // display 'blindness' string
139, 17399, "-10", "same", 1, 0, "same" => 1 // display 'blindness' string
END
END
// turns blind effect into full blindness
// always needs to be run in tandem with cd_full_blindness_opcode_arrays
DEFINE_PATCH_MACRO ~cd_full_blindness_eff_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
177, "-10", "-10", "blind", "-10", "-10", "same" => 1 // blindness
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
177, "-10", "-10", "cdblind", "-10", "-10", "same" => 1 // blindness icon via eff
177, "-10", "-10", "cdblind1", "-10", "-10", "same" => 1 // blindness string via eff
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN // alternate blinded strings, trying to consolidate on one
139, 14071, "-10", "same", 1, 0, "same" => 1 // display 'blindness' string
139, 1474, "-10", "same", 1, 0, "same" => 1 // display 'blindness' string
139, 12015, "-10", "same", 1, 0, "same" => 1 // display 'blindness' string
139, 12948, "-10", "same", 1, 0, "same" => 1 // display 'blindness' string
139, 13017, "-10", "same", 1, 0, "same" => 1 // display 'blindness' string
139, 17399, "-10", "same", 1, 0, "same" => 1 // display 'blindness' string
END
END
// turns petrification immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_petrification_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 134, "same", "-10", "-10", "same" => 1 // immunity to petrification
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 14665, "-10", "same", "-10", "-10", "same" => 1 // disable string "petrified"
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns kill target immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_kill_target_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 13, "same", "-10", "-10", "same" => 1 // immunity to kill target
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 64285, "-10", "same", "-10", "-10", "same" => 1 // disable string "vorpal hit"
267, 14026, "-10", "same", "-10", "-10", "same" => 1 // disable string "death"
267, 10554, "-10", "same", "-10", "-10", "same" => 1 // disable string "undead destroyed"
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns invisibility immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_invisibility_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 20, "same", "-10", "-10", "same" => 1 // immunity to invisibility
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 14773, "-10", "same", "-10", "-10", "same" => 1 // disable string "invisible"
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns silence immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_silence_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 38, "same", "-10", "-10", "same" => 1 // immunity to silence
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 14002, "-10", "same", "-10", "-10", "same" => 1 // disable string "silence"
267, 14676, "-10", "same", "-10", "-10", "same" => 1 // disable string "silenced"
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 34, "same", "-10", "-10", "same" => 1 // prevent silenced icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns blindness immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_blindness_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 74, "same", "-10", "-10", "same" => 1 // immunity to blindness
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 14674, "-10", "same", "-10", "-10", "same" => 1 // disable string "blinded"
267, 1474, "-10", "same", "-10", "-10", "same" => 1 // disable string "blind"
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 8, "same", "-10", "-10", "same" => 1 // prevent blindness icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN // these alts don't appear to be used
/*
267, 1474, "-10", "same", "-10", "-10", "same" => 1 // disable string "blind"
267, 14071, "-10", "same", "-10", "-10", "same" => 1 // display 'blindness' string
267, 12015, "-10", "same", "-10", "-10", "same" => 1 // disable string "blind"
267, 12948, "-10", "same", "-10", "-10", "same" => 1 // disable string "blind"
267, 13017, "-10", "same", "-10", "-10", "same" => 1 // disable string "blind"
267, 17399, "-10", "same", "-10", "-10", "same" => 1 // disable string "blind"
*/
END // nothing to delete
END
// turns deafness immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_deafness_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 80, "same", "-10", "-10", "same" => 1 // immunity to deafneas
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 54318, "-10", "same", "-10", "-10", "same" => 1 // disable string "deaf"
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 112, "same", "-10", "-10", "same" => 1 // prevent deaf icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns slay immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_slay_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 55, "same", "-10", "-10", "same" => 1 // immunity to slay
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 51, "same", "-10", "-10", "same" => 1 // prevent dying icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns invisible detection immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_invisible_detection_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 116, "same", "-10", "-10", "same" => 1 // immunity to detect invisible
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 14109, "-10", "same", "-10", "-10", "same" => 1 // disable string "dispel invisible"
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns polymorph immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_polymorph_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 135, "same", "-10", "-10", "same" => 1 // immunity to polymorph
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
206, "-1", "-10", "spwi711", "-10", "-10", "same" => 1 // protection from spell, sphere of chaos
206, "-1", "-10", "spwi415", "-10", "-10", "same" => 1 // protection from spell, polymorph other
206, "-1", "-10", "spwm113", "-10", "-10", "same" => 1 // protection from spell, wild surge polymorph
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns sleep immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_sleep_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 39, "same", "-10", "-10", "same" => 1 // immunity to sleep
101, "-10", 217, "same", "-10", "-10", "same" => 1 // immunity to pw: sleep
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 14001, "-10", "same", "-10", "-10", "same" => 1 // disable string "sleep"
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 14, "same", "-10", "-10", "same" => 1 // prevent sleep icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns stun immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_stun_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 45, "same", "-10", "-10", "same" => 1 // immunity to stun
101, "-10", 210, "same", "-10", "-10", "same" => 1 // immunity to pw: stun
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
267, 1280, "-10", "same", "-10", "-10", "same" => 1 // disable string "stunned"
267, 14043, "-10", "same", "-10", "-10", "same" => 1 // disable string "stun"
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 55, "same", "-10", "-10", "same" => 1 // prevent stun icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns fear removal into full removal
DEFINE_PATCH_MACRO ~cd_fear_removal_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
161, "-10", "-10", "same", "-10", "-10", "same" => 1 // fear removal
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN END
PATCH_IF FILE_EXISTS_IN_GAME ~monkfist.2da~ BEGIN // ee game
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
321, "-10", "-10", "spin105", 1, 0, "same" => 1 // remove spell effects: horror, innate (removes visuals)
321, "-10", "-10", "spwi205", 1, 0, "same" => 1 // remove spell effects: horror, arcane (removes visuals)
END
END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
240, "-10", 36, "same", 1, 0, "same" => 1 // remove panic icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// turns feeblemind immunity into full immunity
DEFINE_PATCH_MACRO ~cd_immunity_feeblemind_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
101, "-10", 76, "same", "-10", "-10", "same" => 1 // immunity to stun
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN END
PATCH_IF cosmetic = 1 BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
169, "-10", 48, "same", "-10", "-10", "same" => 1 // prevent stun icon
END
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// round out dispel magic
DEFINE_PATCH_MACRO ~cd_full_dispel_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
58, "-10", "-10", "same", "-10", "-10", "same" => 1 // dispel magic opcode
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
177, 7, 7, "destself", "-10", "-10", "same" => 1 // destroy illusionary creatures
215, "-10", 1, "spdispma", 0, 1, "same" => 1 // show dispel visual effect
139, 14056, "-10", "same", "-10", "-10", "same" => 1 // display 'dispel effects' string
81, "-10", "-10", "same", "-10", "-10", "same" => 1 // cure deafness
77, "-10", "-10", "same", "-10", "-10", "same" => 1 // cure feeblemind
240, "-10", 112, "same", "-10", "-10", "same" => 1 // remove deafness icon
240, "-10", 48, "same", "-10", "-10", "same" => 1 // remove feeblemind icon
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN
177, 7, 7, "die" , "-10", "-10", "same" => 1 // handful of items (e.g. deva.itm) nuke illusionary creatures with die.eff instead of correct destself.eff
112, "-10", "-10", "chillt" , "-10", "-10", "same" => 1 // delete redundant magical weapon calls as
112, "-10", "-10", "critical", "-10", "-10", "same" => 1 // dispel already nukes the magical weapon slot)
112, "-10", "-10", "fblade" , "-10", "-10", "same" => 1
112, "-10", "-10", "ghoult" , "-10", "-10", "same" => 1
112, "-10", "-10", "harm" , "-10", "-10", "same" => 1
112, "-10", "-10", "hsword" , "-10", "-10", "same" => 1
112, "-10", "-10", "melfmet" , "-10", "-10", "same" => 1
112, "-10", "-10", "serious" , "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp" , "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp01", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp02", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp03", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp04", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp05", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp06", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp07", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp08", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp09", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp10", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp11", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp12", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp13", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp14", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp15", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp16", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp17", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp18", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp19", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp20", "-10", "-10", "same" => 1
112, "-10", "-10", "shammr" , "-10", "-10", "same" => 1
112, "-10", "-10", "shammr2" , "-10", "-10", "same" => 1
112, "-10", "-10", "shammr3" , "-10", "-10", "same" => 1
112, "-10", "-10", "shille" , "-10", "-10", "same" => 1
112, "-10", "-10", "slaylive", "-10", "-10", "same" => 1
112, "-10", "-10", "sorb" , "-10", "-10", "same" => 1
112, "-10", "-10", "stardart", "-10", "-10", "same" => 1
END
END
// round out dispel magic
DEFINE_PATCH_MACRO ~cd_full_dispel_novis_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
58, "-10", "-10", "same", "-10", "-10", "same" => 1 // dispel magic opcode
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN
177, 7, 7, "destself", "-10", "-10", "same" => 1 // destroy illusionary creatures
// 215, "-10", 1, "spdispma", 0, 1, "same" => 1 // show dispel visual effect
// 139, 14056, "-10", "same", "-10", "-10", "same" => 1 // display 'dispel effects' string
81, "-10", "-10", "same", "-10", "-10", "same" => 1 // cure deafness
77, "-10", "-10", "same", "-10", "-10", "same" => 1 // cure feeblemind
240, "-10", 112, "same", "-10", "-10", "same" => 1 // remove deafness icon
240, "-10", 48, "same", "-10", "-10", "same" => 1 // remove feeblemind icon
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN
177, 7, 7, "die" , "-10", "-10", "same" => 1 // handful of items (e.g. deva.itm) nuke illusionary creatures with die.eff instead of correct destself.eff
112, "-10", "-10", "chillt" , "-10", "-10", "same" => 1 // delete redundant magical weapon calls as
112, "-10", "-10", "critical", "-10", "-10", "same" => 1 // dispel already nukes the magical weapon slot)
112, "-10", "-10", "fblade" , "-10", "-10", "same" => 1
112, "-10", "-10", "ghoult" , "-10", "-10", "same" => 1
112, "-10", "-10", "harm" , "-10", "-10", "same" => 1
112, "-10", "-10", "hsword" , "-10", "-10", "same" => 1
112, "-10", "-10", "melfmet" , "-10", "-10", "same" => 1
112, "-10", "-10", "serious" , "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp" , "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp01", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp02", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp03", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp04", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp05", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp06", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp07", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp08", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp09", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp10", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp11", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp12", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp13", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp14", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp15", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp16", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp17", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp18", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp19", "-10", "-10", "same" => 1
112, "-10", "-10", "sgrasp20", "-10", "-10", "same" => 1
112, "-10", "-10", "shammr" , "-10", "-10", "same" => 1
112, "-10", "-10", "shammr2" , "-10", "-10", "same" => 1
112, "-10", "-10", "shammr3" , "-10", "-10", "same" => 1
112, "-10", "-10", "shille" , "-10", "-10", "same" => 1
112, "-10", "-10", "slaylive", "-10", "-10", "same" => 1
112, "-10", "-10", "sorb" , "-10", "-10", "same" => 1
112, "-10", "-10", "stardart", "-10", "-10", "same" => 1
END
END
// immunity to psionics - this one's a little special, since it'll pick up on an immunity to any psionic attack and
// extend it to *all* psionics. obviously, don't use this in a regexp
DEFINE_PATCH_MACRO ~cd_immunity_psionics_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
206, "-1", "-10", "spin542", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin543", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin544", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin545", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin546", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin547", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin774", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin775", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin804", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin834", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin909", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin910", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin911", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin912", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin959", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin974", "-10", "-10", "same" => 1 // protection from spell
206, "-1", "-10", "spin975", "-10", "-10", "same" => 1 // protection from spell
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// human transform array - clears out special abilities from all forms
DEFINE_PATCH_MACRO ~cd_spell_transformation_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN
172, "-10", "-10", "spin160", 1, 0, "same" => 3 // remove spell x3
172, "-10", "-10", "spinhum", 1, 0, "same" => 1 // remove spell
172, "-10", "-10", "spwi491", 1, 0, "same" => 1 // remove spell
172, "-10", "-10", "spin122", 1, 0, "same" => 1 // remove spell
172, "-10", "-10", "spin123", 1, 0, "same" => 1 // remove spell
172, "-10", "-10", "spin124", 1, 0, "same" => 1 // remove spell
END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_extras BEGIN END
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_delete BEGIN END // nothing to delete
END
// human transform array - clears out special abilities from all forms
DEFINE_PATCH_MACRO ~cd_spell_transformation_human_arrays~ BEGIN
DEFINE_ASSOCIATIVE_ARRAY cd_immunity_batches_key BEGIN