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

BEGIN ~CELVAN~ 2 // non-zero flags may indicate non-pausing dialogue
//////////////////////////////////////////////////
// WARNING: this file contains non-trivial WEIGHTs
//////////////////////////////////////////////////

IF WEIGHT #1 /* Triggers after states #: 9 even though they appear after this state */
~See("Minsc")
InParty("Minsc")
!StateCheck("Minsc",STATE_SLEEPING)
RandomNum(2,1)
Global("celvanminsc","AR0300",0)~ THEN BEGIN 0 // from:
  SAY #25448 /* ~"There once was a warrior true,
With the sense knocked out of him, too.
But in a hamster he found,
Some wisdom profound,
And now where goes he goes his Boo!"~ */
  IF ~~ THEN DO ~SetGlobal("TalkedToCelvan","LOCALS",1)
SetGlobal("celvanminsc","AR0300",1)~ EXTERN ~MINSCJ~ 48
END

IF WEIGHT #8 /* Triggers after states #: 2 3 5 6 7 8 9 even though they appear after this state */
~True()
~ THEN BEGIN 1 // from: ANOMENJ:122.0
  SAY #25453 /* ~Tee-hee hee!~ */
  IF ~~ THEN DO ~RunAwayFrom([PC],300)
~ EXIT
END

IF WEIGHT #2 /* Triggers after states #: 9 even though they appear after this state */
~See("Jaheira")
InParty("Jaheira")
!StateCheck("Jaheira",STATE_SLEEPING)
RandomNum(2,1)
Global("celvanjaheira","AR0300",0)
~ THEN BEGIN 2 // from:
  SAY #25454 /* ~"There once was an elf proud and fair,
Men withered once under her stare.
But she loved one man true,
And he died... as men do,
And now there is naught but grief there."~ */
  IF ~~ THEN DO ~SetGlobal("celvanjaheira","AR0300",1)~ EXTERN ~JAHEIRAJ~ 240
END

IF WEIGHT #3 /* Triggers after states #: 9 even though they appear after this state */
~See("Anomen")
InParty("Anomen")
!StateCheck("Anomen",STATE_SLEEPING)
RandomNum(2,1)
Global("celvananomen","AR0300",0)
~ THEN BEGIN 3 // from:
  SAY #25459 /* ~"There once was a man full of woes,
Strong and mighty he smote all his foes.
Soon he'll take his Test,
To him it's no jest,
If he'll pass not even he knows."~ */
  IF ~~ THEN DO ~SetGlobal("celvananomen","AR0300",1)~ EXTERN ~ANOMENJ~ 122
END

IF ~~ THEN BEGIN 4 // from:
  SAY #25463 /* ~"There once was an elf of the Dark,
Whose bite was far worse than her bark.
Left without a home,
On the surface she'll roam,
In the sun she might just make her mark."~ */
  IF ~~ THEN EXTERN ~VICONIJ~ 14
END

IF WEIGHT #4 /* Triggers after states #: 9 even though they appear after this state */
~See("Aerie")
InParty("Aerie")
!StateCheck("Aerie",STATE_SLEEPING)
RandomNum(2,1)
Global("celvanaerie","AR0300",0)
~ THEN BEGIN 5 // from:
  SAY #25466 /* ~"There once was an elf who could fly,
Without wings she was sure she would die.
But soon she'll have found
That it is on the ground
That her true destiny does lie."~ */
  IF ~~ THEN DO ~SetGlobal("celvanaerie","AR0300",1)~ EXTERN ~AERIEJ~ 28
END

IF WEIGHT #5 /* Triggers after states #: 9 even though they appear after this state */
~See("Keldorn")
InParty("Keldorn")
!StateCheck("Keldorn",STATE_SLEEPING)
RandomNum(2,1)
Global("celvankeldorn","AR0300",0)
~ THEN BEGIN 6 // from:
  SAY #25469 /* ~"There once was a knight pure of heart,
From his wife he is always apart.
Has his heart grown colder
As his deeds grew bolder?
What is finished can never restart."~ */
  IF ~~ THEN DO ~SetGlobal("celvankeldorn","AR0300",1)~ EXTERN ~KELDORJ~ 62
END

IF WEIGHT #6 /* Triggers after states #: 9 even though they appear after this state */
~See("Mazzy")
InParty("Mazzy")
!StateCheck("Mazzy",STATE_SLEEPING)
RandomNum(2,1)
Global("celvanmazzy","AR0300",0)
~ THEN BEGIN 7 // from:
  SAY #25471 /* ~"There once was a halfling so pure,
She's a paladin, as sure as she's sure.
If she's lucky one day
Her god will smile and say
That the lack of one she'll no longer endure."~ */
  IF ~~ THEN DO ~SetGlobal("celvanmazzy","AR0300",1)~ EXTERN ~MAZZYJ~ 77
END

IF WEIGHT #7 /* Triggers after states #: 9 even though they appear after this state */
~See("Valygar")
InParty("Valygar")
!StateCheck("Valygar",STATE_SLEEPING)
RandomNum(2,1)
Global("celvanvalygar","AR0300",0)~ THEN BEGIN 8 // from:
  SAY #25473 /* ~"There once was a man so afraid
That his soul was to be soon waylaid,
See, the wizard's returned
In his sphere, he has learned,
But has he learned if a soul can be weighed?"~ */
  IF ~~ THEN DO ~SetGlobal("celvanvalygar","AR0300",1)~ EXTERN ~VALYGARJ~ 16
END

IF WEIGHT #0 ~Global("TalkedToCelvan","LOCALS",1)
RandomNum(2,1)
~ THEN BEGIN 9 // from:
  SAY #25480 /* ~"There once was a child of... of...~ */
  IF ~~ THEN GOTO 10
END

IF ~~ THEN BEGIN 10 // from: 9.0
  SAY #25482 /* ~Oh my...~ */
  IF ~~ THEN REPLY #25484 /* ~What is it?  How do you know so much about us?~ */ GOTO 11
  IF ~~ THEN REPLY #25485 /* ~Tell me what you know about us or I'll knock you from one end of this city to the other!!~ */ GOTO 12
END

IF ~~ THEN BEGIN 11 // from: 10.0
  SAY #25486 /* ~I..I.. (giggle!)  ..the gods speak!  They speak and speak and speak and speak!  To ME!!  Hee hee...~ */
  IF ~~ THEN DO ~RunAwayFrom([PC],300)
~ EXIT
END

IF ~~ THEN BEGIN 12 // from: 10.1
  SAY #25489 /* ~AAAAAHHHHH!!  DON'T MURDER ME!!  AAAAAHHHHH!!~ */
  IF ~~ THEN DO ~EscapeArea()
~ EXIT
END
