Jump to content

Figurine fixes


CamDawg

Recommended Posts

Four figurines were using screwy effects to simulate their once-per-day abilities. Rather than just using charges, they would get deleted out of inventory and then reappear 24 hours later. However, if the character was dead when the timer expired, the figurine gets lost forever. By eliminating these effects, they fall back to a charge system, which works just fine.

 

// figurines were using some screwy system of reappearing that broke; should be using charges
COPY_EXISTING ~misc3d.itm~ ~override~ // golden lion
             ~misc3e.itm~ ~override~ // back spider
             ~misc3f.itm~ ~override~ // jade hound
             ~misc7t.itm~ ~override~ // moon dog
 READ_LONG  0x64 "abil_off"
 READ_SHORT 0x68 "abil_num"
 READ_LONG  0x6a "fx_off"
 SET "abil_loops" = 0
 SET "delta" = 0
 WHILE ("%abil_num%" > "%abil_loops%") BEGIN
   READ_SHORT ("%abil_off%" + ("%abil_loops%" * 0x38)) "type"
   PATCH_IF ("%type%" = 3) BEGIN // if magical ability
     READ_SHORT  ("%abil_off%" + 0x1e + ("%abil_loops%" * 0x38)) "fx_num"
     READ_SHORT  ("%abil_off%" + 0x20 + ("%abil_loops%" * 0x38)) "fx_idx"
     SET "fx_idx" = ("%fx_idx%" - "%delta%")
     WRITE_SHORT ("%abil_off%" + 0x20 + ("%abil_loops%" * 0x38)) "%fx_idx%"
     SET "fx_init" = ("%fx_num%" + "%delta%")
     WHILE ("%fx_num%" > 0) BEGIN // searches for certain opcodes and deletes them
       SET "fx_num" = ("%fx_num%" - 1)
       READ_SHORT ("%fx_off%" + (("%fx_idx%" + "%fx_num%") * 0x30)) "opcode"
       PATCH_IF (("%opcode%" = 122) OR ("%opcode%" = 123) OR ("%opcode%" = 139)) BEGIN
         DELETE_BYTES ("%fx_off%" + (("%fx_idx%" + "%fx_num%") * 0x30)) 0x30
         SET "delta" = ("%delta%" + 1)
       END
     END
     WRITE_SHORT ("%abil_off%" + 0x1e + ("%abil_num%" * 0x38)) ("%fx_init%" - "%delta%")
   END
   SET "abil_loops" = ("%abil_loops%" + 1)
 END
 BUT_ONLY_IF_IT_CHANGES

Link to comment

To do this the right way, you'll need some uber-script updates. Although I now just use the simple once/day EFF, I had a light version in the old fixpack that did this the "right" way (since the figurines are supposed to *become* the summoned creature, they disappear from the inventory and reappear after the creature dies or is unsummoned). It basically added a Set Global effect, and then Baldur.bcs would take appropriate action (the item would be returned after 5 minutes, with a DisplayStringHead() "Your figurine returns.").

 

I only ever did this for Player1 (otherwise, you have to find who used the item, and set the variable via scripting, and then run checks for InventoryFull() and restore the item to the right character); I found it too confusing in battle and switched it to the not-so-nice method (although it worked perfectly).

Link to comment

Archived

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

×
×
  • Create New...