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

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

IF WEIGHT #0 ~NumberOfTimesTalkedTo(0)
~ THEN BEGIN 0 // from:
  SAY #86062 /* ~Oh, hello! Hey, have you seen my copy of "The History of Halruaa" anywhere? You know how I can't stand the constant shuffling of arthritic feet up in the library... So I thought I'd get a bit of fresh air just east of here and... Oh, I hate being so absent-minded! Please, if you find it, I really do need it back.~ */
  IF ~~ THEN DO ~SetGlobal("Chapter","GLOBAL",1)
AddJournalEntry(86063,QUEST)
SetGlobal("Chapter","GLOBAL",0)
~ EXIT
END

IF WEIGHT #4 /* Triggers after states #: 2 3 4 even though they appear after this state */
~!HasItem("_BOOK16",LastTalkedToBy)
Global("HelpPhlydia","GLOBAL",0)
~ THEN BEGIN 1 // from:
  SAY #86064 /* ~No luck, huh? Did I go visit the cows this time? Oh, I can never remember.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #1 ~ReactionGT(LastTalkedToBy,HOSTILE_UPPER)
HasItem("_BOOK16",LastTalkedToBy)
~ THEN BEGIN 2 // from:
  SAY #86065 /* ~My book! Oh, you remind me of Gorion when you grin like that. Raising you has been hard on him, I know, but he says it's a toil of love, a toil of destiny, even. You must be a very special child, indeed, to draw such praise from a man of his silent nature... Here, take this little gem of mine. Maybe Winthrop will give you a little something for it.~ */
  IF ~~ THEN DO ~AddexperienceParty(50)
TakePartyItem("_BOOK16")
EraseJournalEntry(86063)
GiveItem("_MISC17",LastTalkedToBy)
SetGlobal("HelpPhlydia","GLOBAL",1)
SetGlobal("Chapter","GLOBAL",1)
AddJournalEntry(86066,QUEST_DONE)
SetGlobal("Chapter","GLOBAL",0)
~ EXIT
END

IF WEIGHT #2 ~ReactionLT(LastTalkedToBy,NEUTRAL_LOWER)
HasItem("_BOOK16",LastTalkedToBy)
~ THEN BEGIN 3 // from:
  SAY #86067 /* ~Oh, thanks. It was by the cows again, wasn't it... Hmm, yes, where was I?~ */
  IF ~~ THEN DO ~AddexperienceParty(50)
TakePartyItem("_BOOK16")
EraseJournalEntry(86063)
SetGlobal("HelpPhlydia","GLOBAL",1)
SetGlobal("Chapter","GLOBAL",1)
AddJournalEntry(86068,QUEST_DONE)
SetGlobal("Chapter","GLOBAL",0)
~ EXIT
END

IF WEIGHT #3 ~False()
~ THEN BEGIN 4 // from:
  SAY #86069 /* ~Why you little, impertinent brat! Watchers! Arrest this thug!~ */
  IF ~~ THEN EXIT
END
