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

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

IF WEIGHT #2 /* Triggers after states #: 2 4 even though they appear after this state */
~PartyGoldLT(100)
Global("FirebeadDone","GLOBAL",0)
~ THEN BEGIN 0 // from:
  SAY #75396 /* ~Ah, I know a bookworm when I see one. Come back when I have a little more time and perhaps we can discuss history and literature a bit.~ */
  IF ~~ THEN DO ~SetGlobal("TalkedToFirebead","GLOBAL",1)
~ EXIT
END

IF WEIGHT #3 /* Triggers after states #: 2 4 even though they appear after this state */
~!PartyGoldLT(100)
Global("FirebeadDone","GLOBAL",0)
~ THEN BEGIN 1 // from:
  SAY #75397 /* ~Ah, you're old Gorion's ward, the lonely kid of Candlekeep! Of course!  I heard about the loss of Gorion, and I must give you my deepest condolences.  I hope since you've left Candlekeep, you've kept up on your reading... oh, the world of books... I have heard that a new copy of that wondrous tome, "The History of the Fateful Coin," can be had for a pretty penny in one of the stores around here. If you would be so kind as to buy it for an old man like myself, I'd gladly reimburse you.  I'd even give you a little bonus to help in your travels.  It must be so hard with Gorion gone.~ */
  IF ~~ THEN DO ~SetGlobal("TalkedToFirebead","GLOBAL",1)
~ UNSOLVED_JOURNAL #75398 /* ~A book for Firebead

I have met an old friend in Beregost!  Firebead Elvenhair, an elderly mage who visited the library at Candlekeep on occasion, has asked me to check out the stores in the area and purchase a copy of "The History of the Fateful Coin" for him, should I ever set eyes on it.  Confining as its walls could be, there are days when I miss Candlekeep with every bone and every ounce of flesh in my body.  This, I guess, is just going to be one of those days...~ */ EXIT
  IF ~Global("X#FirebeardImoen1","GLOBAL",0)
InParty("imoen")
InMyArea("imoen")
!StateCheck("imoen",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FirebeardImoen1","GLOBAL",1)~ EXTERN ~_IMOEN2~ 128
END

IF WEIGHT #0 ~PartyHasItem("_BOOK40")
Global("TalkedToFirebead","GLOBAL",1)
Global("FirebeadDone","GLOBAL",0)
~ THEN BEGIN 2 // from:
  SAY #75399 /* ~Ah, you are generous to an old man so I will be generous in turn. Let me give you another book in exchange. It is a touch darker than what you have given me but I get a sense that you might enjoy it, nonetheless.~ */
  IF ~~ THEN DO ~AddexperienceParty(300)
ReputationInc(1)
TakePartyItem("_BOOK40")
GiveItem("_BOOK36",LastTalkedToBy)
SetGlobal("FirebeadDone","GLOBAL",1)
EraseJournalEntry(75398)
~ SOLVED_JOURNAL #88898 /* ~A book for Firebead

Old Firebead appreciated my efforts in locating his book for him, and rewarded me in kind.~ */ EXIT
  IF ~Global("X#FIREBE2","GLOBAL",0)
InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FIREBE2","GLOBAL",1)~ GOTO 8
  IF ~Global("X#FIREBE2","GLOBAL",0)
InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FIREBE2","GLOBAL",1)~ EXTERN ~_VICONJ~ 214
  IF ~Global("X#FIREBE2","GLOBAL",0)
InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FIREBE2","GLOBAL",1)~ GOTO 10
  IF ~Global("X#FIREBE2","GLOBAL",0)
InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FIREBE2","GLOBAL",1)~ EXTERN ~_JAHEIJ~ 413
  IF ~Global("X#FIREBE2","GLOBAL",0)
InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FIREBE2","GLOBAL",1)~ GOTO 14
  IF ~Global("X#FIREBE2","GLOBAL",0)
InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FIREBE2","GLOBAL",1)~ EXTERN ~_GARRIJ~ 234
END

IF ~~ THEN BEGIN 3 // from:
  SAY #75401 /* ~Ah, you are generous to an old man so I will be generous in turn. Let me give you another book in exchange. Personally, I would call it more fantasy than history but I get the sense that you might enjoy it, nonetheless.~ */
  IF ~~ THEN DO ~TakePartyItem("_BOOK40")
GiveItem("_BOOK55",LastTalkedToBy)
SetGlobal("FirebeadDone","GLOBAL",1)
EraseJournalEntry(75398)
~ SOLVED_JOURNAL #88898 /* ~A book for Firebead

Old Firebead appreciated my efforts in locating his book for him, and rewarded me in kind.~ */ EXIT
END

IF WEIGHT #1 ~False()
~ THEN BEGIN 4 // from:
  SAY #75403 /* ~I always felt you were cut from wiser cloth than that, old friend. Gorion would be sad, indeed.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #4 ~Global("FirebeadDone","GLOBAL",0)
~ THEN BEGIN 5 // from:
  SAY #75404 /* ~How is my favorite bookworm?~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #5 ~True()
~ THEN BEGIN 6 // from:
  SAY #75405 /* ~Ah, next time you pass through Candlekeep, you should read the "History of the Bell in the Depths." It is an old favorite of mine that I'm sure you would like.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 7 // from: _IMOEN2:128.4
  SAY #100280 /* ~Imoen! Glad to see you, lass. Forgive me for not recognizing you immediately; but you have changed!~ */
  IF ~~ THEN DO ~SetGlobal("TalkedToFirebead","GLOBAL",1)
~ UNSOLVED_JOURNAL #75398 /* ~A book for Firebead

I have met an old friend in Beregost!  Firebead Elvenhair, an elderly mage who visited the library at Candlekeep on occasion, has asked me to check out the stores in the area and purchase a copy of "The History of the Fateful Coin" for him, should I ever set eyes on it.  Confining as its walls could be, there are days when I miss Candlekeep with every bone and every ounce of flesh in my body.  This, I guess, is just going to be one of those days...~ */ EXIT
  IF ~  InParty("imoen")
InMyArea("imoen")
!StateCheck("imoen",CD_STATE_NOTVALID)
~ THEN EXTERN ~_IMOEN2~ 131
  IF ~  InParty("imoen")
InMyArea("imoen")
!StateCheck("imoen",CD_STATE_NOTVALID)
~ THEN EXTERN ~_IMOEN2~ 130
  IF ~  InParty("imoen")
InMyArea("imoen")
!StateCheck("imoen",CD_STATE_NOTVALID)
~ THEN EXTERN ~_IMOEN2~ 129
END

IF ~~ THEN BEGIN 8 // from: 2.1
  SAY #103484 /* ~Farewell!~ */
  IF ~~ THEN DO ~AddexperienceParty(300)
ReputationInc(1)
TakePartyItem("_BOOK40")
GiveItem("_BOOK36",LastTalkedToBy)
SetGlobal("FirebeadDone","GLOBAL",1)
EraseJournalEntry(75398)
~ SOLVED_JOURNAL #88898 /* ~A book for Firebead

Old Firebead appreciated my efforts in locating his book for him, and rewarded me in kind.~ */ EXIT
END

IF ~~ THEN BEGIN 9 // from:
  SAY #103484 /* ~Farewell!~ */
  IF ~~ THEN DO ~AddexperienceParty(300)
ReputationInc(1)
TakePartyItem("_BOOK40")
GiveItem("_BOOK36",LastTalkedToBy)
SetGlobal("FirebeadDone","GLOBAL",1)
EraseJournalEntry(75398)
~ SOLVED_JOURNAL #88898 /* ~A book for Firebead

Old Firebead appreciated my efforts in locating his book for him, and rewarded me in kind.~ */ EXIT
END

IF ~~ THEN BEGIN 10 // from: 2.3
  SAY #103520 /* ~Much of history is unsettling, but I hope you will enjoy the book nonetheless.~ */
  IF ~~ THEN DO ~AddexperienceParty(300)
ReputationInc(1)
TakePartyItem("_BOOK40")
GiveItem("_BOOK36",LastTalkedToBy)
SetGlobal("FirebeadDone","GLOBAL",1)
EraseJournalEntry(75398)
~ SOLVED_JOURNAL #88898 /* ~A book for Firebead

Old Firebead appreciated my efforts in locating his book for him, and rewarded me in kind.~ */ EXIT
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN GOTO 11
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~_VICONJ~ 215
END

IF ~~ THEN BEGIN 11 // from: 10.1
  SAY #103484 /* ~Farewell!~ */
  IF ~~ THEN DO ~AddexperienceParty(300)
ReputationInc(1)
TakePartyItem("_BOOK40")
GiveItem("_BOOK36",LastTalkedToBy)
SetGlobal("FirebeadDone","GLOBAL",1)
EraseJournalEntry(75398)
~ SOLVED_JOURNAL #88898 /* ~A book for Firebead

Old Firebead appreciated my efforts in locating his book for him, and rewarded me in kind.~ */ EXIT
END

IF ~~ THEN BEGIN 12 // from: _JAHEIJ:413.3
  SAY #103520 /* ~Much of history is unsettling, but I hope you will enjoy the book nonetheless.~ */
  IF ~~ THEN DO ~AddexperienceParty(300)
ReputationInc(1)
TakePartyItem("_BOOK40")
GiveItem("_BOOK36",LastTalkedToBy)
SetGlobal("FirebeadDone","GLOBAL",1)
EraseJournalEntry(75398)
~ SOLVED_JOURNAL #88898 /* ~A book for Firebead

Old Firebead appreciated my efforts in locating his book for him, and rewarded me in kind.~ */ EXIT
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN GOTO 13
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~_VICONJ~ 216
END

IF ~~ THEN BEGIN 13 // from: _JAHEIJ:413.1 12.1
  SAY #103484 /* ~Farewell!~ */
  IF ~~ THEN DO ~AddexperienceParty(300)
ReputationInc(1)
TakePartyItem("_BOOK40")
GiveItem("_BOOK36",LastTalkedToBy)
SetGlobal("FirebeadDone","GLOBAL",1)
EraseJournalEntry(75398)
~ SOLVED_JOURNAL #88898 /* ~A book for Firebead

Old Firebead appreciated my efforts in locating his book for him, and rewarded me in kind.~ */ EXIT
END

IF ~~ THEN BEGIN 14 // from: 2.5
  SAY #103518 /* ~Yes, it is dark, but history often is.~ */
  IF ~~ THEN DO ~AddexperienceParty(300)
ReputationInc(1)
TakePartyItem("_BOOK40")
GiveItem("_BOOK36",LastTalkedToBy)
SetGlobal("FirebeadDone","GLOBAL",1)
EraseJournalEntry(75398)
~ SOLVED_JOURNAL #88898 /* ~A book for Firebead

Old Firebead appreciated my efforts in locating his book for him, and rewarded me in kind.~ */ EXIT
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN GOTO 16
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~_VICONJ~ 217
  IF ~  InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN GOTO 15
  IF ~  InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN EXTERN ~_JAHEIJ~ 414
END

IF ~~ THEN BEGIN 15 // from: _JAHEIJ:414.3 14.3
  SAY #103520 /* ~Much of history is unsettling, but I hope you will enjoy the book nonetheless.~ */
  IF ~~ THEN DO ~AddexperienceParty(300)
ReputationInc(1)
TakePartyItem("_BOOK40")
GiveItem("_BOOK36",LastTalkedToBy)
SetGlobal("FirebeadDone","GLOBAL",1)
EraseJournalEntry(75398)
~ SOLVED_JOURNAL #88898 /* ~A book for Firebead

Old Firebead appreciated my efforts in locating his book for him, and rewarded me in kind.~ */ EXIT
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN GOTO 16
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~_VICONJ~ 217
END

IF ~~ THEN BEGIN 16 // from: _JAHEIJ:414.1 15.1 14.1
  SAY #103484 /* ~Farewell!~ */
  IF ~~ THEN DO ~AddexperienceParty(300)
ReputationInc(1)
TakePartyItem("_BOOK40")
GiveItem("_BOOK36",LastTalkedToBy)
SetGlobal("FirebeadDone","GLOBAL",1)
EraseJournalEntry(75398)
~ SOLVED_JOURNAL #88898 /* ~A book for Firebead

Old Firebead appreciated my efforts in locating his book for him, and rewarded me in kind.~ */ EXIT
END

IF ~~ THEN BEGIN 17 // from: _GARRIJ:234.5
  SAY #103518 /* ~Yes, it is dark, but history often is.~ */
  IF ~~ THEN DO ~AddexperienceParty(300)
ReputationInc(1)
TakePartyItem("_BOOK40")
GiveItem("_BOOK36",LastTalkedToBy)
SetGlobal("FirebeadDone","GLOBAL",1)
EraseJournalEntry(75398)
~ SOLVED_JOURNAL #88898 /* ~A book for Firebead

Old Firebead appreciated my efforts in locating his book for him, and rewarded me in kind.~ */ EXIT
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN GOTO 19
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~_VICONJ~ 218
  IF ~  InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN GOTO 18
  IF ~  InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN EXTERN ~_JAHEIJ~ 415
END

IF ~~ THEN BEGIN 18 // from: _JAHEIJ:415.3 _GARRIJ:234.3 17.3
  SAY #103520 /* ~Much of history is unsettling, but I hope you will enjoy the book nonetheless.~ */
  IF ~~ THEN DO ~AddexperienceParty(300)
ReputationInc(1)
TakePartyItem("_BOOK40")
GiveItem("_BOOK36",LastTalkedToBy)
SetGlobal("FirebeadDone","GLOBAL",1)
EraseJournalEntry(75398)
~ SOLVED_JOURNAL #88898 /* ~A book for Firebead

Old Firebead appreciated my efforts in locating his book for him, and rewarded me in kind.~ */ EXIT
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN GOTO 19
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~_VICONJ~ 218
END

IF ~~ THEN BEGIN 19 // from: _JAHEIJ:415.1 _GARRIJ:234.1 18.1 17.1
  SAY #103484 /* ~Farewell!~ */
  IF ~~ THEN DO ~AddexperienceParty(300)
ReputationInc(1)
TakePartyItem("_BOOK40")
GiveItem("_BOOK36",LastTalkedToBy)
SetGlobal("FirebeadDone","GLOBAL",1)
EraseJournalEntry(75398)
~ SOLVED_JOURNAL #88898 /* ~A book for Firebead

Old Firebead appreciated my efforts in locating his book for him, and rewarded me in kind.~ */ EXIT
END
