/* TP2 file by Cuv
   November 30, 2007
   WeiDU v1.99*/

BACKUP ~CVWights/Backup~

AUTHOR ~cuvieronius@aol.com~

/**********************************************************************
 *************************************************************************                                                                   **
**                         CVWights Installer                        **
**                 Composite slot for 8 animations                   **
**                          By Cuvieronius                           **                           **                                V1.0                               **                                   **                                                                   **
**                                                                   ** ***********************************************************************
 **********************************************************************/

BEGIN ~Cuv Animation Slots Part 2: Wights~

// TOB Check prior to installing
REQUIRE_FILE ~Data/25Dialog.bif~ ~You must have Throne of Bhaal Installed.~    

/********************************************************
 * Files are done in the following order:
 *
 * COPY DIRECTORY CONTENTS
 * COPY ITEMS WITH STRINGS
 * PATCHING EXISTING CREATURES WITH CORRECT ATTACK ITEM
 * COPY TEST CREATURES WITH STRINGS
 *
 ********************************************************/

/*******************************************************
 * COPY DIRECTORY CONTENTS
 *******************************************************/

PRINT ~ *** Copy directory contents *** ~

PRINT ~ Copying directory contents ~

COPY ~CVWights/bam~                   ~override~ 
     ~CVWights/ids~                   ~override~ 

/*******************************************************
 * COPY ITEMS WITH STRINGS
 *******************************************************/

PRINT ~ *** Patching existing items *** ~

// IWD Mummy   (MMUM) - Axe - Mummy disease hit item
COPY_EXISTING ~MUMMYW.itm~   ~override/CVWIGRTW.itm~
WRITE_ASCII 0x0022 ~AX~
WRITE_BYTE 0x001c 25
 
// IWD Mummy   (MMUM) - Axe
COPY_EXISTING ~AX1H01.itm~   ~override/CVWIG1.itm~

// IWD Ghoul   (MGH2) - Club
COPY_EXISTING ~BLUN01.itm~   ~override/CVWIG2.itm~

// IWD Ghast   (MSH3) - Dagger
COPY_EXISTING ~DAGG01.itm~   ~override/CVWIG3.itm~

// IWD Wight   (MWIG) - Flail
COPY_EXISTING ~BLUN02.itm~   ~override/CVWIG4.itm~

// IWD Wight   (MWI2) - Halberd
COPY_EXISTING ~HALB01.itm~   ~override/CVWIG5.itm~

// IWD Wight   (MWI3) - Mace
COPY_EXISTING ~BLUN04.itm~   ~override/CVWIG6.itm~

// IWD Zombie  (MZO2) - Quarterstaff
COPY_EXISTING ~STAF01.itm~   ~override/CVWIG7.itm~

// IWD Zombie2 (MZO3) - Warhammer
COPY_EXISTING ~HAMM01.itm~   ~override/CVWIG8.itm~

/*******************************************************
 * PATCHING EXISTING CREATURES WITH CORRECT ATTACK ITEM
 *******************************************************/

PRINT ~ *** Patching existing creatures using this animation slot *** ~

// Reassures the user the mod will take a few minutes to install
PRINT ~Please relax, this will take 2-5 minutes...~

// Must be done BEFORE I make creatures with this animation, Duh!
// Catch-all item for any mummy in the game
COPY_EXISTING_REGEXP ~.*\.cre~ ~override~
  READ_LONG  "0x0028" "animaionIDS"
  PATCH_IF ("%animaionIDS%" = 57472) BEGIN
    ADD_CRE_ITEM ~CVWIGRTW.itm~ #0 #0 #0 ~IDENTIFIED~ ~WEAPON1~ EQUIP
  END

/*******************************************************
 * COPY CREATURES WITH STRINGS
 *******************************************************/

COPY ~CVWights/cre/cvtest1.cre~ ~override/CVWIG1.cre~
  SAY 0x8   ~IWD Mummy~ // name
  SAY 0xc   ~IWD Mummy~
  WRITE_ASCII 0x0280 ~CVWIG1~
  WRITE_ASCII 0x04e0 ~CVWIG1~
COPY ~CVWights/cre/cvtest2.cre~ ~override/CVWIG2.cre~
  SAY 0x8   ~IWD Ghoul~ // name
  SAY 0xc   ~IWD Ghoul~
  WRITE_ASCII 0x0280 ~CVWIG2~
  WRITE_ASCII 0x04e0 ~CVWIG2~
COPY ~CVWights/cre/cvtest3.cre~ ~override/CVWIG3.cre~
  SAY 0x8   ~IWD Ghast~ // name
  SAY 0xc   ~IWD Ghast~
  WRITE_ASCII 0x0280 ~CVWIG3~
  WRITE_ASCII 0x04e0 ~CVWIG3~
COPY ~CVWights/cre/cvtest4.cre~ ~override/CVWIG4.cre~
  SAY 0x8   ~IWD Wight1~ // name
  SAY 0xc   ~IWD Wight1~
  WRITE_ASCII 0x0280 ~CVWIG4~
  WRITE_ASCII 0x04e0 ~CVWIG4~
COPY ~CVWights/cre/cvtest5.cre~ ~override/CVWIG5.cre~
  SAY 0x8   ~IWD Wight2~ // name
  SAY 0xc   ~IWD Wight2~
  WRITE_ASCII 0x0280 ~CVWIG5~
  WRITE_ASCII 0x04e0 ~CVWIG5~
COPY ~CVWights/cre/cvtest6.cre~ ~override/CVWIG6.cre~
  SAY 0x8   ~IWD Wight3~ // name
  SAY 0xc   ~IWD Wight3~
  WRITE_ASCII 0x0280 ~CVWIG6~
  WRITE_ASCII 0x04e0 ~CVWIG6~
COPY ~CVWights/cre/cvtest7.cre~ ~override/CVWIG7.cre~
  SAY 0x8   ~IWD Zombie~ // name
  SAY 0xc   ~IWD Zombie~
  WRITE_ASCII 0x0280 ~CVWIG7~
  WRITE_ASCII 0x04e0 ~CVWIG7~
COPY ~CVWights/cre/cvtest8.cre~ ~override/CVWIG8.cre~
  SAY 0x8   ~IWD Zombie2~ // name
  SAY 0xc   ~IWD Zombie2~
  WRITE_ASCII 0x0280 ~CVWIG8~
  WRITE_ASCII 0x04e0 ~CVWIG8~