Jump to content

Arbane's Sword


Recommended Posts

Arbane's Sword has an extraneous stun immunity. This removes the immunity and associated effects, and changes the disable sting effect to prevent "Held" instead of "Stunned".

 

// arbane's sword has extraneous effects and prevents the wrong string
COPY_EXISTING ~sw1h27.itm~ ~override~
 READ_LONG  0x64 "abil_off"
 READ_SHORT 0x68 "abil_num"
 READ_LONG  0x6a "fx_off"
 READ_SHORT 0x70 "fx_num"
 SET "delta" = 0
 WHILE ("%fx_num%" > 0) BEGIN
   SET "fx_num" = ("%fx_num%" - 1)
   READ_SHORT ("%fx_off%" +        ("%fx_num%" * 0x30)) "type"
   READ_LONG  ("%fx_off%" + 0x04 + ("%fx_num%" * 0x30)) "string"
   READ_LONG  ("%fx_off%" + 0x08 + ("%fx_num%" * 0x30)) "parameter"
   PATCH_IF (("%type%" = 296) OR // immunity to specific animation
             (("%type%" = 101) AND ("%parameter%" = 45)) OR // immunity to stun
             (("%type%" = 169) AND ("%parameter%" = 55))) BEGIN // prevent stun portrait icon
     DELETE_BYTES ("%fx_off%" + ("%fx_num%" * 0x30)) 0x30 // delete effect
     SET "delta" = ("%delta%" - 1)
   END
   PATCH_IF (("%type%" = 267) AND ("%string%" = 1280)) BEGIN // disable dispay string: stunned
     SAY ("%fx_off%" + 0x04 + ("%fx_num%" * 0x30)) #14102 // held
   END
 END
 WRITE_SHORT 0x70 ("%fx_num%" + "%delta%")
 WHILE ("%abil_num%" > 0) BEGIN
   SET "abil_num" = ("%abil_num%" - 1)
   READ_SHORT  ("%abil_off%" + 0x20 + ("%abil_num%" * 0x38)) "abil_fx_idx"
   WRITE_SHORT ("%abil_off%" + 0x20 + ("%abil_num%" * 0x38)) ("%abil_fx_idx%" + "%delta%")
 END
 BUT_ONLY_IF_IT_CHANGES

Link to comment

It may also be worthwhile to remove the immunity to the grease and entangle overlays. These spells work by setting the movement rate of the creature (normal Free Action protects from this, but the sword doesn't). More copy/paste madness, it seems.

Link to comment

Oh, good catch. Added removal of those three immunities, plus corrected a bug that was leaving the item with -3 effects. :bday:

 

// arbane's sword has extraneous effects and prevents the wrong string
COPY_EXISTING ~sw1h27.itm~ ~override~
 READ_LONG  0x64 "abil_off"
 READ_SHORT 0x68 "abil_num"
 READ_LONG  0x6a "fx_off"
 READ_SHORT 0x70 "fx_num"
 SET "orig_fx" = "%fx_num%"
 SET "delta" = 0
 WHILE ("%fx_num%" > 0) BEGIN
   SET "fx_num" = ("%fx_num%" - 1)
   READ_SHORT ("%fx_off%" +        ("%fx_num%" * 0x30)) "type"
   READ_LONG  ("%fx_off%" + 0x04 + ("%fx_num%" * 0x30)) "string"
   READ_LONG  ("%fx_off%" + 0x08 + ("%fx_num%" * 0x30)) "parameter"
   PATCH_IF (("%type%" = 296) OR // immunity to specific animation
             (("%type%" = 101) AND (("%parameter%" = 45) OR ("%parameter%" = 154) OR ("%parameter%" = 157) OR ("%parameter%" = 158))) OR // immunity to stun, entangle, web, grease
             (("%type%" = 169) AND ("%parameter%" = 55))) BEGIN // prevent stun portrait icon
     DELETE_BYTES ("%fx_off%" + ("%fx_num%" * 0x30)) 0x30 // delete effect
     SET "delta" = ("%delta%" - 1)
   END
   PATCH_IF (("%type%" = 267) AND ("%string%" = 1280)) BEGIN // disable dispay string: stunned
     SAY ("%fx_off%" + 0x04 + ("%fx_num%" * 0x30)) #14102 // held
   END
 END
 WRITE_SHORT 0x70 ("%orig_fx%" + "%delta%")
 WHILE ("%abil_num%" > 0) BEGIN
   SET "abil_num" = ("%abil_num%" - 1)
   READ_SHORT  ("%abil_off%" + 0x20 + ("%abil_num%" * 0x38)) "abil_fx_idx"
   WRITE_SHORT ("%abil_off%" + 0x20 + ("%abil_num%" * 0x38)) ("%abil_fx_idx%" + "%delta%")
 END
 BUT_ONLY_IF_IT_CHANGES

Link to comment

Archived

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

×
×
  • Create New...