Jump to content

Immunity to hold effect batches


Recommended Posts

Finally got tired of trying to tackle these individually. Like our level drain-immune patches, these look for hold immunity and then verify that all supplementary protections (protection from held string, held icon, hold animations, etc.). Anyone spot something that should be in the normal suite of effects?

 

// adds supplementary protections to hold immune creatures
//COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ ~override~
COPY_EXISTING ~demglab.cre~  ~override~
             ~demglab2.cre~ ~override~
             ~demglasu.cre~ ~override~
             ~elemhydr.cre~ ~override~
             ~elemimix.cre~ ~override~
             ~elemogre.cre~ ~override~
             ~elemsunn.cre~ ~override~
             ~elemzaam.cre~ ~override~
             ~enddem01.cre~ ~override~
             ~enddem02.cre~ ~override~
             ~enddem03.cre~ ~override~
             ~enddem04.cre~ ~override~
             ~enddem05.cre~ ~override~
             ~finsol04.cre~ ~override~
             ~icbone01.cre~ ~override~
             ~jondem01.cre~ ~override~
             ~jondem02.cre~ ~override~
             ~jondem03.cre~ ~override~
             ~jondem04.cre~ ~override~
             ~jondem05.cre~ ~override~
             ~mindva01.cre~ ~override~
             ~mindvam.cre~  ~override~
             ~sword01.cre~  ~override~
             ~torgal.cre~   ~override~
             ~udvamp.cre~   ~override~
 PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // protects against invalid files
   READ_BYTE   0x33  "fx_type"
   READ_LONG   0x2a0 "known_off"
   READ_LONG   0x2a8 "meminfo_off"
   READ_LONG   0x2b0 "mem_off"
   READ_LONG   0x2b8 "slot_off"
   READ_LONG   0x2bc "itm_off"
   READ_LONG   0x2c4 "fx_off"
   READ_SHORT  0x2c8 "fx_num"
   SET "new_fx" = 0
   SET "new_fx_1" = 0
   SET "new_fx_2" = 0
   SET "new_fx_3" = 0
   SET "new_fx_4" = 0
   SET "new_fx_5" = 0
   SET "new_fx_6" = 0
   SET "new_fx_7" = 0
   SET "trigger" = 0
   PATCH_IF ("%fx_type%" = 1) BEGIN
     FOR (index = 0; index < fx_num; index = index + 1) BEGIN
       READ_LONG  ("%fx_off%" + 0x08 + ("%index%" * 0x108)) "opcode"
       READ_LONG  ("%fx_off%" + 0x14 + ("%index%" * 0x108)) "string"
       READ_LONG  ("%fx_off%" + 0x18 + ("%index%" * 0x108)) "immune"
       READ_ASCII ("%fx_off%" + 0x28 + ("%index%" * 0x108)) "anim"
       PATCH_IF (("%opcode%" = 101) AND ("%immune%" = 109)) BEGIN // hold immunity
         SET "trigger" = 1
         SET "new_fx_1" = 1
         READ_ASCII ("%fx_off%" +        ("%index%" * 0x108)) "template" (0x108)
       END ELSE
       PATCH_IF (("%opcode%" = 101) AND ("%immune%" = 175)) BEGIN // hold creature type immunity
         SET "trigger" = 1
         SET "new_fx_2" = 1
         READ_ASCII ("%fx_off%" +        ("%index%" * 0x108)) "template" (0x108)
       END ELSE
       PATCH_IF (("%opcode%" = 101) AND ("%immune%" = 185)) BEGIN // hold creature 2 immunity
         SET "trigger" = 1
         SET "new_fx_3" = 1
         READ_ASCII ("%fx_off%" +        ("%index%" * 0x108)) "template" (0x108)
       END ELSE
       PATCH_IF (("%opcode%" = 169) AND ("%immune%" = 13)) BEGIN // prevent held icon
         SET "new_fx_4" = 1
       END ELSE
       PATCH_IF (("%opcode%" = 267) AND ("%string%" = 14102)) BEGIN // disable string 14102, "Held"
         SET "new_fx_5" = 1
       END ELSE
       PATCH_IF (("%opcode%" = 296) AND ("%anim%" STRING_COMPARE_CASE "spflayer" = 0)) BEGIN // spflayer anim
         SET "new_fx_6" = 1
       END ELSE
       PATCH_IF (("%opcode%" = 296) AND ("%anim%" STRING_COMPARE_CASE "spmindat" = 0)) BEGIN // spmindat anim
         SET "new_fx_7" = 1
       END
     END
     PATCH_IF ("%trigger%" = 1) BEGIN
       PATCH_IF ("%new_fx_1%" = 0) BEGIN
         INSERT_BYTES            ("%fx_off%"       ) 0x108
           WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
           WRITE_LONG            ("%fx_off%" + 0x18) 109          // bogstandard immunity to hold
         SET "new_fx" = ("%new_fx%" + 1)
       END
       PATCH_IF ("%new_fx_2%" = 0) BEGIN
         INSERT_BYTES            ("%fx_off%"       ) 0x108
           WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
           WRITE_LONG            ("%fx_off%" + 0x18) 175          // immunity to hold creature type
         SET "new_fx" = ("%new_fx%" + 1)
       END
       PATCH_IF ("%new_fx_3%" = 0) BEGIN
         INSERT_BYTES            ("%fx_off%"       ) 0x108
           WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
           WRITE_LONG            ("%fx_off%" + 0x18) 185          // immunity to hold creature 2
         SET "new_fx" = ("%new_fx%" + 1)
       END
       PATCH_IF ("%new_fx_4%" = 0) BEGIN
         INSERT_BYTES            ("%fx_off%"       ) 0x108
           WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
           WRITE_LONG            ("%fx_off%" + 0x08) 169          // prevent portrait icon
           WRITE_LONG            ("%fx_off%" + 0x18) 13           // held
         SET "new_fx" = ("%new_fx%" + 1)
       END
       PATCH_IF ("%new_fx_5%" = 0) BEGIN
         INSERT_BYTES            ("%fx_off%"       ) 0x108
           WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
           WRITE_LONG            ("%fx_off%" + 0x08) 267          // disable string
           WRITE_LONG            ("%fx_off%" + 0x14) 14102        // strref
         SET "new_fx" = ("%new_fx%" + 1)
       END
       PATCH_IF ("%new_fx_6%" = 0) BEGIN
         INSERT_BYTES            ("%fx_off%"       ) 0x108
           WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
           WRITE_LONG            ("%fx_off%" + 0x08) 296          // immunity to specific animation
           WRITE_ASCII           ("%fx_off%" + 0x28) ~spflayer~   // mind flayer hold animation
         SET "new_fx" = ("%new_fx%" + 1)
       END
       PATCH_IF ("%new_fx_7%" = 0) BEGIN
         INSERT_BYTES            ("%fx_off%"       ) 0x108
           WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
           WRITE_LONG            ("%fx_off%" + 0x08) 296          // immunity to specific animation
           WRITE_ASCII           ("%fx_off%" + 0x28) ~spmindat~   // mind flayer hold animation
         SET "new_fx" = ("%new_fx%" + 1)
       END
       WRITE_LONG  0x2c8 ("%fx_num%" + "%new_fx%")
       PATCH_IF ("%fx_off%" < "%known_off%") BEGIN
         WRITE_LONG 0x2a0 ("%known_off%" + (0x108 * "%new_fx%"))
       END
       PATCH_IF ("%fx_off%" < "%meminfo_off%") BEGIN
         WRITE_LONG 0x2a8 ("%meminfo_off%" + (0x108 * "%new_fx%"))
       END
       PATCH_IF ("%fx_off%" < "%mem_off%") BEGIN
         WRITE_LONG 0x2b0 ("%mem_off%" + (0x108 * "%new_fx%"))
       END
       PATCH_IF ("%fx_off%" < "%slot_off%") BEGIN
         WRITE_LONG 0x2b8 ("%slot_off%" + (0x108 * "%new_fx%"))
       END
       PATCH_IF ("%fx_off%" < "%itm_off%") BEGIN
         WRITE_LONG 0x2bc ("%itm_off%" + (0x108 * "%new_fx%"))
       END
     END
   END
 END
 BUT_ONLY_IF_IT_CHANGES
 
// disables "level drained" strings from showing in items with level drain immunity
//COPY_EXISTING_REGEXP GLOB ~^.+\.itm~ ~override~
COPY_EXISTING ~aldeth.itm~   ~override~
             ~antiweb.itm~  ~override~
             ~beholder.itm~ ~override~
             ~bhaalhp1.itm~ ~override~
             ~bhaalimm.itm~ ~override~
             ~blun30.itm~   ~override~
             ~chalcy3.itm~  ~override~
             ~chalslay.itm~ ~override~
             ~chwraith.itm~ ~override~
             ~demilich.itm~ ~override~
             ~demogorg.itm~ ~override~
             ~dragring.itm~ ~override~
             ~finmel01.itm~ ~override~
             ~freering.itm~ ~override~
             ~gorfirg.itm~  ~override~
             ~gorjelfu.itm~ ~override~
             ~gorjelgr.itm~ ~override~
             ~gormisti.itm~ ~override~
             ~immchs.itm~   ~override~
             ~imoenhp1.itm~ ~override~
             ~innoc.itm~    ~override~
             ~ipsion.itm~   ~override~
             ~jwsuper.itm~  ~override~
             ~killsw01.itm~ ~override~
             ~kuoring.itm~  ~override~
             ~lich.itm~     ~override~
             ~mage05.itm~   ~override~
             ~magiweb.itm~  ~override~
             ~mel01.itm~    ~override~
             ~minhp1.itm~   ~override~
             ~npplat.itm~   ~override~
             ~objring.itm~  ~override~
             ~palring.itm~  ~override~
             ~plytroll.itm~ ~override~
             ~ravag03.itm~  ~override~
             ~ring09.itm~   ~override~
             ~ring94.itm~   ~override~
             ~ring95.itm~   ~override~
             ~ring97.itm~   ~override~
             ~ring98.itm~   ~override~
             ~ring99.itm~   ~override~
             ~ringkora.itm~ ~override~
             ~rossring.itm~ ~override~
             ~sengua04.itm~ ~override~
             ~shalt01.itm~  ~override~
             ~shld25.itm~   ~override~
             ~sper07.itm~   ~override~
             ~sper12.itm~   ~override~
             ~stalker.itm~  ~override~
             ~surehp1.itm~  ~override~
             ~sw1h27.itm~   ~override~
             ~sw2h06.itm~   ~override~
             ~sw2h13.itm~   ~override~
             ~telslav2.itm~ ~override~
             ~trollall.itm~ ~override~
             ~trollimm.itm~ ~override~
             ~vampreg.itm~  ~override~
             ~vampreg1.itm~ ~override~
             ~vampreg2.itm~ ~override~
 PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
   READ_LONG   0x64 "abil_off"
   READ_SHORT  0x68 "abil_num"
   READ_LONG   0x6a "fx_off"
   READ_SHORT  0x70 "fx_num"
   SET "new_fx" = 0
   SET "new_fx_1" = 0
   SET "new_fx_2" = 0
   SET "new_fx_3" = 0
   SET "new_fx_4" = 0
   SET "new_fx_5" = 0
   SET "new_fx_6" = 0
   SET "new_fx_7" = 0
   SET "trigger" = 0
   FOR (index = 0; index < fx_num; index = index + 1) BEGIN
     READ_SHORT ("%fx_off%" +        ("%index%" * 0x30)) "opcode"
     READ_LONG  ("%fx_off%" + 0x04 + ("%index%" * 0x30)) "string"
     READ_LONG  ("%fx_off%" + 0x08 + ("%index%" * 0x30)) "immune"
     READ_ASCII ("%fx_off%" + 0x14 + ("%index%" * 0x30)) "anim"
     PATCH_IF (("%opcode%" = 101) AND ("%immune%" = 109)) BEGIN // hold immunity
       SET "trigger" = 1
       SET "new_fx_1" = 1
       READ_ASCII ("%fx_off%" +        ("%index%" * 0x30)) "template" (0x30)
     END ELSE
     PATCH_IF (("%opcode%" = 101) AND ("%immune%" = 175)) BEGIN // hold creature type immunity
       SET "trigger" = 1
       SET "new_fx_2" = 1
       READ_ASCII ("%fx_off%" +        ("%index%" * 0x30)) "template" (0x30)
     END ELSE
     PATCH_IF (("%opcode%" = 101) AND ("%immune%" = 185)) BEGIN // hold creature 2 immunity
       SET "trigger" = 1
       SET "new_fx_3" = 1
       READ_ASCII ("%fx_off%" +        ("%index%" * 0x30)) "template" (0x30)
     END ELSE
     PATCH_IF (("%opcode%" = 169) AND ("%immune%" = 13)) BEGIN // prevent held icon
       SET "new_fx_4" = 1
     END ELSE
     PATCH_IF (("%opcode%" = 267) AND ("%string%" = 14102)) BEGIN // disable string 14102, "Held"
       SET "new_fx_5" = 1
     END ELSE
     PATCH_IF (("%opcode%" = 296) AND ("%anim%" STRING_COMPARE_CASE "spflayer" = 0)) BEGIN // spflayer anim
       SET "new_fx_6" = 1
     END ELSE
     PATCH_IF (("%opcode%" = 296) AND ("%anim%" STRING_COMPARE_CASE "spmindat" = 0)) BEGIN // spmindat anim
       SET "new_fx_7" = 1
     END
   END
   PATCH_IF ("%trigger%" = 1) BEGIN
     PATCH_IF ("%new_fx_1%" = 0) BEGIN
       INSERT_BYTES            ("%fx_off%"       ) 0x30
         WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
         WRITE_LONG            ("%fx_off%" + 0x08) 109          // bogstandard immunity to hold
       SET "new_fx" = ("%new_fx%" + 1)
     END
     PATCH_IF ("%new_fx_2%" = 0) BEGIN
       INSERT_BYTES            ("%fx_off%"       ) 0x30
         WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
         WRITE_LONG            ("%fx_off%" + 0x08) 175          // immunity to hold creature type
       SET "new_fx" = ("%new_fx%" + 1)
     END
     PATCH_IF ("%new_fx_3%" = 0) BEGIN
       INSERT_BYTES            ("%fx_off%"       ) 0x30
         WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
         WRITE_LONG            ("%fx_off%" + 0x08) 185          // immunity to hold creature 2
       SET "new_fx" = ("%new_fx%" + 1)
     END
     PATCH_IF ("%new_fx_4%" = 0) BEGIN
       INSERT_BYTES            ("%fx_off%"       ) 0x30
         WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
         WRITE_SHORT           ("%fx_off%"       ) 169          // prevent portrait icon
         WRITE_LONG            ("%fx_off%" + 0x08) 13           // held
       SET "new_fx" = ("%new_fx%" + 1)
     END
     PATCH_IF ("%new_fx_5%" = 0) BEGIN
       INSERT_BYTES            ("%fx_off%"       ) 0x30
         WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
         WRITE_SHORT           ("%fx_off%"       ) 267          // disable string
         WRITE_LONG            ("%fx_off%" + 0x04) 14102        // strref
       SET "new_fx" = ("%new_fx%" + 1)
     END
     PATCH_IF ("%new_fx_6%" = 0) BEGIN
       INSERT_BYTES            ("%fx_off%"       ) 0x30
         WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
         WRITE_SHORT           ("%fx_off%"       ) 296          // prevent specific animation
         WRITE_ASCII           ("%fx_off%" + 0x14) ~spflayer~   // mind flayer hold
       SET "new_fx" = ("%new_fx%" + 1)
     END
     PATCH_IF ("%new_fx_7%" = 0) BEGIN
       INSERT_BYTES            ("%fx_off%"       ) 0x30
         WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
         WRITE_SHORT           ("%fx_off%"       ) 296          // prevent specific animation
         WRITE_ASCII           ("%fx_off%" + 0x14) ~spmindat~   // mind flayer hold
       SET "new_fx" = ("%new_fx%" + 1)
     END
     PATCH_IF ("%new_fx%" > 0) BEGIN
       FOR (index2 = 0; index2 < abil_num; index2 = index2 + 1) BEGIN
         READ_SHORT  ("%abil_off%" + 0x20 + ("%abil_num%" * 0x38)) "abil_fx_idx"
         WRITE_SHORT ("%abil_off%" + 0x20 + ("%abil_num%" * 0x38)) ("%abil_fx_idx%" + "%new_fx%")
       END
     END
     WRITE_SHORT  0x70 ("%fx_num%" + "%new_fx%")
   END
 END
 BUT_ONLY_IF_IT_CHANGES

Link to comment

I wouldn't add Hold Creature 2. The way it's used in-game, it looks like it's supposed to be Hold Creature Bypass Stupid Normal Hold Creature Immunity. Yes, I know that some of the default stuff grants immunity to hold creature 2, but we probably shouldn't make the problem worse...

 

I would also finally have the SPFLAYER vs. SPMINDAT showdown. I think it's SPFLAYER that's used all of once in the game (it doesn't even have a VVC). If it's used for stun, I wouldn't add immunity to it for generic hold creature.

Link to comment

I see what you mean--both vvc files exist, but they both invoke spmindat.bam. :down: The only difference is that spflayer.vvc has no sounds attached and is only actually used by spin974 (MF Psionic Blast). I think we'd be better server changing spin974 to use spmindat and ignore spflayer. Will adjust code (afer food).

Link to comment

Without the hold creature 2 effect included, no creatures need updating.

 

// adds supplementary protections to hold immune creatures
//COPY_EXISTING_REGEXP GLOB ~^.+\.itm~ ~override~
COPY_EXISTING ~aldeth.itm~   ~override~
             ~antiweb.itm~  ~override~
             ~beholder.itm~ ~override~
             ~blun30.itm~   ~override~
             ~chalcy3.itm~  ~override~
             ~chalslay.itm~ ~override~
             ~chwraith.itm~ ~override~
             ~demilich.itm~ ~override~
             ~demogorg.itm~ ~override~
             ~dragring.itm~ ~override~
             ~finmel01.itm~ ~override~
             ~freering.itm~ ~override~
             ~gorfirg.itm~  ~override~
             ~gorjelfu.itm~ ~override~
             ~gorjelgr.itm~ ~override~
             ~gormisti.itm~ ~override~
             ~immchs.itm~   ~override~
             ~innoc.itm~    ~override~
             ~ipsion.itm~   ~override~
             ~jwsuper.itm~  ~override~
             ~killsw01.itm~ ~override~
             ~kuoring.itm~  ~override~
             ~lich.itm~     ~override~
             ~mage05.itm~   ~override~
             ~magiweb.itm~  ~override~
             ~npplat.itm~   ~override~
             ~objring.itm~  ~override~
             ~palring.itm~  ~override~
             ~plytroll.itm~ ~override~
             ~ravag03.itm~  ~override~
             ~ring09.itm~   ~override~
             ~ring94.itm~   ~override~
             ~ring95.itm~   ~override~
             ~ring97.itm~   ~override~
             ~ring98.itm~   ~override~
             ~ring99.itm~   ~override~
             ~ringkora.itm~ ~override~
             ~rossring.itm~ ~override~
             ~shalt01.itm~  ~override~
             ~shld25.itm~   ~override~
             ~sper07.itm~   ~override~
             ~sper12.itm~   ~override~
             ~stalker.itm~  ~override~
             ~surehp1.itm~  ~override~
             ~sw1h27.itm~   ~override~
             ~sw2h06.itm~   ~override~
             ~sw2h13.itm~   ~override~
             ~telslav2.itm~ ~override~
             ~trollall.itm~ ~override~
             ~trollimm.itm~ ~override~
             ~vampreg.itm~  ~override~
             ~vampreg1.itm~ ~override~
             ~vampreg2.itm~ ~override~
 PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
   READ_LONG   0x6a "fx_off"
   READ_SHORT  0x70 "fx_num"
   SET "new_fx_1" = 0
   SET "new_fx_2" = 0
   SET "new_fx_3" = 0
   SET "new_fx_4" = 0
   SET "new_fx_5" = 0
   SET "new_fx_6" = 0
   FOR (index = 0; index < fx_num; index = index + 1) BEGIN
     READ_SHORT ("%fx_off%" +        ("%index%" * 0x30)) "opcode"
     READ_LONG  ("%fx_off%" + 0x04 + ("%index%" * 0x30)) "string"
     READ_LONG  ("%fx_off%" + 0x08 + ("%index%" * 0x30)) "immune"
     READ_ASCII ("%fx_off%" + 0x14 + ("%index%" * 0x30)) "anim"
     PATCH_IF (("%opcode%" = 101) AND ("%immune%" = 109)) BEGIN // hold immunity
       SET "new_fx_1" = 1
       READ_ASCII ("%fx_off%" +        ("%index%" * 0x30)) "template" (0x30)
     END ELSE
     PATCH_IF (("%opcode%" = 101) AND ("%immune%" = 175)) BEGIN // hold creature type immunity
       SET "new_fx_2" = 1
       READ_ASCII ("%fx_off%" +        ("%index%" * 0x30)) "template" (0x30)
     END ELSE
     PATCH_IF (("%opcode%" = 101) AND ("%immune%" = 185)) BEGIN // hold creature 2 immunity
       SET "new_fx_3" = 1
       READ_ASCII ("%fx_off%" +        ("%index%" * 0x30)) "template" (0x30)
     END ELSE
     PATCH_IF (("%opcode%" = 169) AND ("%immune%" = 13)) BEGIN // prevent held icon
       SET "new_fx_4" = 1
     END ELSE
     PATCH_IF (("%opcode%" = 267) AND ("%string%" = 14102)) BEGIN // disable string 14102, "Held"
       SET "new_fx_5" = 1
     END ELSE
     PATCH_IF (("%opcode%" = 296) AND ("%anim%" STRING_COMPARE_CASE "spmindat" = 0)) BEGIN // spmindat anim
       SET "new_fx_6" = 1
     END
   END
   PATCH_IF (("%new_fx_1%" = 1) OR ("%new_fx_2%" = 1) OR ("%new_fx_3%" = 1)) BEGIN
     SET "new_fx" = 0
     PATCH_IF ("%new_fx_1%" = 0) BEGIN
       INSERT_BYTES            ("%fx_off%"       ) 0x30
         WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
         WRITE_LONG            ("%fx_off%" + 0x08) 109          // bogstandard immunity to hold
       SET "new_fx" = ("%new_fx%" + 1)
     END
     PATCH_IF ("%new_fx_2%" = 0) BEGIN
       INSERT_BYTES            ("%fx_off%"       ) 0x30
         WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
         WRITE_LONG            ("%fx_off%" + 0x08) 175          // immunity to hold creature type
       SET "new_fx" = ("%new_fx%" + 1)
     END
     PATCH_IF ("%new_fx_4%" = 0) BEGIN
       INSERT_BYTES            ("%fx_off%"       ) 0x30
         WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
         WRITE_SHORT           ("%fx_off%"       ) 169          // prevent portrait icon
         WRITE_LONG            ("%fx_off%" + 0x08) 13           // held
       SET "new_fx" = ("%new_fx%" + 1)
     END
     PATCH_IF ("%new_fx_5%" = 0) BEGIN
       INSERT_BYTES            ("%fx_off%"       ) 0x30
         WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
         WRITE_SHORT           ("%fx_off%"       ) 267          // disable string
         WRITE_LONG            ("%fx_off%" + 0x04) 14102        // strref
       SET "new_fx" = ("%new_fx%" + 1)
     END
     PATCH_IF ("%new_fx_6%" = 0) BEGIN
       INSERT_BYTES            ("%fx_off%"       ) 0x30
         WRITE_EVALUATED_ASCII ("%fx_off%"       ) "%template%" // clones immunity effect
         WRITE_SHORT           ("%fx_off%"       ) 296          // prevent specific animation
         WRITE_ASCII           ("%fx_off%" + 0x14) ~spmindat~   // mind flayer hold
       SET "new_fx" = ("%new_fx%" + 1)
     END
     PATCH_IF ("%new_fx%" > 0) BEGIN
       PATCH_PRINT "              ~%SOURCE_FILE%~ ~override~"
       WRITE_SHORT  0x70 ("%fx_num%" + "%new_fx%")
       READ_LONG   0x64 "abil_off"
       READ_SHORT  0x68 "abil_num"
       FOR (index2 = 0; index2 < abil_num; index2 = index2 + 1) BEGIN
         READ_SHORT  ("%abil_off%" + 0x20 + ("%abil_num%" * 0x38)) "abil_fx_idx"
         WRITE_SHORT ("%abil_off%" + 0x20 + ("%abil_num%" * 0x38)) ("%abil_fx_idx%" + "%new_fx%")
       END
     END
   END
 END
 BUT_ONLY_IF_IT_CHANGES

 

And the pionic blast changes.

 

// MF psionic blast only spell to use spflayer.vvc; changing to use spmindat.vvc--calls same BAM to be played plus sound
// changing this reduces having to add protection from animation: spflayer in a lot of other files
COPY_EXISTING ~spin974.spl~ ~override~
 READ_LONG  0x64 "abil_off"
 READ_SHORT 0x68 "abil_num"
 READ_LONG  0x6a "fx_off"
 FOR (index = 0; index < abil_num; index = index + 1) BEGIN
   READ_SHORT ("%abil_off%" + 0x1e + (0x28 * "%index%")) "abil_fx_num"
   READ_SHORT ("%abil_off%" + 0x20 + (0x28 * "%index%")) "abil_fx_idx"
   FOR (index2 = 0; index2 < abil_fx_num; index2 = index2 + 1) BEGIN
     READ_SHORT ("%fx_off%" +        (0x30 * ("%abil_fx_idx%" + "%index2%"))) "opcode"
     READ_ASCII ("%fx_off%" + 0x14 + (0x30 * ("%abil_fx_idx%" + "%index2%"))) "anim"
     PATCH_IF (("%opcode%" = 215) AND ("%anim%" STRING_COMPARE_CASE "spflayer" = 0)) BEGIN // play 3d animation spflayer.vvc
       WRITE_ASCII ("%fx_off%" + 0x14 + (0x30 * ("%abil_fx_idx%" + "%index2%"))) ~spmindat~
     END
   END
 END
 BUT_ONLY_IF_IT_CHANGES

Link to comment
I see what you mean--both vvc files exist, but they both invoke spmindat.bam. :laugh: The only difference is that spflayer.vvc has no sounds attached and is only actually used by spin974 (MF Psionic Blast). I think we'd be better server changing spin974 to use spmindat and ignore spflayer. Will adjust code (afer food).

Ah. I guess I just fix up the SPFLAYER VVC locally, and then try to make sure that SPMINDAT == hold and SPFLAYER == stun.
Link to comment

Well, I was using the Ring of Free action and Firecam Full Plate, and the Mind Flayers were stunning me anyway with their Psionics. I had to put back in Immunity to SPIN974 to get that stun effect to not work.

 

Also - the Firecam Full plate (NPPLAT) has a sub-set of the protections ring of Free Action has. Since it is supposed to give the same Free Action, perhaps it should?

Link to comment
Well, I was using the Ring of Free action and Firecam Full Plate, and the Mind Flayers were stunning me anyway with their Psionics. I had to put back in Immunity to SPIN974 to get that stun effect to not work.

Free Action does not protect against stun, per the developers. This is why there's an optional component if you wish for Free Action to provide this protection.

 

Also - the Firecam Full plate (NPPLAT) has a sub-set of the protections ring of Free Action has. Since it is supposed to give the same Free Action, perhaps it should?

The description mentions that obstacles like Web don't impede the user, which is not a 'true' Free Action.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...