BACKUP ~Coran/Backup~

AUTHOR ~http://forums.pocketplane.net~

VERSION ~v9~ 

README ~Coran/%LANGUAGE%/Readme-Coran.txt~ ~Coran/Readme-Coran.txt~ 

ALWAYS
  ACTION_IF NOT VARIABLE_IS_SET bg2_chapter BEGIN
    ACTION_IF GAME_IS ~eet~ BEGIN
      OUTER_SET bg2_chapter = 12
    END ELSE BEGIN
      OUTER_SET bg2_chapter = 0
    END
    OUTER_FOR (i=1; i<=10; i=i+1) BEGIN
      OUTER_SET bg2_chapter = bg2_chapter + 1
      OUTER_SPRINT name_source ~bg2_chapter_%i%~
      OUTER_SET EVAL ~%name_source%~ = bg2_chapter
    END
  END

  // Borrowed from Edwin Romance: convert strings to UTF-8 for BGEE/BG2EE
  INCLUDE ~%MOD_FOLDER%/handle_charsets.tpa~

  // No exception, everything needs to be converted
  ACTION_DEFINE_ARRAY O#noconvert BEGIN END

  // Only setup-mod.tra needs to be reloaded
  ACTION_DEFINE_ARRAY O#reload BEGIN Setup-Coran END

  // There is no "language" folder so the root of all languages in %MOD_FOLDER%
  LAF HANDLE_CHARSETS
    INT_VAR
      infer_charset = 1
    STR_VAR
      tra_path = EVAL ~%MOD_FOLDER%~
      // charset_table = O#charsets // Included for illustrative purposes.
      noconvert_array = O#noconvert
      reload_array = O#reload
  END
END

AUTO_TRA ~Coran/%s~

LANGUAGE ~English~ ~English~ ~Coran/English/Setup-Coran.tra~
LANGUAGE ~Russian~ ~Russian~ ~Coran/Russian/Setup-Coran.tra~
LANGUAGE ~SChinese~ ~SChinese~ ~Coran/SChinese/Setup-Coran.tra~
LANGUAGE ~German (nur SvA)~ ~German~ ~Coran/German/Setup-Coran.tra~

BEGIN @0
LABEL O#CoranBGII-main

APPEND ~STATE.IDS~ ~0x80101FEF CD_STATE_NOTVALID~
UNLESS ~CD_STATE_NOTVALID~

COPY ~Coran/Characters/O#Coran.cre~ ~override/O#Coran.cre~
SAY NAME1 @1
SAY NAME2 @1
SAY INITIAL_MEETING @2
SAY MORALE @3
SAY HAPPY @4
SAY UNHAPPY_ANNOYED @5
SAY UNHAPPY_SERIOUS @6
SAY UNHAPPY_BREAKING @7
SAY LEADER @8
SAY TIRED @9
SAY BORED @10
SAY BATTLE_CRY1 @11
SAY BATTLE_CRY2 @12
SAY BATTLE_CRY3 @13
SAY BATTLE_CRY4 @14
SAY BATTLE_CRY5 @15
SAY DAMAGE @16
SAY DYING @17
SAY HURT @18
SAY AREA_FOREST @19
SAY AREA_CITY @20
SAY AREA_DUNGEON @21
SAY AREA_DAY @22
SAY AREA_NIGHT @23
SAY SELECT_COMMON1 @24
SAY SELECT_COMMON2 @25
SAY SELECT_COMMON3 @26
SAY SELECT_COMMON4 @27
SAY SELECT_COMMON5 @28
SAY SELECT_COMMON6 @29
SAY SELECT_ACTION1 @30
SAY SELECT_ACTION2 @31
SAY SELECT_ACTION3 @32
SAY SELECT_ACTION4 @33
SAY SELECT_ACTION5 @34
SAY SELECT_ACTION6 @35
SAY SELECT_ACTION7 @36
SAY SELECT_RARE1 @37
SAY SELECT_RARE2 @38
SAY CRITICAL_HIT @39
SAY CRITICAL_MISS @40
SAY TARGET_IMMUNE @41
SAY INVENTORY_FULL @42
SAY SPELL_DISRUPTED @43
SAY BIO @44
WRITE_ASCII 0x248 ~O#CoranS~ #8 // override
WRITE_ASCII 0x2cc ~O#Coran~ #8 // dialogue
WRITE_ASCII 0x280 ~O#Coran~ #32 //DV

COPY ~Coran/Audio~ ~override~

COMPILE EVALUATE_BUFFER ~Coran/Dialogue/BO#Coran.d~
	~Coran/Dialogue/O#Coran.d~
	~Coran/Dialogue/O#CoranJ.d~
	~Coran/Dialogue/O#CoranP.d~

	~Coran/Scripts/O#CoranF.baf~
	~Coran/Scripts/O#CoranS.baf~
	~Coran/Scripts/O#CoranD.baf~

EXTEND_TOP ~AR0020.bcs~ ~Coran/Scripts/AR0020.baf~

ACTION_IF FILE_EXISTS_IN_GAME ~mel01.cre~ THEN
BEGIN

COPY ~Coran/Characters/O#Cor25.cre~ ~override/O#Cor25.cre~
SAY NAME1 @1
SAY NAME2 @1
SAY INITIAL_MEETING @2
SAY MORALE @3
SAY HAPPY @4
SAY UNHAPPY_ANNOYED @5
SAY UNHAPPY_SERIOUS @6
SAY UNHAPPY_BREAKING @7
SAY LEADER @8
SAY TIRED @9
SAY BORED @10
SAY BATTLE_CRY1 @11
SAY BATTLE_CRY2 @12
SAY BATTLE_CRY3 @13
SAY BATTLE_CRY4 @14
SAY BATTLE_CRY5 @15
SAY DAMAGE @16
SAY DYING @17
SAY HURT @18
SAY AREA_FOREST @19
SAY AREA_CITY @20
SAY AREA_DUNGEON @21
SAY AREA_DAY @22
SAY AREA_NIGHT @23
SAY SELECT_COMMON1 @24
SAY SELECT_COMMON2 @25
SAY SELECT_COMMON3 @26
SAY SELECT_COMMON4 @27
SAY SELECT_COMMON5 @28
SAY SELECT_COMMON6 @29
SAY SELECT_ACTION1 @30
SAY SELECT_ACTION2 @31
SAY SELECT_ACTION3 @32
SAY SELECT_ACTION4 @33
SAY SELECT_ACTION5 @34
SAY SELECT_ACTION6 @35
SAY SELECT_ACTION7 @36
SAY SELECT_RARE1 @37
SAY SELECT_RARE2 @38
SAY CRITICAL_HIT @39
SAY CRITICAL_MISS @40
SAY TARGET_IMMUNE @41
SAY INVENTORY_FULL @42
SAY SPELL_DISRUPTED @43
SAY BIO @44
WRITE_ASCII 0x248 ~O#Cor25S~ #8 // override
WRITE_ASCII 0x2cc ~O#Cor25~ #8 // dialogue
WRITE_ASCII 0x280 ~O#Coran~ #32 //DV

COMPILE EVALUATE_BUFFER ~Coran/Dialogue/BO#Cor25.d~
	~Coran/Dialogue/O#Cor25.d~
	~Coran/Dialogue/O#Cor25J.d~
	~Coran/Dialogue/O#Cor25P.d~

	~Coran/Scripts/O#Cor25S.baf~

ACTION_IF GAME_IS ~BG2EE eet~ BEGIN
COMPILE	~Coran/Dialogue/CoranEE.d~
END

EXTEND_TOP ~AR6200.bcs~ ~Coran/Scripts/AR6200.baf~

COPY ~Coran/Epilogue/O#Corzz.2da~ ~override/O#Cor01.2da~
REPLACE ~99999~ @45

END

APPEND ~interdia.2da~ ~O#Coran       BO#Coran       BO#Cor25~
UNLESS ~O#Coran~

APPEND ~pdialog.2da~ ~O#Coran        O#CoranP             O#CoranJ            O#CoranD             O#Cor25P             O#Cor25J             O#Cor25D       O#Cor25S~
UNLESS ~O#Coran~

ACTION_IF GAME_IS ~eet~ BEGIN
  INCLUDE ~EET/other/EET_functions.tph~
  LAF ~EET_NPC_TRANSITION~
    INT_VAR
      type = 2
      default_ToB = 1
      clean_ToB = 1
    STR_VAR
      dv = "O#Coran"
      override_SoA = "O#CORANS"
      override_ToB = "O#COR25S"
      dialog_ToB = "O#COR25"
      cre_ToB = "O#Cor25"
      traFile = EVAL "Coran/%LANGUAGE%/O#Cor25J.tra"
      string = "@107" //Bring me Coran, the elven fighter and thief.
      stringPosDV = "Corwin"
      clean_ToB_DV = "Coran"
  END
END ELSE BEGIN
  COMPILE ~Coran/Dialogue/FATESP.d~ USING ~Coran/%LANGUAGE%/O#Cor25J.tra~
END

BEGIN @46
LABEL O#CoranBGII-Delete_original_Coran

EXTEND_TOP ~C6Coran.bcs~ ~Coran/Scripts/C6Coran.baf~