Jump to content

Keldorn prof fix


CamDawg

Recommended Posts

Keldorn is missing his 2 pips in longsword in his level nine incarnation. Reocded from BD.

 

//Keldorn proficiency fix
COPY_EXISTING ~keldor9.cre~ ~override~
 READ_LONG 0x2a0 "kspl_off"
 READ_LONG 0x2a8 "minfo_off"
 READ_LONG 0x2b0 "mspl_off"
 READ_LONG 0x2b8 "itmslot_off"
 READ_LONG 0x2bc "itm_off"
 READ_LONG 0x2c4 "fx_off"
 READ_LONG 0x2c8 "fx_num"
 SET "patch" = 0
 WHILE (("%fx_num%" > 0) AND ("%patch%" = 0)) BEGIN
   SET "fx_num" = ("%fx_num%" - 1)
   READ_LONG ("%fx_off%" + 0x08 + ("%fx_num%" * 0x128)) "type"
   READ_LONG ("%fx_off%" + 0x18 + ("%fx_num%" * 0x128)) "weap"
   PATCH_IF (("%type%" = 233) AND ("%weap%" = 90)) // if longsword prof exists
     WRITE_LONG ("%fx_off%" + 0x14 + ("%fx_num%" * 0x128)) 2
     SET "patch" = 1
   END
 END
 PATCH_IF ("%patch%" = 0) BEGIN // if not present and adjusted
   INSERT_BYTES  "%fx_off%" 0x128 // inserting new prof effect
     WRITE_LONG  ("%fx_off%" + 0x08) 233    // opcode
     WRITE_LONG  ("%fx_off%" + 0x18) 90     // prof
     WRITE_LONG  ("%fx_off%" + 0x1c) 9      // timing
     WRITE_SHORT ("%fx_off%" + 0x24) 100    // prob
     WRITE_ASCII ("%fx_off%" + 0x68) ~None~ // vvc
   SET "patch" = 2
 END
 PATCH_IF ("%patch%" = 2) BEGIN // fixes offsets if bytes were inserted
   PATCH_IF NOT ("%fx_off%" > "%kspl_off%") BEGIN
     WRITE_LONG 0x2a0 ("%kspl_off%" + 0x128)
   END
   PATCH_IF NOT ("%fx_off%" > "%minfo_off%") BEGIN
     WRITE_LONG 0x2a8 ("%minfo_off%" + 0x128)
   END
   PATCH_IF NOT ("%fx_off%" > "%mspl_off%") BEGIN
     WRITE_LONG 0x2b0 ("%mspl_off%" + 0x128)
   END
   PATCH_IF NOT ("%fx_off%" > "%itmslot_off%") BEGIN
     WRITE_LONG 0x2b8 ("%itmslot_off%" + 0x128)
   END
   PATCH_IF NOT ("%fx_off%" > "%itm_off%") BEGIN
     WRITE_LONG 0x2bc ("%itm_off%" + 0x128)
   END
 END
 IF ~CRE~
 BUT_ONLY_IF_IT_CHANGES

Link to comment

Archived

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

×
×
  • Create New...