/
iwdee.tph
992 lines (850 loc) · 49.8 KB
/
iwdee.tph
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
///// \\\\\
///// string fixes \\\\\
///// \\\\\
ACTION_IF FILE_EXISTS ~eefixpack/languages/%LANGUAGE%/fixes_%game%.tph~ BEGIN
INCLUDE ~eefixpack/languages/%LANGUAGE%/fixes_%game%.tph~
END
///// \\\\\
///// lua fixes \\\\\
///// \\\\\
///// \\\\\
///// ids/2da fixes \\\\\
///// \\\\\
INCLUDE ~eefixpack/files/tph/a7/anim_3001.tph~ // fix missing creature animation definitions for Neothelid
INCLUDE ~eefixpack/files/tph/tbd_object_ids.tph~ // tbd, cam: missing/dupe entries in object.ids
INCLUDE ~eefixpack/files/tph/tbd_splprot_kitfix.tph~ // tbd, cam: fixing kit check to be a numerical equality check, not bitwise
// tbd, cam
// fixing missing starting equipment in HoW games for shaman, others
COPY ~eefixpack/files/2da/25stweap.2da~ ~override~
/*
luke
**splprot.2da**
- the newly added (v2.6) header descriptions are incorrect for the alignment rows
*/
WITH_SCOPE BEGIN
COPY_EXISTING "splprot.2da" "override"
COUNT_2DA_COLS "cols"
SET_2DA_ENTRY 33 0 "%cols%" "33_ALIGNMENTBITS=GOOD" // NOT BIT1 = Not NEUTRAL or EVIL
SET_2DA_ENTRY 34 0 "%cols%" "34_ALIGNMENTBITS!=GOOD" // HAS BIT1 = Is NEUTRAL or EVIL
SET_2DA_ENTRY 35 0 "%cols%" "35_ALIGNMENTBITS=NEUTRAL" // NOT BIT0 = Not GOOD or EVIL
SET_2DA_ENTRY 36 0 "%cols%" "36_ALIGNMENTBITS!=NEUTRAL" // HAS BIT0 = Is GOOD or EVIL
SET_2DA_ENTRY 37 0 "%cols%" "37_ALIGNMENTBITS=EVIL"
SET_2DA_ENTRY 38 0 "%cols%" "38_ALIGNMENTBITS!=EVIL"
SET_2DA_ENTRY 59 0 "%cols%" "59_ALIGNMENTBITS=LAWFUL" // NOT BIT5 = Not CHAOTIC or NEUTRAL
SET_2DA_ENTRY 60 0 "%cols%" "60_ALIGNMENTBITS!=LAWFUL" // HAS BIT5 = Is CHAOTIC or NEUTRAL
SET_2DA_ENTRY 61 0 "%cols%" "61_ALIGNMENTBITS=CHAOTIC"
SET_2DA_ENTRY 62 0 "%cols%" "62_ALIGNMENTBITS!=CHAOTIC"
SET_2DA_ENTRY 118 0 "%cols%" "118_ALIGNMENTBITS!=n" // Clearly state it is a bitwise check
// Formatting
PRETTY_PRINT_2DA
BUT_ONLY_IF_IT_CHANGES
END
// tbd, davidw
// 7 eyes (eye of the sword shouldn't protect against stunning damage, which is only used for the hp backlash of the Enrage ability)
// luke (EYEMAGE should not absorb MAGIC damage, as per spell description)
COPY_EXISTING ~7eyes.2da~ ~override~
REPLACE_TEXTUALLY "12\*0x8000000" "*"
REPLACE_TEXTUALLY EXACT_MATCH "12*0x400000" "*"
PRETTY_PRINT_2DA
INCLUDE ~eefixpack/files/tph/clswpbon.tpa~ // tbd, cam: fix non-prof penalties for shadowdancers, mage-thieves
// tbd, cam
// regression: add full oiwd soundsets for iwdee now that engine fully supports them
INCLUDE ~eefixpack/files/tph/iwdee_soundsets.tph~
CLEAR_IDS_MAP // reload ids, if we end up having any changes
///// \\\\\
///// mass copy/includes actions \\\\\
///// \\\\\
COPY ~eefixpack/files/bam/ixbow04.bam~ ~override~ // tbd, cam: fix light crossbow BAM
~eefixpack/files/bam/ixbow09.bam~ ~override~ // tbd, cam: fix HQ light crossbow BAM
~eefixpack/files/wav/#choke.wav~ ~override~ // ie-6009, cam: missing sound for talonite poison
~eefixpack/files/2da/clabmo02.2da~ ~override~ // tbd, cam: borked kit ability table, dark moon monk
~eefixpack/files/2da/clabmo03.2da~ ~override~ // tbd, cam: borked kit ability table, sun soul monk
~eefixpack/files/2da/spwi417.2da~ ~override~ // tbd, cam: allow enchant weapon to be cast via contingency
~eefixpack/files/bam/mdem~ ~override~ // tbd, sam.: merging four-frame animations to fix issues, demogorgon
~eefixpack/files/bam/mdr1~ ~override~ // tbd, sam.: merging four-frame animations to fix issues, dragon red
~eefixpack/files/bam/mdr2~ ~override~ // tbd, sam.: merging four-frame animations to fix issues, dragon black
~eefixpack/files/bam/mdr3~ ~override~ // tbd, sam.: merging four-frame animations to fix issues, dragon silver
~eefixpack/files/bam/mwdr~ ~override~ // tbd, sam.: merging four-frame animations to fix issues, dragon white
~eefixpack/files/bam/mwyv~ ~override~ // tbd, sam.: merging four-frame animations to fix issues, wyvern big
~eefixpack/files/bam/cmnk1inv.bam~ ~override~ // monk (tutorial, not pc) paperdoll
~eefixpack/files/2da/fogarea.2da~ ~override~ // tbd, cam: add basic 2das to enable fog
~eefixpack/files/2da/fogpt.2da~ ~override~ // tbd, cam: add basic 2das to enable fog
~eefixpack/files/bam/sppr314d.bam~ ~override~ // new unholy blight portrait icon
// tbd, sam.
// merging multi-part area animations to eliminate issues
ACTION_FOR_EACH file IN
1000ms1 1105ms1 1201ms2 1400t001 1400t002 1400t003 1400t004 1400t005 3001ms1 3601ms1
6013ms1 am0602c am0602d am0602k1 am0602k2 am0602l1 am0602l2 am0801b1 am0801b2 am0902l
am0902l1 am0902l2 am0902l3 am0902l4 am2000a am2000a1 am2000a2 am2000a3 am2000a4 am2000b
am2000b1 am2000b2 am2000b3 am2000b4 am2805b am2805c am414e11 am414e12
BEGIN
COPY ~eefixpack/files/bam/area_anim/%file%.bam~ ~override~
END
// there's another section of INCLUDEs at the bottom if it should be late in the process
INCLUDE ~eefixpack/files/tph/5943_mold_touch.tph~ // ie-5943 , cam: lots of mold touch fixes
INCLUDE ~eefixpack/files/tph/6018_lizardmen.tph~ // ie-6018 , cam: Summoned lizardmen lack visible weapons
INCLUDE ~eefixpack/files/tph/6020_bullets.tph~ // ie-6020 , cam: Bullets +1 and Bullets +2 use the same projectile
INCLUDE ~eefixpack/files/tph/6036_clostsbfbhnaeig.tph~ // ie-6036 , cam: Cam's List o' Stuff That Should Be Fixed But Has No Actual Effect In Game
INCLUDE ~eefixpack/files/tph/b3460_death_tyrant.tph~ // bgcs-3460, cam: death tyrant animation fixes
INCLUDE ~eefixpack/files/tph/b3397_revenant.tph~ // bgcs-3397, cam: revenant animation fixes
INCLUDE ~eefixpack/files/tph/tbd_extraplanar_tieflings.tph~ // tbd, cam: tieflings should not be included in effects that target 'outer' or 'extraplanars'
INCLUDE ~eefixpack/files/tph/tbd_iwdee_chargen.tph~ // tbd, cam: very specific circumstances can crash if starting HoW game
///// \\\\\
///// mechanics fixes / overhauls \\\\\
///// \\\\\
// kjeron
WITH_SCOPE BEGIN
WITH_TRA "eefixpack/languages/en_us/luke/polymorph_overhaul.tra" "eefixpack/languages/%LANGUAGE%/luke/polymorph_overhaul.tra" BEGIN
INCLUDE "eefixpack/files/tph/luke/polymorph_overhaul.tph"
LAF "POLYMORPH_OVERHAUL" END
END
END
/*
luke
"7eyes.2da" vs. SPL/ITM files
*/
WITH_SCOPE BEGIN
INCLUDE "eefixpack/files/tph/luke/7eyes/7eyes.tph"
LAUNCH_ACTION_FUNCTION "7EYES" END
END
/*
luke
**Wing Buffet vs. MR**
*/
WITH_SCOPE BEGIN
INCLUDE "eefixpack/files/tph/luke/wing_buffet_vs_mr.tph"
LAUNCH_ACTION_FUNCTION "WING_BUFFET_VS_MR" END
END
///// \\\\\
///// dialogue fixes \\\\\
///// \\\\\
COMPILE ~eefixpack/files/d/%game%_core_fixes.d~ // misc dialogue fixes
///// \\\\\
///// script fixes \\\\\
///// \\\\\
INCLUDE ~eefixpack/files/tph/tbd_iwd_locals_scripts.tph~ // tbd, cam - region/container scripts can't use LOCALS-scoped variables
// tbd, cam
// player ai checks if magical weapon present before casting shillelagh, but checks old resources
COPY ~scripts/cleric1.bs~ ~scripts/cleric1.bs~
DECOMPILE_AND_PATCH BEGIN
REPLACE_TEXTUALLY ~!HasItem("SGRASP",Myself)~ // shocking grasp just does direct damage in iwdee, no item
~!HasItem("bclaw",Myself) !HasItem("moonbla",Myself) !HasItem("smcudge",Myself)~ // change instead to druid spells: beast claw, moonblade, star metal cudgel
REPLACE_TEXTUALLY ~!HasItem("shille",Myself)~ ~!HasItem("shillel",Myself)~ // wrong resref for shillelagh
REPLACE_TEXTUALLY ~!HasItem("SHAMMR",Myself)~ ~!HasItem("shamme1",Myself) !HasItem("shamme2",Myself) !HasItem("shamme3",Myself)~ // wrong resrefs for spiritual hammer
REPLACE_TEXTUALLY ~!HasItem("chillt",Myself)~ ~!HasItem("ctouch",Myself)~ // wrong resref for chill touch
END
BUT_ONLY
// tbd, cam
// checking for ambients which don't exist
COPY_EXISTING ~eepoqct1.bcs~ ~override~
DECOMPILE_AND_PATCH BEGIN
REPLACE_TEXTUALLY ~AmbientActivate("1105MS1[0-7]",FALSE)~ ~~
END
BUT_ONLY
// ie-6015, cam
// Jorn should heal all fellow barbarians (allies are BARBARIAN_1 to 8, script checks 0-7)
COPY_EXISTING ~iljorn.bcs~ ~override~
DECOMPILE_AND_PATCH BEGIN
REPLACE_TEXTUALLY ~BARBARIAN_0~ ~BARBARIAN_8~
END
BUT_ONLY
// ie-6014, cam
// Loot should have charges: items from random treasure table with differing charges need to be re-added with charges
ACTION_DEFINE_ASSOCIATIVE_ARRAY cd_rndtres_charges BEGIN
wandtrp, 5, "Uligar" => ar2004 // orctres
arowtrn, 8, "Pileo'Stuff" => ar4003 // de3tres
trnbolt, 8, "Pileo'Stuff" => ar4003 // de3tres
boneam, 1, "SerratedSkeleton" => ar5003 // sh1tres
END
ACTION_PHP_EACH cd_rndtres_charges AS params => area BEGIN
EXTEND_BOTTOM ~%area%.bcs~ ~eefixpack/files/baf/rndtres_charges.baf~ EVALUATE_BUFFER
END
// ie-6006, cam
// Talonite Priests don't heal one another
COPY_EXISTING ~d2talon3.bcs~ ~override~
~d2talon4.bcs~ ~override~
DECOMPILE_AND_PATCH BEGIN
REPLACE_TEXTUALLY ~TalonitePriest[14]~ ~Talonite~
REPLACE_TEXTUALLY ~TalonitePriestess[23]~ ~Talonite~
END
BUT_ONLY
// tbd, cam
// potential softlock if party is split when yxunomei closes door as part of her ambush
COPY_EXISTING ~d5yxudor.bcs~ ~override~
DECOMPILE_AND_PATCH BEGIN
REPLACE_TEXTUALLY ~"LOCALS"~ ~"ar4005"~ // need area variable, not locals
REPLACE_TEXTUALLY ~!Global("SPRITE_IS_DEADYXUNOMEI","GLOBAL",0)~ ~CombatCounter(0) OpenState(Myself,FALSE) OR(2) !Global("SPRITE_IS_DEADYXUNOMEI","GLOBAL",0) GlobalTimerExpired("CDYxunDoor","ar4005")~
REPLACE_TEXTUALLY ~!Global("YXUN_ATTACK","MYAREA",0)~ ~!Global("YXUN_ATTACK","MYAREA",0) OpenState(Myself,TRUE)~
REPLACE_TEXTUALLY ~[ %TAB%]Lock(Myself)~ ~Lock(Myself) SetGlobalTimer("CDYxunDoor","ar4005",60)~
END
BUT_ONLY
///// \\\\\
///// area fixes \\\\\
///// \\\\\
// tbd, cam
// dupe random treasure, two containers overlay one another
COPY_EXISTING ~ar6006.are~ ~override~
LPF DELETE_AREA_ITEM STR_VAR item_to_delete = scrl6j END // delete items out of container being removed
LPF DELETE_AREA_ITEM STR_VAR item_to_delete = potn31 END
LPF fj_are_structure INT_VAR fj_delete_mode = 3 STR_VAR fj_structure_type = container END // delete container 4
LPF ALTER_AREA_ITEM STR_VAR match_item = rndtre57 item = scrl6j END // replace dupe random treasure with one of the items from the deleted container
LPF ADD_AREA_ITEM INT_VAR container_to_add_to = 1 STR_VAR item_to_add = potn31 END // re-add the second deleted item
BUT_ONLY
// ie-6016, cam
// Untrapped doors shouldn't show as trapped
COPY_EXISTING ~ar7000.are~ ~override~
LPF ALTER_AREA_DOOR INT_VAR flag_detectable = 0 STR_VAR door_name = AR7000Door1 END
BUT_ONLY
COPY_EXISTING ~ar7002.are~ ~override~
LPF ALTER_AREA_DOOR INT_VAR flag_detectable = 0 STR_VAR door_name = AR7002Door1 END
BUT_ONLY
// ie-6017, cam
// Wrong random treasures in HoW
COPY_EXISTING ~ar9200.are~ ~override~ // swap back the old extres4 dupe fix
LPF REPLACE_AREA_ITEM INT_VAR charges1 = 3 charges2 = 0 charges3 = 0 STR_VAR old_item = rndtre75 new_item = rndtre78 END // 3/0/0 charges for ogien/cloakin
BUT_ONLY
COPY_EXISTING ~ar9601.are~ ~override~ // swap back the old extres4 dupe fix
LPF REPLACE_AREA_ITEM INT_VAR charges1 = 1 charges2 = 1 charges3 = 0 STR_VAR old_item = rndtre78 new_item = rndtre75 END // 1/1/0 charges for beltbon/helmsh/stomper
BUT_ONLY
// ie-6013, cam
// Harpies should despawn for lower level parties
COPY_EXISTING ~ar9706.are~ ~override~ // only two harpy fiends should go away at CheckPartyAverageLevel(14,LESS_THAN)
SET harpy = 0
READ_LONG 0x54 actor_off
READ_SHORT 0x58 actor_num
FOR (index = 0 ; index < actor_num ; ++index) BEGIN
READ_ASCII (actor_off + 0x00 + (index * 0x110)) name
PATCH_IF ("%name%" STRING_COMPARE_CASE "HrpFnd_0" = 0) BEGIN
WRITE_ASCIIE (actor_off + 0x00 + (index * 0x110)) ~HrpFnd_%harpy%~
SET harpy += 1
END
END
BUT_ONLY
///// \\\\\
///// creature file fixes \\\\\
///// \\\\\
//INCLUDE ~eefixpack/files/tph/tbd_bulk_cre_fixes_iwdee.tph~ // bulk general changes (nothing actually here yet)
INCLUDE ~eefixpack/files/tph/tbd_elemental_summons.tph~ // tbd, cam: elemental prince summons shouldn't grant XP
// ie-6035, cam
// Why are constructs carrying gold?
COPY_EXISTING ~biknight.cre~ ~override~ // black ice knight
WRITE_LONG 0x1C 0 // gold
BUT_ONLY
///// \\\\\
///// item file fixes \\\\\
///// \\\\\
//INCLUDE ~eefixpack/files/tph/tbd_bulk_itm_fixes_iwdee.tph~ // bulk general changes (nothing here yet)
INCLUDE ~eefixpack/files/tph/tbd_iwdee_146.tph~ // tbd, cam: fixes items that cast spells
INCLUDE ~eefixpack/files/tph/tbd_energy_blades.tph~ // tbd, cam: per descript, energy blades should do missile damage, not slashing
// ie-6019, cam
// Portrait icon fixes for items
COPY_EXISTING ~bootfox.itm~ ~override~ // boots of the fox: swap haste icon for movement speed increase
LPF ALTER_EFFECT INT_VAR match_opcode = 142 match_parameter2 = 38 parameter2 = 193 END
BUT_ONLY
COPY_EXISTING ~moonbla.itm~ ~override~
LPF CLONE_EFFECT INT_VAR multi_match = 1 match_opcode = 60 opcode = 142 parameter2 = 105 END
BUT_ONLY
COPY_EXISTING ~vexed.itm~ ~override~ // vexed armor: has 2x cold resist icon, one should be cursed instead
LPF ALTER_EFFECT INT_VAR match_opcode = 142 match_parameter2 = 25 parameter2 = 35 multi_match = 1 END
BUT_ONLY
// tbd, cam
// upgraded bren muller's crossbow needs feedback that effect was activated (copy bg2 Heartseeker's visuals)
COPY_EXISTING ~cdxbowbm.itm~ ~override~
LPF ADD_ITEM_EFFECT INT_VAR opcode = 61 target = 1 parameter1 = ((0 << 24) + (30 << 16) + (120 << 8)) parameter2 = (25 << 16) timing = 1 END // rgb fade
LPF ADD_ITEM_EFFECT INT_VAR opcode = 141 target = 1 parameter2 = 24 timing = 1 END // rgb fade
BUT_ONLY
// ie-6007, cam - see also strings 8663, 8712, 8911, 40639, 25818, and 27373
// Weapon damage corrections
COPY_EXISTING ~clbhand.itm~ ~override~ // composite long bow of the hand
LPF ALTER_ITEM_HEADER INT_VAR header_type = 4 damage_bonus = 3 END // missing +1 from being composite long bow
BUT_ONLY
COPY_EXISTING ~kaybow.itm~ ~override~ // kaylessa's composite long bow of the hand
LPF ALTER_ITEM_HEADER INT_VAR header_type = 4 damage_bonus = 4 END // missing +1 from being composite long bow
BUT_ONLY
COPY_EXISTING ~lxbowbm.itm~ ~override~ // bren muller's crossbow
~cdxbowbm.itm~ ~override~ // bren muller's crossbow, upgraded
LPF ALTER_ITEM_HEADER INT_VAR header_type = 4 damage_bonus = 3 END // 1 damage short for +3 lt xbow
BUT_ONLY
COPY_EXISTING ~storm.itm~ ~override~ // storm bow
LPF ALTER_ITEM_HEADER INT_VAR header_type = 4 damage_bonus = 2 END // as a short bow, shouldn't get long bow's +1 damage
BUT_ONLY
COPY_EXISTING ~flailsk.itm~ ~override~ // skullflail
LPF ALTER_ITEM_HEADER INT_VAR header_type = 1 damage_bonus = 5 END // is +4 weapon, base flail damage is 1d6+1, so damage should be 1d6+5
BUT_ONLY
// tbd, cam
// item blocks spmindat, but isn't immune to hold
COPY_EXISTING ~cwreve.itm~ ~override~ // attack - blocks spmindat
LPF DELETE_EFFECT INT_VAR match_opcode = 296 STR_VAR match_resource = spmindat END
BUT_ONLY
// ie-6023, cam
// Weapon effect duration fixes - target both itm and spl so it can go before or after luke's seven eye fixes
COPY_EXISTING ~dart03.itm~ ~override~ // dart of stunning: color glow expires early
~dart03.spl~ ~override~ // dart of stunning: color glow expires early
LPF ALTER_EFFECT INT_VAR silent = 1 match_duration = 38 duration = 42 END
BUT_ONLY IF_EXISTS
COPY_EXISTING ~ghoult.itm~ ~override~ // ghoul touch should last six rounds
~ghoult.spl~ ~override~ // ghoul touch should last six rounds
LPF ALTER_EFFECT INT_VAR silent = 1 match_duration = 25 duration = 36 END // bump up to six rounds
BUT_ONLY IF_EXISTS
// tbd, cam
// sword of days doesn't block all haste/slow spells
COPY_EXISTING ~days.itm~ ~override~ // round out slow/haste immunity; david's stuff will add the immunity spellstates
LPF CLONE_EFFECT INT_VAR check_headers = 0 match_opcode = 318 STR_VAR match_resource = spwi305 resource = spra301 insert = below END // clone haste to ranger haste
LPF CLONE_EFFECT INT_VAR check_headers = 0 match_opcode = 318 STR_VAR match_resource = spwi312 resource = spin146 insert = below END // clone to beholder slow
LPF CLONE_EFFECT INT_VAR check_headers = 0 match_opcode = 318 STR_VAR match_resource = spwi312 resource = spin977 insert = below END // clone to golem slow
LPF CLONE_EFFECT INT_VAR check_headers = 0 match_opcode = 318 STR_VAR match_resource = spwi312 resource = spwish25 insert = below END // clone to wish slow
LPF CLONE_EFFECT INT_VAR check_headers = 0 match_opcode = 318 STR_VAR match_resource = spwi312 resource = spwm164 insert = below END // clone to wild surge slow
LPF CLONE_EFFECT INT_VAR check_headers = 0 match_opcode = 318 opcode = 101 parameter2 = 40 STR_VAR match_resource = spwi312 resource = ~~ END // immune to slow
LPF CLONE_EFFECT INT_VAR check_headers = 0 match_opcode = 318 opcode = 101 parameter2 = 16 STR_VAR match_resource = spwi312 resource = ~~ END // immune to haste
LPF CLONE_EFFECT INT_VAR check_headers = 0 match_opcode = 318 opcode = 267 parameter1= 14023 parameter2 = 0 STR_VAR match_resource = spwi312 resource = ~~ END // immune to string hasted
LPF CLONE_EFFECT INT_VAR check_headers = 0 match_opcode = 267 match_parameter1= 14023 parameter1 = 14000 END // immune to string slow
LPF CLONE_EFFECT INT_VAR check_headers = 0 match_opcode = 267 match_parameter1= 14023 parameter1 = 14668 END // immune to string slowed
LPF CLONE_EFFECT INT_VAR check_headers = 0 match_opcode = 318 opcode = 169 parameter1= 0 parameter2 = 38 STR_VAR match_resource = spwi312 resource = ~~ END // immune to icon haste
LPF CLONE_EFFECT INT_VAR check_headers = 0 match_opcode = 169 match_parameter2= 38 parameter2 = 41 END // immune to icon slow
// ie-5937, cam
// darts of bone shouldn't have a saving throw on their APR boost
COPY_EXISTING ~dobone.itm~ ~override~
LPF ALTER_EFFECT INT_VAR match_opcode = 1 savingthrow = 0 END
BUT_ONLY
// ie-6025, cam
// Items blocking spells that they shouldn't
COPY_EXISTING ~gvalor1.itm~ ~override~ // gauntlets of valor block haste, but should be blocking hold person
LPF ALTER_EFFECT STR_VAR match_resource = spwi305 resource = spwi306 END
BUT_ONLY
COPY_EXISTING ~kinetic.itm~ ~override~ // lance of disruption confers immunity to lance of disruption, but doesn't need it (original item bug fixed, this 318 was a stopgap)
LPF DELETE_EFFECT INT_VAR match_opcode = 318 STR_VAR match_resource = spwi328 END
BUT_ONLY
// tbd, cam
// multiple permanent effects with durations
COPY_EXISTING ~potn10.itm~ ~override~ // (itm) Potion of Invisibility - causes invisibility - sound(s) #cas_m01 - animations(s) illush - additional effects
LPF ALTER_EFFECT INT_VAR match_timing = 1 duration = 0 END
// tbd, cam
// elixir of health should cure intoxication, not set it to zero
COPY_EXISTING ~potn17.itm~ ~override~ // Elixir of Health - set drunkenness to 0, just change to 'cure drunk' instead
LPF ALTER_EFFECT INT_VAR match_opcode = 94 opcode = 164 parameter2 = 0 END // flesh out effects below
// ie-6026, cam - see also string updates to 14913 and 21627
// Revert changes to Thrym Extract and War Hammer +4: Defender (had wrong effects which were documented as if intended)
COPY_EXISTING ~thrym.itm~ ~override~ // should block effects on failed save
LPF CLONE_EFFECT INT_VAR match_opcode = 12 opcode = 318 parameter1 = 0 parameter2 = 0 timing = 0 duration = 6 dicesize = 0 dicenumber = 0 STR_VAR insert = below resource = thrym END
BUT_ONLY
COPY_EXISTING ~u1ham5b.itm~ ~override~ // war hammer +4: defender: 20% heal
LPF DELETE_EFFECT INT_VAR check_globals = 0 END // delete random heal, visuals
BUT_ONLY
// tbd, cam
// disease icon duration doesn't match disease effect; just delete and attach icon to disease effect
COPY_EXISTING ~udagg4a.itm~ ~override~ // (itm) Chaos Dagger +3 - causes disease - portrait icon(s) 7
LPF DELETE_EFFECT INT_VAR match_opcode = 142 END // deletes icon
LPF ALTER_EFFECT INT_VAR match_opcode = 78 special = 7 END // attach icon to disease effect
// ie-6024, cam - see also strings 14432 and 18095
// Two crossbows have the wrong strength requirement
COPY_EXISTING ~uhxbw2a.itm~ ~override~ // finest heavy crossbow
~xbow01.itm~ ~override~ // heavy crossbow
WRITE_SHORT 0x26 11 // min str
BUT_ONLY
// tbd, cam
// feedback with limited timing and/or duration
COPY_EXISTING ~wand08.itm~ ~override~ // (itm) Wand of Sleep - causes sleep - additional effects
~wand19.itm~ ~override~ // (itm) Wand of Cursing - causes blind deafness silence - portrait icon(s) 8 34 112 - sound(s) EFF_E06 - additional effects
~wand19b.spl~ ~override~ // if run after luke's seven eye fixes, busted string is here instead
LPF ALTER_EFFECT INT_VAR silent = 1 match_opcode = 139 timing = 1 duration = 0 END
BUT_ONLY IF_EXISTS
/*
luke
**Black Blade of Disaster**
- Make sure `primary_type` is `NECROMANCER`
- Make sure `equipped appearance` is `Long sword`
- Make sure all unnatural creatures are immune to its level drain effect
- Should not interact with level-based spell protections and Magic Resistance
- Make sure *"The caster is considered to be proficient to the point of Grand Mastery in this weapon"* always works
- `op233` needs to be on the normal effects list to be evaluated after chargen proficiency effects and override them!
- Provide a workaround for the following bugs:
- if you Dual-class when the Black Blade is equipped, the character permanently gains grand mastery in long swords
- if, for example, you have a warrior with an item that grants dagger proficiency while equipped, they can then take dagger specialization at a level-up, remove the item, and keep the specialization permanently
*/
WITH_SCOPE BEGIN
WITH_TRA
"eefixpack/languages/en_us/luke/shared.tra"
"eefixpack/languages/%LANGUAGE%/luke/shared.tra"
BEGIN
INCLUDE "eefixpack/files/tph/luke/black_blade_of_disaster.tph"
LAUNCH_ACTION_FUNCTION "WIZARD_BLACK_BLADE_OF_DISASTER" END
END
END
/*
luke
**Iron Body**
- Move spell features from `SPL` file to `ITM` file
*/
WITH_SCOPE BEGIN
INCLUDE "eefixpack/files/tph/luke/iron_body.tph"
LAUNCH_ACTION_FUNCTION "WIZARD_IRON_BODY" END
END
/*
luke
**Magical Weapon Slot**
(Based on the previous tweak to the Black Blade of Disaster)
- Make sure natural creature weapons / touch attacks do not benefit from Fighting Styles
*/
WITH_SCOPE BEGIN
WITH_TRA
"eefixpack/languages/en_us/luke/shared.tra"
"eefixpack/languages/%LANGUAGE%/luke/shared.tra"
BEGIN
INCLUDE "eefixpack/files/tph/luke/magical_weapon_slot.tph"
LAUNCH_ACTION_FUNCTION "MAGICAL_WEAPON_SLOT" END
END
END
/*
luke
**Attack** (used by Slime Zombie)
- Make sure it uses op318 to grant protection from itself (instead of messy op101 + op267 + op173 effects)
*/
WITH_SCOPE BEGIN
COPY_EXISTING "cwszomb.itm" "override"
LPF "DELETE_EFFECT" INT_VAR "check_globals" = 0 "match_opcode" = 267 END // Disable display string
LPF "DELETE_EFFECT" INT_VAR "check_globals" = 0 "match_opcode" = 173 END // Poison resistance bonus
LPF "DELETE_EFFECT" INT_VAR "check_globals" = 0 "match_opcode" = 101 END // Immunity to effect
LPF CLONE_EFFECT INT_VAR match_opcode = 25 opcode = 321 parameter1 = 0 parameter2 = 2 duration = 0 special = 0 STR_VAR insert = above resource = EVAL ~%SOURCE_RES%~ END
// LPF "ADD_ITEM_EFFECT" INT_VAR "type" = 1 "opcode" = 318 "target" = 2 "probability1" = 10 STR_VAR "resource" = "%DEST_RES%" END
BUT_ONLY_IF_IT_CHANGES
END
///// \\\\\
///// spell fixes \\\\\
///// \\\\\
INCLUDE ~eefixpack/files/tph/tbd_bulk_spl_fixes_iwdee.tph~ // bulk general changes
INCLUDE ~eefixpack/files/tph/5919_iwdee_spider_spawn.tph~ // ie-5919, cam: spider spawn only summons giant spiders, should also summon phase and sword
INCLUDE ~eefixpack/files/tph/tbd_simulacrum.tph~ // tbd, cam (from jmerry): simulacrum/projected images should have thief skills, but no shadow twin
INCLUDE ~eefixpack/files/tph/tbd_324_traps_iwdee.tph~ // tbd, cam - game can crash if a spell-via-trap uses 318/324 vs. a spell without a name
// tbd, cam (from jmerry)
// prevent infinite feedback (and resultant crash) from interacting fireshield-ish effects by giving them a brief immunity to re-application
INCLUDE ~eefixpack/files/tph/tbd_fireshields.tph~
// tbd, davidw
// circle of bone subspell has illegal character in sig
COPY_EXISTING "#bonecir.spl" override WRITE_ASCII 0x0 "SPL "
// feedback with limited timing and/or duration
COPY_EXISTING ~#sunrund.spl~ ~override~ // (spl) <Invalid Strref -1> - causes blind - portrait icon(s) 8 - additional effects
~spin120.spl~ ~override~ // (spl) Retribution - causes sleep - additional effects
~sppr102.spl~ ~override~ // (spl) Command - causes sleep - additional effects
~spwi004.spl~ ~override~ // (spl) Stinking Cloud - causes sleep - portrait icon(s) 126 - additional effects
~spwi032.spl~ ~override~ // (spl) Color Spray - causes blind pause sleep stun - portrait icon(s) 8 55 - additional effects
~spwi105.spl~ ~override~ // (spl) Color Spray - causes blind pause sleep stun - portrait icon(s) 8 - additional effects
~spwi213.spl~ ~override~ // (spl) Stinking Cloud - causes sleep - portrait icon(s) 126 - additional effects
~spwi711.spl~ ~override~ // (spl) Sphere of Chaos - causes confusion hold sleep - portrait icon(s) 38 - additional effects
~spwi806.spl~ ~override~ // (spl) Great Shout - causes deafness pause sleep - portrait icon(s) 112 - additional effects
LPF ALTER_EFFECT INT_VAR match_opcode = 139 timing = 1 duration = 0 END
// tbd, cam
// crippling strike should extend t0 -10 for assassins
COPY_EXISTING ~backstab.spl~ ~override~
READ_SHORT 0x68 abil_num_orig
LPF CD_EXTEND-O-MATIC INT_VAR base_dur = 420 step_dur = 0 level_cap = 11 END
READ_LONG 0x64 abil_off
READ_SHORT 0x68 abil_num
READ_LONG 0x6a fx_off
FOR (index = abil_num_orig ; index < abil_num ; ++index) BEGIN
READ_SHORT (abil_off + 0x1e + (index * 0x28)) abil_fx_num
READ_SHORT (abil_off + 0x20 + (index * 0x28)) abil_fx_idx
FOR (index2 = 0 ; index2 < abil_fx_num ; ++index2) BEGIN
READ_SHORT (fx_off + 0x00 + ((index2 + abil_fx_idx) * 0x30)) op
PATCH_IF ((op = 54) OR (op = 73)) BEGIN
WRITE_LONG (fx_off + 0x04 + ((index2 + abil_fx_idx) * 0x30)) (0 - index) // penalty
WRITE_LONG (fx_off + 0x0e + ((index2 + abil_fx_idx) * 0x30)) 70 // duration
END
END
END
BUT_ONLY
// ie-5938, cam
// Lich Touch should paralyze, not hold
COPY_EXISTING ~ltouch.spl~ ~override~
LPF ALTER_EFFECT INT_VAR match_opcode = 175 opcode = 109 END
BUT_ONLY
// tbd, cam
// stuns, but plays spmindat; iwd generally uses glows so change to that instead
COPY_EXISTING ~spcl118.spl~ ~override~ // the siren's yearning—enthralls creatures - plays spmindat
LPF ALTER_EFFECT INT_VAR match_opcode = 215 opcode = 8 parameter1 = ((46 << 8) + (56 << 16) + (0 << 24)) parameter2 = 255 STR_VAR match_resource = spmindat END
BUT_ONLY
// tbd, cam
// enrage is using berserk's spell icon
COPY_EXISTING ~spcl321.spl~ ~override~
WRITE_ASCII 0x3a ~enrageb~ #8
LPF ALTER_SPELL_HEADER STR_VAR icon = ~enrageb~ END
BUT_ONLY
// ie-6027, cam
// HP draining spells shouldn't work on undead and extraplanar creatures
COPY_EXISTING ~%MONK_LAY_ON_HANDS%.spl~ ~override~ // spcl815 lay on hands (monk)
LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 324 target = 2 parameter2 = 55 duration = 1 STR_VAR resource = spcl815 END
COPY_EXISTING ~%MONK_LAY_ON_HANDS%.spl~ ~override~ // spcl815 lay on hands (monk)
~%WIZARD_LARLOCH_MINOR_DRAIN%.spl~ ~override~ // spwi119 larloch's minor drain
~%WIZARD_VAMPIRIC_TOUCH%.spl~ ~override~ // spwi314 vampiric touch
PATCH_FOR_EACH race IN 121 139 145 147 156 157 158 159 169 BEGIN // demonic mephit elemental genie (anti)solar (dark)planetar salamander
LPF CLONE_EFFECT INT_VAR match_opcode = 324 match_parameter2 = 55 parameter1 = race parameter2 = 104 END
END
BUT_ONLY
// ie-6029, cam
// Hopelessness not always canceling Hope
COPY_EXISTING ~%INNATE_MOURNFUL_WAIL%.spl~ ~override~ // spin115 Mournful Wail; do separately since it has a 206 at top of stack
LPF ALTER_EFFECT INT_VAR match_opcode = 139 probability1 = 100 END // play on all stuns
LPF CLONE_EFFECT INT_VAR match_opcode = 139 opcode = 321 STR_VAR resource = spwi429 END // remove Emotion: Hope
BUT_ONLY
COPY_EXISTING ~%CLERIC_SYMBOL_OF_HOPELESSNESS%.spl~ ~override~ // sppr716 Symbol: Hopelessness
LPF CLONE_EFFECT INT_VAR multi_match = 1 match_opcode = 139 opcode = 321 parameter1 = 0 parameter2 = 0 STR_VAR resource = spwi429 END // remove Emotion: Hope
BUT_ONLY
// ie-6033, cam
// Great Roar has inconsistent durations
COPY_EXISTING ~%INNATE_GREAT_ROAR%.spl~ ~override~ // spin119 great roar
LPF ALTER_EFFECT INT_VAR match_duration = 120 duration = 30 END
BUT_ONLY
// tbd, cam
// mismatching durations
COPY_EXISTING ~spin120.spl~ ~override~ // (spl) Retribution - causes sleep - additional effects
LPF ALTER_EFFECT INT_VAR match_duration = 85 duration = 8571 END // 139 dealt with elsewhere
// tbd, davidw
// The projectile for Bombardier Beetle clouds has a duplicate string
COPY_EXISTING ~%INNATE_BOMBARDIER_BEETLE_CLOUD%.spl~ ~override~ // spin191
LPF DELETE_EFFECT INT_VAR match_opcode=139 match_parameter1=35568 multi_match=1 END // has two 'stunned' strings
BUT_ONLY
// tbd, cam
// nymphs from 'call woodland beings' lack their confusion ability due to a spell not being ported
APPEND ~spell.ids~ ~3704 NYMPH_CONFUSION~
COPY ~eefixpack/files/spl/spin704.spl~ ~override~
SPRINT NYMPH_CONFUSION ~spin704~
// ie-6028, cam
// Charm via Mantle of Hell's Furnace does not work as expected or, really, at all
COPY_EXISTING ~spitm99.spl~ ~override~
LPF ALTER_EFFECT INT_VAR match_opcode = 5 parameter2 = 1 END // change to normal hostile charm
LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 324 target = 2 parameter1 = 187 parameter2 = 115 duration = 1 STR_VAR resource = spitm99 END // block class != fire_elemental
BUT_ONLY
// tbd, cam
// IWDEE bug 321 should be subject to same MR check as AC effect
COPY_EXISTING ~%CLERIC_ALICORN_LANCE%.spl~ ~override~ // sppr218
LPF ALTER_EFFECT INT_VAR match_opcode = 321 resist_dispel = 1 END
// ie-5947, cam
// Cloudburst should remove Fireshields
COPY_EXISTING ~%CLERIC_CLOUDBURST%.spl~ ~override~ // sppr325
LPF CLONE_EFFECT INT_VAR match_opcode = 321 STR_VAR match_resource = firau1d6 resource = spwi403 END // fireshield blue
LPF CLONE_EFFECT INT_VAR match_opcode = 321 STR_VAR match_resource = firau1d6 resource = spwi418 END // fireshield red
LPF CLONE_EFFECT INT_VAR match_opcode = 206 STR_VAR match_resource = firau1d2 resource = sppr730d END // immune to aura of flaming death damage
// tbd, davidw
// Storm Shell shouldn't stack with itself
COPY_EXISTING ~%CLERIC_STORM_SHELL%.spl~ ~override~ // sppr327
LPF ADD_SPELL_EFFECT INT_VAR insert_point=0 opcode=321 target=2 timing=0 resist_dispel=3 STR_VAR resource="%CLERIC_STORM_SHELL%" END
LPF ALTER_EFFECT INT_VAR target=1 END // for some subtle reason, ability_target=5 and target=2 doesn't play nice with the 321 trick
BUT_ONLY
// tbd, cam
// poison icon expires too early, just build into poison effect
COPY_EXISTING ~sppr411.spl~ ~override~ // (spl) Poison - causes poison - portrait icon(s) 6
LPF DELETE_EFFECT INT_VAR match_opcode = 142 END
LPF ALTER_EFFECT INT_VAR match_opcode = 25 special = 6 END
// ie-5945, cam
// Static Charge icon should be dispellable like the rest of the spell
COPY_EXISTING ~%CLERIC_STATIC_CHARGE%.spl~ ~override~ // sppr420
LPF ALTER_EFFECT INT_VAR match_opcode = 142 resist_dispel = 3 END
// ie-5753, cam
// iwdee bug: blood rage can avoid fatigue with a re-cast - clone 321 into 206 then delete it; also block ops 18 and 98
COPY_EXISTING ~%CLERIC_BLOOD_RAGE%.spl~ ~override~ // sppr422
LPF CLONE_EFFECT INT_VAR match_opcode = 101 match_parameter2 = 17 STR_VAR insert = last END
LPF DELETE_EFFECT INT_VAR match_opcode = 101 match_parameter2 = 17 multi_match = 1 END
LPF CLONE_EFFECT INT_VAR match_opcode = 101 match_parameter2 = 17 parameter2 = 18 END
LPF CLONE_EFFECT INT_VAR match_opcode = 101 match_parameter2 = 17 parameter2 = 98 END
LPF CLONE_EFFECT INT_VAR match_opcode = 321 opcode = 206 timing = 0 duration = 120 STR_VAR match_resource = EVAL ~%CLERIC_BLOOD_RAGE%~ insert = last END
LPF DELETE_EFFECT INT_VAR match_opcode = 321 STR_VAR match_resource = EVAL ~%CLERIC_BLOOD_RAGE%~ END
// tbd, cam
// iwdee fix: weird durations for 318/324s
COPY_EXISTING ~%CLERIC_CLOUD_OF_PESTILENCE%.spl~ ~override~ // sppr423
LPF ALTER_EFFECT INT_VAR match_duration = 85 duration = 0 END
// tbd, cam
// iwdee fix: dupe 'unconscious' strings, remove redundant 318 at end
COPY_EXISTING ~%CLERIC_SMASHING_WAVE%.spl~ ~override~ // sppr426
LPF DELETE_EFFECT INT_VAR match_opcode = 139 match_duration = 12 END
LPF DELETE_EFFECT INT_VAR match_opcode = 318 match_parameter2 = 0 END
// tbd, cam
// stun icons provided by stun effect in EE, remove redundant 142
COPY_EXISTING ~%CLERIC_SMASHING_WAVE%.spl~ ~override~ // sppr426
~%CLERIC_WHIRLWIND%.spl~ ~override~ // sppr617
LPF DELETE_EFFECT INT_VAR match_opcode = 142 match_parameter2 = 55 END
// ie-5946, cam
// Wall of Moonlight should not interact with spell protections
COPY_EXISTING ~%CLERIC_WALL_OF_MOONLIGHT%.spl~ ~override~ // sppr428
LPF ALTER_EFFECT INT_VAR resist_dispel = 1 END
COPY_EXISTING ~%CLERIC_WALL_OF_MOONLIGHT%a.spl~ ~override~ // sppr428a
~%CLERIC_WALL_OF_MOONLIGHT%b.spl~ ~override~ // sppr428b
LPF ALTER_EFFECT INT_VAR match_opcode = 12 power = 0 resist_dispel = 0 END
// tbd, cam
// IWDEE bug 321 should be timing 1/dur 0
COPY_EXISTING ~%CLERIC_SPIKE_STONES%.spl~ ~override~ // sppr519
LPF ALTER_EFFECT INT_VAR match_opcode = 321 timing = 1 duration = 0 END
// ie-5944, cam
// Animal Rage needs power level corrections
COPY_EXISTING ~%CLERIC_ANIMAL_RAGE%.spl~ ~override~ // sppr522
LPF DELETE_EFFECT INT_VAR match_opcode = 321 match_timing = 4 END
COPY_EXISTING ~%CLERIC_ANIMAL_RAGE%b.spl~ ~override~ // sppr522b
LPF ALTER_EFFECT INT_VAR power = 0 END
// ie-5942, cam
// Mass Cause Light Wounds should not be available to druids
COPY_EXISTING ~%CLERIC_MASS_CAUSE_LIGHT_WOUNDS%.spl~ ~override~ // sppr523.spl
WRITE_LONG 0x1e (THIS BOR BIT31) // adds druid flag
// tbd, davidw
// entropy shield (remove spurious protection from Breach/Spellstrike/Imprisonment; doesn't protect against Flame Strike)
COPY_EXISTING "%CLERIC_ENTROPY_SHIELD%.spl" ~override~ // sppr615
LPF DELETE_EFFECT INT_VAR match_opcode=83 match_parameter2=54 END // remove immunity to SPARKLGR projectile
PATCH_FOR_EACH resource IN sppr503 spimix01 ohbeflam BEGIN // clone one flamestrike immunity to cover other flamestrike variants
LPF CLONE_EFFECT STR_VAR match_resource=sppr984 resource END
END
BUT_ONLY
// tbd, cam
// oiwd fix
COPY_EXISTING ~%CLERIC_WHIRLWIND%.spl~ ~override~ // sppr617
LPF ALTER_EFFECT INT_VAR match_resist_dispel = 0 resist_dispel = 1 END
// tbd, cam
// stun icons provided by stun effect, remove redundant 142
COPY_EXISTING ~%WIZARD_ICELANCE%.spl~ ~override~ // spwi327
~%WIZARD_GREAT_SHOUT%.spl~ ~override~ // spwi806
LPF DELETE_EFFECT INT_VAR match_opcode = 142 match_parameter2 = 55 END
// ie-6030, cam
// Stoneskin provides too many skins at all levels
COPY_EXISTING ~%WIZARD_STONE_SKIN%.spl~ ~override~ // spwi408
READ_SHORT 0x68 abil_num
FOR (index = 0 ; index < abil_num ; ++index) BEGIN
LPF ALTER_EFFECT INT_VAR header = index match_opcode = 218 parameter1 = (index + 3) END
END
BUT_ONLY
// ie-5941, 1i-6031, cam
// iwdee: not always checking MR correctly
COPY_EXISTING ~%WIZARD_BELTYNS_BURNING_BLOOD%.spl~ ~override~ // spwi422
PATCH_FOR_EACH op IN 61 142 174 215 321 333 BEGIN // everything but the portrait icon is wrong except at header 0
LPF ALTER_EFFECT INT_VAR match_opcode = op resist_dispel = 1 END
END
// ie-5940, cam
// Emotion, Fear bypasses save/MR checks for removing Emotion, Courage
COPY_EXISTING ~%WIZARD_EMOTION_FEAR%.spl~ ~override~ // spwi428
LPF ALTER_EFFECT INT_VAR match_opcode = 321 resist_dispel = 1 savingthrow = BIT0 END
// tbd, cam
// iwdee fix: deafness from (great) shout not including portrait icon
COPY_EXISTING ~%WIZARD_SHOUT%.spl~ ~override~ // spwi431
~%WIZARD_GREAT_SHOUT%.spl~ ~override~ // spwi806
LPF CLONE_EFFECT INT_VAR silent = 1 match_opcode = 80 opcode = 142 parameter2 = 112 END // clone deaf into deafness icon
// ie-6032, cam
// Tenser's Transformation shouldn't block innate abilities
COPY_EXISTING ~%WIZARD_TENSERS_TRANSFORMATION%.spl~ ~override~ // spwi603
LPF ALTER_EFFECT INT_VAR match_opcode = 145 match_parameter2 = 2 parameter2 = 3 END
BUT_ONLY
// tbd, cam
// feeblemind and petrification are permanent, but icons are not
COPY_EXISTING ~spwi714.spl~ ~override~ // (spl) Prismatic Spray - causes blind feeblemind - portrait icon(s) 8 48 171
LPF ALTER_EFFECT INT_VAR match_opcode = 142 match_duration = 308571 timing = 1 duration = 0 END // make permanent
// tbd, cam
// iwdee bug: use 176 for movement speed, 321 needs save
COPY_EXISTING ~%WIZARD_SUFFOCATE%.spl~ ~override~ // spwi726
LPF ALTER_EFFECT INT_VAR match_opcode = 321 savingthrow = BIT0 END
LPF ALTER_EFFECT INT_VAR match_opcode = 126 opcode = 176 END
// tbd, davidw
// Mind Blank is supposed to protect against petrification
COPY_EXISTING ~%WIZARD_MIND_BLANK%.spl~ ~override~ // spwi802
LPF CLONE_EFFECT INT_VAR match_opcode=101 match_parameter2=175 parameter2=134 END // immune to petrification opcode
LPF CLONE_EFFECT INT_VAR match_opcode=267 match_parameter1=14102 parameter1=14127 END // immune to petrification string
LPF CLONE_EFFECT INT_VAR match_opcode=169 match_parameter2=3 parameter2=171 END // immune to petrification icon
BUT_ONLY
// ie-5939, cam
// Great Shout duplicates combat feedback on a failed save
COPY_EXISTING ~%WIZARD_GREAT_SHOUT%.spl~ ~override~ // spwi806 great shout
LPF DELETE_EFFECT INT_VAR match_opcode = 174 END
LPF DELETE_EFFECT INT_VAR match_opcode = 139 match_target = 2 match_savingthrow = BIT0 END // nuke dupe 'stunned' string
LPF CLONE_EFFECT INT_VAR match_opcode = 142 match_duration = 12 opcode = 206 parameter1 = 0 parameter2 = 0 duration = 1 STR_VAR resource = EVAL ~%WIZARD_GREAT_SHOUT%~ insert = below END
LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 174 target = 1 power = 8 timing = 1 resist_dispel = 2 STR_VAR resource = ~#ff_m101~ END
BUT_ONLY
// tbd, cam
// expiry sound is way too early
COPY_EXISTING ~spwish33.spl~ ~override~ // Intoxication - causes drunkenness - plays sound EFF_E06 - portrait icon 5
LPF ALTER_EFFECT INT_VAR match_opcode = 174 match_duration = 60 duration = 1200 END
// luke
// 1) Grease should not interact with spell protections
// 2) Grease (in particular "spwi101b.spl" and "spwi101c.spl") should apply the GREASE stat.
///// As you can see, those two subspells are not applying the aforementioned stat, nor the GREASE spell state. This might confuse both later patches and AI.
///// As a result, I suggest replacing op215 with op158 (param2=1|custom overlay; resource="greaseb" on "spwi101b" and resource="greasec" on "spwi101c").
WITH_SCOPE BEGIN
COPY_EXISTING ~%WIZARD_GREASE%b.spl~ ~override~ // spwi101b
~%WIZARD_GREASE%c.spl~ ~override~ // spwi101c
LPF ~ALTER_EFFECT~ INT_VAR ~power~ = 0 END
LPF ~ALTER_EFFECT~ INT_VAR ~match_opcode~ = 215 ~opcode~ = 158 END // Play visual effect => Grease overlay
BUT_ONLY_IF_IT_CHANGES
END
// luke
// Chill Touch should correctly affect UNDEAD without permanently removing their immunity to Panic (op24)
WITH_SCOPE BEGIN
INCLUDE "eefixpack/files/tph/luke/wizard_chill_touch.tph" // chillt.itm, spwi117a.spl, spwi117b.spl
LAF "WIZARD_CHILL_TOUCH" END
END
/*
luke
**Cause Disease**
- Make sure `op78` displays the `Diseased` portrait icon
- function "remove_redundant_effects" won't be able to properly deal with this file because there are multiple op78 effects and just one op142 effect
*/
WITH_SCOPE BEGIN
COPY_EXISTING "%CLERIC_CAUSE_DISEASE%.spl" "override" // sppr320
LAUNCH_PATCH_FUNCTION "ALTER_EFFECT" INT_VAR "match_opcode" = 78 "special" = 7 END // Disease
LAUNCH_PATCH_FUNCTION "DELETE_EFFECT" INT_VAR "match_opcode" = 142 "match_parameter2" = 7 END // op78 can naturally provide the "Diseased" portrait icon
BUT_ONLY_IF_IT_CHANGES
END
// luke
// Spirit Fire => should not interact with spell protections
// As a result, do not use "bddoom.spl" (since its effects are coded as `power=1`)
WITH_SCOPE BEGIN
INCLUDE "eefixpack/files/tph/luke/cleric_spirit_fire.tph" // sppr450.spl, sppr450a.spl, sppr450b.spl
LAUNCH_ACTION_FUNCTION "CLERIC_SPIRIT_FIRE" END
END
// luke
// Nature's Beauty – permanent blindness (until dispelled)
// 1) Timing Mode 1 will permanently set the creature's STATE_BLIND flag, leaving no removable effect.
// 2) Related: the -4 penalty to AC and THAC0 are apparently tied to the effect (op74), not STATE_BLIND.
// As a result, we suggest to stick with a limited `timing_mode` and set `duration` to a very high random value (max signed value...?).
// Additionally, this spell should only affect HUMANOID (there are a lot of unnatural creatures that are immune to it via op206; also, it is intended, right...?)
WITH_SCOPE BEGIN
COPY_EXISTING ~%CLERIC_NATURE_BEAUTY%.spl~ ~override~ // sppr704.spl
LPF "ADD_SPELL_EFFECT" INT_VAR "insert_point" = 0 "opcode" = 324 "target" = 2 "power" = 7 "parameter2" = 6 "resist_dispel" = BIT1 STR_VAR "resource" = "%DEST_RES%" END // Immunity to resource and message (GENERAL != HUMANOID)
LAUNCH_PATCH_FUNCTION "ALTER_EFFECT" INT_VAR "match_opcode" = 74 "timing" = 0 "duration" = 0x7FFFFFFF END // Blindness
LAUNCH_PATCH_FUNCTION "DELETE_EFFECT" INT_VAR "match_opcode" = 142 END // op74 naturally provides the "Blind" portrait icon
BUT_ONLY_IF_IT_CHANGES
END
/*
luke
**Sunray**
- It now properly distinguishes `GENERAL=UNDEAD || RACE=MYCONID` from `!(GENERAL=UNDEAD || RACE=MYCONID)`
*/
WITH_SCOPE BEGIN
INCLUDE ~eefixpack/files/tph/luke/sunray.tph~ // sppr707.spl, sppr707a.spl, sppr707b.spl, sppr707c.spl
LAF ~CLERIC_SUNRAY~ END
END
/*
luke
Summon Nishruu / Hakeashar
- their attack (`nishrusu.itm`) should ignore all `AC` modifiers
- previously, since it was using `damage_type=piercing`, the Nishruu (`THAC0=11`) would need to roll a Critical Hit in order to hit `AC -9 vs. piercing` attacks targets. A similar argument holds for the Hakeashar
- this is certainly unintended since they don't actually deal piercing damage
- they should be vulnerable to Dispel/Remove Magic
- they should be flagged as `GENERAL=MONSTER` / `RACE=MIST` / `CLASS=MIST` on all games
- make sure the Nishruu has 100% Poison resistance
- The Hakeashar should have the same passive traits as the Nishruu
- i.e., it should be immune to Poison and see invisible creatures
- the Nishruu should use the `NISHRUU` animation on all games
- the Hakeashar should use the `HAKEASHAR` animation on all games
- removed unused spell setup
*/
WITH_SCOPE BEGIN
INCLUDE ~eefixpack/files/tph/luke/nishruu_hakeashar.tph~
LAF ~NISHRUU_HAKEASHAR~ END
END
/*
luke
**Ghast attack**
- Effects that grant a Save vs. Paralyze/Poison/Death should go into the new subspell
*/
WITH_SCOPE BEGIN
COPY_EXISTING "ghast1.spl" "override"
LPF "DELETE_EFFECT" INT_VAR "check_globals" = 0 "match_savingthrow" = BIT2 END
BUT_ONLY_IF_IT_CHANGES
COPY_EXISTING "ghast2.spl" "override"
LPF "ADD_SPELL_EFFECT" INT_VAR "opcode" = 174 "target" = 2 "timing" = 1 "resist_dispel" = 3 STR_VAR "resource" = "#EFF_P11" END
LPF "ADD_SPELL_EFFECT" INT_VAR "opcode" = 174 "target" = 2 "timing" = 4 "duration" = 36 "resist_dispel" = 3 STR_VAR "resource" = "#EFF_E05" END
BUT_ONLY_IF_IT_CHANGES
END
/*
luke
**Jester's song**
- Make sure the Confusion subspell is refreshed every time it triggers (whether or not the target fails the save vs. Spell)
- this is a "eefixpack/files/tph/luke/7eyes/confusion.tph" follow-up
*/
WITH_SCOPE BEGIN
WITH_SCOPE BEGIN
COPY_EXISTING "spcl751a.spl" "override"
LPF "ALTER_EFFECT" INT_VAR "match_opcode" = 146 "savingthrow" = 0 "savebonus" = 0 STR_VAR "match_resource" = "spcl751b" END // Cast spell
BUT_ONLY_IF_IT_CHANGES
END
WITH_SCOPE BEGIN
COPY_EXISTING "spcl751b.spl" "override"
LPF "ALTER_EFFECT" INT_VAR "savingthrow" = BIT0 "savebonus" = 2 END // all effects: Save vs. Spell
LPF "ADD_SPELL_EFFECT" INT_VAR "insert_point" = 0 "opcode" = 321 "target" = 2 "timing" = 1 STR_VAR "resource" = "%DEST_RES%" END // Remove effects by resource
BUT_ONLY_IF_IT_CHANGES
END
END
/*
luke
**Wand of Cursing**
- Move all cosmetic effects into the 3 subspells
- this is a "eefixpack/files/tph/luke/7eyes/silence/blindness/deafness.tph" follow-up
*/
WITH_SCOPE BEGIN
COPY_EXISTING "wand19.itm" "override"
LPF "GET_V10_HEAD_EFFECTS" RET_ARRAY "v10_head_effects" END
LPF "DELETE_ITEM_EFFECT" INT_VAR "opcode_to_delete" = 174 END // Play sound
LPF "DELETE_ITEM_EFFECT" INT_VAR "opcode_to_delete" = 215 END // Play visual effect
BUT_ONLY_IF_IT_CHANGES
WITH_SCOPE BEGIN
COPY_EXISTING_REGEXP "^wand19[a-c]\.spl$" "override"
PHP_EACH "v10_head_effects" AS "fx_attributes" => "" BEGIN
PATCH_IF ("%fx_attributes_0%" != 146) BEGIN
LPF "ADD_SPELL_EFFECT" INT_VAR "opcode" = "%fx_attributes_0%" "target" = "%fx_attributes_1%" "power" = "%fx_attributes_2%" "parameter1" = "%fx_attributes_3%" "parameter2" = "%fx_attributes_4%" "timing" = "%fx_attributes_5%" "resist_dispel" = ("%fx_attributes_6%" == BIT0 ? BIT0 | BIT1 : "%fx_attributes_6%") "duration" = "%fx_attributes_7%" "special" = "%fx_attributes_15%" STR_VAR "resource" = "%fx_attributes_10%" END
END
END
BUT_ONLY_IF_IT_CHANGES
END
END
// tbd, cam
// don't play berserk damage warnings on non-party memebers; see also spin117[ab].eff
INCLUDE ~eefixpack/files/tph/tbd_angry_noises.tph~
///// \\\\\
///// store fixes \\\\\
///// \\\\\
///// \\\\\
///// misc/other fixes \\\\\
///// \\\\\
// ie-6008, cam
// Worldmap travel fixes
COPY_EXISTING ~worldmap.wmp~ ~override~ // inconsistent travel times
READ_LONG 0x0c mos_off
READ_LONG (mos_off + 0x20) area_num
READ_LONG (mos_off + 0x24) area_off
READ_LONG (mos_off + 0x28) link_off
FOR (index = 0 ; index < area_num ; ++index) BEGIN
READ_ASCII (area_off + 0x08 + (index * 0xf0)) area
PATCH_IF ("%area%" STRING_COMPARE_CASE "ar5000" = 0) BEGIN // severed hand
SET hand = index
END ELSE
PATCH_IF ("%area%" STRING_COMPARE_CASE "ar4000" = 0) BEGIN // dragon's eye
SET deye = index
END ELSE
PATCH_IF ("%area%" STRING_COMPARE_CASE "ar7000" = 0) BEGIN // wyrm's tooth
SET wyrm = index
END
END
FOR (index = 0 ; index < area_num ; ++index) BEGIN // loop through areas
FOR (index2 = 0 ; index2 < 4 ; ++index2) BEGIN // loop through four sets of links (n,s,e,w)
READ_LONG (area_off + 0x50 + (index2 * 0x08) + (index * 0xf0)) link_idx
READ_LONG (area_off + 0x54 + (index2 * 0x08) + (index * 0xf0)) link_num
FOR (index3 = 0 ; index3 < link_num ; ++index3) BEGIN // loop through actual links
READ_LONG (link_off + ((link_idx + index3) * 0xd8)) target
PATCH_IF ((index = deye) AND (target = hand)) BEGIN // dragon's eye to severed hand
WRITE_LONG (link_off + 0x24 + ((link_idx + index3) * 0xd8)) 12 // travel time
END ELSE
PATCH_IF ((index = wyrm) AND (target = hand)) BEGIN // wyrm's tooth to severed hand
WRITE_LONG (link_off + 0x24 + ((link_idx + index3) * 0xd8)) 72 // travel time
END
END
END
END
BUT_ONLY
// tbd, cam
// broken sound reference in lance of disruption projectile
COPY_EXISTING ~idpro313.pro~ ~override~
WRITE_ASCII 0x18 ~#tra_59~ #8
///// \\\\\
///// final batch of INCLUDEs and cross-patching \\\\\
///// \\\\\
INCLUDE ~eefixpack/files/tph/6037_iwdee_probabilities.tph~ // ie-6021 & ie-6037, cam: probability fixes
INCLUDE "%MOD_FOLDER%/files/tph/dw_fixes.tph" // tbd, davidw: 318/324 immunity, 109/175/185 disentanglement, and more
WITH_SCOPE BEGIN
INCLUDE "eefixpack/files/tph/luke/redundant_effects.tph"
LAF "remove_redundant_effects" END
END
INCLUDE ~eefixpack/files/lib/cd_effect_batches_functions.tpa~ // function for effect batches
INCLUDE ~eefixpack/files/lib/cd_effect_batches_arrays_bg_bg2_iwd.tpa~ // array definitions for effect batches
INCLUDE ~eefixpack/files/tph/tbd_vfx_removal_iwd.tph~ // use effect batches to remove vfx from effects which have been removed