//Add files if missing

ACTION_IF !(FILE_EXISTS_IN_GAME ~CRIPPSTR.2DA~) BEGIN
  COPY ~ExpandedClasses/files/CRIPPSTR.2DA~ ~override~
END

ACTION_IF !(FILE_EXISTS_IN_GAME ~SNEAKATT.2DA~) BEGIN
  COPY ~ExpandedClasses/files/SNEAKATT.2DA~ ~override~
END

ACTION_IF !(FILE_EXISTS_IN_GAME ~backstab.SPL~) BEGIN
  COPY ~ExpandedClasses/files/backstab.SPL~ ~override~
END



//fix lines for some Expanded Classes kits
//these lines were causing some issues (including for ADD_KIT_EX)
//this will set these lines to 40, with corrected numbers

ACTION_IF !(MOD_IS_INSTALLED ~d2-modfixes.tp2~ 2) BEGIN    // skip if expanded classes component is installed

//Kensai (Thief)
ACTION_IF FILE_EXISTS ~override/CLABUSKT.2DA~ BEGIN
  COPY_EXISTING ~BACKSTAB.2DA~ ~override~
    LPF 2da_find_row_delete STR_VAR row_name = ~USKT00~ RET row_number columns END
    INSERT_2DA_ROW row_number columns ~USKT00 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4~
    PRETTY_PRINT_2DA
  BUT_ONLY
  
  COPY_EXISTING ~CRIPPSTR.2DA~ ~override~
    LPF 2da_find_row_delete STR_VAR row_name = ~USKT00~ RET row_number columns END
    INSERT_2DA_ROW row_number columns ~USKT00 0 0 0 0 0 0 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6~
    PRETTY_PRINT_2DA
  BUT_ONLY
  
  COPY_EXISTING ~SNEAKATT.2DA~ ~override~
    LPF 2da_find_row_delete STR_VAR row_name = ~USKT00~ RET row_number columns END
    INSERT_2DA_ROW row_number columns ~USKT00 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7~
    PRETTY_PRINT_2DA
  BUT_ONLY
END

//Vampyre
ACTION_IF FILE_EXISTS ~override/CLABUSVA.2DA~ BEGIN
  COPY_EXISTING ~BACKSTAB.2DA~ ~override~
    LPF 2da_find_row_delete STR_VAR row_name = ~USVA00~ RET row_number columns END
    INSERT_2DA_ROW row_number columns ~USVA00 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2~
    PRETTY_PRINT_2DA
  BUT_ONLY
  
  COPY_EXISTING ~CRIPPSTR.2DA~ ~override~
    LPF 2da_find_row_delete STR_VAR row_name = ~USVA00~ RET row_number columns END
    INSERT_2DA_ROW row_number columns ~USVA00 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3~
    PRETTY_PRINT_2DA
  BUT_ONLY
  
  COPY_EXISTING ~SNEAKATT.2DA~ ~override~
    LPF 2da_find_row_delete STR_VAR row_name = ~USVA00~ RET row_number columns END
    INSERT_2DA_ROW row_number columns ~USVA00 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4~
    PRETTY_PRINT_2DA
  BUT_ONLY
END

//Seducer
ACTION_IF FILE_EXISTS ~override/CLABUSSD.2DA~ BEGIN
  COPY_EXISTING ~BACKSTAB.2DA~ ~override~
    LPF 2da_find_row_delete STR_VAR row_name = ~USSD77~ RET row_number columns END
    INSERT_2DA_ROW row_number columns ~USSD77 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2~
    PRETTY_PRINT_2DA
  BUT_ONLY
  
  COPY_EXISTING ~CRIPPSTR.2DA~ ~override~
    LPF 2da_find_row_delete STR_VAR row_name = ~USSD77~ RET row_number columns END
    INSERT_2DA_ROW row_number columns ~USSD77 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3~
    PRETTY_PRINT_2DA
  BUT_ONLY
  
  COPY_EXISTING ~SNEAKATT.2DA~ ~override~
    LPF 2da_find_row_delete STR_VAR row_name = ~USSD77~ RET row_number columns END
    INSERT_2DA_ROW row_number columns ~USSD77 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4~
    PRETTY_PRINT_2DA
  BUT_ONLY
END

//Shapechanger
ACTION_IF FILE_EXISTS ~override/CLABUSSC.2DA~ BEGIN
  COPY_EXISTING ~BACKSTAB.2DA~ ~override~
    LPF 2da_find_row_delete STR_VAR row_name = ~USSC00~ RET row_number columns END
    INSERT_2DA_ROW row_number columns ~USSC00 1 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4~
    PRETTY_PRINT_2DA
  BUT_ONLY
  
  COPY_EXISTING ~CRIPPSTR.2DA~ ~override~
    LPF 2da_find_row_delete STR_VAR row_name = ~USSC00~ RET row_number columns END
    INSERT_2DA_ROW row_number columns ~USSC00 0 0 0 0 0 0 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6~
    PRETTY_PRINT_2DA
  BUT_ONLY
  
  COPY_EXISTING ~SNEAKATT.2DA~ ~override~
    LPF 2da_find_row_delete STR_VAR row_name = ~USSC00~ RET row_number columns END
    INSERT_2DA_ROW row_number columns ~USSC00 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7~
    PRETTY_PRINT_2DA
  BUT_ONLY
END

END


/*
*/