Jump to content

(Minor) Globe of Invuln vs., Skull Trap


CamDawg

Recommended Posts

Skull Trap affects creatures protected by both Minor and full-blown Globes of Invulnerability.

 

// (minor) globe of invulnerability should protect against skull trap
COPY_EXISTING ~spwi406.spl~ ~override~ // minor globe of invulnerability
             ~spwi602.spl~ ~override~ // globe of invulnerability
   READ_LONG  0x64 "abil_off"
   READ_SHORT 0x68 "abil_num"
   READ_LONG  0x6a "fx_off"
   SET "loops" = 0
   SET "delta" = 0
   WHILE ("%loops%" < "%abil_num%") BEGIN
     READ_SHORT ("%abil_off%" + 0x1e + (0x28 * "%loops%")) "abil_fx_num"
     READ_SHORT ("%abil_off%" + 0x20 + (0x28 * "%loops%")) "abil_fx_idx"
     SET "abil_fx_idx" = ("%abil_fx_idx%" + "%delta%")
     WRITE_SHORT ("%abil_off%" + 0x20 + (0x28 * "%loops%")) "%abil_fx_idx%"
     SET "subloops" = "%abil_fx_num%"
     WHILE ("%subloops%" > 0) BEGIN
       SET "subloops" = ("%subloops%" - 1)
       READ_SHORT ("%fx_off%" +        (0x30 * ("%abil_fx_idx%" + "%subloops%"))) "opcode"
       PATCH_IF ("%opcode%" = 206) BEGIN // grab parameters from another spell immunity opcode
         READ_BYTE  ("%fx_off%" + 0x02 + (0x30 * ("%abil_fx_idx%" + "%subloops%"))) "target"
         READ_BYTE  ("%fx_off%" + 0x0d + (0x30 * ("%abil_fx_idx%" + "%subloops%"))) "bypass"
         READ_BYTE  ("%fx_off%" + 0x0c + (0x30 * ("%abil_fx_idx%" + "%subloops%"))) "timing"
         READ_LONG  ("%fx_off%" + 0x0e + (0x30 * ("%abil_fx_idx%" + "%subloops%"))) "duration"
         SET "subloops" = 0 // kills WHILE loop
       END
     END
     INSERT_BYTES  ("%fx_off%" +        (0x30 * ("%abil_fx_num%" + "%abil_fx_idx%"))) 0x30
       WRITE_SHORT ("%fx_off%" +        (0x30 * ("%abil_fx_num%" + "%abil_fx_idx%"))) 206          // spell immunity
       WRITE_BYTE  ("%fx_off%" + 0x02 + (0x30 * ("%abil_fx_num%" + "%abil_fx_idx%"))) "%target%"   // inherits target
       WRITE_BYTE  ("%fx_off%" + 0x03 + (0x30 * ("%abil_fx_num%" + "%abil_fx_idx%"))) 4            // power
       WRITE_BYTE  ("%fx_off%" + 0x0c + (0x30 * ("%abil_fx_num%" + "%abil_fx_idx%"))) 0            // instant/limited
       WRITE_BYTE  ("%fx_off%" + 0x0d + (0x30 * ("%abil_fx_num%" + "%abil_fx_idx%"))) "%bypass%"   // inherits dispel/MR
       WRITE_LONG  ("%fx_off%" + 0x0e + (0x30 * ("%abil_fx_num%" + "%abil_fx_idx%"))) "%duration%" // inherits duration
       WRITE_BYTE  ("%fx_off%" + 0x12 + (0x30 * ("%abil_fx_num%" + "%abil_fx_idx%"))) 100          // probability
       WRITE_ASCII ("%fx_off%" + 0x14 + (0x30 * ("%abil_fx_num%" + "%abil_fx_idx%"))) ~spwi313~    // skull trap
     SET "delta1" = 1
     SET "delta" = ("%delta%" + "%delta1%")
     WRITE_SHORT ("%abil_off%" + 0x1e + (0x28 * "%loops%")) ("%abil_fx_num%" + "%delta1%")
     SET "loops" = ("%loops%" + 1)
   END
 END
 BUT_ONLY_IF_IT_CHANGES

Link to comment

Archived

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

×
×
  • Create New...