// creator  : weidu.exe (version 23600)
// argument : RINNIE.DLG
// game     : .
// source   : ./override/RINNIE.DLG
// dialog   : lang\en_us/dialog.tlk
// dialogF  : (none)

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

IF WEIGHT #0 ~  NumberOfTimesTalkedTo(0)
ReactionLT(LastTalkedToBy,NEUTRAL_LOWER)
~ THEN BEGIN 0 // from:
  SAY #15138 /* ~Please don't interrupt me. I'm waiting to be inspired.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #1 ~  NumberOfTimesTalkedTo(0)
ReactionGT(LastTalkedToBy,HOSTILE_UPPER)
~ THEN BEGIN 1 // from:
  SAY #15139 /* ~I have been working on a ballad about the Unicorn Run in the High Forest. I'd like to use a more reliable source than simply hearsay and folklore, though. If you ever find an authoritative history of the run in your travels, I'd love to get my hands on it.~ */
  IF ~~ THEN UNSOLVED_JOURNAL #27415 /* ~A Bard's Request
Rinnie, a bard and balladeer here in Baldur's Gate, has asked me to bring her a history of the Unicorn Run should I encounter one in my travels. Rinnie can be found in one of the houses located beside the palace.~ */ EXIT
  IF ~Global("X#RINNIE1","GLOBAL",0)
InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#RINNIE1","GLOBAL",1)~ GOTO 7
  IF ~Global("X#RINNIE1","GLOBAL",0)
InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#RINNIE1","GLOBAL",1)~ EXTERN ~GARRIJ~ 247
  IF ~Global("X#RINNIE1","GLOBAL",0)
InParty("coran")
InMyArea("coran")
!StateCheck("coran",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#RINNIE1","GLOBAL",1)~ GOTO 9
  IF ~Global("X#RINNIE1","GLOBAL",0)
InParty("coran")
InMyArea("coran")
!StateCheck("coran",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#RINNIE1","GLOBAL",1)~ EXTERN ~CORANJ~ 561
  IF ~Global("X#RINNIE1","GLOBAL",0)
InParty("coran")
InMyArea("coran")
!StateCheck("coran",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#RINNIE1","GLOBAL",1)~ EXTERN ~CORANJ~ 562
  IF ~Global("X#RINNIE1","GLOBAL",0)
InParty("coran")
InMyArea("coran")
!StateCheck("coran",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#RINNIE1","GLOBAL",1)~ EXTERN ~CORANJ~ 564
END

IF WEIGHT #5 /* Triggers after states #: 3 4 6 even though they appear after this state */
~  Global("HelpRinnie","GLOBAL",0)
~ THEN BEGIN 2 // from:
  SAY #15140 /* ~Hi there. Found anything substantial on the Unicorn Run yet?~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #2 ~  PartyHasItem("BOOK55")
ReactionGT(LastTalkedToBy,NEUTRAL_UPPER)
Global("HelpRinnie","GLOBAL",0)
~ THEN BEGIN 3 // from:
  SAY #15141 /* ~"History of the Unicorn Run..." How wonderfully ideal! You wouldn't believe how grateful I am to get my hands on this. Here, a friend of mine gave me this magical scroll and I have yet to make use of it.~ */
  IF ~~ THEN DO ~EraseJournalEntry(27415)
TakePartyItem("BOOK55")
GiveItem("SCRL08",LastTalkedToBy)
SetGlobal("HelpRinnie","GLOBAL",1)
AddexperienceParty(900)
~ SOLVED_JOURNAL #27416 /* ~A Bard's Request
I didn't need it myself, so I gave "The History of the Unicorn Run" to Rinnie.~ */ EXIT
END

IF WEIGHT #3 ~  False()
~ THEN BEGIN 4 // from:
  SAY #15142 /* ~Must you pick on me when I'm trying to concentrate?~ */
  IF ~~ THEN DO ~EscapeArea()
~ EXIT
END

IF WEIGHT #6 /* Triggers after states #: 6 even though they appear after this state */
~  True()
~ THEN BEGIN 5 // from:
  SAY #15143 /* ~"Sweet waters of the forest
flow through each den and glade,
nourishing the unicorns
who lie graceful in the shade..."~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #4 ~  PartyHasItem("BOOK55")
ReactionLT(LastTalkedToBy,FRIENDLY_LOWER)
Global("HelpRinnie","GLOBAL",0)
~ THEN BEGIN 6 // from:
  SAY #15144 /* ~"History of the Unicorn Run..." Interesting... I'll give you 80 gold pieces for it.~ */
  IF ~~ THEN DO ~EraseJournalEntry(27415)
TakePartyItem("BOOK55")
SetGlobal("HelpRinnie","GLOBAL",1)
AddexperienceParty(900)
GiveGoldForce(80)
~ SOLVED_JOURNAL #27416 /* ~A Bard's Request
I didn't need it myself, so I gave "The History of the Unicorn Run" to Rinnie.~ */ EXIT
END

IF ~~ THEN BEGIN 7 // from: 1.1
  SAY #50443 /* ~Well, thanks!~ */
  IF ~~ THEN UNSOLVED_JOURNAL #27415 /* ~A Bard's Request
Rinnie, a bard and balladeer here in Baldur's Gate, has asked me to bring her a history of the Unicorn Run should I encounter one in my travels. Rinnie can be found in one of the houses located beside the palace.~ */ EXIT
END

IF ~~ THEN BEGIN 8 // from:
  SAY #50443 /* ~Well, thanks!~ */
  IF ~~ THEN UNSOLVED_JOURNAL #27415 /* ~A Bard's Request
Rinnie, a bard and balladeer here in Baldur's Gate, has asked me to bring her a history of the Unicorn Run should I encounter one in my travels. Rinnie can be found in one of the houses located beside the palace.~ */ EXIT
END

IF ~~ THEN BEGIN 9 // from: 1.3
  SAY #50441 /* ~*blushes* It is *nothing* of the kind, of course!~ */
  IF ~~ THEN UNSOLVED_JOURNAL #27415 /* ~A Bard's Request
Rinnie, a bard and balladeer here in Baldur's Gate, has asked me to bring her a history of the Unicorn Run should I encounter one in my travels. Rinnie can be found in one of the houses located beside the palace.~ */ EXIT
  IF ~  InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN GOTO 10
  IF ~  InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN EXTERN ~GARRIJ~ 248
END

IF ~~ THEN BEGIN 10 // from: 9.1
  SAY #50443 /* ~Well, thanks!~ */
  IF ~~ THEN UNSOLVED_JOURNAL #27415 /* ~A Bard's Request
Rinnie, a bard and balladeer here in Baldur's Gate, has asked me to bring her a history of the Unicorn Run should I encounter one in my travels. Rinnie can be found in one of the houses located beside the palace.~ */ EXIT
END

IF ~~ THEN BEGIN 11 // from:
  SAY #50441 /* ~*blushes* It is *nothing* of the kind, of course!~ */
  IF ~~ THEN UNSOLVED_JOURNAL #27415 /* ~A Bard's Request
Rinnie, a bard and balladeer here in Baldur's Gate, has asked me to bring her a history of the Unicorn Run should I encounter one in my travels. Rinnie can be found in one of the houses located beside the palace.~ */ EXIT
  IF ~  InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN GOTO 12
  IF ~  InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN EXTERN ~GARRIJ~ 249
END

IF ~~ THEN BEGIN 12 // from: 11.1
  SAY #50443 /* ~Well, thanks!~ */
  IF ~~ THEN UNSOLVED_JOURNAL #27415 /* ~A Bard's Request
Rinnie, a bard and balladeer here in Baldur's Gate, has asked me to bring her a history of the Unicorn Run should I encounter one in my travels. Rinnie can be found in one of the houses located beside the palace.~ */ EXIT
END

IF ~~ THEN BEGIN 13 // from:
  SAY #50441 /* ~*blushes* It is *nothing* of the kind, of course!~ */
  IF ~~ THEN UNSOLVED_JOURNAL #27415 /* ~A Bard's Request
Rinnie, a bard and balladeer here in Baldur's Gate, has asked me to bring her a history of the Unicorn Run should I encounter one in my travels. Rinnie can be found in one of the houses located beside the palace.~ */ EXIT
  IF ~  InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN GOTO 14
  IF ~  InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN EXTERN ~GARRIJ~ 250
END

IF ~~ THEN BEGIN 14 // from: 13.1
  SAY #50443 /* ~Well, thanks!~ */
  IF ~~ THEN UNSOLVED_JOURNAL #27415 /* ~A Bard's Request
Rinnie, a bard and balladeer here in Baldur's Gate, has asked me to bring her a history of the Unicorn Run should I encounter one in my travels. Rinnie can be found in one of the houses located beside the palace.~ */ EXIT
END

IF ~~ THEN BEGIN 15 // from:
  SAY #50441 /* ~*blushes* It is *nothing* of the kind, of course!~ */
  IF ~~ THEN UNSOLVED_JOURNAL #27415 /* ~A Bard's Request
Rinnie, a bard and balladeer here in Baldur's Gate, has asked me to bring her a history of the Unicorn Run should I encounter one in my travels. Rinnie can be found in one of the houses located beside the palace.~ */ EXIT
  IF ~  InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN GOTO 16
  IF ~  InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN EXTERN ~GARRIJ~ 251
END

IF ~~ THEN BEGIN 16 // from: 15.1
  SAY #50443 /* ~Well, thanks!~ */
  IF ~~ THEN UNSOLVED_JOURNAL #27415 /* ~A Bard's Request
Rinnie, a bard and balladeer here in Baldur's Gate, has asked me to bring her a history of the Unicorn Run should I encounter one in my travels. Rinnie can be found in one of the houses located beside the palace.~ */ EXIT
END
