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

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

IF WEIGHT #1 /* Triggers after states #: 8 even though they appear after this state */
~NumTimesTalkedTo(0)
Allegiance(Myself,NEUTRAL)
!Dead("ffbiff01")
!StateCheck("ffbiff01",STATE_SLEEPING)
!Dead("ffactor2")
!StateCheck("ffactor2",STATE_SLEEPING)
!Dead("ffcrowd1")
!StateCheck("ffcrowd1",STATE_SLEEPING)
!Dead("ffcrowd2")
!StateCheck("ffcrowd2",STATE_SLEEPING)
!Dead("ffcrowd3")
!StateCheck("ffcrowd3",STATE_SLEEPING)
!Dead("ffcrowd4")
!StateCheck("ffcrowd4",STATE_SLEEPING)
!Dead("ffcrowd5")
!StateCheck("ffcrowd5",STATE_SLEEPING)
!GlobalGT("HaerDalisFree","GLOBAL",0)~ THEN BEGIN 0 // from:
  SAY #29899 /* ~Your lover has abandoned thee, sweet Lunisia.  You have only one option left... turnest thou to me and let us be wed at last!~ [FFACT101] */
  IF ~~ THEN EXTERN ~FFACTOR2~ 0
END

IF ~~ THEN BEGIN 1 // from: FFCROWD3:0.0
  SAY #29909 /* ~(AHEM!)  But... is it Rodrigo?  No!  No!!  How can this be?!~ [FFACT102] */
  IF ~~ THEN EXTERN ~FFBIFF01~ 3
END

IF ~~ THEN BEGIN 2 // from: FFBIFF01:6.0 FFACTOR3:6.0
  SAY #29917 /* ~(sigh)  Yes, you are correct, Rodrigo.  'Twas I that arranged for thy trip across the great ocean!  'Twas... er... um... truly fiendish of me!  But how did thy ever come to return so quickly?~ [FFACT103] */
  IF ~~ THEN EXTERN ~FFBIFF01~ 7
END

IF WEIGHT #2 /* Triggers after states #: 8 even though they appear after this state */
~Global("RaelisJob","GLOBAL",0)
!GlobalGT("HaerDalisFree","GLOBAL",0)
!Dead("HaerDalis")~ THEN BEGIN 3 // from:
  SAY #29930 /* ~If you have business with us, my <LADYLORD>, I suggest you speak to Raelis.  She is the leader of our troupe and our mentor... and she can tell you of our difficulty.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #3 /* Triggers after states #: 8 even though they appear after this state */
~Global("RaelisJob","GLOBAL",1)
!GlobalGT("HaerDalisFree","GLOBAL",0)
!Dead("HaerDalis")~ THEN BEGIN 4 // from:
  SAY #29931 /* ~You are most gracious, my <LADYLORD>, to offer your assistance.  We thank you, truly... and I am sure Haer'Dalis will appreciate your help, as well!~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #4 /* Triggers after states #: 8 even though they appear after this state */
~GlobalGT("HaerDalisFree","GLOBAL",0)
!Dead("HaerDalis")
Global("RaelisHasGem","GLOBAL",0)
Global("PlanarPrison","GLOBAL",0)
~ THEN BEGIN 5 // from:
  SAY #37751 /* ~You have freed our brother!  For that, I would lay roses at thy feet, my <LADYLORD>!  But... there is still the matter of the... ah... gem, is there not?~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #5 /* Triggers after states #: 8 even though they appear after this state */
~GlobalGT("HaerDalisFree","GLOBAL",0)
!Dead("HaerDalis)
Global("RaelisHasGem","GLOBAL",1)
Global("PlanarPrison","GLOBAL",0)
~ THEN BEGIN 6 // from:
  SAY #37752 /* ~I thank you, my <LADYLORD>... you have done much for us all.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #6 /* Triggers after states #: 8 even though they appear after this state */
~Dead("HaerDalis")~ THEN BEGIN 7 // from:
  SAY #37756 /* ~Ahhh... our brother is dead.  Poor Haer'Dalis, truly he had little in the way of luck.  Leave us be, Prime... we must mourn for our fallen comrade...~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #0 ~Global("PlanarPrison","GLOBAL",1)
Global("DisableDeathTrap","AR0516",0)
Global("KirinaldoWarns","LOCALS",0)
~ THEN BEGIN 8 // from:
  SAY #39749 /* ~Stay back!  If you come in this cell without the planar prison key, the defensive magics will destroy you!~ */
  IF ~~ THEN DO ~SetGlobal("KirinaldoWarns","LOCALS",1)~ EXIT
END
