// creator  : weidu.exe (version 23100)
// argument : KHALIJ.DLG
// game		 : .
// source	 : ./DATA/DIALOG.BIF
// dialog	 : ./DIALOG.TLK
// dialogF  : (none)

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

IF WEIGHT #4 /* Triggers after states #: 2 3 4 5 even though they appear after this state */
~!InParty("Jaheira")
~ THEN BEGIN 0 // from:
  SAY #16683 /* ~There should not be a problem with that, my Lord.  Thank you.~ */
  IF ~~ THEN DO ~LeaveParty()
SetDialog("KhaliP")
~ EXIT
END

IF WEIGHT #5 /* Triggers after states #: 2 3 4 5 even though they appear after this state */
~InParty("Jaheira")
~ THEN BEGIN 1 // from:
  SAY #16684 /* ~Yes, of course.  You're not free yet, are you?~ */
  IF ~~ THEN DO ~ActionOverride("Jaheira",ChangeAIScript("",DEFAULT))
ActionOverride("Jaheira",LeaveParty())
ActionOverride("Jaheira",SetDialog("JaheiP"))
LeaveParty()
SetDialog("KhaliP")
~ EXIT
END

IF WEIGHT #2 /* Triggers after states #: 4 5 even though they appear after this state */
~HappinessLT(Myself,0)
!InParty("Jaheira")
~ THEN BEGIN 2 // from:
  SAY #16685 /* ~Oh... I see.  Of course, my Lord.  I... hope my companionship will please you.~ */
  IF ~~ THEN DO ~LeaveParty()
EscapeArea()
~ EXIT
END

IF WEIGHT #3 /* Triggers after states #: 4 5 even though they appear after this state */
~HappinessLT(Myself,0)
InParty("Jaheira")
~ THEN BEGIN 3 // from:
  SAY #16686 /* ~No, of course not.  I shall see what I can do about this slave business.  Farewell until then.~ */
  IF ~~ THEN DO ~ActionOverride("Jaheira",ChangeAIScript("",DEFAULT))
ActionOverride("Jaheira",LeaveParty())
ActionOverride("Jaheira",EscapeArea())
LeaveParty()
EscapeArea()
~ EXIT
END

IF WEIGHT #0 ~GlobalTimerExpired("Khalid","GLOBAL")
Global("OffToNashkell","GLOBAL",0)
Global("Chapter","GLOBAL",1)
~ THEN BEGIN 4 // from:
  SAY #17214 /* ~I'll try, Hendak.  Wait here.~ */
  IF ~~ THEN DO ~SetGlobalTimer("Khalid","GLOBAL",EIGHT_DAYS)
SetGlobal("OffToNashkell","GLOBAL",1)
~ EXIT
END

IF WEIGHT #1 ~GlobalTimerExpired("Khalid","GLOBAL")
Global("OffToNashkell","GLOBAL",1)
Global("Chapter","GLOBAL",1)
~ THEN BEGIN 5 // from:
  SAY #17215 /* ~May the Gods aid your task!  Would that I could help, but I shall have to be content with the hope that Lehtinan will feel the cold swiftness of my blade.~ */
  IF ~~ THEN DO ~SetGlobal("OffToNashkell","GLOBAL",2)
~ EXIT
END
