// Cap the damage resistance to 75, 85 if barbarian

// ACTION_IF NOT FILE_EXISTS ~override/tb#resisttweak.txt~ THEN
// 	BEGIN
// 	COPY_EXISTING ~sw1h01.itm~ ~override/tb#resisttweak.txt~
// 	COPY ~refinements/armor/copy~ ~override~
// 	EXTEND_TOP ~baldur.bcs~ ~refinements/armor/baldur.baf~
// 	ACTION_IF FILE_EXISTS_IN_GAME ~baldur25.bcs~ THEN
// 		BEGIN
// 		EXTEND_TOP ~baldur25.bcs~ ~refinements/armor/baldur.baf~
// 		END
// 	END

// Install ToBEx
ACTION_IF (FILE_EXISTS ~bgmain.exe~) THEN BEGIN
  OUTER_SPRINT TOBEX_MOD_DIRECTORY "./refinements"
  LOAD_TRA "%TOBEX_MOD_DIRECTORY%/TobEx_redist/TobEx.tra"
  ACTION_INCLUDE "%TOBEX_MOD_DIRECTORY%/TobEx_redist/TobEx.tpa"
END

APPEND ~stats.ids~ ~128 WIZARD_PROTECTION_FROM_MAGIC_WEAPONS~
UNLESS ~WIZARD_PROTECTION_FROM_MAGIC_WEAPONS~
// emulates Detectable spells

APPEND ~class.ids~ ~202 LONG_BOW~ UNLESS ~LONG_BOW~
// since some mods remove this line and I decompiled in environment with LONG_BOW

APPEND ~GTIMES.IDS~ ~6 ONE_ROUND~ UNLESS ~ONE_ROUND~
APPEND ~GTIMES.IDS~ ~12 TWO_ROUNDS~ UNLESS ~TWO_ROUNDS~
APPEND ~GTIMES.IDS~ ~18 THREE_ROUNDS~ UNLESS ~THREE_ROUNDS~
APPEND ~GTIMES.IDS~ ~24 FOUR_ROUNDS~ UNLESS ~FOUR_ROUNDS~
APPEND ~GTIMES.IDS~ ~30 FIVE_ROUNDS~ UNLESS ~FIVE_ROUNDS~
APPEND ~GTIMES.IDS~ ~36 SIX_ROUNDS~ UNLESS ~SIX_ROUNDS~
APPEND ~GTIMES.IDS~ ~42 SEVEN_ROUNDS~ UNLESS ~SEVEN_ROUNDS~
APPEND ~GTIMES.IDS~ ~48 EIGHT_ROUNDS~ UNLESS ~EIGHT_ROUNDS~
APPEND ~GTIMES.IDS~ ~54 NINE_ROUNDS~ UNLESS ~NINE_ROUNDS~
APPEND ~GTIMES.IDS~ ~60 TEN_ROUNDS~ UNLESS ~TEN_ROUNDS~
APPEND ~GTIMES.IDS~ ~60 ONE_TURN~ UNLESS ~ONE_TURN~
APPEND ~GTIMES.IDS~ ~120 TWO_TURNS~ UNLESS ~TWO_TURNS~
APPEND ~GTIMES.IDS~ ~180 THREE_TURNS~ UNLESS ~THREE_TURNS~
APPEND ~GTIMES.IDS~ ~240 FOUR_TURNS~ UNLESS ~FOUR_TURNS~
APPEND ~GTIMES.IDS~ ~300 FIVE_TURNS~ UNLESS ~FIVE_TURNS~
APPEND ~GTIMES.IDS~ ~300 ONE_HOUR~ UNLESS ~ONE_HOUR~
APPEND ~GTIMES.IDS~ ~360 SIX_TURNS~ UNLESS ~SIX_TURNS~
APPEND ~GTIMES.IDS~ ~420 SEVEN_TURNS~ UNLESS ~SEVEN_TURNS~
APPEND ~GTIMES.IDS~ ~480 EIGHT_TURNS~ UNLESS ~EIGHT_TURNS~
APPEND ~GTIMES.IDS~ ~540 NINE_TURNS~ UNLESS ~NINE_TURNS~
APPEND ~GTIMES.IDS~ ~600 TEN_TURNS~ UNLESS ~TEN_TURNS~
APPEND ~GTIMES.IDS~ ~600 TWO_HOURS~ UNLESS ~TWO_HOURS~
APPEND ~GTIMES.IDS~ ~900 FIFTEEN_TURNS~ UNLESS ~FIFTEEN_TURNS~
APPEND ~GTIMES.IDS~ ~900 THREE_HOURS~ UNLESS ~THREE_HOURS~
APPEND ~GTIMES.IDS~ ~1200 FOUR_HOURS~ UNLESS ~FOUR_HOURS~
APPEND ~GTIMES.IDS~ ~1500 FIVE_HOURS~ UNLESS ~FIVE_HOURS~
APPEND ~GTIMES.IDS~ ~1800 SIX_HOURS~ UNLESS ~SIX_HOURS~
APPEND ~GTIMES.IDS~ ~2100 SEVEN_HOURS~ UNLESS ~SEVEN_HOURS~
APPEND ~GTIMES.IDS~ ~2400 EIGHT_HOURS~ UNLESS ~EIGHT_HOURS~
APPEND ~GTIMES.IDS~ ~2700 NINE_HOURS~ UNLESS ~NINE_HOURS~
APPEND ~GTIMES.IDS~ ~3000 TEN_HOURS~ UNLESS ~TEN_HOURS~
APPEND ~GTIMES.IDS~ ~3300 ELEVEN_HOURS~ UNLESS ~ELEVEN_HOURS~
APPEND ~GTIMES.IDS~ ~3600 TWELVE_HOURS~ UNLESS ~TWELVE_HOURS~
APPEND ~GTIMES.IDS~ ~7200 ONE_DAY~ UNLESS ~ONE_DAY~
APPEND ~GTIMES.IDS~ ~14400 TWO_DAYS~ UNLESS ~TWO_DAYS~
APPEND ~GTIMES.IDS~ ~21600 THREE_DAYS~ UNLESS ~THREE_DAYS~
APPEND ~GTIMES.IDS~ ~28800 FOUR_DAYS~ UNLESS ~FOUR_DAYS~
APPEND ~GTIMES.IDS~ ~36000 FIVE_DAYS~ UNLESS ~FIVE_DAYS~
APPEND ~GTIMES.IDS~ ~43200 SIX_DAYS~ UNLESS ~SIX_DAYS~
APPEND ~GTIMES.IDS~ ~50400 SEVEN_DAYS~ UNLESS ~SEVEN_DAYS~
APPEND ~GTIMES.IDS~ ~57600 EIGHT_DAYS~ UNLESS ~EIGHT_DAYS~
APPEND ~GTIMES.IDS~ ~64800 NINE_DAYS~ UNLESS ~NINE_DAYS~
APPEND ~GTIMES.IDS~ ~72000 TEN_DAYS~ UNLESS ~TEN_DAYS~
APPEND ~GTIMES.IDS~ ~79200 ELEVEN_DAYS~ UNLESS ~ELEVEN_DAYS~
APPEND ~GTIMES.IDS~ ~86400 TWELVE_DAYS~ UNLESS ~TWELVE_DAYS~
APPEND ~GTIMES.IDS~ ~93600 THIRTEEN_DAYS~ UNLESS ~THIRTEEN_DAYS~
APPEND ~GTIMES.IDS~ ~100800 FOURTEEN_DAYS~ UNLESS ~FOURTEEN_DAYS~
APPEND ~GTIMES.IDS~ ~108000 FIFTEEN_DAYS~ UNLESS ~FIFTEEN_DAYS~
APPEND ~GTIMES.IDS~ ~216000 THIRTY_DAYS~ UNLESS ~THIRTY_DAYS~
APPEND ~GTIMES.IDS~ ~360000 FIFTY_DAYS~ UNLESS ~FIFTY_DAYS~
// auto-extracted by Excel, didn't type them! same reason as above

ADD_SECTYPE ~TB#Paladinhood~ ~Lost virtuous abilities~
ADD_SECTYPE ~TB#SecondWind~ ~Second Wind triggered~

// ~Fix~ to the meteor swarm projectile.
COPY_EXISTING ~metswarm.pro~ ~override~
  WRITE_LONG 0x104 ~0x0000000000000000~
  WRITE_LONG 0x108 ~0x0000000000000000~


COPY_EXISTING     ~LUABBR.2DA~                  ~override/LUABBR.2DA~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  12   1 ~FMT~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  17   1 ~FMC~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  19   1 ~Ma2~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  20   1 ~Ma6~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  21   1 ~Ma5~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  22   1 ~Ma9~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  23   1 ~Ma8~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  24   1 ~Ma7~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  25   1 ~Ma3~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  26   1 ~Ma4~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  27   1 ~Fi2~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  28   1 ~Fi3~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  29   1 ~Fi4~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  30   1 ~Pa2~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  31   1 ~Pa3~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  32   1 ~Pa4~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  33   1 ~Ra2~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  34   1 ~Ra3~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  35   1 ~Ra4~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  36   1 ~Th2~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  37   1 ~Th3~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  38   1 ~Th4~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  39   1 ~Ba2~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  40   1 ~Ba3~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  41   1 ~Ba4~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  42   1 ~Dr2~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  43   1 ~Dr3~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  44   1 ~Dr4~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  45   1 ~Cl2~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  46   1 ~Cl3~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  47   1 ~Cl4~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  49   1 ~BRB~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  50   1 ~WMG~
SET_2DA_ENTRY_LATER ~_#_#_#lua~  51   1 ~SRC~
SET_2DA_ENTRIES_NOW ~_#_#_#lua~ 2 // don't pretty print the S_2_E_N/L since it's anyway 1 coloumn...

// LI#BARD1 is for all bards, excluding jesters. Also used by Greater War Cry.
// LI#BARD2 is for Jesters. Also used by Death Field.
// TG#ENES2 is used by Energy Storm. Also used by Druids' Whirlwind.
// TG#HOLA  is used by Holy Aura. Also used by Union.
ADD_PROJECTILE      ~refinements/Hlab/_pro/TG#SHOC.PRO~
ADD_PROJECTILE      ~refinements/Hlab/_pro/TG#TOXT.PRO~
ADD_PROJECTILE      ~refinements/Hlab/_pro/TG#ENES2.PRO~
ADD_PROJECTILE      ~refinements/Hlab/_pro/TG#ENES3.PRO~
ADD_PROJECTILE      ~refinements/Hlab/_pro/LI#BARD1.PRO~
ADD_PROJECTILE      ~refinements/Hlab/_pro/LI#BARD2.PRO~
ADD_PROJECTILE      ~refinements/Hlab/_pro/TG#HOLA.PRO~

// ~Updating~ Zone of Sweet Air:
APPEND  ~CLEARAIR.2DA~ ~ToxicTrap     TG#TOXT~
 COPY_EXISTING ~CLEARAIR.2DA~          ~override/CLEARAIR.2DA~
 REPLACE_TEXTUALLY ~TG#TOXT~ ~%TG#TOXT%~



// New portrait icons!
// Includes the fix for Spell Shield! The two corrected spells are in the
// ~refinements/Hlab/_shared/copy~ folder.
// COPY ~refinements/Hlab/_shared/STATDESC.2DA~     ~override/STATDESC.2DA~

APPEND  ~STATDESC.2DA~ ~166     AQUA
167     IDOL
168     SPIRF
169     SCION
170     CHANT
171     DRAGF
172     TIGS
173     CHANM
174     CRIPP
175     DIVSH
176     ENDU
177     GUARD
178     EXOR
179     LING
180     PREC
181     MERC
182     SPII
183     TKAI
184     SECW
185     INTI
186     AEGI
187     SHOL
188     FORS~
COPY_EXISTING ~STATDESC.2DA~     ~override/STATDESC.2DA~
REPLACE ~63873~   @274
REPLACE ~AQUA~    @414
REPLACE ~IDOL~    @400
REPLACE ~SPIRF~   @408
REPLACE ~SCION~   @416
REPLACE ~CHANT~   @186
REPLACE ~DRAGF~   @180
REPLACE ~TIGS~    @182
REPLACE ~CHANM~   @422
REPLACE ~CRIPP~   @141
REPLACE ~DIVSH~   @152
REPLACE ~ENDU~    @212
REPLACE ~GUARD~   @484
REPLACE ~EXOR~    @120
REPLACE ~LING~    @176
REPLACE ~PREC~    @462
REPLACE ~MERC~    @1016
REPLACE ~SPII~    @1012
REPLACE ~TKAI~    @444
REPLACE ~SECW~    @197
REPLACE ~INTI~    @192
REPLACE ~AEGI~    @130
REPLACE ~SHOL~    @126
REPLACE ~FORS~    @139
// S_2_E_L/N is slower with so small stuff
SET_2DA_ENTRY  124   1   2 8286
SET_2DA_ENTRY  74   1   2 26228


// Player's summoned critters in BP get their scripts changed.
// We don't want this to happen to *our* new precious scripts :)
// (Revised Celestials, Ancient Spirit, Elemental Princes)
ACTION_IF FILE_EXISTS_IN_GAME ~gb-summ.bcs~ THEN BEGIN
COPY_EXISTING_REGEXP GLOB ~gb-s.*\.bcs~ ~override~
  DECOMPILE_BCS_TO_BAF
    REPLACE_TEXTUALLY ~  !InParty(LastSeenBy(Myself))
  !Specifics(LastSeenBy(Myself),200)
  !Gender(LastSeenBy(Myself),MALE)
  !Gender(LastSeenBy(Myself),FEMALE)
  !Gender(LastSeenBy(Myself),ILLUSIONARY)
  !Allegiance(LastSeenBy(Myself),GOODBUTBLUE)
  !Allegiance(LastSeenBy(Myself),NEUTRAL)
  !Class(LastSeenBy(Myself),WIZARD_EYE)
  !HasItemEquiped("fammy",LastSeenBy(Myself))
  ~  ~!InParty(LastSeenBy(Myself))
  !Specifics(LastSeenBy(Myself),200)
  !Gender(LastSeenBy(Myself),MALE)
  !Gender(LastSeenBy(Myself),FEMALE)
  !Gender(LastSeenBy(Myself),ILLUSIONARY)
  !Allegiance(LastSeenBy(Myself),GOODBUTBLUE)
  !Allegiance(LastSeenBy(Myself),NEUTRAL)
  !Class(LastSeenBy(Myself),WIZARD_EYE)
  !HasItemEquiped("fammy",LastSeenBy(Myself))
  !HasItemEquiped("tg#solb",LastSeenBy(Myself))
  !HasItemEquiped("tg#plang",LastSeenBy(Myself))
  !HasItemEquiped("tg#devae",LastSeenBy(Myself))
  !HasItemEquiped("tg#devag",LastSeenBy(Myself))
  !HasItemEquiped("tg#spir",LastSeenBy(Myself))
  !HasItemEquiped("tg#benh",LastSeenBy(Myself))
  !HasItemEquiped("elemchan",LastSeenBy(Myself))
  !HasItemEquiped("elemsunn",LastSeenBy(Myself))
  !HasItemEquiped("elemzaam",LastSeenBy(Myself))
  ~
  COMPILE_BAF_TO_BCS
  END
  
/* shared files */

COPY ~refinements/Hlab/_anim~                   ~override~
COPY_EXISTING - ~xpcap.2da~   ~.../xpcap.2da~
                ~xplevel.2da~ ~.../xplevel.2da~
COPY ~refinements/Hlab/_shared/copy~            ~override~
COPY ~.../xpcap.2da~   ~override~
     ~.../xplevel.2da~ ~override~
COPY ~refinements/Hlab/_shared/TG#EVAS.SPL~     ~override/TG#EVAS.SPL~
SAY NAME1 @111
SAY NAME2 @111
SAY UNIDENTIFIED_DESC @112
COPY ~refinements/Hlab/_shared/LI#GCRY.SPL~     ~override/LI#GCRY.SPL~
WRITE_SHORT   0x98   ~%LI#BARD1%~
COPY ~refinements/Hlab/_shared/LI#SCR1.SPL~     ~override/LI#SCR1.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR2.SPL~     ~override/LI#SCR2.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR3.SPL~     ~override/LI#SCR3.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR4.SPL~     ~override/LI#SCR4.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR5.SPL~     ~override/LI#SCR5.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR6.SPL~     ~override/LI#SCR6.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR7.SPL~     ~override/LI#SCR7.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR8.SPL~     ~override/LI#SCR8.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR9.SPL~     ~override/LI#SCR9.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR10.SPL~     ~override/LI#SCR10.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR1B.SPL~     ~override/LI#SCR1B.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR3B.SPL~     ~override/LI#SCR3B.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR4B.SPL~     ~override/LI#SCR4B.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR5B.SPL~     ~override/LI#SCR5B.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR6B.SPL~     ~override/LI#SCR6B.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR7B.SPL~     ~override/LI#SCR7B.SPL~
SAY 0xce @113
SAY 0x12e @114
COPY ~refinements/Hlab/_shared/LI#SCR8B.SPL~     ~override/LI#SCR8B.SPL~
SAY 0xce @113
SAY 0x12e @114


COPY ~refinements/Hlab/_shared/LI#SCRB.SPL~     ~override/LI#SCRB.SPL~
SAY NAME1 @115
SAY NAME2 @115
SAY UNIDENTIFIED_DESC @116
COPY ~refinements/Hlab/_shared/TG#SCRB.SPL~     ~override/TG#SCRB.SPL~
SAY NAME1 @115
SAY NAME2 @115
SAY UNIDENTIFIED_DESC @117
COPY ~refinements/Hlab/_shared/LI#SCRT.SPL~     ~override/LI#SCRT.SPL~
SAY NAME1 @115
SAY NAME2 @115
SAY UNIDENTIFIED_DESC @118

COPY ~refinements/Hlab/_shared/SPCL917.SPL~     ~override/SPCL917.SPL~
SAY UNIDENTIFIED_DESC @119

/* New visuals for Whirlwinds and Smite. Dynamic code by the_bigg */

COPY_EXISTING ~spcl900.spl~ ~override~
               ~spcl901.spl~ ~override~
     READ_LONG 0x64 ext_off
     READ_LONG 0x6a eff_off
     READ_SHORT ext_off + 0x1e eff_cnt
     WRITE_SHORT ext_off + 0x1e eff_cnt + 1
     SET edit = 0
     WHILE (eff_cnt > 0) AND (edit = 0) BEGIN
           SET eff_cnt = eff_cnt - 1
           READ_SHORT eff_off + (eff_cnt * 0x30) opcode
           PATCH_IF opcode = 215 BEGIN
                    WRITE_BYTE eff_off + (eff_cnt * 0x30) + 2 1
                    WRITE_LONG eff_off + (eff_cnt * 0x30) + 8 1
                    WRITE_BYTE eff_off + (eff_cnt * 0x30) + 0xc 0
                    WRITE_BYTE eff_off + (eff_cnt * 0x30) + 0xe 1
                    WRITE_ASCII eff_off + (eff_cnt * 0x30) + 0x14 ~TG#WHIR1~
                    SET edit = 1
           END
     END
     INSERT_BYTES eff_off + ((eff_cnt + 1) * 0x30) 0x30
     SET copyloop = 0
     WHILE copyloop < 0x30 BEGIN
           READ_BYTE eff_off + (eff_cnt * 0x30) + copyloop copyme
           WRITE_BYTE eff_off + ((eff_cnt + 1) * 0x30) + copyloop copyme
           SET copyloop = copyloop + 1
     END
     WRITE_BYTE eff_off + ((eff_cnt + 1) * 0x30) + 0x1b 0x32 // 2 in ASCII


COPY_EXISTING ~spcl909.spl~ ~override~
    READ_LONG 0x64 ext_off
    READ_LONG 0x6a eff_off
    READ_SHORT ext_off + 0x1e eff_cnt
    SET edit = 0
    WHILE (eff_cnt > 0) AND (edit = 0) BEGIN
          SET eff_cnt = eff_cnt - 1
          READ_SHORT eff_off + (eff_cnt * 0x30) opcode
          PATCH_IF opcode = 215 BEGIN
                   WRITE_BYTE eff_off + (eff_cnt * 0x30) + 2 1
                   WRITE_LONG eff_off + (eff_cnt * 0x30) + 8 0
                   WRITE_ASCII eff_off + (eff_cnt * 0x30) + 0x14 ~SPGRWHRL~
                   SET edit = 1
          END
    END



/* Revised Celestials */
COPY ~refinements/Hlab/_celestials/_shared~     ~override~
COPY ~refinements/Hlab/_celestials/Deva~     ~override~
COPY ~refinements/Hlab/_celestials/Fallen Deva~     ~override~
COPY ~refinements/Hlab/_celestials/Fallen Planetar~     ~override~
COPY ~refinements/Hlab/_celestials/Fallen Solar~     ~override~
COPY ~refinements/Hlab/_celestials/Planetar~     ~override~
COPY ~refinements/Hlab/_celestials/Solar~     ~override~

COMPILE ~refinements/Hlab/_celestials/_scripts~ USING ~refinements/languages/%s/miscscripts.tra~

/* Paladin */

COPY ~refinements/Hlab/Paladin/copy~	 	~override~
COPY ~refinements/Hlab/Paladin/TG#EXOR.SPL~     ~override/TG#EXOR.SPL~
SAY NAME1 @120
SAY NAME2 @120
SAY UNIDENTIFIED_DESC @121
COPY ~refinements/Hlab/Paladin/TG#PURG.SPL~     ~override/TG#PURG.SPL~
SAY NAME1 @122
SAY NAME2 @122
SAY UNIDENTIFIED_DESC @123
COPY ~refinements/Hlab/Paladin/TG#RIGH.SPL~     ~override/TG#RIGH.SPL~
SAY NAME1 @124
SAY NAME2 @124
SAY UNIDENTIFIED_DESC @125
COPY ~refinements/Hlab/Paladin/TG#SHOL.SPL~     ~override/TG#SHOL.SPL~
SAY NAME1 @126
SAY NAME2 @126
SAY UNIDENTIFIED_DESC @127
COPY ~refinements/Hlab/Paladin/TG#HOLA.SPL~     ~override/TG#HOLA.SPL~
SAY NAME1 @128
SAY NAME2 @128
SAY UNIDENTIFIED_DESC @129
WRITE_BYTE 0x27 TB#Paladinhood
COPY ~refinements/Hlab/Paladin/TG#HOL1.SPL~     ~override/TG#HOL1.SPL~
WRITE_SHORT   0x98   ~%TG#HOLA%~

EXTEND_TOP ~Baldur.bcs~   ~refinements/Hlab/Paladin/FALLEN.BAF~
EXTEND_TOP ~Baldur25.bcs~   ~refinements/Hlab/Paladin/FALLEN.BAF~



/* Wizard */

COPY ~refinements/Hlab/Wizard/copy~	  	~override~
COPY ~refinements/Hlab/Wizard/TG#AEGI.SPL~	~override/TG#AEGI.SPL~
SAY NAME1 @130
SAY NAME2 @130
SAY UNIDENTIFIED_DESC @131
COPY ~refinements/Hlab/Wizard/TG#DTHF.SPL~	~override/TG#DTHF.SPL~
SAY NAME1 @132
SAY NAME2 @132
SAY UNIDENTIFIED_DESC @133
WRITE_SHORT   0x98   ~%LI#BARD2%~
COPY ~refinements/Hlab/Wizard/LI#DTHF.SPL~	~override/LI#DTHF.SPL~
WRITE_SHORT   0x98   ~%LI#BARD2%~
COPY ~refinements/Hlab/Wizard/LI#DTH2.SPL~	~override/LI#DTH2.SPL~
WRITE_SHORT   0x98   ~%LI#BARD2%~
COPY ~refinements/Hlab/Wizard/TG#BONU.SPL~	~override/TG#BONU.SPL~
SAY NAME1 @134
SAY NAME2 @134
SAY UNIDENTIFIED_DESC @135
COPY ~refinements/Hlab/Wizard/TG#CLEA.SPL~	~override/TG#CLEA.SPL~
SAY NAME1 @136
SAY NAME2 @136
SAY UNIDENTIFIED_DESC @137

COPY_EXISTING ~SPWI921.SPL~                     ~override/SPWI921.SPL~
SAY UNIDENTIFIED_DESC @138
COPY ~refinements/Hlab/Wizard/TG#COME.SPL~	~override/TG#COME.SPL~
SAY UNIDENTIFIED_DESC @294
COPY ~refinements/Hlab/Wizard/TG#DRGB.SPL~	~override/TG#DRGB.SPL~
SAY UNIDENTIFIED_DESC @293
COPY ~refinements/Hlab/Wizard/TG#FORS.SPL~	~override/TG#FORS.SPL~
SAY NAME1 @139
SAY NAME2 @139
SAY UNIDENTIFIED_DESC @140



/* Thief */

COPY ~refinements/Hlab/Thief/copy~	  	~override~
// ToBEx Assassin and Bounty Hunter
ACTION_IF FILE_EXISTS ~bgmain.exe~ THEN BEGIN
  COPY_EXISTING ~luth2.2da~ ~override~
                ~luth3.2da~ ~override~
    SET_2DA_ENTRY 11 1 10 AP_TG#USSC
    SET_2DA_ENTRY 11 4 10 1
    SET_2DA_ENTRY 11 5 10 99
    SET_2DA_ENTRY 11 6 10 1
    SET_2DA_ENTRY 12 1 10 GA_LI#SCRT
    SET_2DA_ENTRY 12 4 10 1
    SET_2DA_ENTRY 12 5 10 99
    SET_2DA_ENTRY 12 6 10 1
    SET_2DA_ENTRY 12 7 10 AP_TG#USSC
END
COPY ~refinements/Hlab/Thief/TG#CRIP.SPL~	~override/TG#CRIP.SPL~
SAY NAME1 @141
SAY NAME2 @141
SAY UNIDENTIFIED_DESC @142
SAY 0x5ae @143
COPY ~refinements/Hlab/Thief/TG#USSC.SPL~	~override/TG#USSC.SPL~
SAY NAME1 @144
SAY NAME2 @144
SAY UNIDENTIFIED_DESC @145
SAY 0xfe @146



/* Cleric */

COPY ~refinements/Hlab/Cleric/copy~	  	 ~override~
COPY ~refinements/Hlab/Cleric/TG#DSTR.ITM~	 ~override/TG#DSTR.ITM~
SAY NAME1 @150
SAY NAME2 @150
COPY ~refinements/Hlab/Cleric/TG#DSTR.SPL~	 ~override/TG#DSTR.SPL~
SAY NAME1 @150
SAY NAME2 @150
SAY UNIDENTIFIED_DESC @151
COPY ~refinements/Hlab/Cleric/TG#DIVN.SPL~	 ~override/TG#DIVN.SPL~
SAY NAME1 @152
SAY NAME2 @152
SAY UNIDENTIFIED_DESC @153
COPY ~refinements/Hlab/Cleric/TG#ENLI.SPL~	 ~override/TG#ENLI.SPL~
SAY NAME1 @154
SAY NAME2 @154
SAY UNIDENTIFIED_DESC @155
COPY ~refinements/Hlab/Cleric/TG#RECI.SPL~	 ~override/TG#RECI.SPL~
SAY NAME1 @156
SAY NAME2 @156
SAY UNIDENTIFIED_DESC @157
COPY ~refinements/Hlab/Cleric/TG#DI13.SPL~       ~override/TG#DI13.SPL~
SAY NAME1 @238
SAY NAME2 @238
COPY ~refinements/Hlab/Cleric/TG#DI12.SPL~       ~override/TG#DI12.SPL~
SAY NAME1 @239
SAY NAME2 @239
COPY ~refinements/Hlab/Cleric/LI#DIVI.BCS~       ~override/LI#DIVI.BCS~
REPLACE 99999240 @240
REPLACE 99999241 @241
REPLACE 99999242 @242
REPLACE 99999243 @243
REPLACE 99999244 @244
REPLACE 99999245 @245
REPLACE 99999246 @246
REPLACE 99999247 @247
REPLACE 99999248 @248
REPLACE 99999251 @251
REPLACE 99999256 @256
REPLACE 99999258 @258
REPLACE 99999262 @262
REPLACE 99999263 @263
COPY ~refinements/Hlab/Cleric/TG#DIV5.SPL~	 ~override/TG#DIV5.SPL~
SAY 0x45e @255
COPY ~refinements/Hlab/Cleric/LI#DIFA.SPL~	 ~override/LI#DIFA.SPL~
SAY 0x24e @1037
SAY 0x1ee @1011
COPY ~refinements/Hlab/Cleric/TG#DIVI.SPL~	 ~override/TG#DIVI.SPL~
SAY NAME1 @158
SAY NAME2 @158
SAY UNIDENTIFIED_DESC @159
COPY ~refinements/Hlab/Cleric/TG#AURA.SPL~	 ~override/TG#AURA.SPL~
SAY NAME1 @249
SAY NAME2 @249
COPY ~refinements/Hlab/Cleric/TG#DIVE.SPL~	 ~override/TG#DIVE.SPL~
SAY NAME1 @158
SAY NAME2 @158
SAY UNIDENTIFIED_DESC @250

COMPILE ~refinements/Hlab/Cleric/_scripts~ USING ~refinements/languages/%s/miscscripts.tra~



/* Druid */

COPY ~refinements/Hlab/Druid/copy~	  	 ~override~
COPY ~refinements/Hlab/Druid/TG#NATW.SPL~	 ~override/TG#NATW.SPL~
SAY NAME1 @160
SAY NAME2 @160
SAY UNIDENTIFIED_DESC @161
COPY ~refinements/Hlab/Druid/TG#TRAN.SPL~	 ~override/TG#TRAN.SPL~
SAY NAME1 @162
SAY NAME2 @162
SAY UNIDENTIFIED_DESC @163
COPY ~refinements/Hlab/Druid/TG#TRAA.SPL~	 ~override/TG#TRAA.SPL~
SAY NAME1 @162
COPY ~refinements/Hlab/Druid/TG#VOLC.SPL~	 ~override/TG#VOLC.SPL~
SAY NAME1 @164
SAY NAME2 @164
SAY UNIDENTIFIED_DESC @165
COPY ~refinements/Hlab/Druid/TG#ELSU.SPL~	 ~override/TG#ELSU.SPL~
SAY NAME1 @166
SAY NAME2 @166
SAY UNIDENTIFIED_DESC @167
COPY ~refinements/Hlab/Druid/TG#PRCA.SPL~	 ~override/TG#PRCA.SPL~
SAY NAME1 @168
SAY NAME2 @168
SAY UNIDENTIFIED_DESC @169
COPY ~refinements/Hlab/Druid/TG#BLON.SPL~	 ~override/TG#BLON.SPL~
SAY NAME1 @292
SAY NAME2 @292
SAY UNIDENTIFIED_DESC @291
SAY 0x1be @290

COPY ~refinements/Hlab/Druid/Princes/_shared~	  	 ~override~
COPY ~refinements/Hlab/Druid/Princes/Chan/copy~	  	 ~override~
COPY ~refinements/Hlab/Druid/Princes/Chan/TG#SUMC.SPL~	 ~override/TG#SUMC.SPL~
SAY NAME1 @279
SAY NAME2 @279
COPY ~refinements/Hlab/Druid/Princes/Sunnis/copy~	 ~override~
COPY ~refinements/Hlab/Druid/Princes/Sunnis/TG#SUMS.SPL~ ~override/TG#SUMS.SPL~
SAY NAME1 @278
SAY NAME2 @278
COPY ~refinements/Hlab/Druid/Princes/Zaaman/copy~	 ~override~
COPY ~refinements/Hlab/Druid/Princes/Zaaman/TG#SUMZ.SPL~ ~override/TG#SUMZ.SPL~
SAY NAME1 @277
SAY NAME2 @277
COPY ~refinements/Hlab/Druid/Princes/Ben/copy~	         ~override~
COPY ~refinements/Hlab/Druid/Princes/Ben/TG#SUMB.SPL~    ~override/TG#SUMB.SPL~
SAY NAME1 @287
SAY NAME2 @287
COPY ~refinements/Hlab/Druid/Princes/Ben/TG#BENH.cre~    ~override/TG#BENH.cre~
SAY NAME1 @288
SAY NAME2 @288
COPY ~refinements/Hlab/Druid/Princes/Ben/TG#WEL2.cre~    ~override/TG#WEL2.cre~
SAY NAME1 @289
SAY NAME2 @289
COPY ~refinements/Hlab/Druid/Princes/Ben/TG#BENG.SPL~    ~override/TG#BENG.SPL~
SAY NAME1 @286
SAY NAME2 @286
/*
COPY ~refinements/Hlab/Druid/Princes/Ben/ELEMBENH.BCS~    ~override/ELEMBENH.BCS~
REPLACE ~295~      @295
//STRING_SET ~72796~ @285
//STRING_SET ~72798~ @283
COPY_EXISTING ~elemchan.bcs~ ~override~
REPLACE ~72796~ @285
COPY_EXISTING ~elemsunn.bcs~ ~override~
REPLACE ~72798~ @283
*/
COMPILE ~refinements/Hlab/Druid/Princes/_scripts~ USING ~refinements/languages/%s/miscscripts.tra~

COPY ~refinements/Hlab/Druid/LI#IMPL.SPL~	 ~override/LI#IMPL.SPL~
SAY NAME1 @281
SAY NAME2 @281
SAY UNIDENTIFIED_DESC @280
COPY ~refinements/Hlab/Druid/LI#WHIR.SPL~	 ~override/LI#WHIR.SPL~
SAY NAME1 @276
SAY NAME2 @276
SAY UNIDENTIFIED_DESC @275
COPY ~refinements/Hlab/Druid/LI#WHIRB.SPL~	 ~override/LI#WHIRB.SPL~
WRITE_SHORT   0x98   TG#ENES2
COPY ~refinements/Hlab/Druid/LI#ELTR.SPL~	 ~override/LI#ELTR.SPL~
SAY NAME1 @274
SAY NAME2 @274
SAY UNIDENTIFIED_DESC @273

COPY ~refinements/Hlab/Druid/Elemental/copy~	         ~override~
ACTION_IF FILE_EXISTS ~tb#shap_alt.txt~ THEN BEGIN
  COPY ~refinements/shapefix/alt/LI#DRFIR.SPL~	 ~override/LI#DRFIR.SPL~
  SAY NAME1 @299
  SAY NAME2 @299
  COPY ~refinements/shapefix/alt/LI#DREAR.SPL~	 ~override/LI#DREAR.SPL~
  SAY NAME1 @298
  SAY NAME2 @298
  COPY ~refinements/shapefix/alt/LI#DRAIR.SPL~	 ~override/LI#DRAIR.SPL~
  SAY NAME1 @297
  SAY NAME2 @297
  COPY ~refinements/shapefix/alt/LI#DRWAT.SPL~	 ~override/LI#DRWAT.SPL~
  SAY NAME1 @296
  SAY NAME2 @296
END ELSE BEGIN
  COPY ~refinements/Hlab/Druid/Elemental/LI#DRFIR.SPL~	 ~override/LI#DRFIR.SPL~
  SAY NAME1 @299
  SAY NAME2 @299
  COPY ~refinements/Hlab/Druid/Elemental/LI#DREAR.SPL~	 ~override/LI#DREAR.SPL~
  SAY NAME1 @298
  SAY NAME2 @298
  COPY ~refinements/Hlab/Druid/Elemental/LI#DRAIR.SPL~	 ~override/LI#DRAIR.SPL~
  SAY NAME1 @297
  SAY NAME2 @297
  COPY ~refinements/Hlab/Druid/Elemental/LI#DRWAT.SPL~	 ~override/LI#DRWAT.SPL~
  SAY NAME1 @296
  SAY NAME2 @296
END




/* Bards */
/* Mostly a courtesy of aVENGER. Stuff is expanded and refined too. */

COPY ~refinements/Hlab/Bard/copy~	  	 ~override~
COPY ~refinements/Hlab/Bard/TG#MASS.SPL~	 ~override/TG#MASS.SPL~
SAY NAME1 @170
SAY NAME2 @170
SAY UNIDENTIFIED_DESC @171
COPY ~refinements/Hlab/Bard/TG#ENTH.SPL~	 ~override/TG#ENTH.SPL~
SAY NAME1 @172
SAY NAME2 @172
SAY UNIDENTIFIED_DESC @173
COPY ~refinements/Hlab/Bard/TG#SOUN.SPL~	 ~override/TG#SOUN.SPL~
SAY NAME1 @174
SAY NAME2 @174
SAY UNIDENTIFIED_DESC @175
COPY ~refinements/Hlab/Bard/TG#LI01.SPL~	 ~override/TG#LI01.SPL~
SAY NAME1 @176
SAY NAME2 @176
SAY UNIDENTIFIED_DESC @177
COPY ~refinements/Hlab/Bard/TG#BFLU.SPL~	 ~override/TG#BFLU.SPL~
SAY UNIDENTIFIED_DESC @178

APPEND  ~TOOLTIP.2DA~ ~TG#BFLU	 	  34625	       34582 	   7480~



/* Monk */

COPY ~refinements/Hlab/Monk/copy~	  	 ~override~
COPY ~refinements/Hlab/Monk/TG#BL03.SPL~	 ~override/TG#BL03.SPL~
SAY NAME1 @180
SAY NAME2 @180
SAY UNIDENTIFIED_DESC @181
COPY ~refinements/Hlab/Monk/TG#TIGS.SPL~	 ~override/TG#TIGS.SPL~
SAY NAME1 @182
SAY NAME2 @182
SAY UNIDENTIFIED_DESC @183
COPY ~refinements/Hlab/Monk/TG#BL09.SPL~	 ~override/TG#BL09.SPL~
SAY NAME1 @184
SAY NAME2 @184
SAY UNIDENTIFIED_DESC @185
SAY 0xce @196
COPY ~refinements/Hlab/Monk/TG#CHNT.SPL~	 ~override/TG#CHNT.SPL~
SAY NAME1 @186
SAY NAME2 @186
SAY UNIDENTIFIED_DESC @187
COPY ~refinements/Hlab/Monk/TG#REGE.SPL~	 ~override/TG#REGE.SPL~
SAY NAME1 @188
SAY NAME2 @188
SAY UNIDENTIFIED_DESC @189
COPY ~refinements/Hlab/Monk/TG#FAST.SPL~	 ~override/TG#FAST.SPL~
SAY NAME1 @190
SAY NAME2 @190
SAY UNIDENTIFIED_DESC @191
COPY ~refinements/Hlab/Monk/TG#INTI.SPL~	 ~override/TG#INTI.SPL~
SAY NAME1 @192
SAY NAME2 @192
SAY UNIDENTIFIED_DESC @193
/*
COPY ~refinements/Hlab/Monk/LI#INTI.SPL~	 ~override/LI#INTI.SPL~
WRITE_SHORT   0x98   ~%TG#INTI%~
COPY ~refinements/Hlab/Monk/TG#INT1.SPL~	 ~override/TG#INT1.SPL~
WRITE_SHORT   0x98   ~%TG#INTI%~
*/
COPY ~refinements/Hlab/Monk/TG#GEVA.SPL~	 ~override/TG#GEVA.SPL~
SAY NAME1 @194
SAY NAME2 @194
SAY UNIDENTIFIED_DESC @195
COPY ~refinements/Hlab/Monk/TG#SECW.SPL~	 ~override/TG#SECW.SPL~
SAY NAME1 @197
SAY NAME2 @197
SAY UNIDENTIFIED_DESC @198
WRITE_BYTE 0x27 TB#SecondWind
COPY ~refinements/Hlab/Monk/TG#SEC2.SPL~	 ~override/TG#SEC2.SPL~
SAY NAME1 @197
SAY NAME2 @197
WRITE_LONG 786 TB#SecondWind
COPY ~refinements/Hlab/Monk/TG#ETHE.SPL~	 ~override/TG#ETHE.SPL~
SAY NAME1 @220
SAY NAME2 @220
SAY UNIDENTIFIED_DESC @221
COPY ~refinements/Hlab/Monk/TG#DIAM.SPL~	 ~override/TG#DIAM.SPL~
SAY NAME1 @222
SAY NAME2 @222
SAY UNIDENTIFIED_DESC @223
COPY ~refinements/Hlab/Monk/TG#FINP.ITM~	 ~override/TG#FINP.ITM~
SAY NAME1 @224
SAY NAME2 @224
COPY ~refinements/Hlab/Monk/TG#FINP.SPL~	 ~override/TG#FINP.SPL~
SAY NAME1 @224
SAY NAME2 @224
SAY UNIDENTIFIED_DESC @225
COPY ~refinements/Hlab/Monk/TG#DIS2.SPL~	 ~override/TG#DIS2.SPL~
SAY 0x1be @226
COPY ~refinements/Hlab/Monk/TG#DISP.SPL~	 ~override/TG#DISP.SPL~
SAY NAME1 @226
SAY NAME2 @226
SAY UNIDENTIFIED_DESC @227

// Modified Quivering Palm (now pickable also from HLA table)
COPY ~refinements/Hlab/Monk/SPCL820.SPL~	 ~override/SPCL820.SPL~
SAY UNIDENTIFIED_DESC @228

// Changing Quivering Palm's save to a save vs. Death
COPY_EXISTING     ~QUIVVIS.EFF~                  ~override/QUIVVIS.EFF~
  WRITE_BYTE 0x40 4
COPY_EXISTING     ~SPCL820.EFF~                  ~override/SPCL820.EFF~
  WRITE_BYTE 0x40 4
  WRITE_BYTE 0x44 0



/* Barbarian */


COPY ~refinements/Hlab/Barbarian/copy~	  	 ~override~
COPY ~refinements/Hlab/Barbarian/TG#GCRY.SPL~	 ~override/TG#GCRY.SPL~
SAY NAME1 @200
SAY NAME2 @200
SAY UNIDENTIFIED_DESC @201
COPY ~refinements/Hlab/Barbarian/TG#HSKI.SPL~	 ~override/TG#HSKI.SPL~
SAY NAME1 @202
SAY NAME2 @202
SAY UNIDENTIFIED_DESC @203
COPY ~refinements/Hlab/Barbarian/TG#TLES.SPL~	 ~override/TG#TLES.SPL~
SAY NAME1 @204
SAY NAME2 @204
SAY UNIDENTIFIED_DESC @205
COPY ~refinements/Hlab/Barbarian/TG#RSKI.SPL~	 ~override/TG#RSKI.SPL~
SAY NAME1 @206
SAY NAME2 @206
SAY UNIDENTIFIED_DESC @207

/* Ranger */


COPY ~refinements/Hlab/Ranger/copy~	  	 ~override~
COPY ~refinements/Hlab/Ranger/TG#AMBI.SPL~	 ~override/TG#AMBI.SPL~
SAY NAME1 @210
SAY NAME2 @210
SAY UNIDENTIFIED_DESC @211
COPY ~refinements/Hlab/Ranger/TG#ENDU.SPL~	 ~override/TG#ENDU.SPL~
SAY NAME1 @212
SAY NAME2 @212
SAY UNIDENTIFIED_DESC @213

ACTION_IF !(MOD_IS_INSTALLED ~item_rev.tp2~ 0) THEN BEGIN
	COPY_EXISTING ~clck32.itm~ ~override~
		 SAY DESC @214
		 READ_LONG 0x6a eff_off
		 READ_SHORT 0x70 eff_cnt
		 WRITE_SHORT 0x70 eff_cnt + 1
		 SET edit = 0
		 WHILE (eff_cnt > 0) AND (edit = 0) BEGIN
			   SET eff_cnt = eff_cnt - 1
			   READ_SHORT eff_off + (eff_cnt * 0x30) opcode
			   PATCH_IF opcode = 305 BEGIN
						WRITE_LONG eff_off + (eff_cnt * 0x30) + 4 1
						WRITE_SHORT eff_off + (eff_cnt * 0x30) + 0xd 0 //no dispel, bypass resistance
						SET edit = 1
			   END
		 END
		 INSERT_BYTES eff_off + ((eff_cnt + 1) * 0x30) 0x30
		 SET copyloop = 0
		 WHILE copyloop < 0x30 BEGIN
			   READ_BYTE eff_off + (eff_cnt * 0x30) + copyloop copyme
			   WRITE_BYTE eff_off + ((eff_cnt + 1) * 0x30) + copyloop copyme
			   SET copyloop = copyloop + 1
		 END
		 WRITE_SHORT eff_off + ((eff_cnt + 1) * 0x30) 54
END

//COPY ~refinements/Hlab/Ranger/spcl922.spl~	 ~override/spcl922.spl~
COPY_EXISTING ~spcl922.spl~ ~override~
	READ_LONG  0x64 "abil_off" ELSE 0
	READ_SHORT 0x68 "abil_num" ELSE 0
	READ_LONG  0x6a "fx_off"	 ELSE 0
	SET "delta" = 0
	FOR (index = 0 ; index < abil_num ; index = index + 1) BEGIN
		READ_SHORT ("%abil_off%" + 0x1e + (0x28 * "%index%")) "abil_fx_num"
		READ_SHORT ("%abil_off%" + 0x20 + (0x28 * "%index%")) "abil_fx_idx"
		SET "abil_fx_idx" = ("%abil_fx_idx%" + "%delta%")
		WRITE_SHORT ("%abil_off%" + 0x20 + (0x28 * "%index%")) "%abil_fx_idx%"
		INSERT_BYTES						("%fx_off%" + 			 (0x30 * ("%abil_fx_idx%"))) 0x30 // new effect
			WRITE_SHORT ("%fx_off%" + 0x00 + (0x30 * ("%abil_fx_idx%"))) 146 // cast spell
			WRITE_BYTE  ("%fx_off%" + 0x02 + (0x30 * ("%abil_fx_idx%"))) 1   // on self
			WRITE_BYTE  ("%fx_off%" + 0x03 + (0x30 * ("%abil_fx_idx%"))) 10  // power
			WRITE_LONG  ("%fx_off%" + 0x04 + (0x30 * ("%abil_fx_idx%"))) 10  // level
			WRITE_LONG  ("%fx_off%" + 0x08 + (0x30 * ("%abil_fx_idx%"))) 1   // Instantly? = yes
			WRITE_BYTE  ("%fx_off%" + 0x0c + (0x30 * ("%abil_fx_idx%"))) 1   // Timing = permanent until death
			WRITE_BYTE  ("%fx_off%" + 0x12 + (0x30 * ("%abil_fx_idx%"))) 100 // Probability
			WRITE_ASCII ("%fx_off%" + 0x14 + (0x30 * ("%abil_fx_idx%"))) ~tg#tra1~ // Probability
		SET "delta" = "%delta%" + 1
		SET "abil_fx_num" = "%abil_fx_num%" + 1
		WRITE_SHORT ("%abil_off%" + 0x1e + (0x28 * "%index%")) "%abil_fx_num%"
	END
	SAY NAME1 @215
	SAY NAME2 @215
	SAY UNIDENTIFIED_DESC @216


//correcting vampires who are wrongly listed as race 126 instead of 125. That means that Minsc is slightly stronger against the one in Korgan & Edwin dungeon.
ACTION_IF FILE_EXISTS ~nevm4.cre~
  THEN BEGIN COPY_EXISTING ~nevm4.cre~ ~override~ WRITE_BYTE 0x272 125 END
ACTION_IF FILE_EXISTS ~vampyf01.cre~
  THEN BEGIN COPY_EXISTING ~vampyf01.cre~ ~override~ WRITE_BYTE 0x272 125 END

COPY ~refinements/Hlab/ranger/tb#hate.spl~ ~override~
SAY NAME1 @217
SAY NAME1 @217
SAY UNIDENTIFIED_DESC @218






/* Kit Specific spells/abilities */
/* specialist mages: */

COPY ~refinements/Hlab/Wizard/LI#MICL.SPL~	~override/LI#MICL.SPL~
SAY NAME1 @301
SAY NAME2 @301
SAY UNIDENTIFIED_DESC @302
SAY 0x18e @303
SAY 0x1be @303
SAY 0x1ee @303
COPY ~refinements/Hlab/Wizard/LI#REV2.SPL~	~override/LI#REV2.SPL~
SAY NAME1 @304
COPY ~refinements/Hlab/Wizard/LI#REVE.SPL~	~override/LI#REVE.SPL~
SAY NAME1 @304
SAY NAME2 @304
SAY UNIDENTIFIED_DESC @305
COPY ~refinements/Hlab/Wizard/LI#REV3.SPL~	~override/LI#REV3.SPL~
SAY NAME1 @306
COPY ~refinements/Hlab/Wizard/LI#RUNE.SPL~	~override/LI#RUNE.SPL~
SAY NAME1 @307
SAY NAME2 @307
SAY UNIDENTIFIED_DESC @308
COPY ~refinements/Hlab/Wizard/TG#BONE.SPL~	~override/TG#BONE.SPL~
SAY NAME1 @309
SAY NAME2 @309
SAY UNIDENTIFIED_DESC @310
COPY ~refinements/Hlab/Wizard/bonefsu.cre~	~override/bonefsu.cre~
SAY NAME1 @311
SAY NAME2 @311
COPY ~refinements/Hlab/Wizard/bonesu2.cre~	~override/bonesu2.cre~
SAY NAME1 @312
SAY NAME2 @312
// The next one in truth is used by clerics (this one must attack everyone!)
COPY ~refinements/Hlab/Wizard/LI#APBN.cre~	~override/LI#APBN.cre~
SAY NAME1 @312
SAY NAME2 @312
COPY ~refinements/Hlab/Wizard/CA#SPWO.SPL~	~override/CA#SPWO.SPL~
SAY NAME1 @313
SAY NAME2 @313
SAY UNIDENTIFIED_DESC @314
COPY ~refinements/Hlab/Wizard/CA#WSTR.SPL~	~override/CA#WSTR.SPL~
SAY NAME1 @315
SAY NAME2 @315
SAY UNIDENTIFIED_DESC @316
COPY ~refinements/Hlab/Wizard/TG#DARP.SPL~	~override/TG#DARP.SPL~
SAY NAME1 @317
SAY NAME2 @317
SAY UNIDENTIFIED_DESC @318
COPY ~refinements/Hlab/Wizard/TG#MAG1.SPL~	~override/TG#MAG1.SPL~
SAY NAME1 @404
SAY NAME2 @404
COPY ~refinements/Hlab/Wizard/TG#MAGG.SPL~	~override/TG#MAGG.SPL~
SAY NAME1 @319
SAY NAME2 @319
SAY UNIDENTIFIED_DESC @320
COPY ~refinements/Hlab/Wizard/TG#GMAL.SPL~	~override/TG#GMAL.SPL~
SAY NAME1 @321
SAY NAME2 @321
SAY UNIDENTIFIED_DESC @322
COPY ~refinements/Hlab/Wizard/TG#GOLE.SPL~	~override/TG#GOLE.SPL~
SAY NAME1 @323
SAY NAME2 @323
SAY UNIDENTIFIED_DESC @324
COPY ~refinements/Hlab/Wizard/TG#ADAM.SPL~	~override/TG#ADAM.SPL~
SAY NAME1 @325
SAY NAME2 @325
SAY UNIDENTIFIED_DESC @326



/* Thief Kits */

COPY ~refinements/Hlab/Thief/TG#NPOI.SPL~	~override/TG#NPOI.SPL~
SAY NAME1 @350
SAY NAME2 @350
SAY UNIDENTIFIED_DESC @351
COPY ~refinements/Hlab/Thief/TG#ACRO.SPL~	~override/TG#ACRO.SPL~
SAY NAME1 @352
SAY NAME2 @352
SAY UNIDENTIFIED_DESC @353
COPY ~refinements/Hlab/Thief/TG#TRAC.SPL~	~override/TG#TRAC.SPL~
SAY NAME1 @354
SAY NAME2 @354
SAY UNIDENTIFIED_DESC @355
COPY ~refinements/Hlab/Thief/TG#BRPO.SPL~	~override/TG#BRPO.SPL~
SAY NAME1 @356
SAY NAME2 @356
SAY UNIDENTIFIED_DESC @357
COPY ~refinements/Hlab/Thief/TG#TOXT.SPL~	~override/TG#TOXT.SPL~
SAY NAME1 @358
SAY NAME2 @358
SAY UNIDENTIFIED_DESC @359
COPY ~refinements/Hlab/Thief/TG#TOXB.SPL~	~override/TG#TOXB.SPL~
WRITE_SHORT   0x98   TG#TOXT


// Poisons. Strings' numbers ~stealt~ from the first positions :(
COPY ~refinements/Hlab/Thief/brewpois/LI#BPOI.BCS~       ~override/LI#BPOI.BCS~
REPLACE 82 @82

COPY ~refinements/Hlab/Thief/brewpois/LI#BR01.SPL~	~override/LI#BR01.SPL~
SAY NAME1 @99
SAY NAME2 @99
COPY ~refinements/Hlab/Thief/brewpois/TG#BR01.SPL~	~override/TG#BR01.SPL~
SAY 0x12e @83
COPY ~refinements/Hlab/Thief/brewpois/TG#BRP1.ITM~	~override/TG#BRP1.ITM~
SAY NAME2 @99
SAY DESC @98

COPY ~refinements/Hlab/Thief/brewpois/LI#BR02.SPL~	~override/LI#BR02.SPL~
SAY NAME1 @97
SAY NAME2 @97
COPY ~refinements/Hlab/Thief/brewpois/TG#BR02.SPL~	~override/TG#BR02.SPL~
SAY 0x12e @83
COPY ~refinements/Hlab/Thief/brewpois/TG#BRP2.ITM~	~override/TG#BRP2.ITM~
SAY NAME2 @97
SAY DESC @96

COPY ~refinements/Hlab/Thief/brewpois/LI#BR03.SPL~	~override/LI#BR03.SPL~
SAY NAME1 @95
SAY NAME2 @95
COPY ~refinements/Hlab/Thief/brewpois/TG#BR03.SPL~	~override/TG#BR03.SPL~
SAY 0x12e @83
COPY ~refinements/Hlab/Thief/brewpois/TG#BRP3.ITM~	~override/TG#BRP3.ITM~
SAY NAME2 @95
SAY DESC @94

COPY ~refinements/Hlab/Thief/brewpois/LI#BR04.SPL~	~override/LI#BR04.SPL~
SAY NAME1 @93
SAY NAME2 @93
COPY ~refinements/Hlab/Thief/brewpois/TG#BR04.SPL~	~override/TG#BR04.SPL~
SAY 0x12e @83
COPY ~refinements/Hlab/Thief/brewpois/TG#BRP4.ITM~	~override/TG#BRP4.ITM~
SAY NAME2 @93
SAY DESC @92

COPY ~refinements/Hlab/Thief/brewpois/LI#BR05.SPL~	~override/LI#BR05.SPL~
SAY NAME1 @91
SAY NAME2 @91
COPY ~refinements/Hlab/Thief/brewpois/TG#BR05.SPL~	~override/TG#BR05.SPL~
SAY 0x12e @83
COPY ~refinements/Hlab/Thief/brewpois/TG#BRP5.ITM~	~override/TG#BRP5.ITM~
SAY NAME2 @91
SAY DESC @90

COPY ~refinements/Hlab/Thief/brewpois/LI#BR06.SPL~	~override/LI#BR06.SPL~
SAY NAME1 @89
SAY NAME2 @89
COPY ~refinements/Hlab/Thief/brewpois/TG#BR06.SPL~	~override/TG#BR06.SPL~
SAY 0x12e @83
COPY ~refinements/Hlab/Thief/brewpois/TG#BRP6.ITM~	~override/TG#BRP6.ITM~
SAY NAME2 @89
SAY DESC @88

COPY ~refinements/Hlab/Thief/brewpois/LI#BR07.SPL~	~override/LI#BR07.SPL~
SAY NAME1 @87
SAY NAME2 @87
COPY ~refinements/Hlab/Thief/brewpois/TG#BR07.SPL~	~override/TG#BR07.SPL~
SAY 0x12e @83
COPY ~refinements/Hlab/Thief/brewpois/TG#BRP7.ITM~	~override/TG#BRP7.ITM~
SAY NAME2 @87
SAY DESC @86

COPY ~refinements/Hlab/Thief/brewpois/LI#BR08.SPL~	~override/LI#BR08.SPL~
SAY NAME1 @85
SAY NAME2 @85
COPY ~refinements/Hlab/Thief/brewpois/TG#BR08.SPL~	~override/TG#BR08.SPL~
SAY 0x12e @83
COPY ~refinements/Hlab/Thief/brewpois/TG#BRP8.ITM~	~override/TG#BRP8.ITM~
SAY NAME2 @85
SAY DESC @84



/* Bard Kits */


COPY ~refinements/Hlab/Bard/TG#AMB2.SPL~	~override/TG#AMB2.SPL~
SAY NAME1 @370
SAY NAME2 @370
SAY UNIDENTIFIED_DESC @371
COPY ~refinements/Hlab/Bard/TG#SWSP.SPL~	~override/TG#SWSP.SPL~
SAY NAME1 @372
SAY NAME2 @372
SAY UNIDENTIFIED_DESC @373
COPY ~refinements/Hlab/Bard/TG#BWSP.SPL~	~override/TG#BWSP.SPL~
SAY NAME1 @374
SAY NAME2 @374
SAY UNIDENTIFIED_DESC @375
COPY ~refinements/Hlab/Bard/TG#EN03.SPL~	~override/TG#EN03.SPL~
SAY NAME1 @376
SAY NAME2 @376
SAY UNIDENTIFIED_DESC @377
COPY ~refinements/Hlab/Bard/TG#LI03.SPL~	~override/TG#LI03.SPL~
SAY NAME1 @378
SAY NAME2 @378
SAY UNIDENTIFIED_DESC @379
COPY ~refinements/Hlab/Bard/TG#EN02.SPL~	~override/TG#EN02.SPL~
SAY NAME1 @380
SAY NAME2 @380
SAY UNIDENTIFIED_DESC @381
COPY ~refinements/Hlab/Bard/TG#LI02.SPL~	~override/TG#LI02.SPL~
SAY NAME1 @382
SAY NAME2 @382
SAY UNIDENTIFIED_DESC @383
COPY ~refinements/Hlab/Bard/LI#EN01.SPL~	~override/LI#EN01.SPL~
SAY NAME1 @384
SAY NAME2 @384
SAY UNIDENTIFIED_DESC @385
COPY ~refinements/Hlab/Bard/TG#BFL2.SPL~	~override/TG#BFL2.SPL~
SAY NAME1 @386
SAY NAME2 @386
SAY UNIDENTIFIED_DESC @387
COPY ~refinements/Hlab/Bard/LI#FINE.SPL~	~override/LI#FINE.SPL~
SAY NAME1 @388
SAY NAME2 @388
SAY UNIDENTIFIED_DESC @389
SAY 0xfe @390

// New projectiles additions (actually not only for kits..)
COPY ~refinements/Hlab/Bard/TG#LIN1.SPL~         ~override/TG#LIN1.SPL~ 
WRITE_SHORT   0x98   LI#BARD1
COPY ~refinements/Hlab/Bard/TG#LIN2.SPL~         ~override/TG#LIN2.SPL~
WRITE_SHORT   0x98   LI#BARD2
COPY ~refinements/Hlab/Bard/TG#LIN3.SPL~         ~override/TG#LIN3.SPL~
WRITE_SHORT   0x98   LI#BARD1



/* Sorcerer */

STRING_SET ~45866~ @430
COPY ~refinements/Hlab/Sorcerer/copy~	  	~override~
COPY ~refinements/Hlab/Sorcerer/TG#IDOF.SPL~	~override/TG#IDOF.SPL~
SAY 0x3ce @431
SAY 0x3fe @431
SAY NAME1 @400
SAY NAME2 @400
SAY UNIDENTIFIED_DESC @401
COPY ~refinements/Hlab/Sorcerer/TG#SSPR.SPL~	~override/TG#SSPR.SPL~
SAY NAME1 @402
SAY NAME2 @402
SAY UNIDENTIFIED_DESC @403
COPY ~refinements/Hlab/Sorcerer/TG#SSHA.SPL~	~override/TG#SSHA.SPL~
SAY NAME1 @404
SAY NAME2 @404
SAY UNIDENTIFIED_DESC @405
COPY ~refinements/Hlab/Sorcerer/TG#SRES.SPL~	~override/TG#SRES.SPL~
SAY NAME1 @406
SAY NAME2 @406
SAY UNIDENTIFIED_DESC @407
COPY ~refinements/Hlab/Sorcerer/LI#SRES.SPL~	~override/LI#SRES.SPL~
SAY 0x9e @413
COPY ~refinements/Hlab/Sorcerer/TG#SPOF.SPL~	~override/TG#SPOF.SPL~
SAY 0x48e @432
SAY 0x4be @432
SAY NAME1 @408
SAY NAME2 @408
SAY UNIDENTIFIED_DESC @409
COPY ~refinements/Hlab/Sorcerer/TG#SINF.SPL~	~override/TG#SINF.SPL~
SAY NAME1 @410
SAY NAME2 @410
SAY UNIDENTIFIED_DESC @411
SAY 0x12e @412
// @413 USED
COPY ~refinements/Hlab/Sorcerer/TG#AQUA.SPL~	~override/TG#AQUA.SPL~
SAY 0x51e @433
SAY 0x54e @433
SAY NAME1 @414
SAY NAME2 @414
SAY UNIDENTIFIED_DESC @415
COPY ~refinements/Hlab/Sorcerer/TG#SCST.SPL~	~override/TG#SCST.SPL~
SAY 0x48e @434
SAY 0x4be @434
SAY NAME1 @416
SAY NAME2 @416
SAY UNIDENTIFIED_DESC @417
COPY ~refinements/Hlab/Sorcerer/TG#SPSP.SPL~	~override/TG#SPSP.SPL~
SAY NAME1 @418
SAY NAME2 @418
SAY UNIDENTIFIED_DESC @419
COPY ~refinements/Hlab/Sorcerer/TG#ENES.SPL~	~override/TG#ENES.SPL~
SAY NAME1 @420
SAY NAME2 @420
SAY UNIDENTIFIED_DESC @421
COPY ~refinements/Hlab/Sorcerer/TG#CHAM.SPL~	~override/TG#CHAM.SPL~
SAY NAME1 @422
SAY NAME2 @422
SAY UNIDENTIFIED_DESC @423
COPY ~refinements/Hlab/Sorcerer/TG#CAAW.SPL~	~override/TG#CAAW.SPL~
SAY NAME1 @424
SAY NAME2 @424
SAY UNIDENTIFIED_DESC @425
COPY ~refinements/Hlab/Sorcerer/LI#AUCL.SPL~	~override/LI#AUCL.SPL~
SAY NAME1 @426
SAY NAME2 @426
SAY UNIDENTIFIED_DESC @427
COPY ~refinements/Hlab/Sorcerer/TG#ENE2.SPL~	~override/TG#ENE2.SPL~
WRITE_SHORT   0x98   TG#ENES2
COPY ~refinements/Hlab/Sorcerer/TG#ENE4.SPL~	~override/TG#ENE4.SPL~
WRITE_SHORT   0x98   TG#ENES3
// @431-@434 USED
COPY ~refinements/Hlab/Sorcerer/TG#SHOC.SPL~	~override/TG#SHOC.SPL~
SAY NAME1 @435
SAY NAME2 @435
SAY UNIDENTIFIED_DESC @436
WRITE_SHORT   0x98   TG#SHOC


// Robe of Vecna ~nerfed~ for sorcerers. Code by the_bigg.
ACTION_IF !(MOD_IS_INSTALLED ~item_rev.tp2~ 0) THEN BEGIN
	COPY_EXISTING ~wa2robe.itm~ ~override~
		READ_LONG 0x6a offeff
		READ_SHORT 0x6e offequipeff
		READ_SHORT 0x70 countequipeff
		WRITE_SHORT 0x70 countequipeff + 1
		SET myeffoff = offeff + offequipeff * 0x30
		INSERT_BYTES myeffoff 0x30
		WRITE_SHORT myeffoff 0xb1
		WRITE_BYTE myeffoff + 2 1
		WRITE_BYTE myeffoff + 3 1
		WRITE_LONG myeffoff + 4 19
		WRITE_LONG myeffoff + 8 5
		WRITE_BYTE myeffoff + 0xc 2
		WRITE_BYTE myeffoff + 0x12 100
		WRITE_ASCII myeffoff + 0x14 ~TB#VECNA~
		SAY DESC @437
END

COPY ~refinements/Hlab/Sorcerer/tb#vecna.eff~ ~override~




/* Fighter + Figther Kits */

COPY ~refinements/Hlab/Fighter/copy~	  	~override~
COPY ~refinements/Hlab/Fighter/TG#GCR2.SPL~	~override/TG#GCR2.SPL~
SAY NAME1 @440
SAY NAME2 @440
SAY UNIDENTIFIED_DESC @441
COPY ~refinements/Hlab/Fighter/TG#WIZS.SPL~	~override/TG#WIZS.SPL~
SAY NAME1 @442
SAY NAME2 @442
SAY UNIDENTIFIED_DESC @443
COPY ~refinements/Hlab/Fighter/TG#GKAI.SPL~	~override/TG#GKAI.SPL~
SAY NAME1 @444
SAY NAME2 @444
SAY UNIDENTIFIED_DESC @445
COPY ~refinements/Hlab/Fighter/TG#IMCR.SPL~	~override/TG#IMCR.SPL~
SAY NAME1 @446
SAY NAME2 @446
SAY UNIDENTIFIED_DESC @447
COPY ~refinements/Hlab/Fighter/TG#TOUG.spl~	~override/TG#TOUG.spl~
SAY NAME1 @448
SAY NAME2 @448
SAY UNIDENTIFIED_DESC @449



/* Paladin Kits */

COPY ~refinements/Hlab/Paladin/TG#VIRT.SPL~	~override/TG#VIRT.SPL~
SAY NAME1 @450
SAY NAME2 @450
SAY UNIDENTIFIED_DESC @451
WRITE_BYTE 0x27 TB#Paladinhood
COPY ~refinements/Hlab/Paladin/TG#CIOL.SPL~	~override/TG#CIOL.SPL~
SAY NAME1 @452
SAY NAME2 @452
SAY UNIDENTIFIED_DESC @453
COPY ~refinements/Hlab/Paladin/TG#SMUN.SPL~	~override/TG#SMUN.SPL~
SAY NAME1 @454
SAY NAME2 @454
SAY UNIDENTIFIED_DESC @455



/* Ranger Kits */

COPY ~refinements/Hlab/Ranger/TG#ANIM.SPL~	~override/TG#ANIM.SPL~
SAY NAME1 @460
SAY NAME2 @460
SAY UNIDENTIFIED_DESC @461
COPY ~refinements/Hlab/Ranger/TG#PREC.SPL~	~override/TG#PREC.SPL~
SAY NAME1 @462
SAY NAME2 @462
SAY UNIDENTIFIED_DESC @463
SAY 0x15e @51
COPY ~refinements/Hlab/Ranger/TG#STAL.SPL~	~override/TG#STAL.SPL~
SAY NAME1 @464
SAY NAME2 @464
SAY UNIDENTIFIED_DESC @465



/* Druid Kits */

COPY ~refinements/Hlab/Druid/TG#COMD.SPL~	~override/TG#COMD.SPL~
SAY NAME1 @470
SAY NAME2 @470
SAY UNIDENTIFIED_DESC @471
COPY ~refinements/Hlab/Druid/TG#FERA.SPL~	~override/TG#FERA.SPL~
SAY NAME1 @472
SAY NAME2 @472
SAY UNIDENTIFIED_DESC @473
COPY ~refinements/Hlab/Druid/TG#SPIR.cre~      ~override/TG#SPIR.cre~ 
SAY NAME1 @475
SAY NAME2 @475
COPY ~refinements/Hlab/Druid/TG#SPIR.SPL~       ~override/TG#SPIR.SPL~
SAY NAME1 @475
SAY NAME2 @475
SAY UNIDENTIFIED_DESC @476
SAY DESC @476
COMPILE ~refinements/Hlab/Druid/tb#spir.baf~ USING ~refinements/languages/%s/miscscripts.tra~



/* Cleric Kits */

COPY ~refinements/Hlab/Cleric/TG#CIO2.SPL~	~override/TG#CIO2.SPL~
SAY NAME1 @480
SAY NAME2 @480
SAY UNIDENTIFIED_DESC @481
COPY ~refinements/Hlab/Cleric/TG#CHAOS.ITM~	~override/TG#CHAOS.ITM~
SAY NAME1 @482
SAY NAME2 @482
COPY ~refinements/Hlab/Cleric/TG#CHAO.SPL~	~override/TG#CHAO.SPL~
SAY NAME1 @482
SAY NAME2 @482
SAY UNIDENTIFIED_DESC @483
COPY ~refinements/Hlab/Cleric/TG#GANG.SPL~	~override/TG#GANG.SPL~
SAY NAME1 @484
SAY NAME2 @484
SAY UNIDENTIFIED_DESC @485
SAY 0x9e @486



/* Multiclasses */

COPY ~refinements/Hlab/Multiclass/copy~	         ~override~
COPY ~refinements/Hlab/Multiclass/TG#COMR.SPL~	 ~override/TG#COMR.SPL~
SAY NAME1 @500
SAY NAME2 @500
SAY UNIDENTIFIED_DESC @501
COPY ~refinements/Hlab/Multiclass/TG#FERL.SPL~	 ~override/TG#FERL.SPL~
SAY NAME1 @502
SAY NAME2 @502
SAY UNIDENTIFIED_DESC @503
COPY ~refinements/Hlab/Multiclass/TG#MDRE.SPL~	 ~override/TG#MDRE.SPL~
SAY NAME1 @504
SAY NAME2 @504
SAY UNIDENTIFIED_DESC @505
COPY ~refinements/Hlab/Multiclass/TG#SLIP.SPL~	 ~override/TG#SLIP.SPL~
SAY NAME1 @506
SAY NAME2 @506
SAY UNIDENTIFIED_DESC @507
COPY ~refinements/Hlab/Multiclass/TG#DINV.SPL~	 ~override/TG#DINV.SPL~
SAY NAME1 @508
SAY NAME2 @508
SAY UNIDENTIFIED_DESC @509
COPY ~refinements/Hlab/Multiclass/LI#COPR.SPL~	 ~override/LI#COPR.SPL~
SAY NAME1 @510
SAY NAME2 @510
SAY UNIDENTIFIED_DESC @511
COPY ~refinements/Hlab/Multiclass/TG#UNIO.SPL~	 ~override/TG#UNIO.SPL~
SAY NAME1 @512
SAY NAME2 @512
// ToBEx 'Apply Casting Level Bonus' check
PATCH_IF FILE_EXISTS ~bgmain.exe~ THEN BEGIN
  SAY UNIDENTIFIED_DESC @513
END ELSE BEGIN
  SAY UNIDENTIFIED_DESC @514
END
COPY ~refinements/Hlab/Multiclass/LI#UNIO.SPL~	 ~override/LI#UNIO.SPL~
WRITE_SHORT   0x98   TG#HOLA

COPY_EXISTING ~LI#FLPA.SPL~ ~override~
WRITE_LONG 450 TB#Paladinhood

ACTION_IF !(FILE_EXISTS ~bgmain.exe~)
THEN BEGIN
    PRINT @524
END
