// creator  : weidu.exe (version 23100)
// argument : RIBALD.DLG
// game		 : .
// source	 : ./DATA/DIALOG.BIF
// dialog	 : ./DIALOG.TLK
// dialogF  : (none)

BEGIN ~RIBALD~ 1 // non-zero flags may indicate non-pausing dialogue
//////////////////////////////////////////////////
// WARNING: this file contains non-trivial WEIGHTs
//////////////////////////////////////////////////

IF WEIGHT #2 /* Triggers after states #: 20 24 even though they appear after this state */
~True()
~ THEN BEGIN 0 // from: 26.0
  SAY #16976 /* ~Ribald Barterman at yer service. My Adventurer's Mart is the finest shopping in all Faerun. Widest selection, lowest prices, and nary a fancy illustration. Just the goods, bare and plain.~ */
  IF ~~ THEN REPLY #16978 /* ~No thanks, we're just looking right now.~ */ GOTO 1
  IF ~GlobalLT("Chapter","GLOBAL",6)~ THEN REPLY #16979 /* ~Yes, there are some items we're interested in.~ */ GOTO 2
  IF ~GlobalGT("Chapter","GLOBAL",5)~ THEN REPLY #58864 /* ~Yes, I'd like to see what you have available.~ */ GOTO 47
  IF ~~ THEN REPLY #16980 /* ~Maybe later. This place is too damn big to make a decision quite yet.~ */ GOTO 3
  IF ~~ THEN REPLY #16981 /* ~What a dump. You'd have to pay me to haul anything out of here.~ */ GOTO 4
  IF ~!Dead("obssol01")
!Dead("obssol02")
!Dead("obssol03")
OR(2)
Global("SolamnicKnights","GLOBAL",1)
Global("SolamnicKnights","GLOBAL",4)~ THEN REPLY #42005 /* ~I need to send a group of Solamnic Knights back to their plane. Can you help?~ */ GOTO 27
  IF ~!Dead("obssol01")
!Dead("obssol02")
!Dead("obssol03")
OR(2)
Global("SolamnicKnights","GLOBAL",2)
Global("SolamnicKnights","GLOBAL",4)~ THEN REPLY #42024 /* ~I have come back regarding the Solamnic Knights and your criminal price.~ */ GOTO 32
  IF ~InPartySlot(LastTalkedToBy,0)~ THEN REPLY #45506 /* ~I was wondering if I could ask you a couple of questions.~ */ GOTO 37
END

IF ~~ THEN BEGIN 1 // from: 0.0
  SAY #16982 /* ~Well then, I be trapped behind the counter here twiddling me thumbs so if it grabs you, entices you, thrills you or disgusts you ye know where I'll be to help you pack it up then.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 2 // from: 0.1
  SAY #16983 /* ~Music to me ears! There's a customer born every minute, and a rube soon after.  What'll it be for ye today?~ */
  IF ~~ THEN DO ~StartStore("ribald",LastTalkedToBy())
~ EXIT
END

IF ~~ THEN BEGIN 3 // from: 0.3
  SAY #16984 /* ~We are. We've catalogues and an army of scribes to keep up with demand. Thirty-three years in the same location. Old Ribald knows half his customers by name. I'll be here.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 4 // from: 0.4
  SAY #16985 /* ~One man's meat's another goon's murder, eh? Each to his own then. If ye change yer thinks, I'll be hereabouts.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 5 // from:
  SAY #25046 /* ~I never met you in Shadowdale, Brelm.  You got drunk here four months ago and haven't left.~ */
  IF ~~ THEN EXTERN ~BRELM~ 2
END

IF ~~ THEN BEGIN 6 // from:
  SAY #25049 /* ~Brelm, you've never been on an actual ship once in your entire life.~ */
  IF ~~ THEN EXTERN ~BRELM~ 4
END

IF ~~ THEN BEGIN 7 // from:
  SAY #25053 /* ~You mean you were pickpocketed three times last week.~ */
  IF ~~ THEN EXTERN ~BRELM~ 7
END

IF ~~ THEN BEGIN 8 // from:
  SAY #25114 /* ~You've never even met a Cowled mage...~ */
  IF ~~ THEN EXTERN ~BRELM~ 9
END

IF ~~ THEN BEGIN 9 // from:
  SAY #25116 /* ~I would be willing to bet the only thing they regretted about meeting you was having to put up with your smell.~ */
  IF ~~ THEN EXTERN ~BRELM~ 10
END

IF ~~ THEN BEGIN 10 // from:
  SAY #25120 /* ~Did you even go and see it?~ */
  IF ~~ THEN EXTERN ~BRELM~ 13
END

IF ~~ THEN BEGIN 11 // from:
  SAY #25122 /* ~You were drunk all last week.~ */
  IF ~~ THEN EXTERN ~BRELM~ 14
END

IF ~~ THEN BEGIN 12 // from:
  SAY #25124 /* ~That's not what you said after nine pitchers of that Turmish whiskey you drank the day before last...~ */
  IF ~~ THEN EXTERN ~BRELM~ 15
END

IF ~~ THEN BEGIN 13 // from:
  SAY #25128 /* ~What adventuring days?~ */
  IF ~~ THEN EXTERN ~BRELM~ 18
END

IF ~~ THEN BEGIN 14 // from:
  SAY #25130 /* ~I thought you were a cobbler.~ */
  IF ~~ THEN EXTERN ~BRELM~ 19
END

IF ~~ THEN BEGIN 15 // from:
  SAY #25132 /* ~Oh?  And where have you been, oh mighty and experienced adventurer?~ */
  IF ~~ THEN EXTERN ~BRELM~ 20
END

IF ~~ THEN BEGIN 16 // from:
  SAY #25134 /* ~So you must have met Lord Francis, then.  Or Denal Sixfingers.  They both lived there last I was in Scornubel.~ */
  IF ~~ THEN EXTERN ~BRELM~ 21
END

IF ~~ THEN BEGIN 17 // from:
  SAY #25140 /* ~Lucy wouldn't hurt a soul, Brelm.~ */
  IF ~~ THEN EXTERN ~BRELM~ 23
END

IF ~~ THEN BEGIN 18 // from:
  SAY #38849 /* ~But of course, feel free to have a look around, my friend.~ */
  IF ~~ THEN DO ~StartStore("ribald",LastTalkedToBy())~ EXIT
END

IF ~~ THEN BEGIN 19 // from:
  SAY #38850 /* ~As ye wish, friend.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #0 ~InParty("Mazzy")
See("Mazzy")
!StateCheck("Mazzy",STATE_SLEEPING)
Global("RibaldMazzy","LOCALS",0)~ THEN BEGIN 20 // from:
  SAY #38851 /* ~Ribald Barterman at yer service, I --~ */
  IF ~~ THEN DO ~SetGlobal("RibaldMazzy","LOCALS",1)~ EXTERN ~MAZZYJ~ 95
END

IF ~~ THEN BEGIN 21 // from:
  SAY #38852 /* ~Well, if it isn't me favorite halfling lass.  How does ye be, girlie?~ */
  IF ~~ THEN EXTERN ~MAZZYJ~ 96
END

IF ~~ THEN BEGIN 22 // from:
  SAY #38853 /* ~Well, then I does owe yer friend a debt of thanks for keeping a fine lass like ye among us.  I trust the adventuring goes well?~ */
  IF ~~ THEN EXTERN ~MAZZYJ~ 97
END

IF ~~ THEN BEGIN 23 // from:
  SAY #38855 /* ~Ah, yer sweet t' say so.  I don't miss it much, though, to say fer certain.  Have a look about me new venture, lass, and don't be so long in yer visits next time.~ */
  IF ~~ THEN EXTERN ~MAZZYJ~ 98
END

IF WEIGHT #1 ~InParty("Jaheira")
See("Jaheira")
!StateCheck("Jaheira",STATE_SLEEPING)
Global("RibaldJaheira","LOCALS",0)~ THEN BEGIN 24 // from:
  SAY #38861 /* ~Ribald Barterman at yer service, I --~ */
  IF ~~ THEN DO ~SetGlobal("RibaldJaheira","LOCALS",1)~ EXTERN ~JAHEIRAJ~ 313
END

IF ~~ THEN BEGIN 25 // from:
  SAY #38863 /* ~It is... well enough, Miss Jaheira.  Ye'll not bring Harper trouble to me doorstep, good lady... might I remind ye that me days of involvement with yer kin are long over?~ */
  IF ~~ THEN EXTERN ~JAHEIRAJ~ 314
END

IF ~~ THEN BEGIN 26 // from:
  SAY #38865 /* ~With your kin there always be a need to worry... but I should mind me manners.  Please excuse me.~ */
  IF ~~ THEN GOTO 0
END

IF ~~ THEN BEGIN 27 // from: 0.5
  SAY #42006 /* ~Well, now that is something I am not asked everyday. Another plane, you say? Strangeness indeed.~ */
  IF ~~ THEN REPLY #42008 /* ~Please, if you can help I would appreciate it.~ */ GOTO 28
  IF ~~ THEN REPLY #42009 /* ~Do you or do you not have means to help them?~ */ GOTO 28
END

IF ~~ THEN BEGIN 28 // from: 27.1 27.0
  SAY #42010 /* ~Hmm... I may have something that fits yer bill perfectly. Yes, yes I believe I do.~ */
  IF ~~ THEN GOTO 29
END

IF ~~ THEN BEGIN 29 // from: 28.0
  SAY #42011 /* ~I know a mage, a fine mage. She has been known to do a favor on occasion. Yes, the more I think of it the more I am sure she can do exactly as you have asked.~ */
  IF ~~ THEN REPLY #42012 /* ~That is excellent! What are we standing around here for then?~ */ GOTO 30
  IF ~~ THEN REPLY #42013 /* ~Well quit stalling and get her over here then.~ */ GOTO 30
END

IF ~~ THEN BEGIN 30 // from: 29.1 29.0
  SAY #42014 /* ~Yes, she can do exactly as you have asked... for a fee. I recall her banishing a planar creature before... that was quite costly.~ */
  IF ~~ THEN GOTO 31
END

IF ~~ THEN BEGIN 31 // from: 30.0
  SAY #42015 /* ~That was a single creature, and you say you have multiple ones? I think the enterprise will cost you... oh... 9,000 gold.~ */
  IF ~~ THEN REPLY #42016 /* ~9,000 gold! That is outrageous!~ */ GOTO 32
  IF ~PartyGoldGT(8999)~ THEN REPLY #42017 /* ~All right then! Here is your damn gold!~ */ DO ~TakePartyGold(9000)~ GOTO 34
  IF ~~ THEN REPLY #42018 /* ~I cannot afford that.~ */ DO ~SetGlobal("SolamnicKnights","GLOBAL",2)~ GOTO 33
END

IF ~~ THEN BEGIN 32 // from: 31.0 0.6
  SAY #42019 /* ~That depends on who you ask. These knights of yours might think it quite reasonable. Take it or leave it.~ */
  IF ~PartyGoldGT(8999)~ THEN REPLY #42020 /* ~Fine, I'll take it.~ */ DO ~TakePartyGold(9000)~ GOTO 34
  IF ~~ THEN REPLY #42021 /* ~I cannot afford it.~ */ GOTO 33
END

IF ~~ THEN BEGIN 33 // from: 32.1 31.2
  SAY #42022 /* ~Then return when you can afford it. I can go no lower for the services of someone else.~ */
  IF ~~ THEN UNSOLVED_JOURNAL #55640 /* ~Mage Stronghold: Ribald can free the Knights.

Ribald in the adventurers' mart has the means to send the knights home, but he requires 9,000 gold.~ */ EXIT
END

IF ~~ THEN BEGIN 34 // from: 32.0 31.1
  SAY #42025 /* ~A pleasure doing business with you. You are in that wondrously odd sphere, are you not? I'll have my friend come by there tomorrow.~ */
  IF ~~ THEN REPLY #42026 /* ~How did you know where I needed your mage to go?~ */ UNSOLVED_JOURNAL #55641 /* ~Mage Stronghold: I have paid for the Knights.

Ribald has taken 9,000 gold and has promised to send a mage to the sphere and teleport the knights home. At these prices, she had better show up!~ */ GOTO 35
  IF ~~ THEN REPLY #42027 /* ~She had better not be late!~ */ GOTO 36
END

IF ~~ THEN BEGIN 35 // from: 34.0
  SAY #42028 /* ~I have ears all about town. Besides, where would planar creatures tend to be? The weirdest place in town, I'll wager. Go on, she'll be there tomorrow.~ */
  IF ~~ THEN DO ~SetGlobal("SolamnicKnights","GLOBAL",3)
SetGlobalTimer("SpawnPaacTimer","GLOBAL",ONE_DAY)
SetGlobal("SpawnPaac","GLOBAL",1)~ EXIT
END

IF ~~ THEN BEGIN 36 // from: 34.1
  SAY #42029 /* ~Not at these prices, she won't be.~ */
  IF ~~ THEN DO ~SetGlobal("SolamnicKnights","GLOBAL",3)
SetGlobalTimer("SpawnPaacTimer","GLOBAL",ONE_DAY)
SetGlobal("SpawnPaac","GLOBAL",1)~ EXIT
END

IF ~~ THEN BEGIN 37 // from: 0.7
  SAY #45507 /* ~You certainly can.  What's on your mind?~ */
  IF ~GlobalLT("chapter","GLOBAL",4)~ THEN REPLY #45508 /* ~A friend of mine has been taken prisoner by the Cowled Wizards.  Do you know where she would be kept?~ */ GOTO 38
  IF ~Global("chapter","GLOBAL",2)
Global("ShadowWork","GLOBAL",1)~ THEN REPLY #45509 /* ~Any ideas on how I might gather a lot of coin?  I need it to free a friend from the Cowled Wizards.~ */ GOTO 42
  IF ~GlobalLT("chapter","GLOBAL",4)~ THEN REPLY #45510 /* ~What can you tell me about the Shadow Thieves?~ */ GOTO 45
  IF ~~ THEN REPLY #45511 /* ~Nothing. Never mind.~ */ GOTO 46
END

IF ~~ THEN BEGIN 38 // from: 45.0 44.0 37.0
  SAY #45512 /* ~Ahhh, too bad.  A friend came in from Riatavin about a year back, a mage named Terce.  His mule had gone lame, and he'd summoned a floating disc to carry his supplies.~ */
  IF ~~ THEN GOTO 39
END

IF ~~ THEN BEGIN 39 // from: 38.0
  SAY #45513 /* ~They captured him, of course.  Terce should have known better... I'm sure he thought a disc was harmless enough, but those wizards are strict about their licenses.~ */
  IF ~~ THEN GOTO 40
END

IF ~~ THEN BEGIN 40 // from: 39.0
  SAY #45514 /* ~I tried looking for him, but the Cowled Wizards aren't easy to find... nobody knows where they stay, here.   And they never let out where their magical prison is.~ */
  IF ~~ THEN GOTO 41
END

IF ~~ THEN BEGIN 41 // from: 40.0
  SAY #45515 /* ~It's a travesty that the Council gives them so much power.  Mystra only knows what they do with their prisoners.  Wish I could help you more, but I never heard from Terce again.~ */
  IF ~Global("chapter","GLOBAL",2)
Global("ShadowWork","GLOBAL",1)~ THEN REPLY #45516 /* ~Any ideas on how I might collect a lot of coin?  I need it to free a friend from the Cowled Wizards.~ */ GOTO 42
  IF ~GlobalLT("chapter","GLOBAL",4)~ THEN REPLY #45517 /* ~What do you know about the Shadow Thieves?~ */ GOTO 45
  IF ~Global("BribedCowled","GLOBAL",0)~ THEN REPLY #61118 /* ~You mentioned something about a license?~ */ GOTO 50
  IF ~~ THEN REPLY #45518 /* ~I see.  I'll be on my way.~ */ GOTO 46
END

IF ~~ THEN BEGIN 42 // from: 52.0 45.1 41.0 37.1
  SAY #45519 /* ~Hmm.  Saving up for a bribe?  Might work, you never know... not even those damned Cowled Wizards are infallible.~ */
  IF ~~ THEN GOTO 43
END

IF ~~ THEN BEGIN 43 // from: 42.0
  SAY #45521 /* ~As for ideas, I'm sure there are plenty of ways for an intrepid adventurer like yourself to make some money.  Rewards are for the taking here, in my opinion.~ */
  IF ~~ THEN GOTO 44
END

IF ~~ THEN BEGIN 44 // from: 43.0
  SAY #45522 /* ~If you haven't already looked in the Copper Coronet in the slums, I would try one of the temples.  Or even the Shadow Thieves in the docks, if you're willing to work with that sort.~ */
  IF ~GlobalLT("chapter","GLOBAL",4)~ THEN REPLY #45523 /* ~A friend of mine was captured by the Cowled Wizards.  Do you have any idea where they might be keeping her?~ */ GOTO 38
  IF ~GlobalLT("chapter","GLOBAL",4)~ THEN REPLY #45524 /* ~What do you know about the Shadow Thieves?~ */ GOTO 45
  IF ~~ THEN REPLY #45525 /* ~I see.  I'll be on my way.~ */ GOTO 46
END

IF ~~ THEN BEGIN 45 // from: 52.1 44.1 41.1 37.2
  SAY #45526 /* ~It's not an area I keep up with.  They run the Docks... the man to talk to is called the Bloodscalp.  Word has it they're in some kind of fight right now, but who knows?~ */
  IF ~GlobalLT("chapter","GLOBAL",4)~ THEN REPLY #45527 /* ~A friend of mine has been imprisoned by the Cowled Wizards.  Do you know where they might keep her?~ */ GOTO 38
  IF ~Global("chapter","GLOBAL",2)
Global("ShadowWork","GLOBAL",1)~ THEN REPLY #45528 /* ~I need to get ahold of a lot of coin to save a friend from the Cowled Wizards.  Any ideas?~ */ GOTO 42
  IF ~~ THEN REPLY #45529 /* ~I see.  I'll be going, then.~ */ GOTO 46
END

IF ~~ THEN BEGIN 46 // from: 52.2 45.2 44.2 41.3 37.3
  SAY #45530 /* ~Alright.  Store'll be here when you return, I'm sure.  Heh.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 47 // from: 0.2
  SAY #57311 /* ~All right then.  You're a good customer, and a successful adventurer.  Would you rather see my secret stock of items?  For only 50 gold I'll show you the wares.~ */
  IF ~PartyGoldGT(49)~ THEN REPLY #57316 /* ~Sure, show me your 'special' wares.~ */ DO ~TakePartyGold(50)~ GOTO 48
  IF ~~ THEN REPLY #57317 /* ~Sorry, I'm only interested in your usual items.~ */ GOTO 49
END

IF ~~ THEN BEGIN 48 // from: 47.0
  SAY #57318 /* ~Take a look at some of these items.  You won't be disappointed.~ */
  IF ~~ THEN DO ~StartStore("ribald3",LastTalkedToBy())
~ EXIT
END

IF ~~ THEN BEGIN 49 // from: 47.1
  SAY #57319 /* ~Okay, but if you ever change your mind, you know where to come.~ */
  IF ~~ THEN DO ~StartStore("ribald",LastTalkedToBy())
~ EXIT
END

IF ~~ THEN BEGIN 50 // from: 41.2
  SAY #61119 /* ~Well, sure.  The ban on magic-casting only applies to the 'disreputable' masses.  And in Amn there's only one barometer for the well-to-do: coin.~ */
  IF ~~ THEN GOTO 51
END

IF ~~ THEN BEGIN 51 // from: 50.0
  SAY #61120 /* ~You got enough coin, the Cowled Wizards are willing to give you the benefit of the doubt.  And why not?  They get rich and if you cause a problem they arrest you anyway.~ */
  IF ~~ THEN GOTO 52
END

IF ~~ THEN BEGIN 52 // from: 51.0
  SAY #61121 /* ~It's not a bad deal, though... once you've paid them, they tend to ignore you.  Try the wizard Corneil at the government building in the Government District if you're interested.~ */
  IF ~Global("chapter","GLOBAL",2)
Global("ShadowWork","GLOBAL",1)~ THEN REPLY #61122 /* ~Any ideas on how I might collect a lot of coin, then?~ */ GOTO 42
  IF ~GlobalLT("chapter","GLOBAL",4)~ THEN REPLY #61123 /* ~What do you know about the Shadow Thieves?~ */ GOTO 45
  IF ~~ THEN REPLY #61124 /* ~I see.  I'll be on my way.~ */ GOTO 46
END
