BACKUP ~1pp/backup~
AUTHOR ~Created by Erephine~
MODDER
VERSION ~v2.7~
README ~1pp/readme-1pp.html~

ALLOW_MISSING 
  ~clck31.itm~   // ToB item
  ~compon05.itm~
  ~dagg21.itm~
  ~dagg22.itm~
  ~demosum4.itm~
  ~helm31.itm~
  ~helm32.itm~
  ~helm33.itm~
  ~quiver02.itm~
  ~quiver04.itm~
  ~quiver05.itm~
  ~quiver06.itm~
  ~shld31.itm~
  ~sw1h59.itm~
  ~sw1h61.itm~
  ~sw1h63.itm~
  ~sw1h65.itm~
  ~sw1h69.itm~
  ~sw1h71.itm~
  ~sw2h19.itm~
  ~sw2h20.itm~

DEFINE_ACTION_MACRO ~Locations~ BEGIN
// for weapons
OUTER_SET wgrey = 16
OUTER_SET wteal = 17
OUTER_SET wpink = 18
OUTER_SET wyellow = 19
OUTER_SET wred = 20
OUTER_SET wblue = 21
OUTER_SET wgreen = 22
// for helmets
OUTER_SET hgrey = 48
OUTER_SET hteal = 49
OUTER_SET hpink = 50
OUTER_SET hyellow = 51
OUTER_SET hred = 52
OUTER_SET hblue = 53
OUTER_SET hgreen = 54
// for shields
OUTER_SET sgrey = 32
OUTER_SET steal = 33
OUTER_SET spink = 34
OUTER_SET syellow = 35
OUTER_SET sred = 36
OUTER_SET sblue = 37
OUTER_SET sgreen = 38
END

DEFINE_PATCH_MACRO ~clear~ BEGIN
SET opcode_to_delete = 7
LAUNCH_PATCH_MACRO DELETE_ITEM_EQEFFECT
SET opcode_to_delete = 8
LAUNCH_PATCH_MACRO DELETE_ITEM_EQEFFECT
SET opcode_to_delete = 9
LAUNCH_PATCH_MACRO DELETE_ITEM_EQEFFECT
END


DEFINE_PATCH_MACRO ~colour~ BEGIN
SET opcode = 7			// Set opcode
SET target = 1			// target type
SET timing = 2			// timing type
SET power = 0			// power
SET resist_dispel = 0	// dispel/resitance
SET duration = 0		// duration
SET probability1 = 100	// probability 1
SET probability2 = 0	// probability 2
SPRINT "resource" "" 		// resource
SET dicenumber = 0		// dice number 
SET dicesize = 0		// dice size
SET savingthrow = 0   // saving throw
SET savebonus = 0		// saving throw bonus 
SET parameter1 = gradient // set colour gradient
SET parameter2 = location // set location
LAUNCH_PATCH_MACRO ADD_ITEM_EQEFFECT
END

DEFINE_PATCH_MACRO ~pulse~ BEGIN
SET opcode = 9		// Set opcode
SET target = 1			// target type
SET timing = 2			// timing type
SET power = 0			// power
SET resist_dispel = 0	// dispel/resitance
SET duration = 0		// duration
SET probability1 = 100	// probability 1
SET probability2 = 0	// probability 2
SPRINT "resource" "" 		// resource
SET dicenumber = 0		// dice number 
SET dicesize = 0		// dice size
SET savingthrow = 0   // saving throw
SET savebonus = 0		// saving throw bonus 
SET setrgb = (setb << 24)+(setg << 16)+(setr << 8) // Set RGB
SET parameter1 = setrgb
SET settwo = (speed << 16)+(location) // Set location and speed
SET parameter2 = settwo
LAUNCH_PATCH_MACRO ADD_ITEM_EQEFFECT
END

DEFINE_PATCH_MACRO ~glow~ BEGIN
SET opcode = 8		// Set opcode
SET target = 1			// target type
SET timing = 2			// timing type
SET power = 0			// power
SET resist_dispel = 0	// dispel/resitance
SET duration = 0		// duration
SET probability1 = 100	// probability 1
SET probability2 = 0	// probability 2
SPRINT "resource" "" 		// resource
SET dicenumber = 0		// dice number 
SET dicesize = 0		// dice size
SET savingthrow = 0   // saving throw
SET savebonus = 0		// saving throw bonus 
SET setrgb = (setb << 24)+(setg << 16)+(setr << 8) // Set RGB
SET parameter1 = setrgb
SET parameter2 = location // set location
LAUNCH_PATCH_MACRO ADD_ITEM_EQEFFECT
END
  
  
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////                                                  \\\\\
///// Core fixes                                       \\\\\
/////                                                  \\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\

BEGIN ~One Pixel Productions: v2 Everything but Potions (1)~
PRINT ~Copying and patching...~
COPY_EXISTING ~blun04.itm~ ~override~
              ~blun06.itm~ ~override~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 16)) BEGIN // set item color, weapon head
      WRITE_BYTE ("%gfx_off%" + 0x0C + (0x30 * ("%gfx_num%" - 1))) 2
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES
  
COPY_EXISTING ~clck31.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_LONG  0x3E 0
    WRITE_ASCII 0x3A ~ICLCK21~
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~compon05.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_ASCII 0x22 ~H0~
    WRITE_LONG  0x3E 0
    WRITE_ASCII 0x3A ~IHELM06~
    READ_LONG  0x6a "gfx_off"
    READ_SHORT 0x70 "gfx_num"
    WHILE ("%gfx_num%" > 0) BEGIN
      READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
      READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
      PATCH_IF (("%type%" = 7) AND ("%part%" = 53)) BEGIN // set item color, helm exterior
        WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 67
      END
      PATCH_IF (("%type%" = 7) AND ("%part%" = 48)) BEGIN // set item color, helm wings
        WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 19
      END
      SET "gfx_num" = ("%gfx_num%" - 1)
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~dagg21.itm~ ~override~
              ~dagg22.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_LONG  0x3E 0
    WRITE_ASCII 0x3A ~idagg18~
    READ_LONG 0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    WHILE ("%abil_num%" > 0) BEGIN
      READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
      PATCH_IF ("%type%" = 1) BEGIN
        WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
        WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~idagg18~
      END
      SET "abil_num" = ("%abil_num%" - 1)
    END
  END
  BUT_ONLY_IF_IT_CHANGES
  
COPY_EXISTING ~demosum4.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_LONG  0x3E 0
    WRITE_ASCII 0x3A ~ISW2H03~
    READ_LONG  0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    WHILE ("%abil_num%" > 0) BEGIN
      READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
      PATCH_IF ("%type%" = 1) BEGIN
        WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
        WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW2H03~
      END
      SET "abil_num" = ("%abil_num%" - 1)
    END
  END
  BUT_ONLY_IF_IT_CHANGES
  
  COPY_EXISTING ~halb07.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ihalb03~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 16)) BEGIN // set item color, weapon head
      WRITE_BYTE ("%gfx_off%" + 0x0C + (0x30 * ("%gfx_num%" - 1))) 2
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~helm02.itm~ ~override~
              ~helm08.itm~ ~override~
              ~helm17.itm~ ~override~
              ~helm21.itm~ ~override~
              ~helm22.itm~ ~override~
  WRITE_ASCII 0x22 ~H4~
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~helm03.itm~ ~override~
              ~helm12.itm~ ~override~
  WRITE_ASCII 0x22 ~H2~
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~helm04.itm~ ~override~
  WRITE_ASCII 0x22 ~H5~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ihelm07~
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~helm05.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ihelm05~
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~helm06.itm~ ~override~
  WRITE_ASCII 0x22 ~H5~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ihelm05~
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~helm09.itm~ ~override~
              ~helm16.itm~ ~override~
  WRITE_ASCII 0x22 ~H3~
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~helm10.itm~ ~override~
              ~helm15.itm~ ~override~
  WRITE_ASCII 0x22 ~H5~
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~helm11.itm~ ~override~
  WRITE_ASCII 0x22 ~H0~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ihelm00~
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~helm13.itm~ ~override~
  WRITE_ASCII 0x22 ~H3~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ihelm03~
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~helm31.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_ASCII 0x22 ~H3~
    READ_LONG  0x6a "gfx_off"
    READ_SHORT 0x70 "gfx_num"
    WHILE ("%gfx_num%" > 0) BEGIN
      READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
      READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
      PATCH_IF (("%type%" = 7) AND ("%part%" = 53)) BEGIN // set item color, helm exterior
        WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 21
      END
      PATCH_IF (("%type%" = 7) AND ("%part%" = 48)) BEGIN // set item color, helm wings
        WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 29
      END
      PATCH_IF (("%type%" = 7) AND ("%part%" = 52)) BEGIN // set item color, unknown (52)
        WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 43
      END
      SET "gfx_num" = ("%gfx_num%" - 1)
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~helm32.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_ASCII 0x22 ~H4~
    READ_LONG  0x6a "gfx_off"
    READ_SHORT 0x70 "gfx_num"
    WHILE ("%gfx_num%" > 0) BEGIN
      READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
      READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
      PATCH_IF (("%type%" = 7) AND ("%part%" = 53)) BEGIN // set item color, helm exterior
        WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 29
      END
      PATCH_IF (("%type%" = 7) AND ("%part%" = 48)) BEGIN // set item color, helm wings
        WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 21
      END
      PATCH_IF (("%type%" = 7) AND ("%part%" = 52)) BEGIN // set item color, unknown (52)
        WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 66
      END
      SET "gfx_num" = ("%gfx_num%" - 1)
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~helm33.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_ASCII 0x22 ~H0~
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~killsw01.itm~ ~override~
              ~sw1h06.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISW1HRN~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  WHILE ("%abil_num%" > 0) BEGIN
    READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
    PATCH_IF ("%type%" = 1) BEGIN
      WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
      WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW1HRN~
    END
    SET "abil_num" = ("%abil_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~quiver02.itm~ ~override~
              ~quiver04.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_ASCII 0x3A ~IBOLTS01~
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~quiver05.itm~ ~override~
              ~quiver06.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_ASCII 0x3A ~IQBULL02~
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld01.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD01~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD01~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD01~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 28
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 30
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld02.itm~ ~override~ // adds one effect
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD02~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD01~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD02~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  SET "gfx_num_orig" = "%gfx_num%"
  SET "gfx_delta" = 0
  WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 24
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 25
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 34)) BEGIN // deletes shield panel if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 29  // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 34  // shield panel
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  SET "gfx_delta" = ("%gfx_delta%" + 1)
  WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
    READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
    WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
    SET "abil_num" = ("%abil_num%" - 1)
  END
  WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld03.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD03~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD03~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD03~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 100
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 70
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld04.itm~ ~override~ // adds one effect
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD04~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD03~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD04~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  SET "gfx_num_orig" = "%gfx_num%"
  SET "gfx_delta" = 0
  WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 30
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 99
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 34)) BEGIN // deletes shield panel if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 8   // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 34  // shield panel
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  SET "gfx_delta" = ("%gfx_delta%" + 1)
  WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
    READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
    WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
    SET "abil_num" = ("%abil_num%" - 1)
  END
  WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld05.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD05~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD05~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD05~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 28
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 111
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld06.itm~ ~override~ // adds two effects
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD06~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD05~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD06~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  SET "gfx_num_orig" = "%gfx_num%"
  SET "gfx_delta" = 0
  WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 30
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 7
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 34)) BEGIN // deletes shield panel if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    PATCH_IF (("%type%" = 7) AND (("%part%" = 33) OR ("%part%" = 34))) BEGIN // deletes unknown (33)/shield panel if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 8   // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 34  // shield panel
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 6   // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 33  // unknown (33)
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  SET "gfx_delta" = ("%gfx_delta%" + 2)
  WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
    READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
    WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
    SET "abil_num" = ("%abil_num%" - 1)
  END
  WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld07.itm~ ~override~ // adds two effects
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD07~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD05~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD07~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  SET "gfx_num_orig" = "%gfx_num%"
  SET "gfx_delta" = 0
  WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND (("%part%" = 37) OR ("%part%" = 32))) BEGIN // set item color, shld body/shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 25
    END
    PATCH_IF (("%type%" = 7) AND (("%part%" = 33) OR ("%part%" = 34))) BEGIN // deletes unknown (33)/shield panel if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 8   // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 34  // shield panel
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 6   // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 33  // unknown (33)
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  SET "gfx_delta" = ("%gfx_delta%" + 2)
  WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
    READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
    WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
    SET "abil_num" = ("%abil_num%" - 1)
  END
  WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld08.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD08~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD08~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD08~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 28
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 30
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld09.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD09~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD08~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD09~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 22
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 23
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld10.itm~ ~override~ // adds one effect
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD10~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD08~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD10~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  SET "gfx_num_orig" = "%gfx_num%"
  SET "gfx_delta" = 0
  WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 28
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 26
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 36)) BEGIN // deletes unknown (36) if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 26  // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 36  // unknown (36)
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  SET "gfx_delta" = ("%gfx_delta%" + 1)
  WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
    READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
    WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
    SET "abil_num" = ("%abil_num%" - 1)
  END
  WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  BUT_ONLY_IF_IT_CHANGES
  
COPY_EXISTING ~shld11.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD11~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD01~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD01~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 28
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 30
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES
  
COPY_EXISTING ~shld12.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD12~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD01~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD01~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 27
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 30
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES
  
COPY_EXISTING ~shld13.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD13~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD03~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD03~
  BUT_ONLY_IF_IT_CHANGES
  
COPY_EXISTING ~shld14.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD14~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD03~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD03~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 30
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 10
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES
  
COPY_EXISTING ~shld15.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD15~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD05~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD05~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 27
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 19
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES
  
COPY_EXISTING ~shld16.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD16~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD05~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD05~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 28
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 19
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld17.itm~ ~override~ // adds one effect
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD17~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD08~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD17~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  SET "gfx_num_orig" = "%gfx_num%"
  SET "gfx_delta" = 0
  WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 17
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 93
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 36)) BEGIN // deletes unknown (36) if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 18  // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 36  // unknown (36)
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  SET "gfx_delta" = ("%gfx_delta%" + 1)
  WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
    READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
    WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
    SET "abil_num" = ("%abil_num%" - 1)
  END
  WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  BUT_ONLY_IF_IT_CHANGES
  
COPY_EXISTING ~shld18.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD15~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD05~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD05~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 27
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 19
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld19.itm~ ~override~ // adds two effects
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD19~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD05~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD19~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  SET "gfx_num_orig" = "%gfx_num%"
  SET "gfx_delta" = 0
  WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND (("%part%" = 37) OR ("%part%" = 32))) BEGIN // set item color, shld body/shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 50
    END
    PATCH_IF (("%type%" = 7) AND (("%part%" = 36) OR ("%part%" = 34))) BEGIN // deletes unknown (36)/shield panel if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 66  // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 34  // shield panel
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x08) 36  // unknown (36)
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  SET "gfx_delta" = ("%gfx_delta%" + 2)
  WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
    READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
    WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
    SET "abil_num" = ("%abil_num%" - 1)
  END
  WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  BUT_ONLY_IF_IT_CHANGES
  
COPY_EXISTING ~shld20.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD20~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD08~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD20~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND (("%part%" = 37) OR ("%part%" = 32))) BEGIN // set item color, shld body/hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 24
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld21.itm~ ~override~ // adds one effect
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLDDS~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD03~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  SET "gfx_num_orig" = "%gfx_num%"
  SET "gfx_delta" = 0
  WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 34)) BEGIN // deletes shield panel if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 19  // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 34  // shield panel
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  SET "gfx_delta" = ("%gfx_delta%" + 1)
  WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
    READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
    WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
    SET "abil_num" = ("%abil_num%" - 1)
  END
  WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld23.itm~ ~override~ // adds two effects
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLDFS~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD05~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD05~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  SET "gfx_num_orig" = "%gfx_num%"
  SET "gfx_delta" = 0
  WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND (("%part%" = 37) OR ("%part%" = 32))) BEGIN // set item color, shld body/shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 31
    END
    PATCH_IF (("%type%" = 7) AND (("%part%" = 33) OR ("%part%" = 34))) BEGIN // deletes unknown (33)/shield panel if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 18  // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 34  // shield panel
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 18  // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 33  // unknown (33)
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  SET "gfx_delta" = ("%gfx_delta%" + 2)
  WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
    READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
    WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
    SET "abil_num" = ("%abil_num%" - 1)
  END
  WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld24.itm~ ~override~ // adds one effect
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLDRF~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD01~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD08~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  SET "gfx_num_orig" = "%gfx_num%"
  SET "gfx_delta" = 0
  WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND (("%part%" = 37) OR ("%part%" = 32))) BEGIN // set item color, shld body/shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 26
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 34)) BEGIN // deletes shield panel if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 63  // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 34  // shield panel
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  SET "gfx_delta" = ("%gfx_delta%" + 1)
  WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
    READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
    WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
    SET "abil_num" = ("%abil_num%" - 1)
  END
  WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  BUT_ONLY_IF_IT_CHANGES
  
COPY_EXISTING ~shld25.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLDHM~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD01~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD02~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND (("%part%" = 37) OR ("%part%" = 32))) BEGIN // set item color, shld body/hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 31
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 34)) BEGIN // set item color, shld body/hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 17
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld26.itm~ ~override~ // adds one effect
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLDVR~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD03~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD03~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  SET "gfx_num_orig" = "%gfx_num%"
  SET "gfx_delta" = 0
  WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 48
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 58
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 34)) BEGIN // deletes shield panel if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 58  // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 34  // shield panel
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  SET "gfx_delta" = ("%gfx_delta%" + 1)
  WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
    READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
    WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
    SET "abil_num" = ("%abil_num%" - 1)
  END
  WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld27.itm~ ~override~ // adds one effect
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLDGN~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD03~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD04~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  SET "gfx_num_orig" = "%gfx_num%"
  SET "gfx_delta" = 0
  WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 30
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 96
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 34)) BEGIN // deletes shield panel if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 18  // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 34  // shield panel
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  SET "gfx_delta" = ("%gfx_delta%" + 1)
  WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
    READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
    WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
    SET "abil_num" = ("%abil_num%" - 1)
  END
  WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld28.itm~ ~override~ // adds one effect
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLDK2~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD01~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD08~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  SET "gfx_num_orig" = "%gfx_num%"
  SET "gfx_delta" = 0
  WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body/shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 46
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld body/shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 26
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 34)) BEGIN // deletes shield panel if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 29  // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 34  // shield panel
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  SET "gfx_delta" = ("%gfx_delta%" + 1)
  WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
    READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
    WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
    SET "abil_num" = ("%abil_num%" - 1)
  END
  WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld29.itm~ ~override~ // adds one effect
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD13~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD03~
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD03~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  SET "gfx_num_orig" = "%gfx_num%"
  SET "gfx_delta" = 0
  WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body/shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 38
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld body/shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 21
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 34)) BEGIN // deletes shield panel if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 66  // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 34  // shield panel
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  SET "gfx_delta" = ("%gfx_delta%" + 1)
  WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
    READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
    WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
    SET "abil_num" = ("%abil_num%" - 1)
  END
  WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld30.itm~ ~override~ // adds one effect
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISHLD07~
  WRITE_LONG  0x48 0
  WRITE_ASCII 0x44 ~GSHLD05~
  WRITE_LONG  0x50 6820
  WRITE_LONG  0x5C 0
  WRITE_ASCII 0x58 ~CSHLD06~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  SET "gfx_num_orig" = "%gfx_num%"
  SET "gfx_delta" = 0
  WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND (("%part%" = 37) OR ("%part%" = 32))) BEGIN // set item color, shld body/shld hub
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 25
    END
    PATCH_IF (("%type%" = 7) AND ("%part%" = 34)) BEGIN // deletes shield panel if present to make way for new one
      DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
      SET "gfx_delta" = ("%gfx_delta%" - 1)
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
    WRITE_SHORT ("%gfx_off%")        7   // set item color
    WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
    WRITE_LONG  ("%gfx_off%" + 0x04) 66  // color index
    WRITE_LONG  ("%gfx_off%" + 0x08) 34  // shield panel
    WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
    WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
  SET "gfx_delta" = ("%gfx_delta%" + 1)
  WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
    READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
    WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
    SET "abil_num" = ("%abil_num%" - 1)
  END
  WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~shld31.itm~ ~override~ // adds one effect
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_LONG  0x3E 0
    WRITE_ASCII 0x3A ~ISHLDZS~
    WRITE_LONG  0x48 0
    WRITE_ASCII 0x44 ~GSHLD05~
    WRITE_LONG  0x5C 0
    WRITE_ASCII 0x58 ~CSHLD07~
    READ_LONG  0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    READ_LONG  0x6a "gfx_off"
    READ_SHORT 0x70 "gfx_num"
    SET "gfx_num_orig" = "%gfx_num%"
    SET "gfx_delta" = 0
    WHILE ("%gfx_num%" > 0) BEGIN // searches for effect we're adding
      READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
      READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
      PATCH_IF (("%type%" = 7) AND ("%part%" = 37)) BEGIN // set item color, shld body/shld hub
        WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 31
      END
      PATCH_IF (("%type%" = 7) AND ("%part%" = 32)) BEGIN // set item color, shld body/shld hub
        WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 20
      END
      PATCH_IF (("%type%" = 7) AND ("%part%" = 34)) BEGIN // deletes shield panel if present to make way for new one
        DELETE_BYTES ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) 0x30
        SET "gfx_delta" = ("%gfx_delta%" - 1)
      END
      SET "gfx_num" = ("%gfx_num%" - 1)
    END
    INSERT_BYTES ("%gfx_off%") 0x30 // adds new effect
      WRITE_SHORT ("%gfx_off%")        7   // set item color
      WRITE_BYTE  ("%gfx_off%" + 0x02) 1   // target self
      WRITE_LONG  ("%gfx_off%" + 0x04) 21  // color index
      WRITE_LONG  ("%gfx_off%" + 0x08) 34  // shield panel
      WRITE_BYTE  ("%gfx_off%" + 0x0C) 2   // instant/while equipped
      WRITE_BYTE  ("%gfx_off%" + 0x12) 100 // probability 2
    SET "gfx_delta" = ("%gfx_delta%" + 1)
    WHILE (("%abil_num%" > 0) AND NOT ("%gfx_delta%" = 0)) BEGIN // if abilities are present, need to adjust their effects index
      READ_SHORT  (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) "fx_idx"
      WRITE_SHORT (0x20 + "%abil_off%" + (("%abil_num%" - 1) * 0x38)) ("%fx_idx%" + "%gfx_delta%")
      SET "abil_num" = ("%abil_num%" - 1)
    END
    WRITE_SHORT 0x70 ("%gfx_num_orig%" + "%gfx_delta%")
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw1h16.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISW1H16~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  WHILE ("%abil_num%" > 0) BEGIN
    READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
    PATCH_IF ("%type%" = 1) BEGIN
      WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
      WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW1H16~
    END
    SET "abil_num" = ("%abil_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw1h18.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISW1HBS~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  WHILE ("%abil_num%" > 0) BEGIN
    READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
    PATCH_IF ("%type%" = 1) BEGIN
      WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
      WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW1HBS~
    END
    SET "abil_num" = ("%abil_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw1h23.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISW1HRC~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  WHILE ("%abil_num%" > 0) BEGIN
    READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
    PATCH_IF ("%type%" = 1) BEGIN
      WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
      WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW1HRC~
    END
    SET "abil_num" = ("%abil_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw1h24.itm~ ~override~
  READ_LONG  0x6a "gfx_off"
  READ_SHORT 0x70 "gfx_num"
  WHILE ("%gfx_num%" > 0) BEGIN
    READ_SHORT ("%gfx_off%" +        (0x30 * ("%gfx_num%" - 1))) "type"
    READ_LONG  ("%gfx_off%" + 0x08 + (0x30 * ("%gfx_num%" - 1))) "part"
    PATCH_IF (("%type%" = 7) AND (("%part%" = 20) OR ("%part%" = 21))) BEGIN // set item color, wpn head/blade minor or wpn grip/staff minor
      WRITE_LONG ("%gfx_off%" + 0x04 + (0x30 * ("%gfx_num%" - 1))) 67
    END
    SET "gfx_num" = ("%gfx_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw1h31.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISW1H34~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  WHILE ("%abil_num%" > 0) BEGIN
    READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
    PATCH_IF ("%type%" = 1) BEGIN
      WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
      WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW1H34~
    END
    SET "abil_num" = ("%abil_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw1h34.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISW1H31~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  WHILE ("%abil_num%" > 0) BEGIN
    READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
    PATCH_IF ("%type%" = 1) BEGIN
      WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
      WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW1H31~
    END
    SET "abil_num" = ("%abil_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw1h41.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISW1H06~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  WHILE ("%abil_num%" > 0) BEGIN
    READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
    PATCH_IF ("%type%" = 1) BEGIN
      WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
      WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW1H06~
    END
    SET "abil_num" = ("%abil_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw1h52.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISW1HWK~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  WHILE ("%abil_num%" > 0) BEGIN
    READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
    PATCH_IF ("%type%" = 1) BEGIN
      WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
      WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW1HWK~
    END
    SET "abil_num" = ("%abil_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw1h59.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_LONG  0x3E 0
    WRITE_ASCII 0x3A ~ISW1H59~
    READ_LONG  0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    WHILE ("%abil_num%" > 0) BEGIN
      READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
      PATCH_IF ("%type%" = 1) BEGIN
        WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
        WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW1H59~
      END
      SET "abil_num" = ("%abil_num%" - 1)
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw1h61.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_LONG  0x3E 0
    WRITE_ASCII 0x3A ~ISW1H61~
    READ_LONG  0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    WHILE ("%abil_num%" > 0) BEGIN
      READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
      PATCH_IF ("%type%" = 1) BEGIN
        WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
        WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW1H61~
      END
      SET "abil_num" = ("%abil_num%" - 1)
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw1h63.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_LONG  0x3E 0
    WRITE_ASCII 0x3A ~ISW1H63~
    READ_LONG  0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    WHILE ("%abil_num%" > 0) BEGIN
      READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
      PATCH_IF ("%type%" = 1) BEGIN
        WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
        WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW1H63~
      END
      SET "abil_num" = ("%abil_num%" - 1)
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw1h65.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_LONG  0x3E 0
    WRITE_ASCII 0x3A ~ISW1H65~
    READ_LONG  0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    WHILE ("%abil_num%" > 0) BEGIN
      READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
      PATCH_IF ("%type%" = 1) BEGIN
        WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
        WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW1H65~
      END
      SET "abil_num" = ("%abil_num%" - 1)
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw1h69.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_LONG  0x3E 0
    WRITE_ASCII 0x3A ~ISW1H69~
    READ_LONG  0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    WHILE ("%abil_num%" > 0) BEGIN
      READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
      PATCH_IF ("%type%" = 1) BEGIN
        WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
        WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW1H69~
      END
      SET "abil_num" = ("%abil_num%" - 1)
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw1h71.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_LONG  0x3E 0
    WRITE_ASCII 0x3A ~ISW1H71~
    READ_LONG  0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    WHILE ("%abil_num%" > 0) BEGIN
      READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
      PATCH_IF ("%type%" = 1) BEGIN
        WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
        WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW1H71~
      END
      SET "abil_num" = ("%abil_num%" - 1)
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw2h10.itm~ ~override~
              ~sw2h19.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_LONG  0x3E 0
    WRITE_ASCII 0x3A ~ISW2H20~
    READ_LONG  0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    WHILE ("%abil_num%" > 0) BEGIN
      READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
      PATCH_IF ("%type%" = 1) BEGIN
        WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
        WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW2H20~
      END
      SET "abil_num" = ("%abil_num%" - 1)
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw2h11.itm~ ~override~
  WRITE_LONG  0x3E 0
  WRITE_ASCII 0x3A ~ISW2H03~
  READ_LONG  0x64 "abil_off"
  READ_SHORT 0x68 "abil_num"
  WHILE ("%abil_num%" > 0) BEGIN
    READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
    PATCH_IF ("%type%" = 1) BEGIN
      WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
      WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW2H03~
    END
    SET "abil_num" = ("%abil_num%" - 1)
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~sw2h20.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    WRITE_LONG  0x3E 0
    WRITE_ASCII 0x3A ~ISW2H06~
    READ_LONG  0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    WHILE ("%abil_num%" > 0) BEGIN
      READ_BYTE ("%abil_off%" + (0x38 * ("%abil_num%" - 1))) "type"
      PATCH_IF ("%type%" = 1) BEGIN
        WRITE_LONG  ("%abil_off%" + 0x08 + (0x38 * ("%abil_num%" - 1))) 0
        WRITE_ASCII ("%abil_off%" + 0x04 + (0x38 * ("%abil_num%" - 1))) ~ISW2H06~
      END
      SET "abil_num" = ("%abil_num%" - 1)
    END
  END
  BUT_ONLY_IF_IT_CHANGES
PRINT ~Copying...~
COPY ~1pp/v2_copy/cdmc1inv.bam~ ~override~
COPY ~1pp/v2_copy/cdmc1inv.plt~ ~override~
COPY ~1pp/v2_copy/cdmc2inv.bam~ ~override~
COPY ~1pp/v2_copy/cdmc2inv.plt~ ~override~
COPY ~1pp/v2_copy/cdmc3inv.bam~ ~override~
COPY ~1pp/v2_copy/cdmc3inv.plt~ ~override~
COPY ~1pp/v2_copy/cdmc4inv.bam~ ~override~
COPY ~1pp/v2_copy/cdmc4inv.plt~ ~override~
COPY ~1pp/v2_copy/cdmf1inv.bam~ ~override~
COPY ~1pp/v2_copy/cdmf1inv.plt~ ~override~
COPY ~1pp/v2_copy/cdmf2inv.bam~ ~override~
COPY ~1pp/v2_copy/cdmf2inv.plt~ ~override~
COPY ~1pp/v2_copy/cdmf3inv.bam~ ~override~
COPY ~1pp/v2_copy/cdmf3inv.plt~ ~override~
COPY ~1pp/v2_copy/cdmf4inv.bam~ ~override~
COPY ~1pp/v2_copy/cdmf4inv.plt~ ~override~
COPY ~1pp/v2_copy/cdmt1inv.bam~ ~override~
COPY ~1pp/v2_copy/cdmt1inv.plt~ ~override~
COPY ~1pp/v2_copy/cdmt2inv.bam~ ~override~
COPY ~1pp/v2_copy/cdmt2inv.plt~ ~override~
COPY ~1pp/v2_copy/cdmw1inv.bam~ ~override~
COPY ~1pp/v2_copy/cdmw1inv.plt~ ~override~
COPY ~1pp/v2_copy/cdmw2inv.bam~ ~override~
COPY ~1pp/v2_copy/cdmw2inv.plt~ ~override~
COPY ~1pp/v2_copy/cdmw3inv.bam~ ~override~
COPY ~1pp/v2_copy/cdmw3inv.plt~ ~override~
COPY ~1pp/v2_copy/cdmw4inv.bam~ ~override~
COPY ~1pp/v2_copy/cefc1inv.bam~ ~override~
COPY ~1pp/v2_copy/cefc1inv.plt~ ~override~
COPY ~1pp/v2_copy/cefc2inv.bam~ ~override~
COPY ~1pp/v2_copy/cefc2inv.plt~ ~override~
COPY ~1pp/v2_copy/cefc3inv.bam~ ~override~
COPY ~1pp/v2_copy/cefc3inv.plt~ ~override~
COPY ~1pp/v2_copy/cefc4inv.bam~ ~override~
COPY ~1pp/v2_copy/cefc4inv.plt~ ~override~
COPY ~1pp/v2_copy/ceff1inv.bam~ ~override~
COPY ~1pp/v2_copy/ceff1inv.plt~ ~override~
COPY ~1pp/v2_copy/ceff2inv.bam~ ~override~
COPY ~1pp/v2_copy/ceff2inv.plt~ ~override~
COPY ~1pp/v2_copy/ceff3inv.bam~ ~override~
COPY ~1pp/v2_copy/ceff3inv.plt~ ~override~
COPY ~1pp/v2_copy/ceff4inv.bam~ ~override~
COPY ~1pp/v2_copy/ceff4inv.plt~ ~override~
COPY ~1pp/v2_copy/ceft1inv.bam~ ~override~
COPY ~1pp/v2_copy/ceft1inv.plt~ ~override~
COPY ~1pp/v2_copy/ceft2inv.bam~ ~override~
COPY ~1pp/v2_copy/ceft2inv.plt~ ~override~
COPY ~1pp/v2_copy/cefw1inv.bam~ ~override~
COPY ~1pp/v2_copy/cefw1inv.plt~ ~override~
COPY ~1pp/v2_copy/cefw2inv.bam~ ~override~
COPY ~1pp/v2_copy/cefw2inv.plt~ ~override~
COPY ~1pp/v2_copy/cefw3inv.bam~ ~override~
COPY ~1pp/v2_copy/cefw3inv.plt~ ~override~
COPY ~1pp/v2_copy/cefw4inv.bam~ ~override~
COPY ~1pp/v2_copy/cefw4inv.plt~ ~override~
COPY ~1pp/v2_copy/cemc1inv.bam~ ~override~
COPY ~1pp/v2_copy/cemc1inv.plt~ ~override~
COPY ~1pp/v2_copy/cemc2inv.bam~ ~override~
COPY ~1pp/v2_copy/cemc2inv.plt~ ~override~
COPY ~1pp/v2_copy/cemc3inv.bam~ ~override~
COPY ~1pp/v2_copy/cemc3inv.plt~ ~override~
COPY ~1pp/v2_copy/cemc4inv.bam~ ~override~
COPY ~1pp/v2_copy/cemc4inv.plt~ ~override~
COPY ~1pp/v2_copy/cemf1inv.bam~ ~override~
COPY ~1pp/v2_copy/cemf1inv.plt~ ~override~
COPY ~1pp/v2_copy/cemf2inv.bam~ ~override~
COPY ~1pp/v2_copy/cemf2inv.plt~ ~override~
COPY ~1pp/v2_copy/cemf3inv.bam~ ~override~
COPY ~1pp/v2_copy/cemf3inv.plt~ ~override~
COPY ~1pp/v2_copy/cemf4inv.bam~ ~override~
COPY ~1pp/v2_copy/cemf4inv.plt~ ~override~
COPY ~1pp/v2_copy/cemt1inv.bam~ ~override~
COPY ~1pp/v2_copy/cemt1inv.plt~ ~override~
COPY ~1pp/v2_copy/cemt2inv.bam~ ~override~
COPY ~1pp/v2_copy/cemt2inv.plt~ ~override~
COPY ~1pp/v2_copy/cemw1inv.bam~ ~override~
COPY ~1pp/v2_copy/cemw1inv.plt~ ~override~
COPY ~1pp/v2_copy/cemw2inv.bam~ ~override~
COPY ~1pp/v2_copy/cemw2inv.plt~ ~override~
COPY ~1pp/v2_copy/cemw3inv.bam~ ~override~
COPY ~1pp/v2_copy/cemw3inv.plt~ ~override~
COPY ~1pp/v2_copy/cemw4inv.bam~ ~override~
COPY ~1pp/v2_copy/cemw4inv.plt~ ~override~
COPY ~1pp/v2_copy/chfc1inv.bam~ ~override~
COPY ~1pp/v2_copy/chfc1inv.plt~ ~override~
COPY ~1pp/v2_copy/chfc2inv.bam~ ~override~
COPY ~1pp/v2_copy/chfc2inv.plt~ ~override~
COPY ~1pp/v2_copy/chfc3inv.bam~ ~override~
COPY ~1pp/v2_copy/chfc3inv.plt~ ~override~
COPY ~1pp/v2_copy/chfc4inv.bam~ ~override~
COPY ~1pp/v2_copy/chfc4inv.plt~ ~override~
COPY ~1pp/v2_copy/chff1inv.plt~ ~override~
COPY ~1pp/v2_copy/chff2inv.plt~ ~override~
COPY ~1pp/v2_copy/chff3inv.plt~ ~override~
COPY ~1pp/v2_copy/chff4inv.plt~ ~override~
COPY ~1pp/v2_copy/chft1inv.bam~ ~override~
COPY ~1pp/v2_copy/chft1inv.plt~ ~override~
COPY ~1pp/v2_copy/chft2inv.bam~ ~override~
COPY ~1pp/v2_copy/chft2inv.plt~ ~override~
COPY ~1pp/v2_copy/chfw1inv.bam~ ~override~
COPY ~1pp/v2_copy/chfw1inv.plt~ ~override~
COPY ~1pp/v2_copy/chfw2inv.bam~ ~override~
COPY ~1pp/v2_copy/chfw2inv.plt~ ~override~
COPY ~1pp/v2_copy/chfw3inv.bam~ ~override~
COPY ~1pp/v2_copy/chfw3inv.plt~ ~override~
COPY ~1pp/v2_copy/chfw4inv.bam~ ~override~
COPY ~1pp/v2_copy/chfw4inv.plt~ ~override~
COPY ~1pp/v2_copy/chmc1inv.plt~ ~override~
COPY ~1pp/v2_copy/chmc2inv.plt~ ~override~
COPY ~1pp/v2_copy/chmc3inv.plt~ ~override~
COPY ~1pp/v2_copy/chmc4inv.plt~ ~override~
COPY ~1pp/v2_copy/chmf1inv.plt~ ~override~
COPY ~1pp/v2_copy/chmf2inv.plt~ ~override~
COPY ~1pp/v2_copy/chmf3inv.plt~ ~override~
COPY ~1pp/v2_copy/chmf4inv.plt~ ~override~
COPY ~1pp/v2_copy/chmm1inv.bam~ ~override~
COPY ~1pp/v2_copy/chmm1inv.plt~ ~override~
COPY ~1pp/v2_copy/chmt1inv.plt~ ~override~
COPY ~1pp/v2_copy/chmt2inv.plt~ ~override~
COPY ~1pp/v2_copy/chmw1inv.plt~ ~override~
COPY ~1pp/v2_copy/chmw2inv.plt~ ~override~
COPY ~1pp/v2_copy/chmw3inv.plt~ ~override~
COPY ~1pp/v2_copy/chmw4inv.plt~ ~override~
COPY ~1pp/v2_copy/cifc.plt~ ~override~
COPY ~1pp/v2_copy/cifc1.plt~  ~override~
COPY ~1pp/v2_copy/cifc1inv.bam~ ~override~
COPY ~1pp/v2_copy/cifc1inv.plt~ ~override~
COPY ~1pp/v2_copy/cifc2inv.bam~ ~override~
COPY ~1pp/v2_copy/cifc2inv.plt~ ~override~
COPY ~1pp/v2_copy/cifc3inv.bam~ ~override~
COPY ~1pp/v2_copy/cifc3inv.plt~ ~override~
COPY ~1pp/v2_copy/cifc4inv.bam~ ~override~
COPY ~1pp/v2_copy/cifc4inv.plt~ ~override~
COPY ~1pp/v2_copy/ciff1inv.bam~ ~override~
COPY ~1pp/v2_copy/ciff1inv.plt~ ~override~
COPY ~1pp/v2_copy/ciff2inv.bam~ ~override~
COPY ~1pp/v2_copy/ciff2inv.plt~ ~override~
COPY ~1pp/v2_copy/ciff3inv.bam~ ~override~
COPY ~1pp/v2_copy/ciff3inv.plt~ ~override~
COPY ~1pp/v2_copy/ciff4inv.bam~ ~override~
COPY ~1pp/v2_copy/ciff4inv.plt~ ~override~
COPY ~1pp/v2_copy/cift1inv.bam~ ~override~
COPY ~1pp/v2_copy/cift1inv.plt~ ~override~
COPY ~1pp/v2_copy/cift2inv.bam~ ~override~
COPY ~1pp/v2_copy/cift2inv.plt~ ~override~
COPY ~1pp/v2_copy/cimc1inv.bam~ ~override~
COPY ~1pp/v2_copy/cimc1inv.plt~ ~override~
COPY ~1pp/v2_copy/cimc2inv.bam~ ~override~
COPY ~1pp/v2_copy/cimc2inv.plt~ ~override~
COPY ~1pp/v2_copy/cimc3inv.bam~ ~override~
COPY ~1pp/v2_copy/cimc3inv.plt~ ~override~
COPY ~1pp/v2_copy/cimc4inv.bam~ ~override~
COPY ~1pp/v2_copy/cimc4inv.plt~ ~override~
COPY ~1pp/v2_copy/cimf1inv.bam~ ~override~
COPY ~1pp/v2_copy/cimf1inv.plt~ ~override~
COPY ~1pp/v2_copy/cimf2inv.bam~ ~override~
COPY ~1pp/v2_copy/cimf2inv.plt~ ~override~
COPY ~1pp/v2_copy/cimf3inv.bam~ ~override~
COPY ~1pp/v2_copy/cimf3inv.plt~ ~override~
COPY ~1pp/v2_copy/cimf4inv.bam~ ~override~
COPY ~1pp/v2_copy/cimf4inv.plt~ ~override~
COPY ~1pp/v2_copy/cimt1inv.bam~ ~override~
COPY ~1pp/v2_copy/cimt1inv.plt~ ~override~
COPY ~1pp/v2_copy/cimt2inv.bam~ ~override~
COPY ~1pp/v2_copy/cimt2inv.plt~ ~override~
COPY ~1pp/v2_copy/cshld19.bam~  ~override~
COPY ~1pp/v2_copy/cshld20.bam~  ~override~
COPY ~1pp/v2_copy/iax1h01.bam~  ~override~
COPY ~1pp/v2_copy/iax1h14.bam~  ~override~
COPY ~1pp/v2_copy/iblun01.bam~  ~override~
COPY ~1pp/v2_copy/iblun04.bam~  ~override~
COPY ~1pp/v2_copy/iblun05.bam~  ~override~
COPY ~1pp/v2_copy/iblun06.bam~  ~override~
COPY ~1pp/v2_copy/iblun26.bam~  ~override~
COPY ~1pp/v2_copy/ibolts01.bam~ ~override~
COPY ~1pp/v2_copy/ibow26.bam~ ~override~
COPY ~1pp/v2_copy/ichan04.bam~  ~override~
COPY ~1pp/v2_copy/ichan05.bam~  ~override~
COPY ~1pp/v2_copy/ichan07.bam~  ~override~
COPY ~1pp/v2_copy/iclck03.bam~  ~override~
COPY ~1pp/v2_copy/iclck04.bam~  ~override~
COPY ~1pp/v2_copy/iclck05.bam~  ~override~
COPY ~1pp/v2_copy/iclck06.bam~  ~override~
COPY ~1pp/v2_copy/iclck09.bam~  ~override~
COPY ~1pp/v2_copy/iclck10.bam~  ~override~
COPY ~1pp/v2_copy/iclck11.bam~  ~override~
COPY ~1pp/v2_copy/iclck12.bam~  ~override~
COPY ~1pp/v2_copy/iclck13.bam~  ~override~
COPY ~1pp/v2_copy/iclck14.bam~  ~override~
COPY ~1pp/v2_copy/iclck15.bam~  ~override~
COPY ~1pp/v2_copy/iclck16.bam~  ~override~
COPY ~1pp/v2_copy/iclck17.bam~  ~override~
COPY ~1pp/v2_copy/idagg11.bam~  ~override~
COPY ~1pp/v2_copy/ihalb03.bam~  ~override~
COPY ~1pp/v2_copy/ihalb10.bam~  ~override~
COPY ~1pp/v2_copy/ihalb12.bam~  ~override~
COPY ~1pp/v2_copy/ihamm10.bam~  ~override~
COPY ~1pp/v2_copy/ihelm00.bam~  ~override~
COPY ~1pp/v2_copy/ihelm01.bam~  ~override~
COPY ~1pp/v2_copy/ihelm02.bam~  ~override~
COPY ~1pp/v2_copy/ihelm03.bam~  ~override~
COPY ~1pp/v2_copy/ihelm04.bam~  ~override~
COPY ~1pp/v2_copy/ihelm05.bam~  ~override~
COPY ~1pp/v2_copy/ihelm06.bam~  ~override~
COPY ~1pp/v2_copy/ihelm07.bam~  ~override~
COPY ~1pp/v2_copy/ihelm14.bam~  ~override~
COPY ~1pp/v2_copy/ihelm31.bam~  ~override~
COPY ~1pp/v2_copy/ihelm32.bam~  ~override~
COPY ~1pp/v2_copy/ileat01.bam~  ~override~
COPY ~1pp/v2_copy/ileat04.bam~  ~override~
COPY ~1pp/v2_copy/iplat01.bam~  ~override~
COPY ~1pp/v2_copy/iplat09.bam~  ~override~
COPY ~1pp/v2_copy/iplot01f.bam~ ~override~
COPY ~1pp/v2_copy/iqbull02.bam~ ~override~
COPY ~1pp/v2_copy/iquiv01.bam~  ~override~
COPY ~1pp/v2_copy/ishld17.bam~  ~override~
COPY ~1pp/v2_copy/ishldds.bam~  ~override~
COPY ~1pp/v2_copy/ishldfs.bam~  ~override~
COPY ~1pp/v2_copy/ishldgn.bam~  ~override~
COPY ~1pp/v2_copy/ishldhm.bam~  ~override~
COPY ~1pp/v2_copy/ishldk2.bam~  ~override~
COPY ~1pp/v2_copy/ishldrf.bam~  ~override~
COPY ~1pp/v2_copy/ishldvr.bam~  ~override~
COPY ~1pp/v2_copy/ishldzs.bam~  ~override~
COPY ~1pp/v2_copy/isw1h02.bam~  ~override~
COPY ~1pp/v2_copy/isw1h06.bam~  ~override~
COPY ~1pp/v2_copy/isw1h16.bam~  ~override~
COPY ~1pp/v2_copy/isw1h42.bam~  ~override~
COPY ~1pp/v2_copy/isw1h51.bam~  ~override~
COPY ~1pp/v2_copy/isw1h58.bam~  ~override~
COPY ~1pp/v2_copy/isw1h59.bam~  ~override~
COPY ~1pp/v2_copy/isw1h60.bam~  ~override~
COPY ~1pp/v2_copy/isw1h61.bam~  ~override~
COPY ~1pp/v2_copy/isw1h62.bam~  ~override~
COPY ~1pp/v2_copy/isw1h63.bam~  ~override~
COPY ~1pp/v2_copy/isw1h64.bam~  ~override~
COPY ~1pp/v2_copy/isw1h65.bam~  ~override~
COPY ~1pp/v2_copy/isw1h66.bam~  ~override~
COPY ~1pp/v2_copy/isw1h67.bam~  ~override~
COPY ~1pp/v2_copy/isw1h68.bam~  ~override~
COPY ~1pp/v2_copy/isw1h69.bam~  ~override~
COPY ~1pp/v2_copy/isw1h70.bam~  ~override~
COPY ~1pp/v2_copy/isw1h71.bam~  ~override~
COPY ~1pp/v2_copy/isw1h72.bam~  ~override~
COPY ~1pp/v2_copy/isw1h73.bam~  ~override~
COPY ~1pp/v2_copy/isw1h74.bam~  ~override~
COPY ~1pp/v2_copy/isw1h75.bam~  ~override~
COPY ~1pp/v2_copy/isw1h76.bam~  ~override~
COPY ~1pp/v2_copy/isw1h77.bam~  ~override~
COPY ~1pp/v2_copy/isw1hbs.bam~  ~override~
COPY ~1pp/v2_copy/isw1hrc.bam~  ~override~
COPY ~1pp/v2_copy/isw1hrn.bam~  ~override~
COPY ~1pp/v2_copy/isw1hwk.bam~  ~override~
COPY ~1pp/v2_copy/isw2h07.bam~  ~override~
COPY ~1pp/v2_copy/isw2h17.bam~  ~override~
COPY ~1pp/v2_copy/isw2h20.bam~  ~override~
COPY ~1pp/v2_copy/iwand01.bam~  ~override~
COPY ~1pp/v2_copy/iwand02.bam~  ~override~
COPY ~1pp/v2_copy/iwand03.bam~  ~override~
COPY ~1pp/v2_copy/iwand04.bam~  ~override~
COPY ~1pp/v2_copy/iwand05.bam~  ~override~
COPY ~1pp/v2_copy/iwand06.bam~  ~override~
COPY ~1pp/v2_copy/iwand07.bam~  ~override~
COPY ~1pp/v2_copy/iwand08.bam~  ~override~
COPY ~1pp/v2_copy/iwand09.bam~  ~override~
COPY ~1pp/v2_copy/iwand10.bam~  ~override~
COPY ~1pp/v2_copy/iwand11.bam~  ~override~
COPY ~1pp/v2_copy/spmagglo.bam~ ~override~
COPY ~1pp/v2_copy/spmagglo.vvc~ ~override~
COPY ~1pp/v2_copy/sw1hwk.itm~ ~override~
COPY ~1pp/v2_copy/wphaxoin.bam~ ~override~
COPY ~1pp/v2_copy/wphd1inv.bam~ ~override~
COPY ~1pp/v2_copy/wphd2inv.bam~ ~override~
COPY ~1pp/v2_copy/wphd2inv.plt~ ~override~
COPY ~1pp/v2_copy/wphd3inv.bam~ ~override~
COPY ~1pp/v2_copy/wphd3inv.plt~ ~override~
COPY ~1pp/v2_copy/wphd4inv.bam~ ~override~
COPY ~1pp/v2_copy/wphd4inv.plt~ ~override~
COPY ~1pp/v2_copy/wphddoin.bam~ ~override~
COPY ~1pp/v2_copy/wphfloin.bam~ ~override~
COPY ~1pp/v2_copy/wphfsinv.bam~ ~override~
COPY ~1pp/v2_copy/wphfsoin.bam~ ~override~
COPY ~1pp/v2_copy/wphh0inv.bam~ ~override~
COPY ~1pp/v2_copy/wphh1inv.bam~ ~override~
COPY ~1pp/v2_copy/wphh2inv.bam~ ~override~
COPY ~1pp/v2_copy/wphh3inv.bam~ ~override~
COPY ~1pp/v2_copy/wphh4inv.bam~ ~override~
COPY ~1pp/v2_copy/wphh5inv.bam~ ~override~
COPY ~1pp/v2_copy/wphh6inv.bam~ ~override~
COPY ~1pp/v2_copy/wphh7inv.bam~ ~override~
COPY ~1pp/v2_copy/wphmcoin.bam~ ~override~
COPY ~1pp/v2_copy/wphmsoin.bam~ ~override~
COPY ~1pp/v2_copy/wphs1oin.bam~ ~override~
COPY ~1pp/v2_copy/wphs3inv.bam~ ~override~
COPY ~1pp/v2_copy/wphs3oin.bam~ ~override~
COPY ~1pp/v2_copy/wphscinv.bam~ ~override~
COPY ~1pp/v2_copy/wphscoin.bam~ ~override~
COPY ~1pp/v2_copy/wphssoin.bam~ ~override~
COPY ~1pp/v2_copy/wphwhoin.bam~ ~override~
COPY ~1pp/v2_copy/wphwmoin.bam~ ~override~
COPY ~1pp/v2_copy/wplaxoin.bam~ ~override~
COPY ~1pp/v2_copy/wpld1inv.plt~ ~override~
COPY ~1pp/v2_copy/wpld2inv.plt~ ~override~
COPY ~1pp/v2_copy/wpld3inv.plt~ ~override~
COPY ~1pp/v2_copy/wpld4inv.plt~ ~override~
COPY ~1pp/v2_copy/wplddoin.bam~ ~override~
COPY ~1pp/v2_copy/wplfloin.bam~ ~override~
COPY ~1pp/v2_copy/wplfsinv.bam~ ~override~
COPY ~1pp/v2_copy/wplfsoin.bam~ ~override~
COPY ~1pp/v2_copy/wplh0inv.plt~ ~override~
COPY ~1pp/v2_copy/wplh1inv.plt~ ~override~
COPY ~1pp/v2_copy/wplh2inv.plt~ ~override~
COPY ~1pp/v2_copy/wplh3inv.plt~ ~override~
COPY ~1pp/v2_copy/wplh4inv.plt~ ~override~
COPY ~1pp/v2_copy/wplh5inv.plt~ ~override~
COPY ~1pp/v2_copy/wplmcoin.bam~ ~override~
COPY ~1pp/v2_copy/wplmsoin.bam~ ~override~
COPY ~1pp/v2_copy/wpls1oin.bam~ ~override~
COPY ~1pp/v2_copy/wpls3inv.bam~ ~override~
COPY ~1pp/v2_copy/wpls3oin.bam~ ~override~
COPY ~1pp/v2_copy/wplscinv.bam~ ~override~
COPY ~1pp/v2_copy/wplscoin.bam~ ~override~
COPY ~1pp/v2_copy/wplssoin.bam~ ~override~
COPY ~1pp/v2_copy/wplwhoin.bam~ ~override~
COPY ~1pp/v2_copy/wplwmoin.bam~ ~override~
COPY ~1pp/v2_copy/wpmaxoin.bam~ ~override~
COPY ~1pp/v2_copy/wpmd1inv.bam~ ~override~
COPY ~1pp/v2_copy/wpmd2inv.bam~ ~override~
COPY ~1pp/v2_copy/wpmd2inv.plt~ ~override~
COPY ~1pp/v2_copy/wpmd3inv.bam~ ~override~
COPY ~1pp/v2_copy/wpmd3inv.plt~ ~override~
COPY ~1pp/v2_copy/wpmd4inv.bam~ ~override~
COPY ~1pp/v2_copy/wpmd4inv.plt~ ~override~
COPY ~1pp/v2_copy/wpmddoin.bam~ ~override~
COPY ~1pp/v2_copy/wpmfloin.bam~ ~override~
COPY ~1pp/v2_copy/wpmfsinv.bam~ ~override~
COPY ~1pp/v2_copy/wpmfsoin.bam~ ~override~
COPY ~1pp/v2_copy/wpmh0inv.bam~ ~override~
COPY ~1pp/v2_copy/wpmh0inv.plt~ ~override~
COPY ~1pp/v2_copy/wpmh1inv.bam~ ~override~
COPY ~1pp/v2_copy/wpmh1inv.plt~ ~override~
COPY ~1pp/v2_copy/wpmh2inv.bam~ ~override~
COPY ~1pp/v2_copy/wpmh2inv.plt~ ~override~
COPY ~1pp/v2_copy/wpmh3inv.bam~ ~override~
COPY ~1pp/v2_copy/wpmh3inv.plt~ ~override~
COPY ~1pp/v2_copy/wpmh4inv.bam~ ~override~
COPY ~1pp/v2_copy/wpmh4inv.plt~ ~override~
COPY ~1pp/v2_copy/wpmh5inv.bam~ ~override~
COPY ~1pp/v2_copy/wpmh5inv.plt~ ~override~
COPY ~1pp/v2_copy/wpmh6inv.bam~ ~override~
COPY ~1pp/v2_copy/wpmh7inv.bam~ ~override~
COPY ~1pp/v2_copy/wpmmcoin.bam~ ~override~
COPY ~1pp/v2_copy/wpmmsoin.bam~ ~override~
COPY ~1pp/v2_copy/wpms1oin.bam~ ~override~
COPY ~1pp/v2_copy/wpms3inv.bam~ ~override~
COPY ~1pp/v2_copy/wpms3oin.bam~ ~override~
COPY ~1pp/v2_copy/wpmscinv.bam~ ~override~
COPY ~1pp/v2_copy/wpmscoin.bam~ ~override~
COPY ~1pp/v2_copy/wpmssoin.bam~ ~override~
COPY ~1pp/v2_copy/wpmwhoin.bam~ ~override~
COPY ~1pp/v2_copy/wpmwmoin.bam~ ~override~
COPY ~1pp/v2_copy/wpnaxoin.bam~ ~override~
COPY ~1pp/v2_copy/wpnd1inv.bam~ ~override~
COPY ~1pp/v2_copy/wpnd2inv.bam~ ~override~
COPY ~1pp/v2_copy/wpnd2inv.plt~ ~override~
COPY ~1pp/v2_copy/wpnd3inv.bam~ ~override~
COPY ~1pp/v2_copy/wpnd3inv.plt~ ~override~
COPY ~1pp/v2_copy/wpnd4inv.bam~ ~override~
COPY ~1pp/v2_copy/wpnd4inv.plt~ ~override~
COPY ~1pp/v2_copy/wpnddoin.bam~ ~override~
COPY ~1pp/v2_copy/wpnfloin.bam~ ~override~
COPY ~1pp/v2_copy/wpnfsinv.bam~ ~override~
COPY ~1pp/v2_copy/wpnfsoin.bam~ ~override~
COPY ~1pp/v2_copy/wpnh0inv.bam~ ~override~
COPY ~1pp/v2_copy/wpnh0inv.plt~ ~override~
COPY ~1pp/v2_copy/wpnh1inv.bam~ ~override~
COPY ~1pp/v2_copy/wpnh1inv.plt~ ~override~
COPY ~1pp/v2_copy/wpnh2inv.bam~ ~override~
COPY ~1pp/v2_copy/wpnh2inv.plt~ ~override~
COPY ~1pp/v2_copy/wpnh3inv.bam~ ~override~
COPY ~1pp/v2_copy/wpnh3inv.plt~ ~override~
COPY ~1pp/v2_copy/wpnh4inv.bam~ ~override~
COPY ~1pp/v2_copy/wpnh4inv.plt~ ~override~
COPY ~1pp/v2_copy/wpnh5inv.bam~ ~override~
COPY ~1pp/v2_copy/wpnh5inv.plt~ ~override~
COPY ~1pp/v2_copy/wpnh6inv.bam~ ~override~
COPY ~1pp/v2_copy/wpnh7inv.bam~ ~override~
COPY ~1pp/v2_copy/wpnmcoin.bam~ ~override~
COPY ~1pp/v2_copy/wpnmsoin.bam~ ~override~
COPY ~1pp/v2_copy/wpns1oin.bam~ ~override~
COPY ~1pp/v2_copy/wpns3inv.bam~ ~override~
COPY ~1pp/v2_copy/wpns3oin.bam~ ~override~
COPY ~1pp/v2_copy/wpnscinv.bam~ ~override~
COPY ~1pp/v2_copy/wpnscoin.bam~ ~override~
COPY ~1pp/v2_copy/wpnssoin.bam~ ~override~
COPY ~1pp/v2_copy/wpnwhoin.bam~ ~override~
COPY ~1pp/v2_copy/wpnwmoin.bam~ ~override~
COPY ~1pp/v2_copy/wpsaxoin.bam~ ~override~
COPY ~1pp/v2_copy/wpsd2inv.plt~ ~override~
COPY ~1pp/v2_copy/wpsd3inv.plt~ ~override~
COPY ~1pp/v2_copy/wpsd4inv.plt~ ~override~
COPY ~1pp/v2_copy/wpsddoin.bam~ ~override~
COPY ~1pp/v2_copy/wpsfloin.bam~ ~override~
COPY ~1pp/v2_copy/wpsfsinv.bam~ ~override~
COPY ~1pp/v2_copy/wpsfsoin.bam~ ~override~
COPY ~1pp/v2_copy/wpsh0inv.bam~ ~override~
COPY ~1pp/v2_copy/wpsh0inv.plt~ ~override~
COPY ~1pp/v2_copy/wpsh1inv.bam~ ~override~
COPY ~1pp/v2_copy/wpsh1inv.plt~ ~override~
COPY ~1pp/v2_copy/wpsh2inv.bam~ ~override~
COPY ~1pp/v2_copy/wpsh2inv.plt~ ~override~
COPY ~1pp/v2_copy/wpsh3inv.bam~ ~override~
COPY ~1pp/v2_copy/wpsh3inv.plt~ ~override~
COPY ~1pp/v2_copy/wpsh4inv.bam~ ~override~
COPY ~1pp/v2_copy/wpsh4inv.plt~ ~override~
COPY ~1pp/v2_copy/wpsh5inv.bam~ ~override~
COPY ~1pp/v2_copy/wpsh5inv.plt~ ~override~
COPY ~1pp/v2_copy/wpsh6inv.bam~ ~override~
COPY ~1pp/v2_copy/wpsh7inv.bam~ ~override~
COPY ~1pp/v2_copy/wpsmcoin.bam~ ~override~
COPY ~1pp/v2_copy/wpsmsoin.bam~ ~override~
COPY ~1pp/v2_copy/wpss1oin.bam~ ~override~
COPY ~1pp/v2_copy/wpss3inv.bam~ ~override~
COPY ~1pp/v2_copy/wpss3oin.bam~ ~override~
COPY ~1pp/v2_copy/wpsscinv.bam~ ~override~
COPY ~1pp/v2_copy/wpsscoin.bam~ ~override~
COPY ~1pp/v2_copy/wpsssoin.bam~ ~override~
COPY ~1pp/v2_copy/wpswhoin.bam~ ~override~
COPY ~1pp/v2_copy/wpswmoin.bam~ ~override~

BEGIN ~One Pixel Productions: v2 New Potion Graphics (2)~
PRINT ~Copying...~
COPY ~1pp/v2_copy/ipotn52.bam~  ~override~
COPY ~1pp/v2_copy/ipotn55.bam~  ~override~
	 

BEGIN ~One Pixel Productions: v3 Flaming Swords (3)~

// Code by Nythrun!

PRINT ~Copying...~
  COPY ~1pp/v3_fs_long~ ~override~
PRINT ~Patching...~
  ACTION_FOR_EACH ~item~ IN ~blakblad~ ~bonedag~ ~morsword~ ~rodsword~ ~sw1h98~ ~_sw1h98~ BEGIN
    ACTION_IF (FILE_EXISTS_IN_GAME ~%item%.itm~) THEN BEGIN
      COPY_EXISTING ~%item%.itm~ ~override~
        PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN
          WRITE_ASCII 0x22 ~S1~
        END
      BUT_ONLY
    END
  END
  
  ACTION_FOR_EACH ~item~ IN ~sw1h53~ ~sw1h60~ ~sw1h61~ BEGIN
    ACTION_IF (FILE_EXISTS_IN_GAME ~%item%.itm~) THEN BEGIN
      COPY_EXISTING ~%item%.itm~ ~override~
        PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN
          READ_LONG  0x64 "ho"
          READ_SHORT 0x68 "hc"
          READ_LONG  0x6a "eo"
          READ_SHORT 0x70 "ge"
          SET "blade" = (~%SOURCE_RES%~ STRING_EQUAL ~sw1h53~ ? 0x9fefff00 :
                         ~%SOURCE_RES%~ STRING_EQUAL ~sw1h60~ ? 0x9fefff00 :
                         ~%SOURCE_RES%~ STRING_EQUAL ~sw1h61~ ? 0x9fefff00 : 0x00)
          SET "grip"  = (~%SOURCE_RES%~ STRING_EQUAL ~sw1h53~ ? 0x20a5da00 : 
                         ~%SOURCE_RES%~ STRING_EQUAL ~sw1h60~ ? 0x20a5da00 :
                         ~%SOURCE_RES%~ STRING_EQUAL ~sw1h61~ ? 0x20a5da00 : 0x00)
          SET "minor" = (~%SOURCE_RES%~ STRING_EQUAL ~sw1h53~ ? 0x3f00ff00 :
                         ~%SOURCE_RES%~ STRING_EQUAL ~sw1h60~ ? 0x3f00ff00 :
                         ~%SOURCE_RES%~ STRING_EQUAL ~sw1h61~ ? 0x3f00ff00 : 0x00)
          FOR ("i1" = 0x00; "i1" < ("ge" * 0x30); "i1" += 0x30) BEGIN
            READ_SHORT  ("eo" + "i1" + 0x00) "op"
            PATCH_IF (("op" = 0x08) OR ("op" = 0x09)) THEN BEGIN
              READ_LONG ("eo" + "i1" + 0x08) "lc"
              PATCH_IF          ("lc" = 0x10) THEN BEGIN
                WRITE_LONG ("eo" + "i1" + 0x04) "blade"
                SET "blade" = 0x00
              END ELSE PATCH_IF ("lc" = 0x14) THEN BEGIN
                WRITE_LONG ("eo" + "i1" + 0x04) "grip"
                SET "grip"  = 0x00
              END ELSE PATCH_IF ("lc" = 0x15) THEN BEGIN
                WRITE_LONG ("eo" + "i1" + 0x04) "minor"
                SET "minor" = 0x00
              END
            END
          END
          PATCH_IF ("blade" != 0x00) THEN BEGIN
            INSERT_BYTES ("eo" + (0x30 * "ge") + 0x00) 0x30
            WRITE_SHORT  ("eo" + (0x30 * "ge") + 0x00) 0x08
            WRITE_BYTE   ("eo" + (0x30 * "ge") + 0x02) 0x01
            WRITE_LONG   ("eo" + (0x30 * "ge") + 0x04) "blade"
            WRITE_LONG   ("eo" + (0x30 * "ge") + 0x08) 0x10
            WRITE_BYTE   ("eo" + (0x30 * "ge") + 0x0c) 0x02
            WRITE_BYTE   ("eo" + (0x30 * "ge") + 0x12) 0x64
            SET "ge" += 0x01
          END
          PATCH_IF ("grip" != 0x00) THEN BEGIN
            INSERT_BYTES ("eo" + (0x30 * "ge") + 0x00) 0x30
            WRITE_SHORT  ("eo" + (0x30 * "ge") + 0x00) 0x08
            WRITE_BYTE   ("eo" + (0x30 * "ge") + 0x02) 0x01
            WRITE_LONG   ("eo" + (0x30 * "ge") + 0x04) "grip"
            WRITE_LONG   ("eo" + (0x30 * "ge") + 0x08) 0x14
            WRITE_BYTE   ("eo" + (0x30 * "ge") + 0x0c) 0x02
            WRITE_BYTE   ("eo" + (0x30 * "ge") + 0x12) 0x64
            SET "ge" += 0x01
          END
          PATCH_IF ("minor" != 0x00) THEN BEGIN
            INSERT_BYTES ("eo" + (0x30 * "ge") + 0x00) 0x30
            WRITE_SHORT  ("eo" + (0x30 * "ge") + 0x00) 0x08
            WRITE_BYTE   ("eo" + (0x30 * "ge") + 0x02) 0x01
            WRITE_LONG   ("eo" + (0x30 * "ge") + 0x04) "minor"
            WRITE_LONG   ("eo" + (0x30 * "ge") + 0x08) 0x15
            WRITE_BYTE   ("eo" + (0x30 * "ge") + 0x0c) 0x02
            WRITE_BYTE   ("eo" + (0x30 * "ge") + 0x12) 0x64
            SET "ge" += 0x01
          END
          PATCH_IF (("blade" != 0x00) OR ("grip" != 0x00) OR ("minor" != 0x00)) THEN BEGIN
            WRITE_SHORT 0x70 "ge"
            FOR ("i1" = 0x00; "i1" < (0x38 * "hc"); "i1" += 0x38) BEGIN
              WRITE_SHORT ("ho" + "i1" + 0x20) "ge"
              READ_SHORT  ("ho" + "i1" + 0x1e) "ec"
              SET "ge" += "ec"
            END
          END
        END
      BUT_ONLY
    END
  END

BEGIN ~One Pixel Productions: v3 Flame Short Swords (4)~
PRINT ~Copying...~
COPY ~1pp/v3_fs_short/fs_s_files~ ~override~

BEGIN ~One Pixel Productions: v3 Flame Short Swords item patches (5)~

LAUNCH_ACTION_MACRO ~Locations~

PRINT ~Patching...~

LAUNCH_ACTION_MACRO ~Locations~

PRINT ~Patching...~

ACTION_IF (FILE_EXISTS_IN_GAME ~miscbc.itm~) THEN BEGIN
COPY_EXISTING ~miscbc.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
    WRITE_ASCII 0x22 ~FS~
  END
  BUT_ONLY_IF_IT_CHANGES
END

ACTION_IF (FILE_EXISTS_IN_GAME ~npsw06.itm~) THEN BEGIN
COPY_EXISTING ~npsw06.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
  WRITE_ASCII 0x22 ~F2~
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 99		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 93		// colour index
SET location = wred		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 108		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET setr = 0x4C // Set Red
SET setg = 0x17 // Set Green
SET setb = 0x20 // Set Blue
SET location = wblue
LAUNCH_PATCH_MACRO ~glow~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~sw1h27.itm~) THEN BEGIN
COPY_EXISTING ~sw1h27.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
  WRITE_ASCII 0x22 ~F2~
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 25		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 89		// colour index
SET location = wred		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 33		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET setr = 0x34 // Set Red
SET setg = 0x15 // Set Green
SET setb = 0x0D // Set Blue
SET location = wblue
LAUNCH_PATCH_MACRO ~glow~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~sblade.itm~) THEN BEGIN
COPY_EXISTING ~sblade.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
  WRITE_ASCII 0x22 ~F2~
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 25		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 68		// colour index
SET location = wred		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 71		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET setr = 0x00 // Set Red
SET setg = 0x00 // Set Green
SET setb = 0x00 // Set Blue
SET location = wgrey
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x00 // Set Red
SET setg = 0x00 // Set Green
SET setb = 0x00 // Set Blue
SET location = wred
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x00 // Set Red
SET setg = 0x00 // Set Green
SET setb = 0x00 // Set Blue
SET location = wblue
LAUNCH_PATCH_MACRO ~glow~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~sw1h39.itm~) THEN BEGIN
COPY_EXISTING ~sw1h39.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
    WRITE_ASCII 0x22 ~FS~
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 30		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 30		// colour index
SET location = wred		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 27		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET setr = 0x19 // Set Red
SET setg = 0x14 // Set Green
SET setb = 0x0B // Set Blue
SET location = wred
LAUNCH_PATCH_MACRO ~glow~
END
END

  ACTION_IF (FILE_EXISTS_IN_GAME ~sw1h98.itm~) THEN BEGIN
COPY_EXISTING ~sw1h98.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
    WRITE_ASCII 0x22 ~SS~
  END
  BUT_ONLY_IF_IT_CHANGES
END

BEGIN ~One Pixel Productions: v3 Flame Short Swords mod item patches (6)~

LAUNCH_ACTION_MACRO ~Locations~

PRINT ~Patching...~

ACTION_IF (FILE_EXISTS_IN_GAME ~chlosw1.itm~) THEN BEGIN
COPY ~1pp/v3_fs_short/fs_s_items/cchak01.bam~ ~override~
COPY ~1pp/v3_fs_short/fs_s_items/cchak02.bam~ ~override~
COPY ~1pp/v3_fs_short/fs_s_items/cchak03.bam~ ~override~
COPY ~1pp/v3_fs_short/fs_s_items/cchla01.bam~ ~override~
COPY ~1pp/v3_fs_short/fs_s_items/cchla02.bam~ ~override~
COPY ~1pp/v3_fs_short/fs_s_items/cchla03.bam~ ~override~
COPY ~1pp/v3_fs_short/fs_s_items/ichak01.bam~ ~override~
COPY ~1pp/v3_fs_short/fs_s_items/ichak02.bam~ ~override~
COPY ~1pp/v3_fs_short/fs_s_items/ichak03.bam~ ~override~
COPY ~1pp/v3_fs_short/fs_s_items/ichla01.bam~ ~override~
COPY ~1pp/v3_fs_short/fs_s_items/ichla02.bam~ ~override~
COPY ~1pp/v3_fs_short/fs_s_items/ichla03.bam~ ~override~
PRINT ~Patching...~
COPY ~1pp/v3_fs_short/fs_s_items/chlosw1.itm~ ~Override~
SAY NAME1 ~Wrath of Akadia~
SAY NAME2 ~Wrath of Akadia~
SAY UNIDENTIFIED_DESC ~Chloe growls at you when you try to look at her weapon, but reluctantly agrees to tell you what it does:

Wrath of Akadia
Weapon type: scimitar
Speed factor: 3
THAC0 and damage bonus: +3, hits as +3 weapon
Damage: (1d8) slashing +3 +(1d2 electrical damage)
Equipped Effect: Immunity to Blindness
Effect: Blur once daily

Usable only by Chloe.~
SAY IDENTIFIED_DESC ~Chloe growls at you when you try to look at her weapon, but reluctantly agrees to tell you what it does:

Wrath of Akadia
Weapon type: scimitar
Speed factor: 3
THAC0 and damage bonus: +3, hits as +3 weapon
Damage: (1d8) slashing +3 +(1d2 electrical damage)
Equipped Effect: Immunity to Blindness
Effect: Blur once daily

Usable only by Chloe.~

COPY ~1pp/v3_fs_short/fs_s_items/chlosw2.itm~ ~Override~
SAY NAME1 ~Rage of Akadia~
SAY NAME2 ~Rage of Akadia~
SAY UNIDENTIFIED_DESC ~Chloe growls at you when you try to look at her weapon, but reluctantly agrees to tell you what it does:

Rage of Akadia
Weapon type: Scimitar
Speed factor: 2
Thac0 and damage bonus: +4, hits as +4 weapon
Damage: (1d8) slashing +4 +(1d4 electrical) +10% of stun
Equipped Effect: Immunity to blindness, confusion
Effect: Improved Haste Once daily, Blur 3 times daily

Usable only by Chloe.~
SAY IDENTIFIED_DESC ~Chloe growls at you when you try to look at her weapon, but reluctantly agrees to tell you what it does:

Rage of Akadia
Weapon type: Scimitar
Speed factor: 2
Thac0 and damage bonus: +4, hits as +4 weapon
Damage: (1d8) slashing +4 +(1d4 electrical) +10% of stun
Equipped Effect: Immunity to blindness, confusion
Effect: Improved Haste Once daily, Blur 3 times daily

Usable only by Chloe.~

COPY ~1pp/v3_fs_short/fs_s_items/chlosw3.itm~ ~Override~
SAY NAME1 ~Fury of Akadia~
SAY NAME2 ~Fury of Akadia~
SAY UNIDENTIFIED_DESC ~Chloe growls at you when you try to look at her weapon, but reluctantly agrees to tell you what it does:

Fury of Akadia
Weapon type: Scimitar
Speed factor: 1
Thac0 and damage bonus: +6, hits as +6 weapon
Damage: (1d8) slashing +6 +(1d6 electrical) +10% chance of electroshock (1d12 damage) and stun
Equipped Effect: Immunity to blind, confusion, and hold
Effect: Improved Haste 3 times daily, blur 3 times daily

Usable only by Chloe.~
SAY IDENTIFIED_DESC ~Chloe growls at you when you try to look at her weapon, but reluctantly agrees to tell you what it does:

Fury of Akadia
Weapon type: Scimitar
Speed factor: 1
Thac0 and damage bonus: +6, hits as +6 weapon
Damage: (1d8) slashing +6 +(1d6 electrical) +10% chance of electroshock (1d12 damage) and stun
Equipped Effect: Immunity to blind, confusion, and hold
Effect: Improved Haste 3 times daily, blur 3 times daily

Usable only by Chloe.~

COPY ~1pp/v3_fs_short/fs_s_items/chlosw4.itm~ ~Override~
SAY NAME1 ~Lathandar's Flame~
SAY NAME2 ~Lathandar's Flame~
SAY UNIDENTIFIED_DESC ~Chloe growls at you when you try to look at her weapon, but reluctantly agrees to tell you what it does:

Lathandar's Flame
Weapon type: Short sword
Speed factor: 2
Thac0 and damage bonus: +2, hits as +2 weapon
Damage: (1d6) piercing +2 +(1d2 fire)
Equipped Effect: 25% Fire resistance
Effect: Flame Arrow once daily, Protection from the Negative Plane once daily

Usable only by Chloe.~
SAY IDENTIFIED_DESC ~Chloe growls at you when you try to look at her weapon, but reluctantly agrees to tell you what it does:

Lathandar's Flame
Weapon type: Short sword
Speed factor: 2
Thac0 and damage bonus: +2, hits as +2 weapon
Damage: (1d6) piercing +2 +(1d2 fire)
Equipped Effect: 25% Fire resistance
Effect: Flame Arrow once daily, Protection from the Negative Plane once daily

Usable only by Chloe.~

COPY ~1pp/v3_fs_short/fs_s_items/chlosw5.itm~ ~Override~
SAY NAME1 ~Lathandar's Blaze~
SAY NAME2 ~Lathandar's Blaze~
SAY UNIDENTIFIED_DESC ~Chloe growls at you when you try to look at her weapon, but reluctantly agrees to tell you what it does:

Lathandar's Blaze
Weapon type: Short sword
Speed factor: 1
Thac0 and damage bonus: +3, hits as +3 weapon
Damage: (1d6) piercing +3 +(1d4 fire) + 10% of blinding opponent
Equipped Effect: Negative Plane Protection, 50% fire resistance
Effect: Flame strike once daily

Usable only by Chloe.~
SAY IDENTIFIED_DESC ~Chloe growls at you when you try to look at her weapon, but reluctantly agrees to tell you what it does:

Lathandar's Blaze
Weapon type: Short sword
Speed factor: 1
Thac0 and damage bonus: +3, hits as +3 weapon
Damage: (1d6) piercing +3 +(1d4 fire) + 10% of blinding opponent
Equipped Effect: Negative Plane Protection, 50% fire resistance
Effect: Flame strike once daily

Usable only by Chloe.~

COPY ~1pp/v3_fs_short/fs_s_items/chlosw6.itm~ ~Override~
SAY NAME1 ~Lathandar's Inferno~
SAY NAME2 ~Lathandar's Inferno~
SAY UNIDENTIFIED_DESC ~Chloe growls at you when you try to look at her weapon, but reluctantly agrees to tell you what it does:

Lathandar's Inferno
Weapon type: Short sword
Speed Factor: 0
Thac0 and damage bonus: +5, hits as +5 weapon
Damage: (1d6) piercing +5 +(1d6 fire) + 15% chance of 1d12 fire and blinding opponent
Equipped Effect: Negative Planes Protection, 100% Fire resistance, Luck
Effect: False Dawn once daily, Sunray once daily

Usable only by Chloe.~
SAY IDENTIFIED_DESC ~Chloe growls at you when you try to look at her weapon, but reluctantly agrees to tell you what it does:

Lathandar's Inferno
Weapon type: Short sword
Speed Factor: 0
Thac0 and damage bonus: +5, hits as +5 weapon
Damage: (1d6) piercing +5 +(1d6 fire) + 15% chance of 1d12 fire and blinding opponent
Equipped Effect: Negative Planes Protection, 100% Fire resistance, Luck
Effect: False Dawn once daily, Sunray once daily

Usable only by Chloe.~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~fireflow.itm~) THEN BEGIN
COPY_EXISTING ~fireflow.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
      WRITE_ASCII 0x22 ~F2~
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 12		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 115		// colour index
SET location = wred		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 70		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET setr = 0x2B // Set Red
SET setg = 0x00 // Set Green
SET setb = 0x00 // Set Blue
SET location = wgrey
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x2C // Set Red
SET setg = 0x05 // Set Green
SET setb = 0x05 // Set Blue
SET location = wblue
LAUNCH_PATCH_MACRO ~glow~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~fireflo2.itm~) THEN BEGIN
COPY_EXISTING ~fireflo2.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
      WRITE_ASCII 0x22 ~F2~
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 96		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 51		// colour index
SET location = wred		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 96		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET setr = 0x2C // Set Red
SET setg = 0x0C // Set Green
SET setb = 0x02 // Set Blue
SET location = wgrey
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x3C // Set Red
SET setg = 0x32 // Set Green
SET setb = 0x18 // Set Blue
SET location = wblue
LAUNCH_PATCH_MACRO ~glow~
END
END

BEGIN ~One Pixel Productions: v3 Paperdolls (human, half-orc, elven, halfling, dwarves) (7)~

COPY 	~1pp/v3_paperdolls/CDFC1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDFC1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDFC2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDFC2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDFC3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDFC3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDFC4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDFC4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDFF1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDFF1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDFF2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDFF2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDFF3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDFF3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDFF4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDFF4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDFT1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDFT1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDFT2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDFT2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDFW1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDFW1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDFW2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDFW2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDFW3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDFW3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDFW4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDFW4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDMC1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDMC1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDMC2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDMC2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDMC3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDMC3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDMC4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDMC4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDMF1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDMF1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDMF2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDMF2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDMF3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDMF3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDMF4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDMF4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDMT1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDMT1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDMT2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDMT2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDMW1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDMW1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDMW2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDMW2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDMW3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDMW3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CDMW4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CDMW4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEFC1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEFC1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEFC2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEFC2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEFC3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEFC3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEFC4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEFC4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEFF1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEFF1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEFF2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEFF2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEFF3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEFF3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEFF4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEFF4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEFT1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEFT1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEFT2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEFT2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEFW1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEFW1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEFW2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEFW2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEFW3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEFW3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEFW4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEFW4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEMC1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEMC1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEMC2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEMC2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEMC3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEMC3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEMC4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEMC4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEMF1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEMF1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEMF2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEMF2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEMF3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEMF3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEMF4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEMF4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEMT1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEMT1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEMT2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEMT2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEMW1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEMW1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEMW2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEMW2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEMW3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEMW3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CEMW4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CEMW4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHFC1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHFC1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHFC2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHFC2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHFC3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHFC3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHFC4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHFC4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHFF1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHFF1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHFF2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHFF2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHFF3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHFF3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHFF4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHFF4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHFM1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHFM1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHFT1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHFT1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHFT2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHFT2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHFW1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHFW1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHFW2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHFW2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHFW3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHFW3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHFW4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHFW4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHMC1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHMC1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHMC2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHMC2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHMC3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHMC3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHMC4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHMC4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHMF1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHMF1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHMF2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHMF2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHMF3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHMF3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHMF4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHMF4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHMM1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHMM1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHMT1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHMT1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHMT2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHMT2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHMW1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHMW1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHMW2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHMW2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHMW3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHMW3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CHMW4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CHMW4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIFC1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIFC1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIFC2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIFC2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIFC3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIFC3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIFC4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIFC4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIFF1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIFF1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIFF2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIFF2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIFF3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIFF3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIFF4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIFF4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIFT1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIFT1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIFT2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIFT2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIMC1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIMC1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIMC2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIMC2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIMC3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIMC3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIMC4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIMC4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIMF1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIMF1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIMF2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIMF2INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIMF3INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIMF3INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIMF4INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIMF4INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIMT1INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIMT1INV.PLT~ ~override~
	~1pp/v3_paperdolls/CIMT2INV.BAM~ ~override~
	~1pp/v3_paperdolls/CIMT2INV.PLT~ ~override~
	~1pp/v3_paperdolls/COFC1INV.BAM~ ~override~
	~1pp/v3_paperdolls/COFC1INV.PLT~ ~override~
	~1pp/v3_paperdolls/COFC2INV.BAM~ ~override~
	~1pp/v3_paperdolls/COFC2INV.PLT~ ~override~
	~1pp/v3_paperdolls/COFC3INV.BAM~ ~override~
	~1pp/v3_paperdolls/COFC3INV.PLT~ ~override~
	~1pp/v3_paperdolls/COFC4INV.BAM~ ~override~
	~1pp/v3_paperdolls/COFC4INV.PLT~ ~override~
	~1pp/v3_paperdolls/COFF1INV.BAM~ ~override~
	~1pp/v3_paperdolls/COFF1INV.PLT~ ~override~
	~1pp/v3_paperdolls/COFF2INV.BAM~ ~override~
	~1pp/v3_paperdolls/COFF2INV.PLT~ ~override~
	~1pp/v3_paperdolls/COFF3INV.BAM~ ~override~
	~1pp/v3_paperdolls/COFF3INV.PLT~ ~override~
	~1pp/v3_paperdolls/COFF4INV.bam~ ~override~
	~1pp/v3_paperdolls/COFF4INV.PLT~ ~override~
	~1pp/v3_paperdolls/COFT1INV.BAM~ ~override~
	~1pp/v3_paperdolls/COFT1INV.PLT~ ~override~
	~1pp/v3_paperdolls/COFT2INV.BAM~ ~override~
	~1pp/v3_paperdolls/COFT2INV.PLT~ ~override~
	~1pp/v3_paperdolls/COFW1INV.BAM~ ~override~
	~1pp/v3_paperdolls/COFW1INV.PLT~ ~override~
	~1pp/v3_paperdolls/COFW2INV.BAM~ ~override~
	~1pp/v3_paperdolls/COFW2INV.PLT~ ~override~
	~1pp/v3_paperdolls/COFW3INV.BAM~ ~override~
	~1pp/v3_paperdolls/COFW3INV.PLT~ ~override~
	~1pp/v3_paperdolls/COFW4INV.BAM~ ~override~
	~1pp/v3_paperdolls/COFW4INV.PLT~ ~override~
	~1pp/v3_paperdolls/COMC1INV.bam~ ~override~
	~1pp/v3_paperdolls/COMC1INV.PLT~ ~override~
	~1pp/v3_paperdolls/COMC2INV.bam~ ~override~
	~1pp/v3_paperdolls/COMC2INV.PLT~ ~override~
	~1pp/v3_paperdolls/COMC3INV.bam~ ~override~
	~1pp/v3_paperdolls/COMC3INV.PLT~ ~override~
	~1pp/v3_paperdolls/COMC4INV.bam~ ~override~
	~1pp/v3_paperdolls/COMC4INV.PLT~ ~override~
	~1pp/v3_paperdolls/COMF1INV.bam~ ~override~
	~1pp/v3_paperdolls/COMF1INV.PLT~ ~override~
	~1pp/v3_paperdolls/COMF2INV.bam~ ~override~
	~1pp/v3_paperdolls/COMF2INV.PLT~ ~override~
	~1pp/v3_paperdolls/COMF3INV.bam~ ~override~
	~1pp/v3_paperdolls/COMF3INV.PLT~ ~override~
	~1pp/v3_paperdolls/COMF4INV.bam~ ~override~
	~1pp/v3_paperdolls/COMF4INV.PLT~ ~override~
	~1pp/v3_paperdolls/COMT1INV.BAM~ ~override~
	~1pp/v3_paperdolls/COMT1INV.PLT~ ~override~
	~1pp/v3_paperdolls/COMT2INV.BAM~ ~override~
	~1pp/v3_paperdolls/COMT2INV.PLT~ ~override~
	~1pp/v3_paperdolls/COMW1INV.BAM~ ~override~
	~1pp/v3_paperdolls/COMW1INV.PLT~ ~override~
	~1pp/v3_paperdolls/COMW2INV.BAM~ ~override~
	~1pp/v3_paperdolls/COMW2INV.PLT~ ~override~
	~1pp/v3_paperdolls/COMW3INV.BAM~ ~override~
	~1pp/v3_paperdolls/COMW3INV.PLT~ ~override~
	~1pp/v3_paperdolls/COMW4INV.BAM~ ~override~
	~1pp/v3_paperdolls/COMW4INV.PLT~ ~override~


BEGIN ~One Pixel Productions: v3 Legacy Shields - Bucklers (D1) (8)~

PRINT ~Copying...~

COPY ~1pp/v3_d1_shield/WQLD1A1.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQLD1A3.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQLD1A5.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQLD1G1.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQLD1SS.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQMD1A1.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQMD1A3.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQMD1A5.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQMD1G1.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQMD1SS.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQND1A1.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQND1A3.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQND1A5.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQND1G1.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQND1SS.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQSD1A1.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQSD1A3.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQSD1A5.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQSD1G1.BAM~ ~override~
COPY ~1pp/v3_d1_shield/WQSD1SS.BAM~ ~override~

PRINT ~Patching D1 shields...~
ACTION_IF (FILE_EXISTS_IN_GAME ~shld08.itm~) THEN BEGIN
COPY_EXISTING ~shld08.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
    WRITE_ASCII 0x22 ~D1~
  END
  BUT_ONLY_IF_IT_CHANGES
END

ACTION_IF (FILE_EXISTS_IN_GAME ~shld09.itm~) THEN BEGIN
COPY_EXISTING ~shld09.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
    WRITE_ASCII 0x22 ~D1~
  END
  BUT_ONLY_IF_IT_CHANGES
END
 
 ACTION_IF (FILE_EXISTS_IN_GAME ~shld10.itm~) THEN BEGIN
COPY_EXISTING ~shld10.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
    WRITE_ASCII 0x22 ~D1~
  END
  BUT_ONLY_IF_IT_CHANGES
END

ACTION_IF (FILE_EXISTS_IN_GAME ~shld17.itm~) THEN BEGIN
COPY_EXISTING ~shld17.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
    WRITE_ASCII 0x22 ~D1~
  END
  BUT_ONLY_IF_IT_CHANGES
END

ACTION_IF (FILE_EXISTS_IN_GAME ~shld20.itm~) THEN BEGIN
COPY_EXISTING ~shld20.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
    WRITE_ASCII 0x22 ~D1~
  END
  BUT_ONLY_IF_IT_CHANGES
END

BEGIN ~One Pixel Productions: v3 Legacy Shields - Small Shields (D2) (9)~

PRINT ~Copying...~

COPY ~1pp/v3_d2_shield/WQLD2A1.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQLD2A3.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQLD2A5.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQLD2G1.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQLD2SS.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQMD2A1.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQMD2A3.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQMD2A5.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQMD2G1.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQMD2SS.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQND2A1.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQND2A3.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQND2A5.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQND2G1.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQND2SS.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQSD2A1.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQSD2A3.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQSD2A5.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQSD2G1.BAM~ ~override~
COPY ~1pp/v3_d2_shield/WQSD2SS.BAM~ ~override~

BEGIN ~One Pixel Productions: v3 Legacy Shields - Medium Shields (D3) (10)~

PRINT ~Copying...~

COPY ~1pp/v3_d3_shield/WQLD3A1.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQLD3A3.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQLD3A5.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQLD3G1.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQLD3SS.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQMD3A1.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQMD3A3.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQMD3A5.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQMD3G1.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQMD3SS.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQND3A1.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQND3A3.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQND3A5.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQND3G1.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQND3SS.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQSD3A1.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQSD3A3.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQSD3A5.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQSD3G1.BAM~ ~override~
COPY ~1pp/v3_d3_shield/WQSD3SS.BAM~ ~override~


// Colourable Quarterstaves, 1pp beta
// Presented in Technicolour

BEGIN ~One Pixel Productions: v3 Colourable Quarterstaves core (11)~

PRINT ~Copying...~

COPY ~1pp/qs_technicolour/wqlqsa2.bam~ ~override~
COPY ~1pp/qs_technicolour/wqlqsa4.bam~ ~override~
COPY ~1pp/qs_technicolour/wqlqsa6.bam~ ~override~
COPY ~1pp/qs_technicolour/wqlqsg1.bam~ ~override~
COPY ~1pp/qs_technicolour/wqmqsa2.bam~ ~override~
COPY ~1pp/qs_technicolour/wqmqsa4.bam~ ~override~
COPY ~1pp/qs_technicolour/wqmqsa6.bam~ ~override~
COPY ~1pp/qs_technicolour/wqmqsg1.bam~ ~override~
COPY ~1pp/qs_technicolour/wqnqsa2.bam~ ~override~
COPY ~1pp/qs_technicolour/wqnqsa4.bam~ ~override~
COPY ~1pp/qs_technicolour/wqnqsa6.bam~ ~override~
COPY ~1pp/qs_technicolour/wqnqsg1.bam~ ~override~
COPY ~1pp/qs_technicolour/wqsqsa2.bam~ ~override~
COPY ~1pp/qs_technicolour/wqsqsa4.bam~ ~override~
COPY ~1pp/qs_technicolour/wqsqsa6.bam~ ~override~
COPY ~1pp/qs_technicolour/wqsqsg1.bam~ ~override~

COPY ~1pp/qs_technicolour/wplqsinv.bam~ ~override~
COPY ~1pp/qs_technicolour/wphqsinv.bam~ ~override~
COPY ~1pp/qs_technicolour/wpmqsinv.bam~ ~override~
COPY ~1pp/qs_technicolour/wpnqsinv.bam~ ~override~
COPY ~1pp/qs_technicolour/wpsqsinv.bam~ ~override~

BEGIN ~1PP: Colourable Quarterstaves core item patches (12)~

LAUNCH_ACTION_MACRO ~Locations~

PRINT ~Patching...~

ACTION_IF (FILE_EXISTS_IN_GAME ~enstaff.itm~) THEN BEGIN
COPY_EXISTING ~enstaff.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 25		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 21		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 109		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 27		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~hgnya01.itm~) THEN BEGIN
COPY_EXISTING ~hgnya01.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 23		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 36		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 25		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 23		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 27		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~hgwra01.itm~) THEN BEGIN
COPY_EXISTING ~hgwra01.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET setr = 0x60 // Set Red
SET setg = 0x00 // Set Green
SET setb = 0x71 // Set Blue
SET speed = 0x1E // Speed
SET location = wgrey
LAUNCH_PATCH_MACRO ~pulse~
SET setr = 0x00 // Set Red
SET setg = 0x00 // Set Green
SET setb = 0xC0 // Set Blue
SET speed = 0x14 // Speed
SET location = wteal
LAUNCH_PATCH_MACRO ~pulse~
SET setr = 0x63 // Set Red
SET setg = 0x63 // Set Green
SET setb = 0xE6 // Set Blue
SET speed = 0x0C // Speed
SET location = wpink
LAUNCH_PATCH_MACRO ~pulse~
SET setr = 0x6D // Set Red
SET setg = 0x6D // Set Green
SET setb = 0xFF // Set Blue
SET speed = 0x0C // Speed
SET location = wblue
LAUNCH_PATCH_MACRO ~pulse~
SET setr = 0x60 // Set Red
SET setg = 0x00 // Set Green
SET setb = 0x71 // Set Blue
SET speed = 0x1E // Speed
SET location = wred
LAUNCH_PATCH_MACRO ~pulse~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~misc5t.itm~) THEN BEGIN
COPY_EXISTING ~misc5t.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 11		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 24		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 19		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 26		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~misc9o.itm~) THEN BEGIN
COPY_EXISTING ~misc9o.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 22		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 23		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~rods04.itm~) THEN BEGIN
COPY_EXISTING ~rods04.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 102		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 96		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 91		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 102		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~rods05.itm~) THEN BEGIN
COPY_EXISTING ~rods05.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 5		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 6		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 5		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 3		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~sahstaff.itm~) THEN BEGIN
COPY_EXISTING ~sahstaff.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 22		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 90		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

// ordinary staves

ACTION_IF (FILE_EXISTS_IN_GAME ~staf01.itm~) THEN BEGIN
COPY_EXISTING ~staf01.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 22		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 90		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END


ACTION_IF (FILE_EXISTS_IN_GAME ~staf02.itm~) THEN BEGIN
COPY_EXISTING ~staf02.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 25		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 21		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 25		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 5		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 27		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf03.itm~) THEN BEGIN
COPY_EXISTING ~staf03.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 2		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 90		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 2		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf04.itm~) THEN BEGIN
COPY_EXISTING ~staf04.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 2		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 90		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 2		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf05.itm~) THEN BEGIN
COPY_EXISTING ~staf05.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 25		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 21		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 109		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 27		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 27		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf08.itm~) THEN BEGIN
COPY_EXISTING ~staf08.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 81		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 66		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 83		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 85		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 85		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
SET setr = 0x00 // Set Red
SET setg = 0x14 // Set Green
SET setb = 0x14 // Set Blue
SET location = wgrey
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x00 // Set Red
SET setg = 0x19 // Set Green
SET setb = 0x19 // Set Blue
SET location = wteal
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x00 // Set Red
SET setg = 0x28 // Set Green
SET setb = 0x28 // Set Blue
SET location = wpink
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x00 // Set Red
SET setg = 0x1E // Set Green
SET setb = 0x1E // Set Blue
SET location = wblue
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x00 // Set Red
SET setg = 0x28 // Set Green
SET setb = 0x28 // Set Blue
SET location = wred
LAUNCH_PATCH_MACRO ~glow~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf09.itm~) THEN BEGIN
COPY_EXISTING ~staf09.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 14		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 19		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 21		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 13		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 10		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf10.itm~) THEN BEGIN
COPY_EXISTING ~staf10.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 96		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 100		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 96		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 102		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 96		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf11.itm~) THEN BEGIN
COPY_EXISTING ~staf11.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
SET opcode_to_delete = 7
LAUNCH_PATCH_MACRO DELETE_ITEM_EQEFFECT
SET opcode_to_delete = 8
LAUNCH_PATCH_MACRO DELETE_ITEM_EQEFFECT
SET gradient = 112		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 113		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 93		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 98		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 27		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf12.itm~) THEN BEGIN
COPY_EXISTING ~staf12.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 25		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 21		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 25		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 5		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 27		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf13.itm~) THEN BEGIN
COPY_EXISTING ~staf13.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 18		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 100		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 101		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 96		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 104		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
SET setr = 0xC6 // Set Red
SET setg = 0xD5 // Set Green
SET setb = 0xDE // Set Blue
SET speed = 0x14 // Speed
SET location = wteal
LAUNCH_PATCH_MACRO ~pulse~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf14.itm~) THEN BEGIN
COPY_EXISTING ~staf14.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 16		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 19		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 16		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 39		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf15.itm~) THEN BEGIN
COPY_EXISTING ~staf15.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 14		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 17		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 28		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 27		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 27		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf16.itm~) THEN BEGIN
COPY_EXISTING ~staf16.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 38		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 20		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 39		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 38		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 39		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf17.itm~) THEN BEGIN
COPY_EXISTING ~staf17.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 10		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 11		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 111		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 12		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 10		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf18.itm~) THEN BEGIN
COPY_EXISTING ~staf18.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 25		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 66		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 81		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 43		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 39		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf19.itm~) THEN BEGIN
COPY_EXISTING ~staf19.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 105		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 96		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 97		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 97		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 97		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
SET setr = 0x00 // Set Red
SET setg = 0x8B // Set Green
SET setb = 0xCA // Set Blue
SET location = wgrey
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x00 // Set Red
SET setg = 0x77 // Set Green
SET setb = 0xB6 // Set Blue
SET location = wteal
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x00 // Set Red
SET setg = 0x90 // Set Green
SET setb = 0xD0 // Set Blue
SET location = wpink
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x00 // Set Red
SET setg = 0x8B // Set Green
SET setb = 0xCA // Set Blue
SET location = wblue
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x00 // Set Red
SET setg = 0x8B // Set Green
SET setb = 0xCA // Set Blue
SET location = wred
LAUNCH_PATCH_MACRO ~glow~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf20.itm~) THEN BEGIN
COPY_EXISTING ~staf20.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 97		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 96		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 97		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 97		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 97		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
SET setr = 0x00 // Set Red
SET setg = 0x8B // Set Green
SET setb = 0xCA // Set Blue
SET location = wgrey
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x00 // Set Red
SET setg = 0x77 // Set Green
SET setb = 0xB6 // Set Blue
SET location = wteal
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x00 // Set Red
SET setg = 0x90 // Set Green
SET setb = 0xD0 // Set Blue
SET location = wpink
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x00 // Set Red
SET setg = 0x8B // Set Green
SET setb = 0xCA // Set Blue
SET location = wblue
LAUNCH_PATCH_MACRO ~glow~
SET setr = 0x00 // Set Red
SET setg = 0x8B // Set Green
SET setb = 0xCA // Set Blue
SET location = wred
LAUNCH_PATCH_MACRO ~glow~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf21.itm~) THEN BEGIN
COPY_EXISTING ~staf21.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 42		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 37		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 36		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 42		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 36		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf22.itm~) THEN BEGIN
COPY_EXISTING ~staf22.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 42		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 37		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 36		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 42		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 36		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf23.itm~) THEN BEGIN
COPY_EXISTING ~staf23.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 36		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 35		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 86		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 37		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 52		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
SET setr = 0x21 // Set Red
SET setg = 0xC0 // Set Green
SET setb = 0x00 // Set Blue
SET speed = 0x28 // Speed
SET location = wgrey
LAUNCH_PATCH_MACRO ~pulse~
SET setr = 0x37 // Set Red
SET setg = 0xA6 // Set Green
SET setb = 0x00 // Set Blue
SET speed = 0x28 // Speed
SET location = wteal
LAUNCH_PATCH_MACRO ~pulse~
SET setr = 0x21 // Set Red
SET setg = 0xD2 // Set Green
SET setb = 0x00 // Set Blue
SET speed = 0x28 // Speed
SET location = wpink
LAUNCH_PATCH_MACRO ~pulse~
SET setr = 0x21 // Set Red
SET setg = 0xC0 // Set Green
SET setb = 0x00 // Set Blue
SET speed = 0x28 // Speed
SET location = wblue
LAUNCH_PATCH_MACRO ~pulse~
SET setr = 0x21 // Set Red
SET setg = 0xC0 // Set Green
SET setb = 0x00 // Set Blue
SET speed = 0x28 // Speed
SET location = wred
LAUNCH_PATCH_MACRO ~pulse~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~staf24.itm~) THEN BEGIN
COPY_EXISTING ~staf24.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 25		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 66		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 81		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 43		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 39		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~wastaff.itm~) THEN BEGIN
COPY_EXISTING ~wastaff.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 10		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 15		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 10		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 10		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 27		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
SET setr = 0x4C // Set Red
SET setg = 0xFF // Set Green
SET setb = 0x00 // Set Blue
SET location = wteal
LAUNCH_PATCH_MACRO ~glow~
END
END


BEGIN ~One Pixel Productions: v3 Colourable Quarterstaves mod patches (13)~

PRINT ~Patching...~

LAUNCH_ACTION_MACRO ~Locations~

PRINT ~Patching...~

ACTION_IF (FILE_EXISTS_IN_GAME ~bw02st1.itm~) THEN BEGIN
COPY_EXISTING ~bw02st1.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 81		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 15		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 25		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 27		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~bw02st2.itm~) THEN BEGIN
COPY_EXISTING ~bw02st2.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 26		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 19		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 19		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 24		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~bw02st3.itm~) THEN BEGIN
COPY_EXISTING ~bw02st3.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 81		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 15		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 25		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 27		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~bw02st4.itm~) THEN BEGIN
COPY_EXISTING ~bw02st4.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 26		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 19		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 19		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 24		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~bw02st5.itm~) THEN BEGIN
COPY_EXISTING ~bw02st5.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 81		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 15		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 25		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 27		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END

ACTION_IF (FILE_EXISTS_IN_GAME ~bw02st6.itm~) THEN BEGIN
COPY_EXISTING ~bw02st6.itm~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN 
LAUNCH_PATCH_MACRO ~clear~
SET gradient = 26		// colour index
SET location = wgrey		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 19		// colour index
SET location = wteal		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 19		// colour index
SET location = wpink		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 24		// colour index
SET location = wblue		// location
LAUNCH_PATCH_MACRO ~colour~
SET gradient = 22		// colour index
SET location = wred		// location * compatibility 
LAUNCH_PATCH_MACRO ~colour~
END
END