Jump to content

Carsomyr


Recommended Posts

This fixes the bug in both Carsomyr +5 and +6 where the dispel on hit effect does not work; this uses the same methodology as the SotM now. It also fixes the bug where Carsomyr +5 was using d10 instead of d12 for melee damage. Carsomyr +6 is ToB only.

 

// Carsomyr's dispel on hit effect is incorrect
COPY_EXISTING ~sw2h10.itm~ ~override~
             ~sw2h19.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 "delta" = 0
   SET "loops" = "%abil_num%"
   WHILE ("%loops%" < "%abil_num%") BEGIN
     SET "delta1" = 0
     READ_BYTE  ("%abil_off%" +        ("%loops%" * 0x38)) "type"
     READ_SHORT ("%abil_off%" + 0x1e + ("%loops%" * 0x38)) "abil_fx_num"
     READ_SHORT ("%abil_off%" + 0x20 + ("%loops%" * 0x38)) "abil_fx_idx"
     SET "abil_fx_idx" = ("%abil_fx_idx%" + "%delta%")
     WRITE_SHORT  ("%abil_off%" + 0x20 + ("%loops%" * 0x38)) "%abil_fx_idx%"
     PATCH_IF ("%type%" = 1) BEGIN // melee
       WRITE_SHORT ("%abil_off%" + 0x16 + ("%loops%" * 0x38)) 12 // sets dice size to 12
       DELETE_BYTES ("%fx_off%" + (0x30 * "%abil_fx_idx%")) (0x30 * "%abil_fx_num%") // removes all old effects
       SET "delta1" = (6 - "%fx_num%")
       INSERT_BYTES  ("%fx_off%" +        (0x30 * "%abil_fx_idx%")) 0x30   // new effect
         WRITE_SHORT ("%fx_off%" +        (0x30 * "%abil_fx_idx%")) 139    // display string
         WRITE_BYTE  ("%fx_off%" + 0x02 + (0x30 * "%abil_fx_idx%")) 2      // target: preset target
         SAY         ("%fx_off%" + 0x04 + (0x30 * "%abil_fx_idx%")) #14056 // ~Dispel Effects~
         WRITE_BYTE  ("%fx_off%" + 0x0d + (0x30 * "%abil_fx_idx%")) 3      // dispel/bypass resistance
         WRITE_LONG  ("%fx_off%" + 0x0e + (0x30 * "%abil_fx_idx%")) 1      // duration
         WRITE_BYTE  ("%fx_off%" + 0x12 + (0x30 * "%abil_fx_idx%")) 100    // probability
       INSERT_BYTES  ("%fx_off%" +        (0x30 * "%abil_fx_idx%")) 0x30 // new effect
         WRITE_SHORT ("%fx_off%" +        (0x30 * "%abil_fx_idx%")) 240  // remove icon 2
         WRITE_BYTE  ("%fx_off%" + 0x02 + (0x30 * "%abil_fx_idx%")) 2    // target: preset target
         WRITE_LONG  ("%fx_off%" + 0x08 + (0x30 * "%abil_fx_idx%")) 48   // feeblemind
         WRITE_BYTE  ("%fx_off%" + 0x0c + (0x30 * "%abil_fx_idx%")) 1    // instant/permanent until death
         WRITE_BYTE  ("%fx_off%" + 0x0d + (0x30 * "%abil_fx_idx%")) 2    // not dispel/not bypass resistance
         WRITE_BYTE  ("%fx_off%" + 0x12 + (0x30 * "%abil_fx_idx%")) 100  // probability
       INSERT_BYTES  ("%fx_off%" +        (0x30 * "%abil_fx_idx%")) 0x30 // new effect
         WRITE_SHORT ("%fx_off%" +        (0x30 * "%abil_fx_idx%")) 77   // cure feeblemindedness
         WRITE_BYTE  ("%fx_off%" + 0x02 + (0x30 * "%abil_fx_idx%")) 2    // target: preset target
         WRITE_BYTE  ("%fx_off%" + 0x0c + (0x30 * "%abil_fx_idx%")) 1    // instant/permanent until death
         WRITE_BYTE  ("%fx_off%" + 0x0d + (0x30 * "%abil_fx_idx%")) 2    // not dispel/not bypass resistance
         WRITE_BYTE  ("%fx_off%" + 0x12 + (0x30 * "%abil_fx_idx%")) 100  // probability
       INSERT_BYTES  ("%fx_off%" +        (0x30 * "%abil_fx_idx%")) 0x30      // new effect
         WRITE_SHORT ("%fx_off%" +        (0x30 * "%abil_fx_idx%")) 215       // play 3d effect
         WRITE_BYTE  ("%fx_off%" + 0x02 + (0x30 * "%abil_fx_idx%")) 2         // target: preset target
         WRITE_LONG  ("%fx_off%" + 0x08 + (0x30 * "%abil_fx_idx%")) 1         // play over target
         WRITE_BYTE  ("%fx_off%" + 0x0d + (0x30 * "%abil_fx_idx%")) 3         // dispel/bypass resistance
         WRITE_LONG  ("%fx_off%" + 0x0e + (0x30 * "%abil_fx_idx%")) 1         // duration
         WRITE_BYTE  ("%fx_off%" + 0x12 + (0x30 * "%abil_fx_idx%")) 100       // probability
         WRITE_ASCII ("%fx_off%" + 0x14 + (0x30 * "%abil_fx_idx%")) ~spdisma~ // vvc file
       INSERT_BYTES  ("%fx_off%" +        (0x30 * "%abil_fx_idx%")) 0x30       // new effect
         WRITE_SHORT ("%fx_off%" +        (0x30 * "%abil_fx_idx%")) 177        // use eff file
         WRITE_BYTE  ("%fx_off%" + 0x02 + (0x30 * "%abil_fx_idx%")) 2          // target: preset target
         WRITE_LONG  ("%fx_off%" + 0x04 + (0x30 * "%abil_fx_idx%")) 7          // illusionary
         WRITE_LONG  ("%fx_off%" + 0x08 + (0x30 * "%abil_fx_idx%")) 7          // gender
         WRITE_BYTE  ("%fx_off%" + 0x0c + (0x30 * "%abil_fx_idx%")) 1          // instant/permanent until death
         WRITE_BYTE  ("%fx_off%" + 0x0d + (0x30 * "%abil_fx_idx%")) 2          // not dispel/not bypass resistance
         WRITE_BYTE  ("%fx_off%" + 0x12 + (0x30 * "%abil_fx_idx%")) 100        // probability
         WRITE_ASCII ("%fx_off%" + 0x14 + (0x30 * "%abil_fx_idx%")) ~destself~ // eff file
       INSERT_BYTES  ("%fx_off%" +        (0x30 * "%abil_fx_idx%")) 0x30 // new effect
         WRITE_SHORT ("%fx_off%" +        (0x30 * "%abil_fx_idx%")) 58   // dispel effects
         WRITE_BYTE  ("%fx_off%" + 0x02 + (0x30 * "%abil_fx_idx%")) 2    // target: preset target
         WRITE_LONG  ("%fx_off%" + 0x04 + (0x30 * "%abil_fx_idx%")) 30   // level
         WRITE_LONG  ("%fx_off%" + 0x08 + (0x30 * "%abil_fx_idx%")) 2    // use specific level
         WRITE_BYTE  ("%fx_off%" + 0x0c + (0x30 * "%abil_fx_idx%")) 1    // instant/permanent until death
         WRITE_BYTE  ("%fx_off%" + 0x0d + (0x30 * "%abil_fx_idx%")) 2    // not dispel/not bypass resistance
         WRITE_BYTE  ("%fx_off%" + 0x12 + (0x30 * "%abil_fx_idx%")) 100  // probability
     END
     SET "abil_fx_num" = ("%abil_fx_num%" + "%delta1%")
     WRITE_SHORT  ("%abil_off%" + 0x1e + ("%loops%" * 0x38)) "%abil_fx_num%"
     SET "delta" = ("%delta%" + "%delta1%")
     SET "loops" = ("%loops%" + 1)
   END
 END

Link to comment

Archived

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

×
×
  • Create New...