// creator  : weidu.exe (version 23100)
// argument : _TETHTO2.DLG
// game		 : .
// source	 : ./override/_TETHTO2.DLG
// dialog	 : ./DIALOG.TLK
// dialogF  : (none)

BEGIN ~_TETHTO2~
//////////////////////////////////////////////////
// WARNING: this file contains non-trivial WEIGHTs
//////////////////////////////////////////////////

IF WEIGHT #1 /* Triggers after states #: 1 even though they appear after this state */
~NumberOfTimesTalkedTo(0)
~ THEN BEGIN 0 // from:
  SAY #74529 /* ~You there!  I have come to speak with <CHARNAME>.  Hast thou come to collect the inheritance from your father?  He left thee several items, all of which are within his old room.  You remember where his old room is, don't you?  If you've somehow forgotten, it's on the fifth floor of the central keep. Please forgive my abrupt nature, but much requires my attention this day.  It is important that we later speak of your foster father, but not now.~ */
  IF ~~ THEN DO ~SetGlobal("PartyCured","GLOBAL",1)
~ EXIT
END

IF WEIGHT #0 ~Global("Arrested","GLOBAL",1)
~ THEN BEGIN 1 // from:
  SAY #74530 /* ~Hello, young one, I am sorry to see thee in such terrible circumstances.  I know thee well enough to see that you have been falsely accused.  Tomorrow Ulraunt will most likely sentence thee to be sent to Baldur's Gate.  There, thou wouldst receive the death penalty for these actions.  I know that Gorion would not want to see his only child killed a scant few weeks after his own death.  'Tis as a favor to his memory that I will help thee escape.  Make thy way through the catacombs beneath the library, but disturb them not.  I have your possessions with me; you must take them and go with haste.~ */
  IF ~  Global("P#KnowBhaal","GLOBAL",1)
Global("TalkedToKoveras","GLOBAL",1)
~ THEN REPLY #74531 /* ~Do you know anyone by the name of Koveras?~ */ GOTO 2
  IF ~  Global("P#KnowBhaal","GLOBAL",1)
~ THEN REPLY #74532 /* ~Thank you for helping us.~ */ GOTO 3
  IF ~  Global("P#KnowBhaal","GLOBAL",1)
Dead("rieltar")
~ THEN REPLY #74533 /* ~Actually I did kill them, but they're the leaders of the Iron Throne.  They were the people behind the iron shortage and everything else that's been wrong with the Sword Coast.  We did everyone a favor by killing them.~ */ GOTO 5
  IF ~  Global("TalkedToKoveras","GLOBAL",1)
Global("P#KnowBhaal","GLOBAL",0)
~ THEN REPLY #74531 /* ~Do you know anyone by the name of Koveras?~ */ DO ~GiveItemCreate("_scrl2J",Player1,0,0,0)
SetGlobal("P#KnowBhaal","GLOBAL",1)
~ GOTO 2
  IF ~  Global("P#KnowBhaal","GLOBAL",0)
~ THEN REPLY #74532 /* ~Thank you for helping us.~ */ DO ~GiveItemCreate("_scrl2J",Player1,0,0,0)
SetGlobal("P#KnowBhaal","GLOBAL",1)
~ GOTO 3
  IF ~  Global("P#KnowBhaal","GLOBAL",0)
Dead("rieltar")
~ THEN REPLY #98308 /* ~Actually I did kill them, but they're the leaders of the Iron Throne.  They were the people behind the iron shortage and everything else that's been wrong with the Sword Coast.  We did everyone a favor by killing them. ~ */ DO ~GiveItemCreate("_scrl2J",Player1,0,0,0)
SetGlobal("P#KnowBhaal","GLOBAL",1)
~ GOTO 5
END

IF ~~ THEN BEGIN 2 // from: 1.3 1.0
  SAY #74534 /* ~I know of no one named Koveras, but Koveras is the reverse of Sarevok, a young man who accompanied the leaders of the Iron Throne when they first came.  I know not where he has gone.~ */
  IF ~~ THEN GOTO 3
  IF ~Global("X#ImoenTethoril1","GLOBAL",0)
InParty("imoen")
InMyArea("imoen")
!StateCheck("imoen",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#ImoenTethoril1","GLOBAL",1)~ EXTERN ~_IMOEN2~ 219
END

IF ~~ THEN BEGIN 3 // from: 5.0 2.0 1.4 1.1
  SAY #74535 /* ~It is now time for you to go <CHARNAME>.  I can teleport you to the secret room that leads to the catacombs, but from there you are on your own.  You must be careful within the catacombs, as there are many guardians and traps, and perhaps whoever planned these murders.  However dangerous the catacombs may be, they are a safer alternative to Ulraunt's wrath.~ */
  IF ~~ THEN REPLY #74536 /* ~Teleport us to the secret library; we're as ready as we'll ever be.~ */ DO ~EndCutSceneMode()
SetGlobal("PartyCured","GLOBAL",1)
SetGlobal("Teth","GLOBAL",1)
ActionOverride(Player1,LeaveAreaLUAPanic("FW2613","",[133.278],12))
ActionOverride(Player1,LeaveAreaLUA("FW2613","",[133.278],12))
ActionOverride(Player1,SetMasterArea("FW2626"))
ActionOverride(Player2,LeaveAreaLUA("FW2613","",[179.225],12))
ActionOverride(Player3,LeaveAreaLUA("FW2613","",[248.199],12))
ActionOverride(Player4,LeaveAreaLUA("FW2613","",[323.199],12))
ActionOverride(Player5,LeaveAreaLUA("FW2613","",[361.224],12))
ActionOverride(Player6,LeaveAreaLUA("FW2613","",[192.344],12))
~ EXIT
  IF ~~ THEN REPLY #78619 /* ~Why can't you teleport us outside of Candlekeep?~ */ GOTO 4
END

IF ~~ THEN BEGIN 4 // from: 3.1
  SAY #78620 /* ~Candlekeep is protected by powerful runes that seal it from divinatory and alteration magics.  If I were to teleport you outside of Candlekeep, you would be ripped asunder when you came in contact with the protective field.  Trust me child, this is the only way.~ */
  IF ~~ THEN DO ~EndCutSceneMode()
SetGlobal("PartyCured","GLOBAL",1)
SetGlobal("Teth","GLOBAL",1)
ActionOverride(Player1,LeaveAreaLUAPanic("FW2613","",[133.278],12))
ActionOverride(Player1,LeaveAreaLUA("FW2613","",[133.278],12))
ActionOverride(Player1,SetMasterArea("FW2626"))
ActionOverride(Player2,LeaveAreaLUA("FW2613","",[179.225],12))
ActionOverride(Player3,LeaveAreaLUA("FW2613","",[248.199],12))
ActionOverride(Player4,LeaveAreaLUA("FW2613","",[323.199],12))
ActionOverride(Player5,LeaveAreaLUA("FW2613","",[361.224],12))
ActionOverride(Player6,LeaveAreaLUA("FW2613","",[192.344],12))
~ EXIT
END

IF ~~ THEN BEGIN 5 // from: 1.5 1.2
  SAY #78621 /* ~That is unfortunate... that you had to resort to killing.  I believe you, and your reasons seem valid, but I still cannot agree with what you have done.  If you had presented your case with evidence or proof of some sort, instead of simply killing them... events might have happened differently.  As it is you are a criminal in the eyes of your enemies AND the law.  Still, it would seem that someone wishes to secure your fate, even though you ARE guilty.  Much more evidence points to you, much more than you admit to.  I am not prone to suspicions, but I would almost believe that someone intended those men dead and was going to blame you regardless.  If this is so, then those men, evil though they were, were not your true enemies, and this does not bode well for the Sword Coast.  I will help you escape so you might continue your crusade, but remember that the authorities will not believe your accusations without proof, especially now that you are an accused murderer.~ */
  IF ~~ THEN GOTO 3
END
