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

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

IF WEIGHT #1 /* Triggers after states #: 15 even though they appear after this state */
~InParty("coran")
NumberOfTimesTalkedTo(0)
~ THEN BEGIN 0 // from:
  SAY #84941 /* ~Coran!  So you've come back to the city, coward.  What brought you back?  Are you looking for another girl to seduce with your deceitful promises? Perhaps you'd care to know that you have a daughter.~ */
  IF ~~ THEN EXTERN ~_CORANJ~ 1
END

IF ~~ THEN BEGIN 1 // from: _CORANJ:1.0 _CORAN:8.0
  SAY #84957 /* ~Surprised, that your fling had its consequences.  My husband was none too pleased when my daughter turned out to be a half elf.  Yago went into a fury, nearly killed me in fact. If you care to remember, Yago was a mage of some power, power enough to curse our child to an early death. Little Namara won't live to see her first birthday.  He's gloated to me that he possesses the reverse to the spell, but he won't give it to me.  Since you're her father, Coran, you're going to find Yago and you ARE going to get the reverse of the spell from him.~ */
  IF ~~ THEN JOURNAL #84958 /* ~Our companion Coran used to be the lover of a woman named Brielbara, a woman that happened to be married at the time.  He also has a daughter that he did not know about.~ */ EXTERN ~_CORANJ~ 2
END

IF ~~ THEN BEGIN 2 // from: _CORANJ:2.0 _CORAN:9.0
  SAY #84959 /* ~Yago has been spending his nights at the Low Lantern.  It's just another despicable whorehouse disguised as something classier.  Yago has been spending all of his time there since he left me.  He's rented out a room somewhere on the ship.  Just find his spell book and bring it to me.  I should be able to reverse the curse if I had the formula.~ */
  IF ~~ THEN EXTERN ~_CORANJ~ 3
END

IF WEIGHT #2 /* Triggers after states #: 15 even though they appear after this state */
~!InParty("coran")
NumberOfTimesTalkedTo(0)
~ THEN BEGIN 3 // from:
  SAY #84961 /* ~Travelers!  Could you wait for a while so I might talk with you?  I am Brielbara, a mage of minor power.  I have heard that a group fitting your description were hiring themselves out as mercenaries.  Is that true?~ */
  IF ~~ THEN REPLY #84962 /* ~No, we're not mercenaries. We just carry weapons and kill things for the joy of the experience.~ */ GOTO 4
  IF ~~ THEN REPLY #84963 /* ~Yes, we're available for hire. Why are you interested?~ */ GOTO 5
END

IF ~~ THEN BEGIN 4 // from: 3.0
  SAY #84964 /* ~I apologize for bothering you, I most desperately needed the help of a strong band of warriors.  I'll have to keep searching.~ */
  IF ~~ THEN REPLY #84965 /* ~Wait!  We can help you out.  What do you need us for?~ */ GOTO 5
  IF ~~ THEN REPLY #74099 /* ~Bye.~ */ EXIT
END

IF ~~ THEN BEGIN 5 // from: 4.0 3.1
  SAY #84966 /* ~I wish to hire you; I'll pay you 200 gold, not much for heroic adventurers, but all that I have.  An evil mage has laid a curse upon my only child, Namara.  She is slowly wasting away and without help, she'll die.  The mage who did this is named Yago, and I'm sure that he possesses the remedy to the curse.  Would you track him down for me, please?~ */
  IF ~~ THEN REPLY #84967 /* ~Sorry, we don't like messing with powerful mages.~ */ EXIT
  IF ~~ THEN REPLY #56803 /* ~Of course.~ */ GOTO 6
END

IF ~~ THEN BEGIN 6 // from: 5.1
  SAY #84968 /* ~He's been staying at a place called the Low Lantern.  It's the playground for the wicked and depraved; a ship where prostitutes ply their trade.  All I want you to do is find him and take his spellbook.  I have enough magical skill to reverse the curse if I had the formula for his spell.~ */
  IF ~~ THEN GOTO 7
  IF ~Global("X#AjantisBrielbara1","GLOBAL",0)
InParty("ajantis")
InMyArea("ajantis")
!StateCheck("ajantis",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#AjantisBrielbara1","GLOBAL",1)~ EXTERN ~_AJANTJ~ 80
END

IF ~~ THEN BEGIN 7 // from: _CORANJ:3.1 _CORAN:10.1 6.0 _AJANTJ:80.0
  SAY #84970 /* ~When you're finished, come meet me at the Splurging Sturgeon inn.  I'll be there for the next few days.~ */
  IF ~~ THEN DO ~SetGlobal("BrielbaraMove","GLOBAL",1)
EscapeArea()
~ UNSOLVED_JOURNAL #84969 /* ~Brielbara's baby

We've accepted a quest from a woman named Brielbara, who wants us to find a man named Yago.  Yago has cursed Brielbara's daughter to die, and we are to help Brielbara undo this curse by obtaining Yago's spellbook.  We can find Yago at the Low Lantern; we are to meet Brielbara at the Splurging Sturgeon when we are done.~ */ EXIT
END

IF WEIGHT #3 /* Triggers after states #: 15 even though they appear after this state */
~Global("BrielbaraMove","GLOBAL",1)
~ THEN BEGIN 8 // from:
  SAY #84972 /* ~Tell me, did you get the reversal for the curse?~ */
  IF ~~ THEN REPLY #84973 /* ~No, we failed.~ */ GOTO 9
  IF ~PartyHasItem("_BOOK70")
~ THEN REPLY #84974 /* ~Yes, we have it right here.~ */ DO ~EraseJournalEntry(84960)
EraseJournalEntry(84971)
EraseJournalEntry(84969)
EraseJournalEntry(84986)
TakePartyItem("_BOOK70")
AddexperienceParty(1000)
ReputationInc(1)
SetGlobal("BrielbaraMove","GLOBAL",2)
SetGlobal("HelpBrielbara","GLOBAL",1)
~ GOTO 12
END

IF ~~ THEN BEGIN 9 // from: 8.0
  SAY #84975 /* ~Go back and get it, please.  It's my daughter's life!!~ */
  IF ~~ THEN REPLY #84976 /* ~Sorry, we don't have time to try again.~ */ GOTO 11
  IF ~~ THEN REPLY #84977 /* ~We'll try again, should we meet you back here again?~ */ GOTO 10
END

IF ~~ THEN BEGIN 10 // from: 9.1
  SAY #84978 /* ~Yes, I'll be waiting here.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 11 // from: _CORANJ:3.0 9.0
  SAY #84979 /* ~You spineless bastards, get out of my sight. I would curse you if I had the magic... but I have it not... <sob>~ */
  IF ~~ THEN DO ~EraseJournalEntry(84960)
EraseJournalEntry(84971)
EraseJournalEntry(84969)
EraseJournalEntry(84986)
Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 12 // from: 8.1
  SAY #84980 /* ~Thank you, thank you so very much.  I owe you everything.  If there is anything I can do for you, just name it.~ */
  IF ~!InParty("coran")
~ THEN REPLY #84981 /* ~We'd just like to be paid.~ */ DO ~GivePartyGold(200)
EscapeArea()
~ SOLVED_JOURNAL #88972 /* ~Brielbara's baby

We succeeded in obtaining Yago's spellbook for Brielbara, who should now be able to undo the curse on her infant child.~ */ EXIT
  IF ~!InParty("coran")
~ THEN REPLY #84982 /* ~Just remember us for the future.~ */ DO ~EscapeArea()
~ SOLVED_JOURNAL #88972 /* ~Brielbara's baby

We succeeded in obtaining Yago's spellbook for Brielbara, who should now be able to undo the curse on her infant child.~ */ EXIT
  IF ~InParty("coran")
~ THEN REPLY #84981 /* ~We'd just like to be paid.~ */ DO ~GivePartyGold(200)
~ GOTO 13
  IF ~InParty("coran")
~ THEN REPLY #84982 /* ~Just remember us for the future.~ */ GOTO 13
END

IF ~~ THEN BEGIN 13 // from: 12.3 12.2
  SAY #84983 /* ~What about you Coran?  Are you planning on leaving again? Not even trying to be a father...~ */
  IF ~~ THEN EXTERN ~_CORANJ~ 4
  IF ~Global("X#KivanBrielbaraTalk","GLOBAL",0)
InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#KivanBrielbaraTalk","GLOBAL",1)~ EXTERN ~_KIVANJ~ 217
END

IF ~~ THEN BEGIN 14 // from: _CORANJ:4.0 _CORAN:11.0
  SAY #101821 /* ~That you are an idiot. Go, if you want, but maybe someday you'll figure out what is it you really want, elf.~ */
  IF ~~ THEN DO ~SetGlobal("P#Briel_Stay","GLOBAL",1)
RealSetGlobalTimer("X#BriLostPatience","GLOBAL",SIX_HOURS)
~ SOLVED_JOURNAL #88972 /* ~Brielbara's baby

We succeeded in obtaining Yago's spellbook for Brielbara, who should now be able to undo the curse on her infant child.~ */ EXIT
  IF ~Global("X#JaheiraBrielbara","GLOBAL",0)
InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
InParty("coran")
InMyArea("coran")
!StateCheck("coran",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#JaheiraBrielbara","GLOBAL",1)
EscapeArea()
~ EXTERN ~_JAHEIJ~ 115
END

IF WEIGHT #0 ~StateCheck(Myself,STATE_CHARMED)
~ THEN BEGIN 15 // from:
  SAY #84985 /* ~All I know is that Yago has cursed my child, and she'll die without any help!  I know that there has been a lot of talk around the city about the Iron Throne.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #4 ~  Global("HelpBrielbara","GLOBAL",1)
~ THEN BEGIN 16 // from:
  SAY #84987 /* ~I must thank you again for the service you have done.~ */
  IF ~  Global("P#CoranBaby","GLOBAL",2)
Global("P#Briel_Stay","GLOBAL",1)
InParty("coran")
~ THEN DO ~SetGlobal("X#BriFinale","GLOBAL",1)
~ GOTO 19
  IF ~  GlobalLT("P#CoranBaby","GLOBAL",2)
Global("P#Briel_Stay","GLOBAL",1)
InParty("coran")
~ THEN DO ~SetGlobal("X#BriFinale","GLOBAL",1)
~ GOTO 23
  IF ~  Global("P#Briel_Stay","GLOBAL",2)
InParty("coran")
~ THEN DO ~SetGlobal("X#BriFinale","GLOBAL",1)
~ GOTO 24
  IF ~  Global("P#Briel_Stay","GLOBAL",3)
~ THEN DO ~SetGlobal("X#BriFinale","GLOBAL",1)
~ GOTO 25
  IF ~  Global("P#Briel_Stay","GLOBAL",1)
!InParty("coran")
~ THEN DO ~SetGlobal("X#BriFinale","GLOBAL",1)
~ EXIT
  IF ~  !Global("P#Briel_Stay","GLOBAL",1)
!InParty("coran")
~ THEN DO ~SetGlobal("X#BriFinale","GLOBAL",1)
~ EXIT
  IF ~  GlobalGT("P#Briel_Stay","GLOBAL",1)
~ THEN DO ~SetGlobal("X#BriFinale","GLOBAL",1)
~ EXIT
END

IF ~~ THEN BEGIN 17 // from:
  SAY #76111 /* ~I'll not speak a word after what you did!~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #5 ~Global("HelpBrielbara","GLOBAL",0)
~ THEN BEGIN 18 // from:
  SAY #61290 /* ~Leave me be!~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #6 ~  Global("P#Briel_Stay","GLOBAL",1)
InParty("coran")
InMyArea("coran")
!StateCheck("coran",CD_STATE_NOTVALID)
~ THEN BEGIN 19 // from: 16.0
  SAY #101850 /* ~Coran?~ */
  IF ~~ THEN EXTERN ~_CORANJ~ 203
END

IF ~~ THEN BEGIN 20 // from: 34.0
  SAY #101851 /* ~Thank you, again, <CHARNAME>.~ */
  IF ~~ THEN REPLY #101852 /* ~Brielbara, I promise you, that if it gets hot, Coran will run and save the child.~ */ DO ~SetGlobal("P#Briel_Stay","GLOBAL",4)
GiveItemCreate("X#CBABY","coran",1,0,0)
GiveItemCreate("X#CBOOK","coran",1,0,0)
GiveItemCreate("X#COBAG","coran",1,0,0)
GiveItemCreate("X#CMILK","coran",1,0,0)
~ EXTERN ~_CORANJ~ 198
  IF ~~ THEN REPLY #101853 /* ~You are a mad woman, Brielbara, but we'll try to keep Namara safe and well.~ */ DO ~SetGlobal("P#Briel_Stay","GLOBAL",4)
GiveItemCreate("X#CBABY","coran",1,0,0)
GiveItemCreate("X#CBOOK","coran",1,0,0)
GiveItemCreate("X#COBAG","coran",1,0,0)
GiveItemCreate("X#CMILK","coran",1,0,0)
~ EXTERN ~_CORANJ~ 198
  IF ~~ THEN REPLY #101854 /* ~Great, just great. That's *just* what we need.~ */ DO ~SetGlobal("P#Briel_Stay","GLOBAL",4)
GiveItemCreate("X#CBABY","coran",1,0,0)
GiveItemCreate("X#CBOOK","coran",1,0,0)
GiveItemCreate("X#COBAG","coran",1,0,0)
GiveItemCreate("X#CMILK","coran",1,0,0)
~ EXTERN ~_CORANJ~ 199
  IF ~  Global("P#CoranRomancePath","GLOBAL",1)
~ THEN REPLY #101855 /* ~You have done well, my love.~ */ DO ~SetGlobal("P#Briel_Stay","GLOBAL",4)
GiveItemCreate("X#CBABY","coran",1,0,0)
GiveItemCreate("X#CBOOK","coran",1,0,0)
GiveItemCreate("X#COBAG","coran",1,0,0)
GiveItemCreate("X#CMILK","coran",1,0,0)
~ EXTERN ~_CORANJ~ 200
  IF ~  PartyGoldGT(10001)
~ THEN REPLY #101856 /* ~That would not do at all. Brielbara, Coran is my sworn sword, and as his liege <PRO_LADYLORD>, I accept the responsibility for his past misdeeds. As he has no inclination to marry you, and I do not wish to force him in this matter, I would like to pay you 10,000 gold as a compensation for his dishonoring you. I trust that it is enough for you to live comfortably until you've arranged your affairs.~ */ DO ~GiveGoldForce(-10000)
~ GOTO 21
END

IF ~~ THEN BEGIN 21 // from: 20.4
  SAY #101857 /* ~I... I am... This is very generous, my <PRO_LADYLORD>....~ */
  IF ~~ THEN GOTO 22
END

IF ~~ THEN BEGIN 22 // from: 21.0
  SAY #101858 /* ~Coran, I wish... I wish it could have been different, but I can't make you love me, not without my sorcery. *smiles softly* And who needs love instigated by magic?~ */
  IF ~~ THEN DO ~SetGlobal("P#Briel_Stay","GLOBAL",5)
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 23 // from: 16.1
  SAY #101859 /* ~Coran? Do not you even want to see Namara? She has your eyes... elven eyes.~ */
  IF ~~ THEN EXTERN ~_CORANJ~ 201
END

IF ~~ THEN BEGIN 24 // from: _CORANJ:201.0 16.2
  SAY #101860 /* ~I curse the day I laid my eyes on you, Coran.~ */
  IF ~~ THEN EXTERN ~_CORANJ~ 202
END

IF ~~ THEN BEGIN 25 // from: 16.3
  SAY #101861 /* ~And... thank you for sending that no good thief my way. *sighs dreamily* He is not *that* bad, actually.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 26 // from: _CORANJ:203.0
  SAY #101863 /* ~Apologize? What do I need an apology for? Would it put food on Namara’s plate and clothes on her back? Or should I sing your apology as a lullaby for her, when she will not stop crying for her father?~ */
  IF ~~ THEN EXTERN ~_CORANJ~ 204
END

IF ~~ THEN BEGIN 27 // from: _CORANJ:204.0
  SAY #101865 /* ~Coran, why must you be so incredibly stubborn about it? You are going to end up in prison or hanged for a bandit, silly Elf. I know you have a better heart than that... why would not you...~ */
  IF ~~ THEN EXTERN ~_CORANJ~ 205
END

IF ~~ THEN BEGIN 28 // from: _CORANJ:205.0
  SAY #101867 /* ~A pity...~ */
  IF ~~ THEN EXTERN ~_CORANJ~ 206
END

IF ~~ THEN BEGIN 29 // from: _CORANJ:206.0
  SAY #101869 /* ~I see. Coran, I feel that you are sincere, and that you do want to help. However, I am afraid that will not be enough, not with your peculiar notion on what responsibility is. I have an idea, though, on how you can help.~ */
  IF ~~ THEN EXTERN ~_CORANJ~ 207
END

IF ~~ THEN BEGIN 30 // from: _CORANJ:207.0
  SAY #101871 /* ~It has been rough going for us lately with Namara sick and my husband plotting against us... He took it all, Coran! House, money, everything. I can hardly get by, and I am so tired... Would you take Namara with you and take care of her for a while to give me some time to get back on my feet?~ */
  IF ~~ THEN EXTERN ~_CORANJ~ 208
END

IF ~~ THEN BEGIN 31 // from: _CORANJ:208.0
  SAY #101873 /* ~Then it is past time that you learnt. She is now at an age when she does not require breast feeding, and I have here a book of helpful hints...~ */
  IF ~~ THEN EXTERN ~_CORANJ~ 209
END

IF ~~ THEN BEGIN 32 // from: _CORANJ:209.0
  SAY #101875 /* ~It is no more dangerous for her in your company than in that place in the bowels of this city I keep her now... I never know that she won’t be sold to some slavers or killed out of spite by some lowlife while I am away... Coran, desperate people cannot be choosy.~ */
  IF ~~ THEN EXTERN ~_CORANJ~ 210
END

IF ~~ THEN BEGIN 33 // from: _CORANJ:210.0
  SAY #101877 /* ~No, Coran, I will not be a part of a mercenary group, and I would not go about robbing people with you. My reputation is ruined as is. If you want to help - take care of Namara for a bit...~ */
  IF ~~ THEN EXTERN ~_CORANJ~ 211
END

IF ~~ THEN BEGIN 34 // from: _CORANJ:211.0
  SAY #101879 /* ~Good. Thank you, Coran. And do not look so sour, you might come to enjoy it, after all. Here is the book, and I will bring Namara in a moment.~ */
  IF ~~ THEN GOTO 20
END
