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

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

IF WEIGHT #0 ~!Dead("cefald01")
Global("KickedOut","LOCALS",0)~ THEN BEGIN 0 // from:
  SAY #8149 /* ~I question the throwing away of the apple while it is still green, but this is your group to lead. I will remind you that our mission at the druid grove is far from complete. I will await you near the grove. Do not be long.~ [CERND78] */
  IF ~~ THEN DO ~SetDialog("cernd")
SetGlobal("CerndWentHunting","GLOBAL",1)
RevealAreaOnMap("ar1900")
EscapeAreaMove("ar1900",2432,604,12)~ EXIT
END

IF ~~ THEN BEGIN 1 // from:
  SAY #8152 /* ~If that is what you wish, though I have enjoyed the interesting travels we have made. If you wish to meet with me again I will be at the druid grove.~ */
  IF ~~ THEN DO ~SetGlobal("KickedOut","LOCALS",1)
EscapeAreaMove("ar1900",2432,604,12)~ EXIT
END

IF ~~ THEN BEGIN 2 // from: 5.0
  SAY #8161 /* ~It will be a while before all is well, but for now things are stable. I might even be able to leave... if you had need of an extra hand once more.~ */
  IF ~~ THEN REPLY #8162 /* ~I do. Join the group and let's go.~ */ GOTO 3
  IF ~~ THEN REPLY #8163 /* ~Not as yet, but perhaps later.~ */ GOTO 4
END

IF ~~ THEN BEGIN 3 // from: 11.0 2.0
  SAY #8164 /* ~Off to travel the world once more, I do so like seeing so much of nature, even what is constrained within the cities.~ */
  IF ~~ THEN DO ~SetGlobal("KickedOut","LOCALS",0)
JoinParty()
~ EXIT
END

IF ~~ THEN BEGIN 4 // from: 11.1 2.1
  SAY #8201 /* ~As you will. I will remain here for now. Such beauty...~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #1 ~Global("KickedOut","LOCALS",1)
Global("CerndBaby","GLOBAL",0)~ THEN BEGIN 5 // from:
  SAY #39756 /* ~Hello again! Have you come here on business or just to sample the rich beauty of nature? I find myself doing much of the latter as Verthan has handled the transition to leadership very well.~ [CERND79] */
  IF ~~ THEN GOTO 2
END

IF WEIGHT #4 /* Triggers after states #: 9 10 even though they appear after this state */
~Global("KickedOut","LOCALS",0)
~ THEN BEGIN 6 // from:
  SAY #48331 /* ~Do we flower anew or is the fall upon us?~ [CERND82] */
  IF ~~ THEN REPLY #48332 /* ~Uh, just stay with the group and let's go.~ */ GOTO 7
  IF ~~ THEN REPLY #48333 /* ~I think it best that we split up for now.~ */ GOTO 8
END

IF ~~ THEN BEGIN 7 // from: 6.0
  SAY #48336 /* ~That is what I intended. Onward then.~ */
  IF ~~ THEN DO ~SetGlobal("KickedOut","LOCALS",0)
JoinParty()
~ EXIT
END

IF ~~ THEN BEGIN 8 // from: 6.1
  SAY #48337 /* ~Then I shall return to the druid grove and do nature's work from there. That is where I'll be if you wish to find me.~ */
  IF ~!AreaCheck("AR0601")
!AreaCheck("AR0602")
!AreaCheck("AR0603")
!AreaCheck("AR0410")
!AreaCheck("AR0411")
!AreaCheck("AR0412")
!AreaCheck("AR0413")
!AreaCheck("AR0414")
!AreaCheck("AR1512")
!AreaCheck("AR1513")
!AreaCheck("AR1514")
!AreaCheck("AR1515")
!AreaCheck("AR1516")
!AreaCheck("AR1501")
!AreaCheck("AR1502")
!AreaCheck("AR1503")
!AreaCheck("AR1504")
!AreaCheck("AR1505")
!AreaCheck("AR1506")
!AreaCheck("AR1507")
!AreaCheck("AR1508")
!AreaCheck("AR1509")
!AreaCheck("AR1510")
!AreaCheck("AR1511")
!AreaCheck("AR2100")
!AreaCheck("AR2101")
!AreaCheck("AR2102")
!AreaCheck("AR2200")
!AreaCheck("AR2202")
!AreaCheck("AR2203")
!AreaCheck("AR2204")
!AreaCheck("AR2205")
!AreaCheck("AR2206")
!AreaCheck("AR2207")
!AreaCheck("AR2208")
!AreaCheck("AR2209")
!AreaCheck("AR2210")
!AreaCheck("AR2300")
!AreaCheck("AR2400")
!AreaCheck("AR2401")
!AreaCheck("AR2402")
!AreaCheck("AR2900")
!AreaCheck("AR2901")
!AreaCheck("AR2902")
!AreaCheck("AR2903")
!AreaCheck("AR2904")
!AreaCheck("AR2905")
!AreaCheck("AR2906")
~ THEN REPLY #49755 /* ~We'll meet you at the druid grove, if we need you again.~ */ DO ~SetGlobal("KickedOut","LOCALS",1)
EscapeAreaMove("ar1900",2432,604,12)
~ EXIT
  IF ~!AreaCheck("AR0301")
!AreaCheck("AR0302")
!AreaCheck("AR0303")
!AreaCheck("AR0304")
!AreaCheck("AR0305")
!AreaCheck("AR0306")
!AreaCheck("AR0307")
!AreaCheck("AR0509")
!AreaCheck("AR0510")
!AreaCheck("AR0511")
!AreaCheck("AR1102")
!AreaCheck("AR1107")
!AreaCheck("AR0801")
!AreaCheck("AR0803")
!AreaCheck("AR1300")
!AreaCheck("AR1301")
!AreaCheck("AR1302")
!AreaCheck("AR1303")
!AreaCheck("AR0604")
!AreaCheck("AR0605")
!AreaCheck("AR0606")
!InWatchersKeep()
~ THEN REPLY #49756 /* ~Just wait here and if we need you we'll return.~ */ DO ~SetGlobal("KickedOut","LOCALS",1)~ EXIT
END

IF WEIGHT #2 ~HappinessLT(Myself,-299)
~ THEN BEGIN 9 // from:
  SAY #48572 /* ~Enough!  I can take no more of your company!~ */
  IF ~~ THEN DO ~EscapeArea()
~ EXIT
END

IF WEIGHT #3 ~Global("KickedOut","LOCALS",1)
Global("CerndBaby","GLOBAL",1)~ THEN BEGIN 10 // from:
  SAY #55354 /* ~My business here is done.  My child shall be raised by the druids of this place until such a time as he can choose for himself what he wishes to do... and I can return to see him whenever I wish.~ [CERND81] */
  IF ~~ THEN DO ~SetGlobal("CerndBaby","GLOBAL",0)~ GOTO 11
END

IF ~~ THEN BEGIN 11 // from: 10.0
  SAY #55355 /* ~I am still available to travel with you, if you like, <CHARNAME>.  Shall we continue your journey, then?~ */
  IF ~~ THEN REPLY #55356 /* ~Certainly.  Let's join up and get going.~ */ GOTO 3
  IF ~~ THEN REPLY #55357 /* ~No, I think we'll travel without you for awhile.~ */ GOTO 4
END
