Jump to content

Staff of Curing


Recommended Posts

Staff of Curing grants spurious save bonuses, has an incorrect enchantment level, does not bypass MR, and has an incorrect speed factor.

 

// disables erroneous save effects. fixes speed, healing bypass MR, and fixes enchanment
COPY_EXISTING ~staf10.itm~ ~override~
 WRITE_LONG 0x60 1 // enchantment level
 READ_LONG  0x64 "abil_off"
 READ_SHORT 0x68 "abil_num"
 READ_LONG  0x6a "fx_off"
 READ_SHORT 0x70 "fx_num"
 WHILE ("%abil_num%" > 0) BEGIN
   SET "abil_num" = ("%abil_num%" - 1)
   READ_BYTE ("%abil_off%" + ("%abil_num%" * 0x38)) "type"
   PATCH_IF ("%type%" = 1) BEGIN // melee
     WRITE_SHORT ("%abil_off%" + 0x12 + ("%abil_num%" * 0x38)) 4 // corrects speed factor
   END
   PATCH_IF ("%type%" = 3) BEGIN // magical
     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 // searches through fx for THAC0 bonus
       SET "abil_fx_num" = ("%abil_fx_num%" - 1)
       WRITE_BYTE ("%fx_off%" + 0x0d + (("%abil_fx_idx%" + "%abil_fx_num%") * 0x30)) 3 // dispel/bypass resistance
     END
   END
 END
 WHILE ("%fx_num%" > 0) BEGIN
   SET "fx_num" = ("%fx_num%" - 1)
   READ_BYTE ("%fx_off%" +        ("%fx_num%" * 0x30)) "type"
   PATCH_IF (("%type%" > 32) AND ("%type%" < 38)) BEGIN // save bonuses
     WRITE_BYTE ("%fx_off%" + 0x12 + ("%fx_num%" * 0x30)) 0 // probability: 0
   END
 END
 BUT_ONLY_IF_IT_CHANGES

Link to comment

Archived

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

×
×
  • Create New...