Jump to content

Foebane


Recommended Posts

Foebane's HP bonus to self on a successful hit was not bypassing MR.

 

// foebane's HP bonus should bypass MR on self
COPY_EXISTING ~sw1h63.itm~ ~override~
 READ_LONG  0x64 "abil_off"
 READ_SHORT 0x68 "abil_num"
 READ_LONG  0x6a "fx_off"
 WHILE ("%abil_num%" > 0) BEGIN
   SET "abil_num" = ("%abil_num%" - 1)
   READ_SHORT  ("%abil_off%" + ("%abil_num%" * 0x38)) "type"
   PATCH_IF ("%type%" = 1) BEGIN // melee
     READ_SHORT  ("%abil_off%" + 0x1e + ("%abil_num%" * 0x38)) "abil_fx_num"
     READ_SHORT  ("%abil_off%" + 0x20 + ("%abil_num%" * 0x38)) "abil_fx_idx"
     WHILE ("%abil_fx_num%" > 0) BEGIN
       SET "abil_fx_num" = ("%abil_fx_num%" - 1)
       READ_SHORT ("%fx_off%" + (("%abil_fx_idx%" + "%abil_fx_num%") * 0x30)) "opcode"
       PATCH_IF ("%opcode%" = 18) BEGIN // max HP bonus
         WRITE_SHORT ("%fx_off%" + 0x0d + (("%abil_fx_idx%" + "%abil_fx_num%") * 0x30)) 3 // dispel/bypass MR
       END
     END
   END
 END
 BUT_ONLY_IF_IT_CHANGES

Link to comment

Scratch that. It doesn't have drain effects, it actually casts LMD per the weapon description, implying that MR should come into play. As such, I've replaced the effects attached to melee with one--cast spell, spin104 (LMD). This ensures the same MR checks and whatnot as the fixed LMD. If we determine later that MR should be bypassed, we can replace cast spin104 with cast spin104a.

 

// foebane's LMD is bypassing MR
COPY_EXISTING ~sw1h63.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"
   SET "delta" = 0
   SET "loops" = 0
   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
       DELETE_BYTES ("%fx_off%" + (0x30 * "%abil_fx_idx%")) (0x30 * "%abil_fx_num%") // removes all old effects
       SET "delta1" = (1 - "%abil_fx_num%")
       INSERT_BYTES  ("%fx_off%" +        (0x30 * "%abil_fx_idx%")) 0x30      // new effect
         WRITE_SHORT ("%fx_off%" +        (0x30 * "%abil_fx_idx%")) 146       // cast spell
         WRITE_BYTE  ("%fx_off%" + 0x02 + (0x30 * "%abil_fx_idx%")) 2         // target: self
         WRITE_BYTE  ("%fx_off%" + 0x03 + (0x30 * "%abil_fx_idx%")) 1         // level
         WRITE_LONG  ("%fx_off%" + 0x04 + (0x30 * "%abil_fx_idx%")) 1         // cast at level
         WRITE_LONG  ("%fx_off%" + 0x08 + (0x30 * "%abil_fx_idx%")) 1         // cast instantly
         WRITE_BYTE  ("%fx_off%" + 0x0d + (0x30 * "%abil_fx_idx%")) 1         // dispel/not 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%")) ~spin104~ // spell
     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...