// 1ppv3 Thieves Galore!
// NOTE: IWD HoW .exe patching is only required if you'd like to have armour and chain mail on thieves.
// (leather and unarmoured work fine) | IWD II should not need it at all.
// +Unique animations for different thief armour levels
// +Smarter avatar changing on equipping/unequipping items
//

BACKUP ~1pp_thieves_galore/backup~
AUTHOR ~dotdot~
ASK_EVERY_COMPONENT

BEGIN ~IWD HoW/TotL - Unique Thief Avatars (patch)~ 
SUBCOMPONENT ~1ppv3: Unique Thief Avatars (patch)~ (GAME_IS ~totlm how~)

// exe patch IWD 

OUTER_SET fail = 0
OUTER_SET found = 0

ACTION_IF (~%WEIDU_OS%~ STRING_EQUAL_CASE ~win32~ || ~%WEIDU_OS%~ STRING_EQUAL_CASE ~unix~) BEGIN

COPY ~IDMain.exe~ ~IDMain.exe~
PATCH_IF (SOURCE_SIZE == 6873088) BEGIN // is IDMain 142
PATCH_PRINT ~Icewind Dale 1.4.2 found (TotL)~
SET found = 1
READ_BYTE "0x3D65DE" "check_r"
PATCH_IF ("%check_r%" = 0x32) BEGIN
WRITE_BYTE 0x3D65DE 0x34
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x3D65DE (%check_r%) does not match what was expected (32).  Stopping installation.~
SET fail = 1
END
END
ELSE BEGIN
PATCH_PRINT ~Warning: Icewind Dale is not patched to 1.4.2; trying 1.4.1~
END

COPY ~IDMain.exe~ ~IDMain.exe~
PATCH_IF (SOURCE_SIZE == 6840320) BEGIN // is IDMain 141
PATCH_PRINT ~Icewind Dale 1.4.1 found (HoW only)~
SET found = 1
READ_BYTE "0x3CF7D0" "check_r"
PATCH_IF ("%check_r%" = 0x32) BEGIN
WRITE_BYTE 0x3CF7D0 0x34
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x3CF7D0 (%check_r%) does not match what was expected (32).  Stopping installation.~
SET fail = 1
END
END
ELSE BEGIN
PATCH_PRINT ~Game is not 1.4.1~
END

ACTION_IF (fail = 1) BEGIN
FAIL ~Could not patch successfully.~
END

ACTION_IF (found != 1) BEGIN
FAIL ~Type of executable is unknown. Make sure your game is patched to 1.4.1 (HoW) or 1.4.2 (TotL).~
END

END // from Act If

BEGIN ~BGII - Unique Thief Avatars (patch)~ 
SUBCOMPONENT ~1ppv3: Unique Thief Avatars (patch)~ (GAME_IS ~bg2 tob tutu tutu_totsc ca~)


OUTER_SET fail = 0
OUTER_SET found = 0

ACTION_IF (~%WEIDU_OS%~ STRING_EQUAL_CASE ~win32~ || ~%WEIDU_OS%~ STRING_EQUAL_CASE ~unix~) BEGIN
COPY ~BGMain.exe~ ~BGMain.exe~
PATCH_IF (SOURCE_SIZE == 7417902) BEGIN // is BGMain SoA
PATCH_PRINT ~BG II SoA found (v23037)~
SET found = 1
READ_BYTE "0x40136D" "check_r"
PATCH_IF ("%check_r%" = 0xC2) BEGIN
WRITE_BYTE 0x40136D 0xED
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x40136D (%check_r%) does not match what was expected (C2).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x40136e" "check_r"
PATCH_IF ("%check_r%" = 0x16) BEGIN
WRITE_BYTE 0x40136e 0x06
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x40136e (%check_r%) does not match what was expected (16).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401371" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x401371 0x34
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401371 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x40137D" "check_r"
PATCH_IF ("%check_r%" = 0xED) BEGIN
WRITE_BYTE 0x40137D 0xD3
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x40137D (%check_r%) does not match what was expected (ED).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x40137e" "check_r"
PATCH_IF ("%check_r%" = 0x06) BEGIN
WRITE_BYTE 0x40137e 0x16
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x40137e (%check_r%) does not match what was expected (06).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401381" "check_r"
PATCH_IF ("%check_r%" = 0x32) BEGIN
WRITE_BYTE 0x401381 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401381 (%check_r%) does not match what was expected (32).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4013DE" "check_r"
PATCH_IF ("%check_r%" = 0xE0) BEGIN
WRITE_BYTE 0x4013DE 0xC8
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4013DE (%check_r%) does not match what was expected (E0).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4013df" "check_r"
PATCH_IF ("%check_r%" = 0xCD) BEGIN
WRITE_BYTE 0x4013df 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4013df (%check_r%) does not match what was expected (CD).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401430" "check_r"
PATCH_IF ("%check_r%" = 0xEC) BEGIN
WRITE_BYTE 0x401430 0xD1
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401430 (%check_r%) does not match what was expected (EC).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401431" "check_r"
PATCH_IF ("%check_r%" = 0xCD) BEGIN
WRITE_BYTE 0x401431 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401431 (%check_r%) does not match what was expected (CD).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401496" "check_r"
PATCH_IF ("%check_r%" = 0xF8) BEGIN
WRITE_BYTE 0x401496 0xDA
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401496 (%check_r%) does not match what was expected (F8).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401497" "check_r"
PATCH_IF ("%check_r%" = 0xCD) BEGIN
WRITE_BYTE 0x401497 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401497 (%check_r%) does not match what was expected (CD).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4014C0" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x4014C0 0xDF
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4014C0 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4014c1" "check_r"
PATCH_IF ("%check_r%" = 0xCE) BEGIN
WRITE_BYTE 0x4014c1 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4014c1 (%check_r%) does not match what was expected (CE).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401528" "check_r"
PATCH_IF ("%check_r%" = 0x0C) BEGIN
WRITE_BYTE 0x401528 0xE4
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401528 (%check_r%) does not match what was expected (0C).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401529" "check_r"
PATCH_IF ("%check_r%" = 0xCE) BEGIN
WRITE_BYTE 0x401529 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401529 (%check_r%) does not match what was expected (CE).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401552" "check_r"
PATCH_IF ("%check_r%" = 0x14) BEGIN
WRITE_BYTE 0x401552 0xE9
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401552 (%check_r%) does not match what was expected (14).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401553" "check_r"
PATCH_IF ("%check_r%" = 0xCE) BEGIN
WRITE_BYTE 0x401553 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401553 (%check_r%) does not match what was expected (CE).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401568" "check_r"
PATCH_IF ("%check_r%" = 0x1C) BEGIN
WRITE_BYTE 0x401568 0xE9
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401568 (%check_r%) does not match what was expected (1C).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401569" "check_r"
PATCH_IF ("%check_r%" = 0xCE) BEGIN
WRITE_BYTE 0x401569 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401569 (%check_r%) does not match what was expected (CE).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4015BE" "check_r"
PATCH_IF ("%check_r%" = 0x28) BEGIN
WRITE_BYTE 0x4015BE 0xF2
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4015BE (%check_r%) does not match what was expected (28).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4015bf" "check_r"
PATCH_IF ("%check_r%" = 0xCE) BEGIN
WRITE_BYTE 0x4015bf 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4015bf (%check_r%) does not match what was expected (CE).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4015FE" "check_r"
PATCH_IF ("%check_r%" = 0x34) BEGIN
WRITE_BYTE 0x4015FE 0xF7
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4015FE (%check_r%) does not match what was expected (34).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4015ff" "check_r"
PATCH_IF ("%check_r%" = 0xCE) BEGIN
WRITE_BYTE 0x4015ff 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4015ff (%check_r%) does not match what was expected (CE).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401664" "check_r"
PATCH_IF ("%check_r%" = 0x40) BEGIN
WRITE_BYTE 0x401664 0xE4
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401664 (%check_r%) does not match what was expected (40).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401665" "check_r"
PATCH_IF ("%check_r%" = 0xCE) BEGIN
WRITE_BYTE 0x401665 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401665 (%check_r%) does not match what was expected (CE).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x40167A" "check_r"
PATCH_IF ("%check_r%" = 0x48) BEGIN
WRITE_BYTE 0x40167A 0x05
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x40167A (%check_r%) does not match what was expected (48).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x40167b" "check_r"
PATCH_IF ("%check_r%" = 0xCE) BEGIN
WRITE_BYTE 0x40167b 0xDF
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x40167b (%check_r%) does not match what was expected (CE).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401692" "check_r"
PATCH_IF ("%check_r%" = 0x50) BEGIN
WRITE_BYTE 0x401692 0xF7
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401692 (%check_r%) does not match what was expected (50).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401693" "check_r"
PATCH_IF ("%check_r%" = 0xCE) BEGIN
WRITE_BYTE 0x401693 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401693 (%check_r%) does not match what was expected (CE).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4016A8" "check_r"
PATCH_IF ("%check_r%" = 0x58) BEGIN
WRITE_BYTE 0x4016A8 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4016A8 (%check_r%) does not match what was expected (58).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4016a9" "check_r"
PATCH_IF ("%check_r%" = 0xCE) BEGIN
WRITE_BYTE 0x4016a9 0xDF
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4016a9 (%check_r%) does not match what was expected (CE).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401714" "check_r"
PATCH_IF ("%check_r%" = 0x68) BEGIN
WRITE_BYTE 0x401714 0xC8
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401714 (%check_r%) does not match what was expected (68).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401715" "check_r"
PATCH_IF ("%check_r%" = 0xCE) BEGIN
WRITE_BYTE 0x401715 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401715 (%check_r%) does not match what was expected (CE).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x40172A" "check_r"
PATCH_IF ("%check_r%" = 0x70) BEGIN
WRITE_BYTE 0x40172A 0x0F
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x40172A (%check_r%) does not match what was expected (70).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x40172b" "check_r"
PATCH_IF ("%check_r%" = 0xCE) BEGIN
WRITE_BYTE 0x40172b 0xDF
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x40172b (%check_r%) does not match what was expected (CE).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x40176A" "check_r"
PATCH_IF ("%check_r%" = 0x7C) BEGIN
WRITE_BYTE 0x40176A 0xD1
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x40176A (%check_r%) does not match what was expected (7C).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x40176b" "check_r"
PATCH_IF ("%check_r%" = 0xCE) BEGIN
WRITE_BYTE 0x40176b 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x40176b (%check_r%) does not match what was expected (CE).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401780" "check_r"
PATCH_IF ("%check_r%" = 0x84) BEGIN
WRITE_BYTE 0x401780 0x0A
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401780 (%check_r%) does not match what was expected (84).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x401781" "check_r"
PATCH_IF ("%check_r%" = 0xCE) BEGIN
WRITE_BYTE 0x401781 0xDF
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x401781 (%check_r%) does not match what was expected (CE).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4160EE" "check_r"
PATCH_IF ("%check_r%" = 0xD0) BEGIN
WRITE_BYTE 0x4160EE 0xCD
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4160EE (%check_r%) does not match what was expected (D0).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x416118" "check_r"
PATCH_IF ("%check_r%" = 0xD4) BEGIN
WRITE_BYTE 0x416118 0xD1
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x416118 (%check_r%) does not match what was expected (D4).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x41612E" "check_r"
PATCH_IF ("%check_r%" = 0xDC) BEGIN
WRITE_BYTE 0x41612E 0xD6
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x41612E (%check_r%) does not match what was expected (DC).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x41616C" "check_r"
PATCH_IF ("%check_r%" = 0xE0) BEGIN
WRITE_BYTE 0x41616C 0xDA
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x41616C (%check_r%) does not match what was expected (E0).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x416184" "check_r"
PATCH_IF ("%check_r%" = 0xE8) BEGIN
WRITE_BYTE 0x416184 0xDF
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x416184 (%check_r%) does not match what was expected (E8).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x41619A" "check_r"
PATCH_IF ("%check_r%" = 0xF0) BEGIN
WRITE_BYTE 0x41619A 0xD6
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x41619A (%check_r%) does not match what was expected (F0).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4161DA" "check_r"
PATCH_IF ("%check_r%" = 0xF4) BEGIN
WRITE_BYTE 0x4161DA 0xE4
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4161DA (%check_r%) does not match what was expected (F4).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4161F2" "check_r"
PATCH_IF ("%check_r%" = 0xFC) BEGIN
WRITE_BYTE 0x4161F2 0xE9
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4161F2 (%check_r%) does not match what was expected (FC).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x416208" "check_r"
PATCH_IF ("%check_r%" = 0x04) BEGIN
WRITE_BYTE 0x416208 0xEE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x416208 (%check_r%) does not match what was expected (04).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x416209" "check_r"
PATCH_IF ("%check_r%" = 0xDF) BEGIN
WRITE_BYTE 0x416209 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x416209 (%check_r%) does not match what was expected (DF).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x416248" "check_r"
PATCH_IF ("%check_r%" = 0x08) BEGIN
WRITE_BYTE 0x416248 0xF2
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x416248 (%check_r%) does not match what was expected (08).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x416249" "check_r"
PATCH_IF ("%check_r%" = 0xDF) BEGIN
WRITE_BYTE 0x416249 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x416249 (%check_r%) does not match what was expected (DF).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x416260" "check_r"
PATCH_IF ("%check_r%" = 0x10) BEGIN
WRITE_BYTE 0x416260 0xF7
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x416260 (%check_r%) does not match what was expected (10).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x416261" "check_r"
PATCH_IF ("%check_r%" = 0xDF) BEGIN
WRITE_BYTE 0x416261 0xDE
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x416261 (%check_r%) does not match what was expected (DF).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6EDECD" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6EDECD 0x57
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6EDECD (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edece" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edece 0x50
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edece (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edecf" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edecf 0x4C
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edecf (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6eded0" "check_r"
PATCH_IF ("%check_r%" = 0x57) BEGIN
WRITE_BYTE 0x6eded0 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6eded0 (%check_r%) does not match what was expected (57).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6eded1" "check_r"
PATCH_IF ("%check_r%" = 0x50) BEGIN
WRITE_BYTE 0x6eded1 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6eded1 (%check_r%) does not match what was expected (50).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6eded2" "check_r"
PATCH_IF ("%check_r%" = 0x4C) BEGIN
WRITE_BYTE 0x6eded2 0x48
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6eded2 (%check_r%) does not match what was expected (4C).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6eded3" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6eded3 0x46
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6eded3 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6eded4" "check_r"
PATCH_IF ("%check_r%" = 0x43) BEGIN
WRITE_BYTE 0x6eded4 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6eded4 (%check_r%) does not match what was expected (43).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6eded5" "check_r"
PATCH_IF ("%check_r%" = 0x48) BEGIN
WRITE_BYTE 0x6eded5 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6eded5 (%check_r%) does not match what was expected (48).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6eded6" "check_r"
PATCH_IF ("%check_r%" = 0x46) BEGIN
WRITE_BYTE 0x6eded6 0x57
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6eded6 (%check_r%) does not match what was expected (46).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6eded7" "check_r"
PATCH_IF ("%check_r%" = 0x54) BEGIN
WRITE_BYTE 0x6eded7 0x50
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6eded7 (%check_r%) does not match what was expected (54).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6eded8" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6eded8 0x4D
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6eded8 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6EDEDA" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6EDEDA 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6EDEDA (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6ededb" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6ededb 0x45
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6ededb (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6ededc" "check_r"
PATCH_IF ("%check_r%" = 0x57) BEGIN
WRITE_BYTE 0x6ededc 0x4D
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6ededc (%check_r%) does not match what was expected (57).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6ededd" "check_r"
PATCH_IF ("%check_r%" = 0x50) BEGIN
WRITE_BYTE 0x6ededd 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6ededd (%check_r%) does not match what was expected (50).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edede" "check_r"
PATCH_IF ("%check_r%" = 0x4D) BEGIN
WRITE_BYTE 0x6edede 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edede (%check_r%) does not match what was expected (4D).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6ededf" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6ededf 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6ededf (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edee0" "check_r"
PATCH_IF ("%check_r%" = 0x43) BEGIN
WRITE_BYTE 0x6edee0 0x45
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edee0 (%check_r%) does not match what was expected (43).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edee1" "check_r"
PATCH_IF ("%check_r%" = 0x45) BEGIN
WRITE_BYTE 0x6edee1 0x46
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edee1 (%check_r%) does not match what was expected (45).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edee2" "check_r"
PATCH_IF ("%check_r%" = 0x4D) BEGIN
WRITE_BYTE 0x6edee2 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edee2 (%check_r%) does not match what was expected (4D).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edee3" "check_r"
PATCH_IF ("%check_r%" = 0x54) BEGIN
WRITE_BYTE 0x6edee3 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edee3 (%check_r%) does not match what was expected (54).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edee4" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edee4 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edee4 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edee5" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edee5 0x44
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edee5 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edee6" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edee6 0x4D
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edee6 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edee7" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edee7 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edee7 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edee8" "check_r"
PATCH_IF ("%check_r%" = 0x43) BEGIN
WRITE_BYTE 0x6edee8 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edee8 (%check_r%) does not match what was expected (43).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edee9" "check_r"
PATCH_IF ("%check_r%" = 0x45) BEGIN
WRITE_BYTE 0x6edee9 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edee9 (%check_r%) does not match what was expected (45).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edeea" "check_r"
PATCH_IF ("%check_r%" = 0x46) BEGIN
WRITE_BYTE 0x6edeea 0x44
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edeea (%check_r%) does not match what was expected (46).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edeeb" "check_r"
PATCH_IF ("%check_r%" = 0x54) BEGIN
WRITE_BYTE 0x6edeeb 0x46
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edeeb (%check_r%) does not match what was expected (54).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edeec" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edeec 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edeec (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6EDEEE" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6EDEEE 0x57
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6EDEEE (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edeef" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edeef 0x50
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edeef (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edef0" "check_r"
PATCH_IF ("%check_r%" = 0x57) BEGIN
WRITE_BYTE 0x6edef0 0x53
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edef0 (%check_r%) does not match what was expected (57).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edef1" "check_r"
PATCH_IF ("%check_r%" = 0x50) BEGIN
WRITE_BYTE 0x6edef1 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edef1 (%check_r%) does not match what was expected (50).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edef2" "check_r"
PATCH_IF ("%check_r%" = 0x4D) BEGIN
WRITE_BYTE 0x6edef2 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edef2 (%check_r%) does not match what was expected (4D).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edef3" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edef3 0x49
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edef3 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edef4" "check_r"
PATCH_IF ("%check_r%" = 0x43) BEGIN
WRITE_BYTE 0x6edef4 0x4D
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edef4 (%check_r%) does not match what was expected (43).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edef5" "check_r"
PATCH_IF ("%check_r%" = 0x44) BEGIN
WRITE_BYTE 0x6edef5 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edef5 (%check_r%) does not match what was expected (44).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edef6" "check_r"
PATCH_IF ("%check_r%" = 0x4D) BEGIN
WRITE_BYTE 0x6edef6 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edef6 (%check_r%) does not match what was expected (4D).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edef7" "check_r"
PATCH_IF ("%check_r%" = 0x54) BEGIN
WRITE_BYTE 0x6edef7 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edef7 (%check_r%) does not match what was expected (54).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edef8" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edef8 0x49
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edef8 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edef9" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edef9 0x46
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edef9 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edefa" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edefa 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edefa (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6EDEFC" "check_r"
PATCH_IF ("%check_r%" = 0x43) BEGIN
WRITE_BYTE 0x6EDEFC 0x57
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6EDEFC (%check_r%) does not match what was expected (43).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edefd" "check_r"
PATCH_IF ("%check_r%" = 0x44) BEGIN
WRITE_BYTE 0x6edefd 0x50
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edefd (%check_r%) does not match what was expected (44).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edefe" "check_r"
PATCH_IF ("%check_r%" = 0x4D) BEGIN
WRITE_BYTE 0x6edefe 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edefe (%check_r%) does not match what was expected (4D).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edeff" "check_r"
PATCH_IF ("%check_r%" = 0x54) BEGIN
WRITE_BYTE 0x6edeff 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edeff (%check_r%) does not match what was expected (54).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf00" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edf00 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf00 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf01" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edf01 0x47
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf01 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf02" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edf02 0x46
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf02 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf03" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edf03 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf03 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf04" "check_r"
PATCH_IF ("%check_r%" = 0x57) BEGIN
WRITE_BYTE 0x6edf04 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf04 (%check_r%) does not match what was expected (57).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf05" "check_r"
PATCH_IF ("%check_r%" = 0x50) BEGIN
WRITE_BYTE 0x6edf05 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf05 (%check_r%) does not match what was expected (50).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf06" "check_r"
PATCH_IF ("%check_r%" = 0x53) BEGIN
WRITE_BYTE 0x6edf06 0x47
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf06 (%check_r%) does not match what was expected (53).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf07" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edf07 0x4D
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf07 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf08" "check_r"
PATCH_IF ("%check_r%" = 0x43) BEGIN
WRITE_BYTE 0x6edf08 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf08 (%check_r%) does not match what was expected (43).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf09" "check_r"
PATCH_IF ("%check_r%" = 0x49) BEGIN
WRITE_BYTE 0x6edf09 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf09 (%check_r%) does not match what was expected (49).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf0a" "check_r"
PATCH_IF ("%check_r%" = 0x4D) BEGIN
WRITE_BYTE 0x6edf0a 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf0a (%check_r%) does not match what was expected (4D).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf0b" "check_r"
PATCH_IF ("%check_r%" = 0x54) BEGIN
WRITE_BYTE 0x6edf0b 0x4F
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf0b (%check_r%) does not match what was expected (54).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf0c" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edf0c 0x46
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf0c (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf0d" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x6edf0d 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf0d (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6EDF0F" "check_r"
PATCH_IF ("%check_r%" = 0x43) BEGIN
WRITE_BYTE 0x6EDF0F 0x4F
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6EDF0F (%check_r%) does not match what was expected (43).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf10" "check_r"
PATCH_IF ("%check_r%" = 0x49) BEGIN
WRITE_BYTE 0x6edf10 0x4D
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf10 (%check_r%) does not match what was expected (49).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf11" "check_r"
PATCH_IF ("%check_r%" = 0x46) BEGIN
WRITE_BYTE 0x6edf11 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf11 (%check_r%) does not match what was expected (46).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x6edf12" "check_r"
PATCH_IF ("%check_r%" = 0x54) BEGIN
WRITE_BYTE 0x6edf12 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x6edf12 (%check_r%) does not match what was expected (54).  Stopping installation.~
SET fail = 1
END
END

COPY ~BGMain.exe~ ~BGMain.exe~
PATCH_IF (SOURCE_SIZE == 7839790) BEGIN // is BGMain ToB
PATCH_PRINT ~BG II ToB found (v26498)~
SET found = 1
READ_BYTE "0x444848" "check_r"
PATCH_IF ("%check_r%" = 0xC2) BEGIN
WRITE_BYTE 0x444848 0xED
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444848 (%check_r%) does not match what was expected (C2).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444849" "check_r"
PATCH_IF ("%check_r%" = 0x16) BEGIN
WRITE_BYTE 0x444849 0x06
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444849 (%check_r%) does not match what was expected (16).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x44484C" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x44484C 0x34
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x44484C (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444858" "check_r"
PATCH_IF ("%check_r%" = 0xED) BEGIN
WRITE_BYTE 0x444858 0xD3
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444858 (%check_r%) does not match what was expected (ED).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444859" "check_r"
PATCH_IF ("%check_r%" = 0x06) BEGIN
WRITE_BYTE 0x444859 0x16
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444859 (%check_r%) does not match what was expected (06).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x44485C" "check_r"
PATCH_IF ("%check_r%" = 0x32) BEGIN
WRITE_BYTE 0x44485C 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x44485C (%check_r%) does not match what was expected (32).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4448B9" "check_r"
PATCH_IF ("%check_r%" = 0x24) BEGIN
WRITE_BYTE 0x4448B9 0x0C
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4448B9 (%check_r%) does not match what was expected (24).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4448ba" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x4448ba 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4448ba (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x44490B" "check_r"
PATCH_IF ("%check_r%" = 0x30) BEGIN
WRITE_BYTE 0x44490B 0x15
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x44490B (%check_r%) does not match what was expected (30).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x44490c" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x44490c 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x44490c (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444971" "check_r"
PATCH_IF ("%check_r%" = 0x3C) BEGIN
WRITE_BYTE 0x444971 0x1E
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444971 (%check_r%) does not match what was expected (3C).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444972" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x444972 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444972 (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x44499B" "check_r"
PATCH_IF ("%check_r%" = 0x44) BEGIN
WRITE_BYTE 0x44499B 0x23
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x44499B (%check_r%) does not match what was expected (44).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x44499c" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x44499c 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x44499c (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444A03" "check_r"
PATCH_IF ("%check_r%" = 0x50) BEGIN
WRITE_BYTE 0x444A03 0x28
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444A03 (%check_r%) does not match what was expected (50).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444a04" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x444a04 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444a04 (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444A2D" "check_r"
PATCH_IF ("%check_r%" = 0x58) BEGIN
WRITE_BYTE 0x444A2D 0x2D
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444A2D (%check_r%) does not match what was expected (58).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444a2e" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x444a2e 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444a2e (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444A43" "check_r"
PATCH_IF ("%check_r%" = 0x60) BEGIN
WRITE_BYTE 0x444A43 0x2D
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444A43 (%check_r%) does not match what was expected (60).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444a44" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x444a44 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444a44 (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444A99" "check_r"
PATCH_IF ("%check_r%" = 0x6C) BEGIN
WRITE_BYTE 0x444A99 0x36
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444A99 (%check_r%) does not match what was expected (6C).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444a9a" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x444a9a 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444a9a (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444AD9" "check_r"
PATCH_IF ("%check_r%" = 0x78) BEGIN
WRITE_BYTE 0x444AD9 0x3B
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444AD9 (%check_r%) does not match what was expected (78).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444ada" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x444ada 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444ada (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444B3F" "check_r"
PATCH_IF ("%check_r%" = 0x84) BEGIN
WRITE_BYTE 0x444B3F 0x28
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444B3F (%check_r%) does not match what was expected (84).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444b40" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x444b40 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444b40 (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444B55" "check_r"
PATCH_IF ("%check_r%" = 0x8C) BEGIN
WRITE_BYTE 0x444B55 0x49
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444B55 (%check_r%) does not match what was expected (8C).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444b56" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x444b56 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444b56 (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444B6D" "check_r"
PATCH_IF ("%check_r%" = 0x94) BEGIN
WRITE_BYTE 0x444B6D 0x3B
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444B6D (%check_r%) does not match what was expected (94).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444b6e" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x444b6e 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444b6e (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444B83" "check_r"
PATCH_IF ("%check_r%" = 0x9C) BEGIN
WRITE_BYTE 0x444B83 0x44
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444B83 (%check_r%) does not match what was expected (9C).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444b84" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x444b84 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444b84 (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444BEF" "check_r"
PATCH_IF ("%check_r%" = 0xAC) BEGIN
WRITE_BYTE 0x444BEF 0x0C
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444BEF (%check_r%) does not match what was expected (AC).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444bf0" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x444bf0 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444bf0 (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444C05" "check_r"
PATCH_IF ("%check_r%" = 0xB4) BEGIN
WRITE_BYTE 0x444C05 0x53
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444C05 (%check_r%) does not match what was expected (B4).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444c06" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x444c06 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444c06 (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444C45" "check_r"
PATCH_IF ("%check_r%" = 0xC0) BEGIN
WRITE_BYTE 0x444C45 0x15
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444C45 (%check_r%) does not match what was expected (C0).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444c46" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x444c46 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444c46 (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444C5B" "check_r"
PATCH_IF ("%check_r%" = 0xC8) BEGIN
WRITE_BYTE 0x444C5B 0x4E
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444C5B (%check_r%) does not match what was expected (C8).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x444c5c" "check_r"
PATCH_IF ("%check_r%" = 0x27) BEGIN
WRITE_BYTE 0x444c5c 0x38
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x444c5c (%check_r%) does not match what was expected (27).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4595C9" "check_r"
PATCH_IF ("%check_r%" = 0x14) BEGIN
WRITE_BYTE 0x4595C9 0x11
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4595C9 (%check_r%) does not match what was expected (14).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4595F3" "check_r"
PATCH_IF ("%check_r%" = 0x18) BEGIN
WRITE_BYTE 0x4595F3 0x15
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4595F3 (%check_r%) does not match what was expected (18).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x459609" "check_r"
PATCH_IF ("%check_r%" = 0x20) BEGIN
WRITE_BYTE 0x459609 0x1A
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x459609 (%check_r%) does not match what was expected (20).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x459647" "check_r"
PATCH_IF ("%check_r%" = 0x24) BEGIN
WRITE_BYTE 0x459647 0x1E
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x459647 (%check_r%) does not match what was expected (24).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x45965F" "check_r"
PATCH_IF ("%check_r%" = 0x2C) BEGIN
WRITE_BYTE 0x45965F 0x23
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x45965F (%check_r%) does not match what was expected (2C).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x459675" "check_r"
PATCH_IF ("%check_r%" = 0x34) BEGIN
WRITE_BYTE 0x459675 0x1A
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x459675 (%check_r%) does not match what was expected (34).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4596B5" "check_r"
PATCH_IF ("%check_r%" = 0x38) BEGIN
WRITE_BYTE 0x4596B5 0x28
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4596B5 (%check_r%) does not match what was expected (38).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4596CD" "check_r"
PATCH_IF ("%check_r%" = 0x40) BEGIN
WRITE_BYTE 0x4596CD 0x2D
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4596CD (%check_r%) does not match what was expected (40).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x4596E3" "check_r"
PATCH_IF ("%check_r%" = 0x48) BEGIN
WRITE_BYTE 0x4596E3 0x32
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x4596E3 (%check_r%) does not match what was expected (48).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x459723" "check_r"
PATCH_IF ("%check_r%" = 0x4C) BEGIN
WRITE_BYTE 0x459723 0x36
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x459723 (%check_r%) does not match what was expected (4C).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x45973B" "check_r"
PATCH_IF ("%check_r%" = 0x54) BEGIN
WRITE_BYTE 0x45973B 0x3B
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x45973B (%check_r%) does not match what was expected (54).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753811" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753811 0x57
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753811 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753812" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753812 0x50
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753812 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753813" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753813 0x4C
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753813 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753814" "check_r"
PATCH_IF ("%check_r%" = 0x57) BEGIN
WRITE_BYTE 0x753814 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753814 (%check_r%) does not match what was expected (57).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753815" "check_r"
PATCH_IF ("%check_r%" = 0x50) BEGIN
WRITE_BYTE 0x753815 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753815 (%check_r%) does not match what was expected (50).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753816" "check_r"
PATCH_IF ("%check_r%" = 0x4C) BEGIN
WRITE_BYTE 0x753816 0x48
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753816 (%check_r%) does not match what was expected (4C).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753817" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753817 0x46
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753817 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753818" "check_r"
PATCH_IF ("%check_r%" = 0x43) BEGIN
WRITE_BYTE 0x753818 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753818 (%check_r%) does not match what was expected (43).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753819" "check_r"
PATCH_IF ("%check_r%" = 0x48) BEGIN
WRITE_BYTE 0x753819 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753819 (%check_r%) does not match what was expected (48).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75381a" "check_r"
PATCH_IF ("%check_r%" = 0x46) BEGIN
WRITE_BYTE 0x75381a 0x57
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75381a (%check_r%) does not match what was expected (46).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75381b" "check_r"
PATCH_IF ("%check_r%" = 0x54) BEGIN
WRITE_BYTE 0x75381b 0x50
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75381b (%check_r%) does not match what was expected (54).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75381c" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x75381c 0x4D
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75381c (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75381E" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x75381E 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75381E (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75381f" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x75381f 0x45
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75381f (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753820" "check_r"
PATCH_IF ("%check_r%" = 0x57) BEGIN
WRITE_BYTE 0x753820 0x4D
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753820 (%check_r%) does not match what was expected (57).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753821" "check_r"
PATCH_IF ("%check_r%" = 0x50) BEGIN
WRITE_BYTE 0x753821 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753821 (%check_r%) does not match what was expected (50).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753822" "check_r"
PATCH_IF ("%check_r%" = 0x4D) BEGIN
WRITE_BYTE 0x753822 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753822 (%check_r%) does not match what was expected (4D).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753823" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753823 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753823 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753824" "check_r"
PATCH_IF ("%check_r%" = 0x43) BEGIN
WRITE_BYTE 0x753824 0x45
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753824 (%check_r%) does not match what was expected (43).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753825" "check_r"
PATCH_IF ("%check_r%" = 0x45) BEGIN
WRITE_BYTE 0x753825 0x46
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753825 (%check_r%) does not match what was expected (45).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753826" "check_r"
PATCH_IF ("%check_r%" = 0x4D) BEGIN
WRITE_BYTE 0x753826 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753826 (%check_r%) does not match what was expected (4D).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753827" "check_r"
PATCH_IF ("%check_r%" = 0x54) BEGIN
WRITE_BYTE 0x753827 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753827 (%check_r%) does not match what was expected (54).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753828" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753828 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753828 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753829" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753829 0x44
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753829 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75382a" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x75382a 0x4D
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75382a (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75382b" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x75382b 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75382b (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75382c" "check_r"
PATCH_IF ("%check_r%" = 0x43) BEGIN
WRITE_BYTE 0x75382c 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75382c (%check_r%) does not match what was expected (43).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75382d" "check_r"
PATCH_IF ("%check_r%" = 0x45) BEGIN
WRITE_BYTE 0x75382d 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75382d (%check_r%) does not match what was expected (45).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75382e" "check_r"
PATCH_IF ("%check_r%" = 0x46) BEGIN
WRITE_BYTE 0x75382e 0x44
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75382e (%check_r%) does not match what was expected (46).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75382f" "check_r"
PATCH_IF ("%check_r%" = 0x54) BEGIN
WRITE_BYTE 0x75382f 0x46
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75382f (%check_r%) does not match what was expected (54).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753830" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753830 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753830 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753832" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753832 0x57
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753832 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753833" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753833 0x50
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753833 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753834" "check_r"
PATCH_IF ("%check_r%" = 0x57) BEGIN
WRITE_BYTE 0x753834 0x53
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753834 (%check_r%) does not match what was expected (57).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753835" "check_r"
PATCH_IF ("%check_r%" = 0x50) BEGIN
WRITE_BYTE 0x753835 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753835 (%check_r%) does not match what was expected (50).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753836" "check_r"
PATCH_IF ("%check_r%" = 0x4D) BEGIN
WRITE_BYTE 0x753836 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753836 (%check_r%) does not match what was expected (4D).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753837" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753837 0x49
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753837 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753838" "check_r"
PATCH_IF ("%check_r%" = 0x43) BEGIN
WRITE_BYTE 0x753838 0x4D
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753838 (%check_r%) does not match what was expected (43).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753839" "check_r"
PATCH_IF ("%check_r%" = 0x44) BEGIN
WRITE_BYTE 0x753839 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753839 (%check_r%) does not match what was expected (44).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75383a" "check_r"
PATCH_IF ("%check_r%" = 0x4D) BEGIN
WRITE_BYTE 0x75383a 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75383a (%check_r%) does not match what was expected (4D).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75383b" "check_r"
PATCH_IF ("%check_r%" = 0x54) BEGIN
WRITE_BYTE 0x75383b 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75383b (%check_r%) does not match what was expected (54).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75383c" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x75383c 0x49
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75383c (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75383d" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x75383d 0x46
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75383d (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75383e" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x75383e 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75383e (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753840" "check_r"
PATCH_IF ("%check_r%" = 0x43) BEGIN
WRITE_BYTE 0x753840 0x57
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753840 (%check_r%) does not match what was expected (43).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753841" "check_r"
PATCH_IF ("%check_r%" = 0x44) BEGIN
WRITE_BYTE 0x753841 0x50
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753841 (%check_r%) does not match what was expected (44).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753842" "check_r"
PATCH_IF ("%check_r%" = 0x4D) BEGIN
WRITE_BYTE 0x753842 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753842 (%check_r%) does not match what was expected (4D).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753843" "check_r"
PATCH_IF ("%check_r%" = 0x54) BEGIN
WRITE_BYTE 0x753843 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753843 (%check_r%) does not match what was expected (54).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753844" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753844 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753844 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753845" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753845 0x47
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753845 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753846" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753846 0x46
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753846 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753847" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753847 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753847 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753848" "check_r"
PATCH_IF ("%check_r%" = 0x57) BEGIN
WRITE_BYTE 0x753848 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753848 (%check_r%) does not match what was expected (57).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753849" "check_r"
PATCH_IF ("%check_r%" = 0x50) BEGIN
WRITE_BYTE 0x753849 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753849 (%check_r%) does not match what was expected (50).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75384a" "check_r"
PATCH_IF ("%check_r%" = 0x53) BEGIN
WRITE_BYTE 0x75384a 0x47
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75384a (%check_r%) does not match what was expected (53).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75384b" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x75384b 0x4D
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75384b (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75384c" "check_r"
PATCH_IF ("%check_r%" = 0x43) BEGIN
WRITE_BYTE 0x75384c 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75384c (%check_r%) does not match what was expected (43).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75384d" "check_r"
PATCH_IF ("%check_r%" = 0x49) BEGIN
WRITE_BYTE 0x75384d 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75384d (%check_r%) does not match what was expected (49).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75384e" "check_r"
PATCH_IF ("%check_r%" = 0x4D) BEGIN
WRITE_BYTE 0x75384e 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75384e (%check_r%) does not match what was expected (4D).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x75384f" "check_r"
PATCH_IF ("%check_r%" = 0x54) BEGIN
WRITE_BYTE 0x75384f 0x4F
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x75384f (%check_r%) does not match what was expected (54).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753850" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753850 0x46
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753850 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753851" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753851 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753851 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753853" "check_r"
PATCH_IF ("%check_r%" = 0x00) BEGIN
WRITE_BYTE 0x753853 0x43
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753853 (%check_r%) does not match what was expected (00).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753854" "check_r"
PATCH_IF ("%check_r%" = 0x43) BEGIN
WRITE_BYTE 0x753854 0x4F
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753854 (%check_r%) does not match what was expected (43).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753855" "check_r"
PATCH_IF ("%check_r%" = 0x49) BEGIN
WRITE_BYTE 0x753855 0x4D
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753855 (%check_r%) does not match what was expected (49).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753856" "check_r"
PATCH_IF ("%check_r%" = 0x46) BEGIN
WRITE_BYTE 0x753856 0x54
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753856 (%check_r%) does not match what was expected (46).  Stopping installation.~
SET fail = 1
END
READ_BYTE "0x753857" "check_r"
PATCH_IF ("%check_r%" = 0x54) BEGIN
WRITE_BYTE 0x753857 0x00
END
ELSE BEGIN
PATCH_PRINT ~Error: the value we are trying to replace at offset 0x753857 (%check_r%) does not match what was expected (54).  Stopping installation.~
SET fail = 1
END
END

ACTION_IF (fail = 1) BEGIN
FAIL ~Could not patch successfully.~
END

ACTION_IF (found != 1) BEGIN
FAIL ~Type of executable is unknown. Make sure your game is patched to v26498 (ToB) or v23037 (SoA).~
END

END // from Act If


BEGIN ~1ppv3: Unique Thief Avatars (content)~ 


// COPY NEW CONTENT

PRINT ~Copying new files for...~

PRINT ~CDFT1~
COPY 	~1pp_thieves_galore/files/CDFT1/CDFT1A1.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1A2.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1A3.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1A4.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1A5.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1A6.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1A7.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1A8.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1A9.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1CA.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1G1.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1G11.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1G12.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1G13.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1G14.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1G15.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1G16.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1G17.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1G18.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1G19.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1SA.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1SS.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT1/CDFT1SX.BAM~ ~override~

PRINT ~CDFT3~
COPY 	~1pp_thieves_galore/files/CDFT3/CDFT3A1.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3A2.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3A3.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3A4.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3A5.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3A6.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3A7.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3A8.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3A9.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3CA.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3G1.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3G11.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3G12.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3G13.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3G14.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3G15.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3G16.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3G17.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3G18.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3G19.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3SA.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3SS.BAM~ ~override~
	~1pp_thieves_galore/files/CDFT3/CDFT3SX.BAM~ ~override~

PRINT ~CDMT1~
COPY 	~1pp_thieves_galore/files/CDMT1/CDMT1A1.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1A2.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1A3.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1A4.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1A5.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1A6.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1A7.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1A8.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1A9.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1CA.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1G1.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1G11.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1G12.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1G13.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1G14.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1G15.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1G16.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1G17.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1G18.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1G19.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1SA.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1SS.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT1/CDMT1SX.BAM~ ~override~

PRINT ~CDMT3~
COPY 	~1pp_thieves_galore/files/CDMT3/CDMT3A1.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3A2.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3A3.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3A4.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3A5.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3A6.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3A7.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3A8.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3A9.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3CA.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3G1.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3G11.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3G12.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3G13.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3G14.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3G15.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3G16.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3G17.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3G18.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3G19.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3SA.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3SS.BAM~ ~override~
	~1pp_thieves_galore/files/CDMT3/CDMT3SX.BAM~ ~override~

PRINT ~CEFT1~
COPY 	~1pp_thieves_galore/files/CEFT1/CEFT1A1.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1A2.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1A3.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1A4.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1A5.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1A6.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1A7.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1A8.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1A9.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1CA.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1G1.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1G11.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1G12.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1G13.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1G14.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1G15.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1G16.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1G17.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1G18.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1G19.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1SA.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1SS.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT1/CEFT1SX.BAM~ ~override~

PRINT ~CEFT2~
COPY 	~1pp_thieves_galore/files/CEFT2/CEFT2A1.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2A2.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2A3.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2A4.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2A5.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2A6.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2A7.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2A8.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2A9.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2CA.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2G1.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2G11.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2G12.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2G13.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2G14.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2G15.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2G16.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2G17.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2G18.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2G19.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2SA.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2SS.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT2/CEFT2SX.BAM~ ~override~

PRINT ~CEFT3~
COPY 	~1pp_thieves_galore/files/CEFT3/CEFT3A1.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3A2.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3A3.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3A4.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3A5.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3A6.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3A7.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3A8.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3A9.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3CA.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3G1.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3G11.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3G12.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3G13.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3G14.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3G15.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3G16.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3G17.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3G18.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3G19.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3SA.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3SS.BAM~ ~override~
	~1pp_thieves_galore/files/CEFT3/CEFT3SX.BAM~ ~override~

PRINT ~CEMT1~
COPY 	~1pp_thieves_galore/files/CEMT1/CEMT1A1.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1A2.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1A3.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1A4.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1A5.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1A6.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1A7.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1A8.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1A9.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1CA.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1G1.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1G11.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1G12.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1G13.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1G14.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1G15.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1G16.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1G17.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1G18.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1G19.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1SA.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1SS.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT1/CEMT1SX.BAM~ ~override~

PRINT ~CEMT3~
COPY 	~1pp_thieves_galore/files/CEMT3/CEMT3A1.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3A2.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3A3.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3A4.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3A5.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3A6.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3A7.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3A8.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3A9.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3CA.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3G1.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3G11.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3G12.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3G13.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3G14.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3G15.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3G16.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3G17.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3G18.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3G19.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3SA.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3SS.BAM~ ~override~
	~1pp_thieves_galore/files/CEMT3/CEMT3SX.BAM~ ~override~

PRINT ~CHFT1~
COPY 	~1pp_thieves_galore/files/CHFT1/CHFT1A1.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1A2.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1A3.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1A4.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1A5.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1A6.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1A7.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1A8.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1A9.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1CA.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1G1.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1G11.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1G12.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1G13.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1G14.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1G15.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1G16.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1G17.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1G18.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1G19.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1SA.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1SS.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT1/CHFT1SX.BAM~ ~override~

PRINT ~CHFT2~
COPY 	~1pp_thieves_galore/files/CHFT2/CHFT2A1.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2A2.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2A3.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2A4.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2A5.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2A6.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2A7.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2A8.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2A9.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2CA.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2G1.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2G11.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2G12.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2G13.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2G14.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2G15.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2G16.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2G17.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2G18.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2G19.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2SA.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2SS.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT2/CHFT2SX.BAM~ ~override~

PRINT ~CHFT3~
COPY 	~1pp_thieves_galore/files/CHFT3/CHFT3A1.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3A2.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3A3.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3A4.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3A5.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3A6.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3A7.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3A8.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3A9.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3CA.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3G1.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3G11.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3G12.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3G13.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3G14.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3G15.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3G16.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3G17.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3G18.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3G19.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3SA.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3SS.BAM~ ~override~
	~1pp_thieves_galore/files/CHFT3/CHFT3SX.BAM~ ~override~

PRINT ~CHMT1~
COPY 	~1pp_thieves_galore/files/CHMT1/CHMT1A1.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1A2.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1A3.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1A4.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1A5.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1A6.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1A7.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1A8.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1A9.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1CA.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1G1.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1G11.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1G12.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1G13.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1G14.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1G15.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1G16.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1G17.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1G18.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1G19.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1SA.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1SS.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT1/CHMT1SX.BAM~ ~override~

PRINT ~CHMT3~
COPY 	~1pp_thieves_galore/files/CHMT3/CHMT3A1.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3A2.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3A3.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3A4.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3A5.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3A6.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3A7.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3A8.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3A9.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3CA.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3G1.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3G11.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3G12.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3G13.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3G14.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3G15.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3G16.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3G17.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3G18.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3G19.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3SA.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3SS.BAM~ ~override~
	~1pp_thieves_galore/files/CHMT3/CHMT3SX.BAM~ ~override~

PRINT ~CIFT1~
COPY 	~1pp_thieves_galore/files/CIFT1/CIFT1A1.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1A2.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1A3.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1A4.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1A5.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1A6.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1A7.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1A8.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1A9.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1CA.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1G1.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1G11.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1G12.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1G13.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1G14.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1G15.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1G16.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1G17.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1G18.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1G19.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1SA.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1SS.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT1/CIFT1SX.BAM~ ~override~

PRINT ~CIFT3~
COPY 	~1pp_thieves_galore/files/CIFT3/CIFT3A1.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3A2.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3A3.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3A4.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3A5.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3A6.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3A7.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3A8.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3A9.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3CA.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3G1.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3G11.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3G12.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3G13.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3G14.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3G15.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3G16.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3G17.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3G18.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3G19.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3SA.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3SS.BAM~ ~override~
	~1pp_thieves_galore/files/CIFT3/CIFT3SX.BAM~ ~override~

PRINT ~CIMT1~
COPY 	~1pp_thieves_galore/files/CIMT1/CIMT1A1.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1A2.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1A3.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1A4.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1A5.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1A6.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1A7.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1A8.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1A9.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1CA.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1G1.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1G11.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1G12.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1G13.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1G14.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1G15.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1G16.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1G17.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1G18.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1G19.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1SA.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1SS.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT1/CIMT1SX.BAM~ ~override~

PRINT ~CIMT2~
COPY 	~1pp_thieves_galore/files/CIMT2/CIMT2A1.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2A2.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2A3.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2A4.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2A5.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2A6.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2A7.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2A8.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2A9.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2CA.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2G1.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2G11.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2G12.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2G13.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2G14.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2G15.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2G16.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2G17.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2G18.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2G19.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2SA.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2SS.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT2/CIMT2SX.BAM~ ~override~

PRINT ~CIMT3~
COPY 	~1pp_thieves_galore/files/CIMT3/CIMT3A1.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3A2.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3A3.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3A4.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3A5.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3A6.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3A7.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3A8.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3A9.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3CA.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3G1.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3G11.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3G12.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3G13.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3G14.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3G15.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3G16.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3G17.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3G18.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3G19.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3SA.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3SS.BAM~ ~override~
	~1pp_thieves_galore/files/CIMT3/CIMT3SX.BAM~ ~override~

ACTION_IF (GAME_IS ~bg2 tob tutu tutu_totsc~) THEN BEGIN	

PRINT ~Paperdolls (BGII install)~
COPY		~1pp_thieves_galore/files/INV/CDFT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CDFT1INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CDFT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CDFT2INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CDFT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CDFT3INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CDMT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CDMT1INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CDMT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CDMT2INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CDMT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CDMT3INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CEFT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CEFT1INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CEFT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CEFT2INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CEFT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CEFT3INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CEMT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CEMT1INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CEMT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CEMT2INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CEMT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CEMT3INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CGFT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CGFT1INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CGFT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CGFT2INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CGFT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CGFT3INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CGMT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CGMT1INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CGMT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CGMT2INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CGMT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CGMT3INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CHFT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CHFT1INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CHFT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CHFT2INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CHFT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CHFT3INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CHMT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CHMT1INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CHMT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CHMT2INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CHMT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CHMT3INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CIFT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CIFT1INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CIFT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CIFT2INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CIFT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CIFT3INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CIMT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CIMT1INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CIMT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CIMT2INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/CIMT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CIMT3INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/COFT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/COFT1INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/COFT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/COFT2INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/COFT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/COFT3INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/COMT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/COMT1INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/COMT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/COMT2INV.PLT~ ~override~
	~1pp_thieves_galore/files/INV/COMT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/COMT3INV.PLT~ ~override~

END

ACTION_IF (GAME_IS ~totlm how~) THEN BEGIN	

PRINT ~Paperdolls (IWD install)~
COPY		~1pp_thieves_galore/files/INV/CDFT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CDFT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CDFT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CDMT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CDMT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CDMT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CEFT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CEFT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CEFT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CEMT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CEMT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CEMT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CHFT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CHFT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CHFT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CHMT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CHMT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CHMT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CIFT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CIFT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CIFT3INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CIMT1INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CIMT2INV.BAM~ ~override~
	~1pp_thieves_galore/files/INV/CIMT3INV.BAM~ ~override~
END
	
// We are duplicating the plate armour animations here to avoid massive crashing

PRINT ~Creating T4 duplicates..~

COPY_EXISTING 	~CDFF4A1.BAM~ ~override/CDFT4A1.BAM~
	~CDFF4A2.BAM~ ~override/CDFT4A2.BAM~
	~CDFF4A3.BAM~ ~override/CDFT4A3.BAM~
	~CDFF4A4.BAM~ ~override/CDFT4A4.BAM~
	~CDFF4A5.BAM~ ~override/CDFT4A5.BAM~
	~CDFF4A6.BAM~ ~override/CDFT4A6.BAM~
	~CDFF4A7.BAM~ ~override/CDFT4A7.BAM~
	~CDFF4A8.BAM~ ~override/CDFT4A8.BAM~
	~CDFF4A9.BAM~ ~override/CDFT4A9.BAM~
	~CDFF4CA.BAM~ ~override/CDFT4CA.BAM~
	~CDFF4G1.BAM~ ~override/CDFT4G1.BAM~
	~CDFF4G11.BAM~ ~override/CDFT4G11.BAM~
	~CDFF4G12.BAM~ ~override/CDFT4G12.BAM~
	~CDFF4G13.BAM~ ~override/CDFT4G13.BAM~
	~CDFF4G14.BAM~ ~override/CDFT4G14.BAM~
	~CDFF4G15.BAM~ ~override/CDFT4G15.BAM~
	~CDFF4G16.BAM~ ~override/CDFT4G16.BAM~
	~CDFF4G17.BAM~ ~override/CDFT4G17.BAM~
	~CDFF4G18.BAM~ ~override/CDFT4G18.BAM~
	~CDFF4G19.BAM~ ~override/CDFT4G19.BAM~
	~CDFF4SA.BAM~ ~override/CDFT4SA.BAM~
	~CDFF4SS.BAM~ ~override/CDFT4SS.BAM~
	~CDFF4SX.BAM~ ~override/CDFT4SX.BAM~

COPY_EXISTING 	~CDMF4A1.BAM~ ~override/CDMT4A1.BAM~
	~CDMF4A2.BAM~ ~override/CDMT4A2.BAM~
	~CDMF4A3.BAM~ ~override/CDMT4A3.BAM~
	~CDMF4A4.BAM~ ~override/CDMT4A4.BAM~
	~CDMF4A5.BAM~ ~override/CDMT4A5.BAM~
	~CDMF4A6.BAM~ ~override/CDMT4A6.BAM~
	~CDMF4A7.BAM~ ~override/CDMT4A7.BAM~
	~CDMF4A8.BAM~ ~override/CDMT4A8.BAM~
	~CDMF4A9.BAM~ ~override/CDMT4A9.BAM~
	~CDMF4CA.BAM~ ~override/CDMT4CA.BAM~
	~CDMF4G1.BAM~ ~override/CDMT4G1.BAM~
	~CDMF4G11.BAM~ ~override/CDMT4G11.BAM~
	~CDMF4G12.BAM~ ~override/CDMT4G12.BAM~
	~CDMF4G13.BAM~ ~override/CDMT4G13.BAM~
	~CDMF4G14.BAM~ ~override/CDMT4G14.BAM~
	~CDMF4G15.BAM~ ~override/CDMT4G15.BAM~
	~CDMF4G16.BAM~ ~override/CDMT4G16.BAM~
	~CDMF4G17.BAM~ ~override/CDMT4G17.BAM~
	~CDMF4G18.BAM~ ~override/CDMT4G18.BAM~
	~CDMF4G19.BAM~ ~override/CDMT4G19.BAM~
	~CDMF4SA.BAM~ ~override/CDMT4SA.BAM~
	~CDMF4SS.BAM~ ~override/CDMT4SS.BAM~
	~CDMF4SX.BAM~ ~override/CDMT4SX.BAM~
	

COPY_EXISTING 	~CEFF4A1.BAM~ ~override/CEFT4A1.BAM~
	~CEFF4A2.BAM~ ~override/CEFT4A2.BAM~
	~CEFF4A3.BAM~ ~override/CEFT4A3.BAM~
	~CEFF4A4.BAM~ ~override/CEFT4A4.BAM~
	~CEFF4A5.BAM~ ~override/CEFT4A5.BAM~
	~CEFF4A6.BAM~ ~override/CEFT4A6.BAM~
	~CEFF4A7.BAM~ ~override/CEFT4A7.BAM~
	~CEFF4A8.BAM~ ~override/CEFT4A8.BAM~
	~CEFF4A9.BAM~ ~override/CEFT4A9.BAM~
	~CEFF4CA.BAM~ ~override/CEFT4CA.BAM~
	~CEFF4G1.BAM~ ~override/CEFT4G1.BAM~
	~CEFF4G11.BAM~ ~override/CEFT4G11.BAM~
	~CEFF4G12.BAM~ ~override/CEFT4G12.BAM~
	~CEFF4G13.BAM~ ~override/CEFT4G13.BAM~
	~CEFF4G14.BAM~ ~override/CEFT4G14.BAM~
	~CEFF4G15.BAM~ ~override/CEFT4G15.BAM~
	~CEFF4G16.BAM~ ~override/CEFT4G16.BAM~
	~CEFF4G17.BAM~ ~override/CEFT4G17.BAM~
	~CEFF4G18.BAM~ ~override/CEFT4G18.BAM~
	~CEFF4G19.BAM~ ~override/CEFT4G19.BAM~
	~CEFF4SA.BAM~ ~override/CEFT4SA.BAM~
	~CEFF4SS.BAM~ ~override/CEFT4SS.BAM~
	~CEFF4SX.BAM~ ~override/CEFT4SX.BAM~

COPY_EXISTING 	~CEMC4A1.BAM~ ~override/CEMT4A1.BAM~
	~CEMC4A2.BAM~ ~override/CEMT4A2.BAM~
	~CEMC4A3.BAM~ ~override/CEMT4A3.BAM~
	~CEMC4A4.BAM~ ~override/CEMT4A4.BAM~
	~CEMC4A5.BAM~ ~override/CEMT4A5.BAM~
	~CEMC4A6.BAM~ ~override/CEMT4A6.BAM~
	~CEMC4A7.BAM~ ~override/CEMT4A7.BAM~
	~CEMC4A8.BAM~ ~override/CEMT4A8.BAM~
	~CEMC4A9.BAM~ ~override/CEMT4A9.BAM~
	~CEMC4CA.BAM~ ~override/CEMT4CA.BAM~
	~CEMC4G1.BAM~ ~override/CEMT4G1.BAM~
	~CEMC4G11.BAM~ ~override/CEMT4G11.BAM~
	~CEMC4G12.BAM~ ~override/CEMT4G12.BAM~
	~CEMC4G13.BAM~ ~override/CEMT4G13.BAM~
	~CEMC4G14.BAM~ ~override/CEMT4G14.BAM~
	~CEMC4G15.BAM~ ~override/CEMT4G15.BAM~
	~CEMC4G16.BAM~ ~override/CEMT4G16.BAM~
	~CEMC4G17.BAM~ ~override/CEMT4G17.BAM~
	~CEMC4G18.BAM~ ~override/CEMT4G18.BAM~
	~CEMC4G19.BAM~ ~override/CEMT4G19.BAM~
	~CEMC4SA.BAM~ ~override/CEMT4SA.BAM~
	~CEMC4SS.BAM~ ~override/CEMT4SS.BAM~
	~CEMC4SX.BAM~ ~override/CEMT4SX.BAM~
	

COPY_EXISTING 	~CHFF4A1.BAM~ ~override/CHFT4A1.BAM~
	~CHFF4A2.BAM~ ~override/CHFT4A2.BAM~
	~CHFF4A3.BAM~ ~override/CHFT4A3.BAM~
	~CHFF4A4.BAM~ ~override/CHFT4A4.BAM~
	~CHFF4A5.BAM~ ~override/CHFT4A5.BAM~
	~CHFF4A6.BAM~ ~override/CHFT4A6.BAM~
	~CHFF4A7.BAM~ ~override/CHFT4A7.BAM~
	~CHFF4A8.BAM~ ~override/CHFT4A8.BAM~
	~CHFF4A9.BAM~ ~override/CHFT4A9.BAM~
	~CHFF4CA.BAM~ ~override/CHFT4CA.BAM~
	~CHFF4G1.BAM~ ~override/CHFT4G1.BAM~
	~CHFF4G11.BAM~ ~override/CHFT4G11.BAM~
	~CHFF4G12.BAM~ ~override/CHFT4G12.BAM~
	~CHFF4G13.BAM~ ~override/CHFT4G13.BAM~
	~CHFF4G14.BAM~ ~override/CHFT4G14.BAM~
	~CHFF4G15.BAM~ ~override/CHFT4G15.BAM~
	~CHFF4G16.BAM~ ~override/CHFT4G16.BAM~
	~CHFF4G17.BAM~ ~override/CHFT4G17.BAM~
	~CHFF4G18.BAM~ ~override/CHFT4G18.BAM~
	~CHFF4G19.BAM~ ~override/CHFT4G19.BAM~
	~CHFF4SA.BAM~ ~override/CHFT4SA.BAM~
	~CHFF4SS.BAM~ ~override/CHFT4SS.BAM~
	~CHFF4SX.BAM~ ~override/CHFT4SX.BAM~

COPY_EXISTING 	~CHMF4A1.BAM~ ~override/CHMT4A1.BAM~
	~CHMF4A2.BAM~ ~override/CHMT4A2.BAM~
	~CHMF4A3.BAM~ ~override/CHMT4A3.BAM~
	~CHMF4A4.BAM~ ~override/CHMT4A4.BAM~
	~CHMF4A5.BAM~ ~override/CHMT4A5.BAM~
	~CHMF4A6.BAM~ ~override/CHMT4A6.BAM~
	~CHMF4A7.BAM~ ~override/CHMT4A7.BAM~
	~CHMF4A8.BAM~ ~override/CHMT4A8.BAM~
	~CHMF4A9.BAM~ ~override/CHMT4A9.BAM~
	~CHMF4CA.BAM~ ~override/CHMT4CA.BAM~
	~CHMF4G1.BAM~ ~override/CHMT4G1.BAM~
	~CHMF4G11.BAM~ ~override/CHMT4G11.BAM~
	~CHMF4G12.BAM~ ~override/CHMT4G12.BAM~
	~CHMF4G13.BAM~ ~override/CHMT4G13.BAM~
	~CHMF4G14.BAM~ ~override/CHMT4G14.BAM~
	~CHMF4G15.BAM~ ~override/CHMT4G15.BAM~
	~CHMF4G16.BAM~ ~override/CHMT4G16.BAM~
	~CHMF4G17.BAM~ ~override/CHMT4G17.BAM~
	~CHMF4G18.BAM~ ~override/CHMT4G18.BAM~
	~CHMF4G19.BAM~ ~override/CHMT4G19.BAM~
	~CHMF4SA.BAM~ ~override/CHMT4SA.BAM~
	~CHMF4SS.BAM~ ~override/CHMT4SS.BAM~
	~CHMF4SX.BAM~ ~override/CHMT4SX.BAM~
	

COPY_EXISTING 	~CIFF4A1.BAM~ ~override/CIFT4A1.BAM~
	~CIFF4A2.BAM~ ~override/CIFT4A2.BAM~
	~CIFF4A3.BAM~ ~override/CIFT4A3.BAM~
	~CIFF4A4.BAM~ ~override/CIFT4A4.BAM~
	~CIFF4A5.BAM~ ~override/CIFT4A5.BAM~
	~CIFF4A6.BAM~ ~override/CIFT4A6.BAM~
	~CIFF4A7.BAM~ ~override/CIFT4A7.BAM~
	~CIFF4A8.BAM~ ~override/CIFT4A8.BAM~
	~CIFF4A9.BAM~ ~override/CIFT4A9.BAM~
	~CIFF4CA.BAM~ ~override/CIFT4CA.BAM~
	~CIFF4G1.BAM~ ~override/CIFT4G1.BAM~
	~CIFF4G11.BAM~ ~override/CIFT4G11.BAM~
	~CIFF4G12.BAM~ ~override/CIFT4G12.BAM~
	~CIFF4G13.BAM~ ~override/CIFT4G13.BAM~
	~CIFF4G14.BAM~ ~override/CIFT4G14.BAM~
	~CIFF4G15.BAM~ ~override/CIFT4G15.BAM~
	~CIFF4G16.BAM~ ~override/CIFT4G16.BAM~
	~CIFF4G17.BAM~ ~override/CIFT4G17.BAM~
	~CIFF4G18.BAM~ ~override/CIFT4G18.BAM~
	~CIFF4G19.BAM~ ~override/CIFT4G19.BAM~
	~CIFF4SA.BAM~ ~override/CIFT4SA.BAM~
	~CIFF4SS.BAM~ ~override/CIFT4SS.BAM~
	~CIFF4SX.BAM~ ~override/CIFT4SX.BAM~

COPY_EXISTING 	~CIMF4A1.BAM~ ~override/CIMT4A1.BAM~
	~CIMF4A2.BAM~ ~override/CIMT4A2.BAM~
	~CIMF4A3.BAM~ ~override/CIMT4A3.BAM~
	~CIMF4A4.BAM~ ~override/CIMT4A4.BAM~
	~CIMF4A5.BAM~ ~override/CIMT4A5.BAM~
	~CIMF4A6.BAM~ ~override/CIMT4A6.BAM~
	~CIMF4A7.BAM~ ~override/CIMT4A7.BAM~
	~CIMF4A8.BAM~ ~override/CIMT4A8.BAM~
	~CIMF4A9.BAM~ ~override/CIMT4A9.BAM~
	~CIMF4CA.BAM~ ~override/CIMT4CA.BAM~
	~CIMF4G1.BAM~ ~override/CIMT4G1.BAM~
	~CIMF4G11.BAM~ ~override/CIMT4G11.BAM~
	~CIMF4G12.BAM~ ~override/CIMT4G12.BAM~
	~CIMF4G13.BAM~ ~override/CIMT4G13.BAM~
	~CIMF4G14.BAM~ ~override/CIMT4G14.BAM~
	~CIMF4G15.BAM~ ~override/CIMT4G15.BAM~
	~CIMF4G16.BAM~ ~override/CIMT4G16.BAM~
	~CIMF4G17.BAM~ ~override/CIMT4G17.BAM~
	~CIMF4G18.BAM~ ~override/CIMT4G18.BAM~
	~CIMF4G19.BAM~ ~override/CIMT4G19.BAM~
	~CIMF4SA.BAM~ ~override/CIMT4SA.BAM~
	~CIMF4SS.BAM~ ~override/CIMT4SS.BAM~
	~CIMF4SX.BAM~ ~override/CIMT4SX.BAM~
	
// Here we go and create paperdoll duplicates supporting absent BAMS with PLT.

ACTION_IF (GAME_IS ~bg2 tob tutu tutu_totsc~) THEN BEGIN	

ACTION_IF (FILE_EXISTS_IN_GAME ~CDFF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CDFF4INV.BAM~ ~override/CDFT4INV.BAM~
COPY_EXISTING ~CDFF4INV.PLT~ ~override/CDFT4INV.PLT~
END
ELSE BEGIN
COPY_EXISTING ~CDFF4INV.PLT~ ~override/CDFT4INV.PLT~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CDMF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CDMF4INV.BAM~ ~override/CDMT4INV.BAM~
COPY_EXISTING ~CDMF4INV.PLT~ ~override/CDMT4INV.PLT~
END
ELSE BEGIN
COPY_EXISTING ~CDMF4INV.PLT~ ~override/CDMT4INV.PLT~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CEFF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CEFF4INV.BAM~ ~override/CEFT4INV.BAM~
COPY_EXISTING ~CEFF4INV.PLT~ ~override/CEFT4INV.PLT~
END
ELSE BEGIN
COPY_EXISTING ~CEFF4INV.PLT~ ~override/CEFT4INV.PLT~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CEMF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CEMC4INV.BAM~ ~override/CEMT4INV.BAM~
COPY_EXISTING ~CEMC4INV.PLT~ ~override/CEMT4INV.PLT~
END
ELSE BEGIN
COPY_EXISTING ~CEMC4INV.PLT~ ~override/CEMT4INV.PLT~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CHFF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CHFF4INV.BAM~ ~override/CHFT4INV.BAM~
COPY_EXISTING ~CHFF4INV.PLT~ ~override/CHFT4INV.PLT~
END
ELSE BEGIN
COPY_EXISTING ~CHFF4INV.PLT~ ~override/CHFT4INV.PLT~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CHMF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CHMF4INV.BAM~ ~override/CHMT4INV.BAM~
COPY_EXISTING ~CHMF4INV.PLT~ ~override/CHMT4INV.PLT~
END
ELSE BEGIN
COPY_EXISTING ~CHMF4INV.PLT~ ~override/CHMT4INV.PLT~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~COFF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~COFF4INV.BAM~ ~override/COFT4INV.BAM~
COPY_EXISTING ~COFF4INV.PLT~ ~override/COFT4INV.PLT~
END
ELSE BEGIN
COPY_EXISTING ~COFF4INV.PLT~ ~override/COFT4INV.PLT~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~COMF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~COMF4INV.BAM~ ~override/COMT4INV.BAM~
COPY_EXISTING ~COMF4INV.PLT~ ~override/COMT4INV.PLT~
END
ELSE BEGIN
COPY_EXISTING ~COMF4INV.PLT~ ~override/COMT4INV.PLT~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CIFF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CIFF4INV.BAM~ ~override/CIFT4INV.BAM~
COPY_EXISTING ~CIFF4INV.PLT~ ~override/CIFT4INV.PLT~
END
ELSE BEGIN
COPY_EXISTING ~CIFF4INV.PLT~ ~override/CIFT4INV.PLT~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CIMF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CIMF4INV.BAM~ ~override/CIMT4INV.BAM~
COPY_EXISTING ~CIMF4INV.PLT~ ~override/CIMT4INV.PLT~
END
ELSE BEGIN
COPY_EXISTING ~CIMF4INV.PLT~ ~override/CIMT4INV.PLT~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CGFF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CGFF4INV.BAM~ ~override/CGFT4INV.BAM~
COPY_EXISTING ~CGFF4INV.PLT~ ~override/CGFT4INV.PLT~
END
ELSE BEGIN
COPY_EXISTING ~CGFF4INV.PLT~ ~override/CGFT4INV.PLT~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CGMF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CGMF4INV.BAM~ ~override/CGMT4INV.BAM~
COPY_EXISTING ~CGMF4INV.PLT~ ~override/CGMT4INV.PLT~
END
ELSE BEGIN
COPY_EXISTING ~CGMF4INV.PLT~ ~override/CGMT4INV.PLT~
END
END

ACTION_IF (GAME_IS ~totlm how~) THEN BEGIN	

ACTION_IF (FILE_EXISTS_IN_GAME ~CDFF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CDFF4INV.BAM~ ~override/CDFT4INV.BAM~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CDMF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CDMF4INV.BAM~ ~override/CDMT4INV.BAM~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CEFF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CEFF4INV.BAM~ ~override/CEFT4INV.BAM~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CEMF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CEMC4INV.BAM~ ~override/CEMT4INV.BAM~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CHFF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CHFF4INV.BAM~ ~override/CHFT4INV.BAM~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CHMF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CHMF4INV.BAM~ ~override/CHMT4INV.BAM~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CIFF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CIFF4INV.BAM~ ~override/CIFT4INV.BAM~
END

ACTION_IF (FILE_EXISTS_IN_GAME ~CIMF4INV.BAM~) THEN BEGIN
COPY_EXISTING ~CIMF4INV.BAM~ ~override/CIMT4INV.BAM~
END
END

BEGIN ~1ppv3: Improved Improved Galactygon's Avatar Switching~
REQUIRE_PREDICATE GAME_IS ~bg2 tob tutu tutu_totsc~ ~Skipping BG2 variant~

// PATCH ME HAPPY

PRINT ~Installing avatar switching code and files~

EXTEND_TOP ~baldur.bcs~ ~1pp_thieves_galore/patches/script/script.baf~

// the following built on and mostly copied from the BGII Tweak Pack component
// http://www.gibberlings3.net/bg2tweaks/

COPY 	~1pp_thieves_galore/patches/switch/fc_dwar2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fc_dwarf.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fc_el2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fc_elf.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fc_gnom2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fc_gnome.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fc_half2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fc_halfl.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fc_hfor2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fc_hforc.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fc_huma2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fc_human.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ff_dwar2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ff_dwarf.eff~ ~override~
	~1pp_thieves_galore/patches/switch/FF_EL2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ff_elf.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ff_gnom2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ff_gnome.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ff_half2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ff_halfl.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ff_hfor2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ff_hforc.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ff_huma2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ff_human.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fm_dwar2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fm_dwarf.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fm_el2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fm_elf.eff~ ~override~
	~1pp_thieves_galore/patches/switch/FM_GNOM2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fm_gnome.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fm_half2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fm_halfl.eff~ ~override~
	~1pp_thieves_galore/patches/switch/FM_HFOR2.EFF~ ~override~
	~1pp_thieves_galore/patches/switch/FM_HFORC.EFF~ ~override~
	~1pp_thieves_galore/patches/switch/fm_huma2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/fm_human.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ft_dwar2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ft_dwarf.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ft_el2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ft_elf.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ft_gnom2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ft_gnome.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ft_half2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ft_halfl.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ft_hfor2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ft_hforc.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ft_huma2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/ft_human.eff~ ~override~
	~1pp_thieves_galore/patches/switch/FX_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/switch/FX_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/switch/lcarmor.spl~ ~override~
	~1pp_thieves_galore/patches/switch/LCARMOR2.EFF~ ~override~
	~1pp_thieves_galore/patches/switch/lcarmorc.eff~ ~override~
	~1pp_thieves_galore/patches/switch/LCARMORC.spl~ ~override~
	~1pp_thieves_galore/patches/switch/lcarmorf.eff~ ~override~
	~1pp_thieves_galore/patches/switch/LCARMORF.spl~ ~override~
	~1pp_thieves_galore/patches/switch/LCARMORM.EFF~ ~override~
	~1pp_thieves_galore/patches/switch/LCARMORM.SPL~ ~override~
	~1pp_thieves_galore/patches/switch/lcarmort.eff~ ~override~
	~1pp_thieves_galore/patches/switch/LCARMORT.spl~ ~override~
	~1pp_thieves_galore/patches/switch/lcrobe.spl~ ~override~
	~1pp_thieves_galore/patches/switch/LCROBE2.EFF~ ~override~
	~1pp_thieves_galore/patches/switch/LCUARMRD.EFF~ ~override~
	~1pp_thieves_galore/patches/switch/LCUARMRD.SPL~ ~override~
	~1pp_thieves_galore/patches/switch/mc_dwar2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/MC_DWARF.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mc_el2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/MC_ELF.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mc_gnom2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/MC_GNOME.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mc_half2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/MC_HALFL.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mc_hfor2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/MC_HFORC.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mc_huma2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/MC_HUMAN.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mf_dwar2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mf_dwarf.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mf_el2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mf_elf.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mf_gnom2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mf_gnome.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mf_half2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mf_halfl.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mf_hfor2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mf_hforc.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mf_huma2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mf_human.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mm_dwar2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mm_dwarf.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mm_el2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mm_elf.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mm_gnom2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mm_gnome.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mm_half2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mm_halfl.eff~ ~override~
	~1pp_thieves_galore/patches/switch/MM_HFOR2.EFF~ ~override~
	~1pp_thieves_galore/patches/switch/MM_HFORC.EFF~ ~override~
	~1pp_thieves_galore/patches/switch/mm_huma2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/MM_HUMAN.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mt_dwar2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mt_dwarf.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mt_el2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mt_elf.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mt_gnom2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mt_gnome.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mt_half2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mt_halfl.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mt_hfor2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mt_hforc.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mt_huma2.eff~ ~override~
	~1pp_thieves_galore/patches/switch/mt_human.eff~ ~override~
	~1pp_thieves_galore/patches/switch/MX_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/switch/MX_HUMAN.EFF~ ~override~
ACTION_IF (FILE_EXISTS_IN_GAME ~PROPC101.EFF~) THEN BEGIN
END
ELSE BEGIN
COPY ~1pp_thieves_galore/patches/switch/PROPC101.EFF~ ~override~
END

PRINT ~Patching armour and robes (BGII style)~
COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
  READ_SHORT 0x1c "itemtype" ELSE 0
  PATCH_IF ("%itemtype%" = 2) BEGIN
    READ_ASCII 0x22 "anim" (2)
    READ_LONG  0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    READ_LONG  0x6a "fx_off"
    READ_SHORT 0x70 "fx_num"
    SET "new_fx" = 1
    FOR (loops = 0 ; loops < abil_num ; loops = loops + 1) BEGIN // adjusts effects on abilities up by new_fx
      READ_SHORT  (0x20 + "%abil_off%" + ("%loops%" * 0x38)) "abil_fx_idx"
      WRITE_SHORT (0x20 + "%abil_off%" + ("%loops%" * 0x38)) ("%abil_fx_idx%" + "%new_fx%")
    END
    WRITE_SHORT 0x70 ("%fx_num%" + "%new_fx%")
    INSERT_BYTES  ("%fx_off%" +        ("%fx_num%" * 0x30)) 0x30 // new effect
      WRITE_SHORT ("%fx_off%" +        ("%fx_num%" * 0x30)) 146  // cast spell
      WRITE_BYTE  ("%fx_off%" + 0x02 + ("%fx_num%" * 0x30)) 1    // target self
      WRITE_LONG  ("%fx_off%" + 0x04 + ("%fx_num%" * 0x30)) 1    // cast at level
      WRITE_BYTE  ("%fx_off%" + 0x08 + ("%fx_num%" * 0x30)) 1    // cast instantly? yes
      WRITE_BYTE  ("%fx_off%" + 0x0c + ("%fx_num%" * 0x30)) 2    // instant/while equipped
      WRITE_BYTE  ("%fx_off%" + 0x12 + ("%fx_num%" * 0x30)) 100  // probability 100
    PATCH_IF (
               ("%anim%" STRING_COMPARE_CASE "2w" = 0) OR
               ("%anim%" STRING_COMPARE_CASE "3w" = 0) OR
               ("%anim%" STRING_COMPARE_CASE "4w" = 0)
             ) BEGIN // if robe
      WRITE_ASCII  ("%fx_off%" + 0x14 + ("%fx_num%" * 0x30)) ~lcrobe~  // robe spell effect
    END ELSE BEGIN
      WRITE_ASCII  ("%fx_off%" + 0x14 + ("%fx_num%" * 0x30)) ~lcarmor~ // armor spell effect
    END
  END
  BUT_ONLY_IF_IT_CHANGES
  
  
  
  
  ///////// IWD
  
  
BEGIN ~1ppv3: IWD Avatar Switching~
REQUIRE_PREDICATE GAME_IS ~totlm how~ ~Skipping IWD variant~

PRINT ~Installing avatar switching files~
  
COPY		~1pp_thieves_galore/patches/iwd_switch/FC_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FC_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FC_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FC_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FC_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FC_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FC_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FC_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FC_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FC_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FC_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FC_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FC_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FC_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FF_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FF_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FF_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FF_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FF_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FF_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FF_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FF_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FF_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FF_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FF_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FF_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FF_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FF_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_HFOR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_HFORC.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FM_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FT_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FT_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FT_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FT_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FT_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FT_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FT_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FT_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FT_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FT_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FT_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FT_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FT_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/FT_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/LICNG0.BAM~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/LICNG1.BAM~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/LICNG2.BAM~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MC_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MC_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MC_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MC_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MC_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MC_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MC_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MC_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MC_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MC_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MC_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MC_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MC_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MC_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MF_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MF_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MF_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MF_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MF_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MF_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MF_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MF_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MF_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MF_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MF_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MF_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MF_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MF_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MM_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MM_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MM_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MM_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MM_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MM_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MM_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MM_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MM_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MM_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MM_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MM_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MM_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MM_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MT_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MT_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MT_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MT_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MT_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MT_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MT_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MT_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MT_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MT_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MT_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MT_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MT_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd_switch/MT_HUMAN.EFF~ ~override~
  
COPY ~1pp_thieves_galore/patches/iwd_switch/LIARMOR.SPL~ ~override~
COPY ~1pp_thieves_galore/patches/iwd_switch/LIROBE.SPL~ ~override~
COPY ~1pp_thieves_galore/patches/iwd_switch/LIUARM3.SPL~ ~override~

COPY ~1pp_thieves_galore/patches/iwd_switch/PRE_M01.WAV~ ~override~
  
  PRINT ~Patching armour and robes (IWD style)~
COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
  READ_SHORT 0x1c "itemtype" ELSE 0
  PATCH_IF ("%itemtype%" = 2) BEGIN
      READ_ASCII 0x22 "anim" (2)
        PATCH_IF (
               ("%anim%" STRING_COMPARE_CASE "2w" = 0) OR
               ("%anim%" STRING_COMPARE_CASE "3w" = 0) OR
               ("%anim%" STRING_COMPARE_CASE "4w" = 0)
             ) BEGIN // if robe
      SPRINT "resource" "lirobe" 		// resource
	  SPRINT "icon" "licng1" 		// resource
    END ELSE BEGIN
      SPRINT "resource" "liarmor" 		// resource
	  SPRINT "icon" "licng0" 		// resource
    END
	
		PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
  READ_LONG 0x64 ~abil_loc~
  READ_SHORT 0x68 ~abil_num~
  READ_SHORT 0x6A ~fx_loc~
  
  // generate real eff number
  SET overhead = (%SOURCE_SIZE% - %fx_loc%)
  SET entfx_num = (overhead / 0x30)
  
  READ_SHORT 0x70 ~fx_num~
   SET abil_size = ((%fx_loc% - %abil_loc%) / %abil_num%)
   SET new_bytes = (%fx_loc%)
   SET new_abil_loc = %new_bytes%
   SET new_fx_loc = (%new_abil_loc% + 0x38)
     INSERT_BYTES %new_bytes% 0x38
   WRITE_SHORT 104 (%abil_num% + 1)
   WRITE_LONG 106 (%new_fx_loc%)
   WRITE_BYTE  (%new_abil_loc% + 0) 0              // attack type
   WRITE_BYTE  (%new_abil_loc% + 2) 3              // use location
   WRITE_EVALUATED_ASCII (%new_abil_loc% + 4) ~%icon%~         // use icon
   WRITE_BYTE  (%new_abil_loc% + 12) 5             // type of target
    WRITE_BYTE  (%new_abil_loc% + 14) 1             // Range
   WRITE_SHORT (%new_abil_loc% + 18) 0            // speed
   WRITE_SHORT (%new_abil_loc% + 22) 6             // dice sides
   WRITE_SHORT (%new_abil_loc% + 24) 0             // dice rolls
   WRITE_SHORT (%new_abil_loc% + 28) 1             // damage type
   WRITE_SHORT (%new_abil_loc% + 36) 1             // charge removal
   WRITE_LONG  (%new_abil_loc% + 38) 0             // flag: use strength
   WRITE_SHORT (%new_abil_loc% + 42) 1            // Projectile Type
   WRITE_SHORT (%new_abil_loc% + 44) 34            // overh
   WRITE_SHORT (%new_abil_loc% + 46) 33            // backhand
   WRITE_SHORT (%new_abil_loc% + 48) 33            // thrust
   WRITE_SHORT (%new_abil_loc% + 30) 3				// # of effects
   WRITE_SHORT (%new_abil_loc% + 32) %entfx_num%				// Effect index
 
  SET addeffectone = (%SOURCE_SIZE% + 0x38)
 SET addeffecttwo = (%SOURCE_SIZE% + 0x30 + 0x38)
 SET addeffectthree = (%SOURCE_SIZE% + 0x60 + 0x38)
 
 // CAST SPELL
 
SET new_abil_loc = addeffectone
 INSERT_BYTES %addeffectone% 0x30
   WRITE_SHORT  (%new_abil_loc% + 0x00) 146              // opcode
   WRITE_BYTE  (%new_abil_loc% + 0x02) 1            // target
   WRITE_BYTE  (%new_abil_loc% + 0x03) 0            // power
   WRITE_LONG  (%new_abil_loc% + 0x04) 1            // cast at level
   WRITE_LONG  (%new_abil_loc% + 0x08) 1            // cast instantly
   WRITE_BYTE  (%new_abil_loc% + 0x0C) 2            // timing mode
   WRITE_BYTE  (%new_abil_loc% + 0x0D) 0            // dispel/resist
   WRITE_LONG  (%new_abil_loc% + 0x0E) 0            // duration
   WRITE_BYTE  (%new_abil_loc% + 0x12) 100            // probability 1
   WRITE_BYTE  (%new_abil_loc% + 0x13) 0            // probability 2
   WRITE_EVALUATED_ASCII (%new_abil_loc% + 0x14) ~%resource%~         // resource
   WRITE_LONG  (%new_abil_loc% + 0x1C) 0            // #dice/maxlevel
   WRITE_LONG  (%new_abil_loc% + 0x20) 0            // dicesize/minlevel
   WRITE_LONG  (%new_abil_loc% + 0x24) 0            // savetype
   WRITE_LONG  (%new_abil_loc% + 0x28) 0            // savebogus
	   
	   //REMOVE SPELL
	   
	   SET new_abil_loc = addeffecttwo
 INSERT_BYTES %addeffecttwo% 0x30
   WRITE_SHORT  (%new_abil_loc% + 0x00) 172              // opcode
   WRITE_BYTE  (%new_abil_loc% + 0x02) 1            // target
   WRITE_BYTE  (%new_abil_loc% + 0x03) 0            // power
   WRITE_LONG  (%new_abil_loc% + 0x04) 0            // cast at level
   WRITE_LONG  (%new_abil_loc% + 0x08) 0            // cast instantly
   WRITE_BYTE  (%new_abil_loc% + 0x0C) 1            // timing mode
   WRITE_BYTE  (%new_abil_loc% + 0x0D) 0            // dispel/resist
   WRITE_LONG  (%new_abil_loc% + 0x0E) 0            // duration
   WRITE_BYTE  (%new_abil_loc% + 0x12) 100            // probability 1
   WRITE_BYTE  (%new_abil_loc% + 0x13) 0            // probability 2
   WRITE_EVALUATED_ASCII (%new_abil_loc% + 0x14) ~liuarm3~         // resource
   WRITE_LONG  (%new_abil_loc% + 0x1C) 0            // #dice/maxlevel
   WRITE_LONG  (%new_abil_loc% + 0x20) 0            // dicesize/minlevel
   WRITE_LONG  (%new_abil_loc% + 0x24) 0            // savetype
   WRITE_LONG  (%new_abil_loc% + 0x28) 0            // savebogus
	   
	   // GIVE INNATE (switch)
	   
	    SET new_abil_loc = addeffectthree
 INSERT_BYTES %addeffectthree% 0x30
   WRITE_SHORT  (%new_abil_loc% + 0x00) 171              // opcode
   WRITE_BYTE  (%new_abil_loc% + 0x02) 1            // target
   WRITE_BYTE  (%new_abil_loc% + 0x03) 0            // power
   WRITE_LONG  (%new_abil_loc% + 0x04) 0            // cast at level
   WRITE_LONG  (%new_abil_loc% + 0x08) 0            // cast instantly
   WRITE_BYTE  (%new_abil_loc% + 0x0C) 1            // timing mode
   WRITE_BYTE  (%new_abil_loc% + 0x0D) 0            // dispel/resist
   WRITE_LONG  (%new_abil_loc% + 0x0E) 0            // duration
   WRITE_BYTE  (%new_abil_loc% + 0x12) 100            // probability 1
   WRITE_BYTE  (%new_abil_loc% + 0x13) 0            // probability 2
   WRITE_EVALUATED_ASCII (%new_abil_loc% + 0x14) ~liuarm3~         // resource
   WRITE_LONG  (%new_abil_loc% + 0x1C) 0            // #dice/maxlevel
   WRITE_LONG  (%new_abil_loc% + 0x20) 0            // dicesize/minlevel
   WRITE_LONG  (%new_abil_loc% + 0x24) 0            // savetype
   WRITE_LONG  (%new_abil_loc% + 0x28) 0            // savebogus
	   
	   
	   
	   END
   
	 END
  BUT_ONLY_IF_IT_CHANGES
  
  
  
  BEGIN ~1ppv3: IWDII Avatar Switching~
REQUIRE_PREDICATE GAME_IS ~iwd2~ ~Skipping IWDII variant~

PRINT ~Installing avatar switching files~
  
COPY	~1pp_thieves_galore/patches/iwd2_switch/FC_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_GNOM2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_GNOME.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_HFOR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_HFOR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_HFORC.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FC_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_GNOM2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_GNOME.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_HFOR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_HFOR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_HFORC.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FF_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_GNOM2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_GNOME.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_HFOR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_HFOR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_HFORC.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FM_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_GNOM2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_GNOME.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_HFOR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_HFOR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_HFORC.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/FT_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/L2ARMOR.SPL~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/L2ROBE.SPL~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/LICNG2.BAM~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_GNOM2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_GNOME.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_HFOR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_HFOR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_HFORC.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MC_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_GNOM2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_GNOME.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_HFOR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_HFOR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_HFORC.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MF_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_GNOM2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_GNOME.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_HFOR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_HFOR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_HFORC.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MM_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_DWAR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_DWAR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_DWARF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_EL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_EL2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_ELF.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_GNOM0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_GNOM2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_GNOME.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_HALF0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_HALF2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_HALFL.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_HEL0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_HFOR0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_HFOR2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_HFORC.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_HUMA0.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_HUMA2.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/MT_HUMAN.EFF~ ~override~
	~1pp_thieves_galore/patches/iwd2_switch/SPIN100.SPL~ ~override~

COPY ~1pp_thieves_galore/patches/iwd2_switch/PRE_M01.WAV~ ~override~
	
PRINT ~Copying .2da~
COPY	~1pp_thieves_galore/patches/iwd2_switch/LISTINNT.2DA~ ~override~

PRINT ~Patching armour and robes (IWDII style)~
COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
  READ_ASCII 0x22 "itemtype" (2)
  PATCH_IF (   ("%itemtype%" STRING_COMPARE_CASE "2a" = 0) OR
               ("%itemtype%" STRING_COMPARE_CASE "3a" = 0) OR
               ("%itemtype%" STRING_COMPARE_CASE "4a" = 0) OR
               ("%itemtype%" STRING_COMPARE_CASE "2w" = 0) OR
               ("%itemtype%" STRING_COMPARE_CASE "3w" = 0) OR
               ("%itemtype%" STRING_COMPARE_CASE "4w" = 0)
             ) BEGIN
    READ_ASCII 0x22 "anim" (2)
    READ_LONG  0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    READ_LONG  0x6a "fx_off"
    READ_SHORT 0x70 "fx_num"
    SET "new_fx" = 1
    FOR (loops = 0 ; loops < abil_num ; loops = loops + 1) BEGIN // adjusts effects on abilities up by new_fx
      READ_SHORT  (0x20 + "%abil_off%" + ("%loops%" * 0x38)) "abil_fx_idx"
      WRITE_SHORT (0x20 + "%abil_off%" + ("%loops%" * 0x38)) ("%abil_fx_idx%" + "%new_fx%")
    END
    WRITE_SHORT 0x70 ("%fx_num%" + "%new_fx%")
    INSERT_BYTES  ("%fx_off%" +        ("%fx_num%" * 0x30)) 0x30 // new effect
      WRITE_SHORT ("%fx_off%" +        ("%fx_num%" * 0x30)) 146  // cast spell
      WRITE_BYTE  ("%fx_off%" + 0x02 + ("%fx_num%" * 0x30)) 1    // target self
      WRITE_LONG  ("%fx_off%" + 0x04 + ("%fx_num%" * 0x30)) 1    // cast at level
      WRITE_BYTE  ("%fx_off%" + 0x08 + ("%fx_num%" * 0x30)) 1    // cast instantly? yes
      WRITE_BYTE  ("%fx_off%" + 0x0c + ("%fx_num%" * 0x30)) 1    // instant/while equipped
      WRITE_BYTE  ("%fx_off%" + 0x12 + ("%fx_num%" * 0x30)) 100  // probability 100
    PATCH_IF (
               ("%anim%" STRING_COMPARE_CASE "2w" = 0) OR
               ("%anim%" STRING_COMPARE_CASE "3w" = 0) OR
               ("%anim%" STRING_COMPARE_CASE "4w" = 0)
             ) BEGIN // if robe
      WRITE_ASCII  ("%fx_off%" + 0x14 + ("%fx_num%" * 0x30)) ~l2robe~  // robe spell effect
    END ELSE BEGIN
      WRITE_ASCII  ("%fx_off%" + 0x14 + ("%fx_num%" * 0x30)) ~l2armor~ // armor spell effect
    END
  END
  BUT_ONLY_IF_IT_CHANGES