// --------------------------------------------
// Mod setup
// --------------------------------------------
// Basics
BACKUP ~arath/backup~
//AUTHOR ~K'aeloree (kae@spellholdstudios.net)~
SUPPORT ~http://www.shsforums.net/forum/624-arath/~
VERSION ~v6~ 
README ~arath/arath_readme.html~
//MODDER

ALWAYS

  ACTION_IF NOT VARIABLE_IS_SET bg2_chapter THEN BEGIN // check to make this happen only once per install

    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

    // convert strings to UTF-8 for BGEE/BG2EE
    ACTION_DEFINE_ARRAY lk#reload BEGIN setup END
    LAF HANDLE_CHARSETS 
	INT_VAR infer_charsets = 1 
	STR_VAR tra_path = ~arath/translations~
	reload_array = lk#reload 
    END

  END

END

// Translations
AUTO_TRA ~arath/translations/%s~

LANGUAGE ~English~
         ~english~
         ~arath/translations/english/setup.tra~
LANGUAGE ~Russian (by Ghyn)~
         ~russian~
         ~arath/translations/russian/setup.tra~

// --------------------------------------------
// Arath NPC Mod 
// --------------------------------------------
// Component setup
BEGIN @1 
DESIGNATED 0 
LABEL arath_npc
//  REQUIRE_PREDICATE GAME_IS ~tob bgt bg2ee~ @2
//  REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~mel01.cre~ @2
  REQUIRE_PREDICATE GAME_INCLUDES ~tob~ @2

// Adds custom IsValidForPartyDialogue state used throughout arath
APPEND ~STATE.IDS~ // adds custom IsValidForPartyDialogue state
    ~0x80101FEF CD_STATE_NOTVALID~
    UNLESS ~CD_STATE_NOTVALID~

ACTION_IF GAME_IS ~tob bgt~ THEN BEGIN
  // Fixing Imoen's dialogue file
  COPY_EXISTING ~interdia.2da~ ~override~
      SET_2DA_ENTRY 17 1 2 ~BIMOEN2~ // fixes ToB version
      BUT_ONLY_IF_IT_CHANGES

  // Fixpack ids fixes
  INCLUDE ~arath/lib/ids.tph~
  INCLUDE ~arath/lib/times.tph~
  CLEAR_IDS_MAP
END

// Fixing Anomen romance variable
/* adding transactions to ensure Anomen romance gets closed correctly so it doesn't get set to committed silently */
<<<<<<<< ...inlined/c#anomen_romance_fix.d
ADD_TRANS_ACTION BANOMEN BEGIN 399 464 END BEGIN END ~SetGlobal("AnomenRomanceActive","GLOBAL",3)~ UNLESS ~SetGlobal("AnomenRomanceActive","GLOBAL",3)~
>>>>>>>>
COMPILE ~...inlined/c#anomen_romance_fix.d~


// Copying images and creatures
ACTION_IF GAME_IS ~bg2ee eet~ BEGIN
  COPY ~arath/images/ee~ ~override~
END ELSE BEGIN
  COPY ~arath/images/bg2~ ~override~
END

COPY_EXISTING ~arath/creatures/lk#arath.cre~ ~override/lk#arath.cre~
  SAY NAME1 @3
  SAY NAME2 @4
  WRITE_EVALUATED_ASCII DIALOG          ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII DEATHVAR        ~arath~ #32
  WRITE_EVALUATED_ASCII SCRIPT_OVERRIDE ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII SCRIPT_DEFAULT  ~~ #8
  WRITE_ASCII 0X34 ~LK#ARATS~ #8   //small portrait
  WRITE_ASCII 0x3c ~LK#ARATM~ #8   //medium portrait
  SAY BIO @5
  SAY MORALE @6
  SAY LEADER @7
  SAY TIRED @8
  SAY BORED @9
  SAY BATTLE_CRY1 @10
  SAY BATTLE_CRY2 @11
  SAY BATTLE_CRY3 @12
  SAY BATTLE_CRY4 @13
  SAY BATTLE_CRY5 @14
  SAY DYING ~~  [lk#ar10]
  SAY HURT @16
  SAY DAMAGE ~~ [lk#ar12]
  SAY AREA_DUNGEON @18
  SAY AREA_FOREST @19
  SAY AREA_CITY @20
  SAY AREA_DAY @21
  SAY AREA_NIGHT @22
  SAY SELECT_COMMON1 @23
  SAY SELECT_COMMON2 @24
  SAY SELECT_COMMON3 @25
  SAY SELECT_COMMON4 @26
  SAY SELECT_COMMON5 @27
  SAY SELECT_COMMON6 @28
  SAY SELECT_ACTION1 @29
  SAY SELECT_ACTION2 @30
  SAY SELECT_ACTION3 @31
  SAY SELECT_ACTION4 @32
  SAY SELECT_ACTION5 @33
  SAY SELECT_ACTION6 @34
  SAY SELECT_ACTION7 @35
  SAY SELECT_RARE1 @36
  SAY SELECT_RARE2 @37
  SAY CRITICAL_HIT @38
  SAY CRITICAL_MISS @39
  SAY TARGET_IMMUNE @40
  SAY INVENTORY_FULL @41
  SAY HAPPY @42
  SAY UNHAPPY_ANNOYED @43
  SAY UNHAPPY_SERIOUS @44
  SAY UNHAPPY_BREAKING @45
  SAY SPELL_DISRUPTED @46
  SAY SET_A_TRAP @47
  SAY HIDDEN_IN_SHADOWS @48
  SAY PICKED_POCKET @49

COPY_EXISTING ~arath/creatures/lk#arath.cre~ ~override/lk#ar25.cre~
  SAY NAME1 @3
  SAY NAME2 @4
  WRITE_EVALUATED_ASCII DIALOG          ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII DEATHVAR        ~arath~ #32
  WRITE_EVALUATED_ASCII SCRIPT_OVERRIDE ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII SCRIPT_DEFAULT  ~~ #8
  WRITE_ASCII 0X34 ~LK#ARATS~ #8   //small portrait
  WRITE_ASCII 0x3c ~LK#ARATM~ #8   //medium portrait
  WRITE_LONG 0x18 2500000
  SAY BIO @5
  SAY MORALE @6
  SAY LEADER @7
  SAY TIRED @8
  SAY BORED @9
  SAY BATTLE_CRY1 @10
  SAY BATTLE_CRY2 @11
  SAY BATTLE_CRY3 @12
  SAY BATTLE_CRY4 @13
  SAY BATTLE_CRY5 @14
  SAY DYING ~~  [lk#ar10]
  SAY HURT @16
  SAY DAMAGE ~~ [lk#ar12]
  SAY AREA_DUNGEON @18
  SAY AREA_FOREST @19
  SAY AREA_CITY @20
  SAY AREA_DAY @21
  SAY AREA_NIGHT @22
  SAY SELECT_COMMON1 @23
  SAY SELECT_COMMON2 @24
  SAY SELECT_COMMON3 @25
  SAY SELECT_COMMON4 @26
  SAY SELECT_COMMON5 @27
  SAY SELECT_COMMON6 @28
  SAY SELECT_ACTION1 @29
  SAY SELECT_ACTION2 @30
  SAY SELECT_ACTION3 @31
  SAY SELECT_ACTION4 @32
  SAY SELECT_ACTION5 @33
  SAY SELECT_ACTION6 @34
  SAY SELECT_ACTION7 @35
  SAY SELECT_RARE1 @36
  SAY SELECT_RARE2 @37
  SAY CRITICAL_HIT @38
  SAY CRITICAL_MISS @39
  SAY TARGET_IMMUNE @40
  SAY INVENTORY_FULL @41
  SAY HAPPY @42
  SAY UNHAPPY_ANNOYED @43
  SAY UNHAPPY_SERIOUS @44
  SAY UNHAPPY_BREAKING @45
  SAY SPELL_DISRUPTED @46
  SAY SET_A_TRAP @47
  SAY HIDDEN_IN_SHADOWS @48
  SAY PICKED_POCKET @49


// Vampire!Arath
COPY_EXISTING ~vampano.cre~ ~override/lk#arvmp.cre~
  SAY NAME1 @3
  SAY NAME2 @4
  WRITE_EVALUATED_ASCII DIALOG          ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII DEATHVAR        ~%DEST_RES%~ #32
  WRITE_EVALUATED_ASCII SCRIPT_OVERRIDE ~%DEST_RES%~ #8
  WRITE_BYTE            0x0237          2
  WRITE_BYTE            0x0275          2
  WRITE_ASCII           0x0034          ~lk#aratv~ #8
  WRITE_ASCII           0x003c          ~lk#aratm~ #8
  REPLACE_CRE_ITEM ~LK#ARBDY~ #0 #0 #0 ~IDENTIFIED~ ~QITEM1~


// Messenger
COPY_EXISTING ~messen.cre~ ~override/lk#armes.cre~
  SAY NAME1 @50
  SAY NAME2 @50
  WRITE_EVALUATED_ASCII DIALOG          ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII DEATHVAR        ~%DEST_RES%~ #32
  WRITE_EVALUATED_ASCII SCRIPT_OVERRIDE ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII SCRIPT_CLASS    ~~ #8
  WRITE_EVALUATED_ASCII SCRIPT_RACE     ~~ #8
  WRITE_EVALUATED_ASCII SCRIPT_DEFAULT  ~~ #8
  WRITE_EVALUATED_ASCII SCRIPT_GENERAL  ~~ #8
  

// Archmage Wreimass
COPY_EXISTING ~suelf10.cre~ ~override/lk#arwre.cre~
  SAY NAME1 @51
  SAY NAME2 @51
  ADD_CRE_ITEM ~minhp1~ #1 #0 #0 ~IDENTIFIED~ ~AMULET~
  WRITE_EVALUATED_ASCII DIALOG          ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII DEATHVAR        ~%DEST_RES%~ #32
  WRITE_EVALUATED_ASCII SCRIPT_OVERRIDE ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII SCRIPT_CLASS    ~~ #8
  WRITE_EVALUATED_ASCII SCRIPT_RACE     ~~ #8
  WRITE_EVALUATED_ASCII SCRIPT_DEFAULT  ~~ #8

// Guards
COPY_EXISTING ~slarch1.cre~ ~override/lk#argd1.cre~
  SAY NAME1 @52
  SAY NAME2 @52
  WRITE_EVALUATED_ASCII DIALOG          ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII DEATHVAR        ~%DEST_RES%~ #32
  WRITE_EVALUATED_ASCII SCRIPT_OVERRIDE ~%DEST_RES%~ #8

COPY_EXISTING ~slguard1.cre~ ~override/lk#argd2.cre~
  SAY NAME1 @52
  SAY NAME2 @52
  WRITE_EVALUATED_ASCII DIALOG          ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII DEATHVAR        ~%DEST_RES%~ #32
  WRITE_EVALUATED_ASCII SCRIPT_OVERRIDE ~%DEST_RES%~ #8

COPY_EXISTING ~slguard2.cre~ ~override/lk#argd3.cre~
  SAY NAME1 @52
  SAY NAME2 @52
  WRITE_EVALUATED_ASCII DIALOG          ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII DEATHVAR        ~%DEST_RES%~ #32
  WRITE_EVALUATED_ASCII SCRIPT_OVERRIDE ~%DEST_RES%~ #8

COPY_EXISTING ~slmage1.cre~ ~override/lk#argd4.cre~
  SAY NAME1 @53
  SAY NAME2 @53
  WRITE_EVALUATED_ASCII DIALOG          ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII DEATHVAR        ~%DEST_RES%~ #32
  WRITE_EVALUATED_ASCII SCRIPT_OVERRIDE ~%DEST_RES%~ #8

COPY_EXISTING ~haegan.cre~ ~override/lk#arbos.cre~
  SAY NAME1 @54
  SAY NAME2 @54
  ADD_CRE_ITEM ~minhp1~ #1 #0 #0 ~IDENTIFIED~ ~AMULET~
  WRITE_EVALUATED_ASCII DIALOG          ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII DEATHVAR        ~%DEST_RES%~ #32
  WRITE_EVALUATED_ASCII SCRIPT_OVERRIDE ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII SCRIPT_CLASS    ~~ #8
  WRITE_EVALUATED_ASCII SCRIPT_RACE     ~~ #8
  WRITE_EVALUATED_ASCII SCRIPT_DEFAULT  ~~ #8


// Slave
COPY_EXISTING ~slslav01.cre~ ~override/lk#arslv.cre~
  SAY NAME1 @55
  SAY NAME2 @55
  WRITE_EVALUATED_ASCII DIALOG          ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII DEATHVAR        ~%DEST_RES%~ #32
  WRITE_EVALUATED_ASCII SCRIPT_OVERRIDE ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII SCRIPT_CLASS    ~~ #8
  WRITE_EVALUATED_ASCII SCRIPT_RACE     ~~ #8
  WRITE_EVALUATED_ASCII SCRIPT_DEFAULT  ~~ #8


// Guide
COPY_EXISTING ~madeen.cre~ ~override/lk#argui.cre~
  SAY NAME1 @56
  SAY NAME2 @56
  WRITE_EVALUATED_ASCII DIALOG          ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII DEATHVAR        ~%DEST_RES%~ #32
  WRITE_EVALUATED_ASCII SCRIPT_OVERRIDE ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII SCRIPT_CLASS    ~~ #8
  WRITE_EVALUATED_ASCII SCRIPT_RACE     ~~ #8
  WRITE_EVALUATED_ASCII SCRIPT_DEFAULT  ~~ #8


// Wraith Mother
COPY_EXISTING ~noblew1.cre~ ~override/lk#armom.cre~
  SAY NAME1 @57
  SAY NAME2 @57
  WRITE_EVALUATED_ASCII DIALOG          ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII DEATHVAR        ~%DEST_RES%~ #32
  WRITE_EVALUATED_ASCII SCRIPT_OVERRIDE ~%DEST_RES%~ #8
  WRITE_EVALUATED_ASCII SCRIPT_CLASS    ~~ #8
  WRITE_EVALUATED_ASCII SCRIPT_RACE     ~~ #8
  WRITE_EVALUATED_ASCII SCRIPT_DEFAULT  ~~ #8
  

// Items
COPY_EXISTING ~miscbm.itm~ ~override/lk#arbdy.itm~
  SAY NAME1 @58
  SAY NAME2 @58
  SAY DESC @59


// Spells
COPY ~arath/spells~ ~override~


// Adding talk condition to Yoshimo just in case...
COPY_EXISTING ~yoshimox.dlg~ ~override~
  DECOMPILE_AND_PATCH BEGIN
    REPLACE_TEXTUALLY ~Enemy()~ ~SetGlobal("LK#ArathYoshBetray","GLOBAL",1) Enemy()~
  END
  BUT_ONLY_IF_IT_CHANGES

// Appends
APPEND ~interdia.2da~ ~Arath BLK#ARAT BLK#AR25~
   UNLESS ~arath~

APPEND ~pdialog.2da~ ~Arath LK#ARATP LK#ARATJ LK#ARATD LK#AR25P LK#AR25J LK#AR25D LK#AR25~
   UNLESS ~arath~
   
// Areas

ACTION_IF GAME_IS ~bg2ee eet~ THEN BEGIN
  COPY ~arath/pvrz~ ~override~ // area tiles (PVRZ)
END ELSE BEGIN
  COPY ~arath/tis_v1~ ~override~ //tis and mos for original BGII
END

COPY ~arath/areas/lk#ar1ht.bmp~ ~override~
COPY ~arath/areas/lk#ar1lm.bmp~ ~override~
COPY ~arath/areas/lk#ar1sr.bmp~ ~override~
COPY ~arath/areas/lk#ar1.wed~ ~override~
COPY ~arath/areas/lk#ar1.are~ ~override~
  SAY 0x180 @60
  SAY 0x308 @61

COPY ~arath/areas/lk#ar2ht.bmp~ ~override~
COPY ~arath/areas/lk#ar2lm.bmp~ ~override~
COPY ~arath/areas/lk#ar2sr.bmp~ ~override~
COPY ~arath/areas/lk#ar2.wed~ ~override~
COPY ~arath/areas/lk#ar2.are~ ~override~

APPEND ~mastarea.2da~
  ~LK#AR1  value~
UNLESS ~LK#AR1~


// Audio
COPY ~arath/audio/lk#blk.mus~ ~music~

COPY_EXISTING ~songlist.2da~ ~override~
  SET_2DA_ENTRY 0 2 3 ~lk#blk.mus~
BUT_ONLY

LAF HANDLE_AUDIO END

// Epilogues
COPY ~arath/epilogues/lk#arat.2da~ ~override/lk#arat1.2da~
  REPLACE ~99999~ @62

COPY ~arath/epilogues/lk#arat.2da~ ~override/lk#arat2.2da~
  REPLACE ~99999~ @63

COPY ~arath/epilogues/lk#arat.2da~ ~override/lk#arat3.2da~
  REPLACE ~99999~ @64
  

// Compiling dialogue...
COMPILE ~arath/dialogue/lk#arath.d~
COMPILE EVALUATE_BUFFER ~arath/dialogue/lk#aratj.d~
COMPILE EVALUATE_BUFFER ~arath/dialogue/blk#arat.d~
COMPILE EVALUATE_BUFFER ~arath/dialogue/lk#aratp.d~
  USING ~arath/translations/%LANGUAGE%/lk#aratj.tra~
COMPILE ~arath/dialogue/lk#ar25.d~
COMPILE ~arath/dialogue/lk#ar25j.d~
COMPILE ~arath/dialogue/blk#ar25.d~
COMPILE ~arath/dialogue/lk#ar25p.d~


// Compiling scripts...
COMPILE EVALUATE_BUFFER ~arath/scripts/lk#arath.baf~
EXTEND_BOTTOM ~lk#arath.bcs~ ~arath/scripts/c#_lvl_once_20.baf~
COMPILE ~arath/scripts/lk#aratd.baf~
COMPILE ~arath/scripts/lk#ar25.baf~
EXTEND_BOTTOM ~lk#ar25.bcs~ ~arath/scripts/c#_lvl_once_20.baf~
COMPILE ~arath/scripts/lk#ar25d.baf~
COMPILE ~arath/scripts/lk#artr1.baf~
COMPILE ~arath/scripts/lk#artr2.baf~
COMPILE ~arath/scripts/lk#artr3.baf~
COMPILE ~arath/scripts/lk#arct1.baf~
COMPILE ~arath/scripts/lk#arct2.baf~
COMPILE ~arath/scripts/lk#arvmp.baf~
COMPILE ~arath/scripts/lk#armes.baf~
COMPILE ~arath/scripts/lk#arwre.baf~
COMPILE ~arath/scripts/lk#arslv.baf~
COMPILE ~arath/scripts/lk#argd1.baf~
COMPILE ~arath/scripts/lk#argd2.baf~
COMPILE ~arath/scripts/lk#argd3.baf~
COMPILE ~arath/scripts/lk#argd4.baf~
COMPILE ~arath/scripts/lk#arbos.baf~
COMPILE ~arath/scripts/lk#argui.baf~
COMPILE ~arath/scripts/lk#ar1.baf~
COMPILE ~arath/scripts/lk#ar2.baf~
COMPILE ~arath/scripts/lk#arwr1.baf~
EXTEND_TOP ~ar0406.bcs~      ~arath/scripts/ar0406.baf~
EXTEND_TOP ~ar0809.bcs~      ~arath/scripts/ar0809.baf~
EXTEND_TOP ~ar6200.bcs~      ~arath/scripts/ar6200.baf~
EXTEND_BOTTOM ~ar1900.bcs~   ~arath/scripts/ar1900.baf~
EXTEND_BOTTOM ~ar1901.bcs~   ~arath/scripts/ar1901.baf~
EXTEND_BOTTOM ~AR4000.bcs~   ~arath/scripts/ar4000.baf~ //disable summoning in ToB if in party
EXTEND_BOTTOM ~baldur.bcs~   ~arath/scripts/baldur.baf~
EXTEND_BOTTOM ~cleanse.bcs~  ~arath/scripts/cleanse.baf~
EXTEND_BOTTOM ~bodhiamb.bcs~ ~arath/scripts/bodhiamb.baf~
EXTEND_BOTTOM ~vampamb.bcs~  ~arath/scripts/vampamb.baf~
EXTEND_BOTTOM ~cut218g.bcs~  ~arath/scripts/lk#arwr2.baf~

// Journals
ADD_JOURNAL EXISTING TITLE (#74337) @1644 @1651 @2148 USING ~arath/translations/%LANGUAGE%/lk#aratj.tra~
ADD_JOURNAL @1675 @1686 @1695 @1761 @1813 @1858 @1889 @1936 @1939 @1995 @1998 @2019 USING ~arath/translations/%LANGUAGE%/lk#aratj.tra~

// Patching slaver sewers
COPY_EXISTING ~AR0404.are~ ~override/AR0404.are~
  LPF ~fj_are_structure~
    INT_VAR
    fj_type         = 0    //proximity trigger
    fj_box_left    = 2467
    fj_box_top     = 2224
    fj_box_right   = 2811
    fj_box_bottom  = 2476
    fj_loc_x       = 2600
    fj_loc_y       = 2500
    fj_vertex_0    = 2467 + (2300 << 16) 
    fj_vertex_1    = 2559 + (2224 << 16)
    fj_vertex_2    = 2890 + (2495 << 16)
    fj_vertex_3    = 2829 + (2535 << 16)
    STR_VAR
    fj_structure_type   = region
    fj_trap_detect      = 100
    fj_trap_active      = 1
    fj_trap_status      = 0
    fj_name             = lk#artr1
    fj_reg_script   = lk#artr1
  END
BUT_ONLY_IF_IT_CHANGES

// Patching slaver stockade
COPY_EXISTING ~AR0405.are~ ~override/AR0405.are~
  LPF ~fj_are_structure~
    INT_VAR
    fj_type         = 0    //proximity trigger
    fj_box_left    = 1312
    fj_box_top     = 295
    fj_box_right   = 1751
    fj_box_bottom  = 564
    fj_loc_x       = 1500
    fj_loc_y       = 400
    fj_vertex_0    = 1312 + (433 << 16) 
    fj_vertex_1    = 1517 + (295 << 16)
    fj_vertex_2    = 1751 + (417 << 16)
    fj_vertex_3    = 1525 + (564 << 16)
    STR_VAR
    fj_structure_type   = region
    fj_trap_detect      = 100
    fj_trap_active      = 1
    fj_trap_status      = 0
    fj_name             = lk#artr2
    fj_reg_script   = lk#artr2
  END
BUT_ONLY_IF_IT_CHANGES

// Patching Waukeen's Promenade
COPY_EXISTING ~AR0700.are~ ~override/AR0700.are~
  LPF ~fj_are_structure~
    INT_VAR
    fj_type         = 0    //proximity trigger
    fj_box_left    = 2112
    fj_box_top     = 1709
    fj_box_right   = 3317
    fj_box_bottom  = 2446
    fj_loc_x       = 2800
    fj_loc_y       = 2000
    fj_vertex_0    = 2112 + (1709 << 16) 
    fj_vertex_1    = 3212 + (1709 << 16)
    fj_vertex_2    = 3317 + (2446 << 16)
    fj_vertex_3    = 2112 + (2446 << 16)
    STR_VAR
    fj_structure_type   = region
    fj_trap_detect      = 100
    fj_trap_active      = 1
    fj_trap_status      = 0
    fj_name             = lk#artr3
    fj_reg_script   = lk#artr3
  END
BUT_ONLY_IF_IT_CHANGES

/* Throne of Bhaal transition */

ACTION_IF GAME_IS ~eet~ BEGIN
  INCLUDE ~EET/other/EET_functions.tph~
  LAF ~EET_NPC_TRANSITION~
    INT_VAR
      type = 2
      default_ToB = 1
    STR_VAR
      dv = "Arath"
      override_SoA = "lk#arath"
      override_ToB = "lk#ar25"
      dialog_ToB = "LK#AR25"
      cre_ToB = "lk#ar25"
      traFile = EVAL "arath/Translations/%LANGUAGE%/lk#ar25.tra"
      string = "@0" 
      stringPosDV = "Anomen"
      SummonedVar = "LK#ArathSummoned"
  END
END ELSE BEGIN
  COMPILE ~arath/dialogue/lk#ar25_FATESP.d~ USING ~arath/translations/%LANGUAGE%/lk#ar25.tra~
END

