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

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

IF WEIGHT #0 ~NumberOfTimesTalkedTo(0)
Global("Therella","GLOBAL",0)
ReactionGT(LastTalkedToBy(Myself),HOSTILE_UPPER)
~ THEN BEGIN 0 // from:
  SAY #84504 /* ~Greetings, adventurers. You must excuse me if I've nary a happy word to share this day. There has been a loss in the family, you see.~ */
  IF ~~ THEN REPLY #84505 /* ~Worry not, lady. Is there anything that we could do to help?~ */ GOTO 3
  IF ~~ THEN REPLY #84506 /* ~I see. We shall not bother you any longer, in that case.~ */ GOTO 4
  IF ~~ THEN REPLY #84507 /* ~I care not for your petty problems. I have questions that need to be answered.~ */ GOTO 5
END

IF WEIGHT #1 ~NumberOfTimesTalkedTo(0)
Global("Therella","GLOBAL",0)
ReactionGT(LastTalkedToBy(Myself),NEUTRAL_UPPER)
~ THEN BEGIN 1 // from:
  SAY #84508 /* ~Noble people, I beg your forgiveness for my grim visage. There has been a disappearance in my family. I still mourn the loss.~ */
  IF ~~ THEN REPLY #84505 /* ~Worry not, lady. Is there anything that we could do to help?~ */ GOTO 3
  IF ~~ THEN REPLY #84506 /* ~I see. We shall not bother you any longer, in that case.~ */ GOTO 4
  IF ~~ THEN REPLY #84507 /* ~I care not for your petty problems. I have questions that need to be answered.~ */ GOTO 5
END

IF WEIGHT #2 ~NumberOfTimesTalkedTo(0)
Global("Therella","GLOBAL",0)
ReactionLT(LastTalkedToBy(Myself),NEUTRAL_LOWER)
~ THEN BEGIN 2 // from:
  SAY #84509 /* ~Please leave me be. I am in mourning.~ */
  IF ~~ THEN REPLY #84505 /* ~Worry not, lady. Is there anything that we could do to help?~ */ GOTO 3
  IF ~~ THEN REPLY #84506 /* ~I see. We shall not bother you any longer, in that case.~ */ GOTO 4
  IF ~~ THEN REPLY #84507 /* ~I care not for your petty problems. I have questions that need to be answered.~ */ GOTO 5
END

IF ~~ THEN BEGIN 3 // from: 17.0 2.0 1.0 0.0
  SAY #84510 /* ~Unless you wish to search for my errant son, then no.~ */
  IF ~~ THEN REPLY #84511 /* ~Tell us the tale and we might be able to help.~ */ GOTO 6
  IF ~~ THEN REPLY #84512 /* ~As you will. Good day.~ */ GOTO 4
END

IF ~~ THEN BEGIN 4 // from: 17.1 3.1 2.1 1.1 0.1
  SAY #84513 /* ~May your stay in Ulgoth's Beard be happier than mine.~ */
  IF ~~ THEN DO ~SetGlobal("TherTalk","GLOBAL",1)
~ EXIT
END

IF ~~ THEN BEGIN 5 // from: 17.2 7.2 2.2 1.2 0.2
  SAY #84514 /* ~I have done nothing to deserve such unkindness. Leave me to my mourning.~ */
  IF ~~ THEN DO ~SetGlobal("TherTalk","GLOBAL",1)
~ EXIT
END

IF ~~ THEN BEGIN 6 // from: 3.0
  SAY #84515 /* ~I have, or perhaps I should say had, a son named Dalton. He fell in with a crew of adventurers from Waterdeep. Dalton was always obsessed with the idea of being a hero. Alas, he has neither the brains nor the ability. Such is a mother's lot in life however, to watch her children perform acts of idiocy despite her warnings or concerns.~ */
  IF ~~ THEN GOTO 7
END

IF ~~ THEN BEGIN 7 // from: 6.0
  SAY #84517 /* ~My poor boy took those acts of idiocy to the extreme. He and his thickskulled cohorts took it upon themselves to plumb the depths of Durlag's Tower. They bought a ward token from that shyster, Galkin, and made ready to leave. Though I begged and cried, Dalton still insisted on going. The band never returned. I fear that they were destroyed by the mad dwarf's machinations. That is the tale, sad but true.~ */
  IF ~~ THEN REPLY #84518 /* ~I wish I could help, but we have other concerns at present.~ */ GOTO 8
  IF ~~ THEN REPLY #84519 /* ~Rest easy, woman. We will find your son if he still lives.~ */ GOTO 9
  IF ~~ THEN REPLY #84520 /* ~He deserved his fate. Cease your pointless weeping.~ */ GOTO 5
  IF ~Global("X#THEREL7","GLOBAL",0)
InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#THEREL7","GLOBAL",1)~ EXTERN ~_GARRIJ~ 26
  IF ~Global("X#THEREL7","GLOBAL",0)
InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#THEREL7","GLOBAL",1)~ EXTERN ~_GARRIJ~ 27
  IF ~Global("X#THEREL7","GLOBAL",0)
InParty("faldorn")
InMyArea("faldorn")
!StateCheck("faldorn",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#THEREL7","GLOBAL",1)~ EXTERN ~_FALDOJ~ 48
END

IF ~~ THEN BEGIN 8 // from: 7.0
  SAY #84521 /* ~If you say so. Excuse me.~ */
  IF ~~ THEN DO ~SetGlobal("TherTalk","GLOBAL",1)
~ EXIT
END

IF ~~ THEN BEGIN 9 // from: 7.1
  SAY #84522 /* ~Thank you so much. Such kindness from strangers is unheard of in this harsh life. I will await Dalton's return with breathless anticipation.~ */
  IF ~~ THEN DO ~SetGlobal("Therella","GLOBAL",1)
~ UNSOLVED_JOURNAL #84516 /* ~Therella's missing son

In Ulgoth's Beard, a woman named Therella asked us to look for her errant son in Durlag's Tower.  The boy's name is Dalton.~ */ EXIT
END

IF WEIGHT #3 ~Global("Therella","GLOBAL",2)
!Dead("dalton")
~ THEN BEGIN 10 // from:
  SAY #84523 /* ~Thank you for rescuing Dalton.  He arrived back here just a few days before you did.  The tales he had to tell were quite fantastic: demon knights!  Well, it was nice seeing my son even if wasn't for long.  Here is some of my savings for your time.~ */
  IF ~~ THEN DO ~GiveGoldForce(300)
~ GOTO 11
END

IF ~~ THEN BEGIN 11 // from: 10.0
  SAY #84524 /* ~Your rescue may have been in vain, however. Dalton has set off in search of adventure again. That stupid, stupid child.~ */
  IF ~~ THEN DO ~SetGlobal("Therella","GLOBAL",9)
EraseJournalEntry(84516)
EraseJournalEntry(84055)
EraseJournalEntry(83707)
~ SOLVED_JOURNAL #88927 /* ~Therella's missing son

We journeyed to Ulgoth's Beard and informed Therella of our success in saving her son.  She was thankful, and even rewarded us with some gold from her undoubtedly meager savings.~ */ EXIT
END

IF WEIGHT #8 /* Triggers after states #: 13 14 17 18 even though they appear after this state */
~Global("Therella","GLOBAL",9)
~ THEN BEGIN 12 // from:
  SAY #84525 /* ~I must return to my worrying. Excuse me.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #7 /* Triggers after states #: 14 17 18 even though they appear after this state */
~Global("Therella","GLOBAL",1)
~ THEN BEGIN 13 // from:
  SAY #84526 /* ~Please keep looking for my poor son.  I don't know how much longer I can bear to be apart from him.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #4 ~Dead("daltan")
~ THEN BEGIN 14 // from:
  SAY #84527 /* ~Have you found Dalton yet?  I so worry about my boy.~ */
  IF ~~ THEN REPLY #84528 /* ~No, he's dead.  The whiny little boy had it coming.~ */ GOTO 15
  IF ~~ THEN REPLY #84529 /* ~I'm sorry Therella, there was little we could do.  Your son is dead.~ */ GOTO 16
END

IF ~~ THEN BEGIN 15 // from: 14.0
  SAY #84530 /* ~You... you... MONSTERS!!!!~ */
  IF ~~ THEN DO ~EraseJournalEntry(84516)
EraseJournalEntry(84055)
EraseJournalEntry(83707)
EscapeArea()
~ SOLVED_JOURNAL #88926 /* ~Therella's missing son

We journeyed to Ulgoth's Beard and informed Therella of her son's death.  Not unexpectedly, she was deeply distraugt after hearing the news.~ */ EXIT
END

IF ~~ THEN BEGIN 16 // from: 14.1
  SAY #84531 /* ~My son is dead.  But... I can't believe... it's not fair.  Why is fate so cruel?~ */
  IF ~~ THEN DO ~EraseJournalEntry(84516)
EraseJournalEntry(84055)
EraseJournalEntry(83707)
EscapeArea()
~ SOLVED_JOURNAL #88926 /* ~Therella's missing son

We journeyed to Ulgoth's Beard and informed Therella of her son's death.  Not unexpectedly, she was deeply distraugt after hearing the news.~ */ EXIT
END

IF WEIGHT #5 ~Global("TherTalk","GLOBAL",1)
Global("Therella","GLOBAL",0)
~ THEN BEGIN 17 // from:
  SAY #84532 /* ~You must excuse me if I've nary a happy word to share this day. There has been a loss in the family, you see.~ */
  IF ~~ THEN REPLY #84505 /* ~Worry not, lady. Is there anything that we could do to help?~ */ GOTO 3
  IF ~~ THEN REPLY #84506 /* ~I see. We shall not bother you any longer, in that case.~ */ GOTO 4
  IF ~~ THEN REPLY #84507 /* ~I care not for your petty problems. I have questions that need to be answered.~ */ GOTO 5
END

IF WEIGHT #6 ~Global("TherTalk","GLOBAL",0)
Global("Therella","GLOBAL",0)
Global("Daltan","GLOBAL",1)
~ THEN BEGIN 18 // from:
  SAY #84533 /* ~My son has run off on some foolish adventure. You must excuse me for being to distraught to talk.~ */
  IF ~~ THEN EXIT
END
