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

BEGIN ~JARLAXLE~

IF ~NumTimesTalkedTo(0)~ THEN BEGIN 0 // from:
  SAY #57062 /* ~Ah!  It worked.  I wasn't sure it would... these things have a way of never working out exactly as you plan.  Thinking on the fly is an occupational hazard.~ */
  IF ~!IsValidForPartyDialog("Viconia")
!IsValidForPartyDialog("Jaheira")
!IsValidForPartyDialog("Aerie")~ THEN REPLY #57063 /* ~What didn't work?!  Who are you?!~ */ GOTO 2
  IF ~IsValidForPartyDialog("Viconia")~ THEN EXTERN ~VICONIJ~ 173
  IF ~!IsValidForPartyDialog("Viconia")
IsValidForPartyDialog("Jaheira")~ THEN EXTERN ~JAHEIRAJ~ 509
  IF ~!IsValidForPartyDialog("Viconia")
!IsValidForPartyDialog("Jaheira")
IsValidForPartyDialog("Aerie")~ THEN EXTERN ~AERIEJ~ 180
END

IF ~~ THEN BEGIN 1 // from: JAHEIRAJ:509.0
  SAY #57064 /* ~The one and the same.  Charmed, I'm sure, pretty lady.~ */
  IF ~~ THEN REPLY #57070 /* ~Jarlaxle?  Then Visaj lied!  The rope didn't work!~ */ GOTO 3
END

IF ~~ THEN BEGIN 2 // from: 0.0
  SAY #57068 /* ~Excuse my lapse of manners.  I often tend to wax philosophical when I see my plans come to fruition.  I am Jarlaxle, leader of the Bregan D'aerthe, at your service.~ */
  IF ~~ THEN REPLY #57069 /* ~Jarlaxle?  Then Visaj lied!  The rope didn't work!~ */ GOTO 3
END

IF ~~ THEN BEGIN 3 // from: 2.0 1.0
  SAY #57071 /* ~Lied?  Now that is rather harsh language.  Visaj... Visaj, are you about?~ */
  IF ~~ THEN DO ~SetInterrupt(FALSE)
StartCutSceneMode()
CreateVisualEffect("SPDIMNDR",[253.404])
Wait(5)
CreateCreature("breg01",[253.404],14)
SetGlobal("JarlaxleHQ","GLOBAL",1)
SetInterrupt(TRUE)
ActionOverride("breg01",StartDialogueNoSet([PC]))~ EXIT
END

IF ~~ THEN BEGIN 4 // from:
  SAY #57073 /* ~Yes, I see that.  Allow me to introduce my lieutenant, Visaj.  Visaj, I am sure you are already familiar with Veldrin, yes?  Tell me... did you lie to <PRO_HIMHER>?~ */
  IF ~~ THEN EXTERN ~BREG01~ 33
END

IF ~~ THEN BEGIN 5 // from:
  SAY #57075 /* ~I didn't think so.  Visaj said the rope would protect you from Deirex's imprisonment spell, and it did.  You are here, not in some miniscule hellish sub-plane.~ */
  IF ~~ THEN DO ~EraseJournalEntry(55435)~ GOTO 6
END

IF ~~ THEN BEGIN 6 // from: 5.0
  SAY #57076 /* ~This is a pocket plane, headquarters of the Bregan D'aerthe, my mercenary band.  I hoped the rope would bring you here, and I see that it has.  Welcome, Veldrin.~ */
  IF ~~ THEN REPLY #57078 /* ~You wanted me to come here?  Why?~ */ GOTO 7
  IF ~~ THEN REPLY #57079 /* ~Why go through all the subterfuge just to bring me here?~ */ GOTO 7
  IF ~~ THEN REPLY #57080 /* ~You had better tell me what you want, and quickly, or things are going to get very bloody.~ */ GOTO 7
END

IF ~~ THEN BEGIN 7 // from: 6.2 6.1 6.0
  SAY #57081 /* ~I wanted to see if you would actually attempt to face the lich.  Call it a test of your courage, if you will.~ */
  IF ~~ THEN GOTO 8
END

IF ~~ THEN BEGIN 8 // from: 7.0
  SAY #57082 /* ~With most of my men imprisoned by the lich, I've hardly anyone left to do what I require done... and I can't go asking just anybody, now, can I?~ */
  IF ~~ THEN REPLY #57083 /* ~And just what do you require done?~ */ GOTO 11
  IF ~~ THEN REPLY #57084 /* ~I've no interest in working for you, Jarlaxle.  You had better just send me back to Ust Natha.~ */ GOTO 9
  IF ~~ THEN REPLY #57085 /* ~I refuse to be manipulated!  I'll do nothing for you... send me back or you'll regret being born, I swear!~ */ GOTO 9
END

IF ~~ THEN BEGIN 9 // from: 8.2 8.1
  SAY #57087 /* ~Now, now.  This isn't how it's done.  You listen to my offer and *then* you gesticulate helplessly.  That is, before you agree to do as I ask.~ */
  IF ~~ THEN GOTO 10
END

IF ~~ THEN BEGIN 10 // from: 9.0
  SAY #57088 /* ~After all, do *you* know how to use the rope and leave this sub-plane?  But let's not get unpleasant... all I wish is a friendly chat.  Then you may decide.~ */
  IF ~~ THEN REPLY #57089 /* ~Fine.  Be quick about it, then.~ */ GOTO 11
END

IF ~~ THEN BEGIN 11 // from: 10.0 8.0
  SAY #57090 /* ~Well, you were about to deal with the lich, anyway, before he cast you into the planes.  I simply need you to acquire something that he has in his possession.~ */
  IF ~~ THEN REPLY #57091 /* ~The wardstone for the House of Jae'llat?~ */ GOTO 12
END

IF ~~ THEN BEGIN 12 // from: 11.0
  SAY #57092 /* ~No, no.  Even I know when to give up on a plan.  My men come first.  The lich has numerous gems that contain the souls of my men, and I want them back.~ */
  IF ~~ THEN GOTO 13
END

IF ~~ THEN BEGIN 13 // from: 12.0
  SAY #57093 /* ~Whether you kill the lich or not is up to you.  Killing him would allow you to loot the tower, I suppose, but however you get those gems is of no concern to me.~ */
  IF ~~ THEN GOTO 14
END

IF ~~ THEN BEGIN 14 // from: 13.0
  SAY #57094 /* ~Once you gather up the gems, I will use the rope to pull you back into the headquarters, here.  Easy enough, yes?  You are ready to go, then?~ */
  IF ~~ THEN REPLY #57128 /* ~What?  I never said I would do this!~ */ GOTO 15
  IF ~~ THEN REPLY #57129 /* ~Wait a minute... what do I get out of all this?~ */ GOTO 15
  IF ~~ THEN REPLY #57130 /* ~You are quite presumptuous, fool!  I would prefer to kill you than do any 'task' for you!!~ */ GOTO 15
END

IF ~~ THEN BEGIN 15 // from: 14.2 14.1 14.0
  SAY #57132 /* ~Oh, right.  We're at the 'gesticulating helplessly' part, aren't we?  Visaj, I thought I told you to remind me when we arrived at this point.~ */
  IF ~~ THEN EXTERN ~BREG01~ 34
END

IF ~~ THEN BEGIN 16 // from:
  SAY #57137 /* ~You're forgiven.  As for you, dear friends, I think you will *want* to do this.  You wouldn't want your true identity revealed, would you... <CHARNAME>?~ */
  IF ~~ THEN GOTO 17
END

IF ~~ THEN BEGIN 17 // from: 16.0
  SAY #57138 /* ~Ahhhh, there's no need for such a glare, <CHARNAME>.  I am confident you will acquire the gems, and such action will be unnecessary.~ */
  IF ~~ THEN GOTO 18
END

IF ~~ THEN BEGIN 18 // from: 17.0
  SAY #57139 /* ~And if you kill Deirex you have access to his tower.  You could even take the Jae'llat wardstone and pillage House Jae'llat, if you wish.  It's all good.~ */
  IF ~~ THEN GOTO 19
END

IF ~~ THEN BEGIN 19 // from: 18.0
  SAY #57140 /* ~I just want to make sure that you find those gems in a timely manner.   Hmmm... how long would you say would be fair, Visaj?  An hour?~ */
  IF ~~ THEN EXTERN ~BREG01~ 35
END

IF ~~ THEN BEGIN 20 // from:
  SAY #57144 /* ~Right.  <CHARNAME> won't need it, but just to be sure.  You have one day, <CHARNAME>, to get my gems.  Make sure you hold onto the rope... you'll need it.~ */
  IF ~~ THEN GOTO 21
END

IF ~~ THEN BEGIN 21 // from: 20.0
  SAY #57145 /* ~See you then.  And, oh... give my warmest regards to the lich.~ */
  IF ~~ THEN DO ~StartCutSceneMode()
StartCutScene("cut52b")~ UNSOLVED_JOURNAL #55458 /* ~Intrigue with Jarlaxle

I have been ambushed into the service of Jarlaxle. While his men are indeed captives of the Lich Deirex, Visaj's story about stealing the rope was false. Now it appears I must retrieve certain gems from the Lich's tower and return them to Jarlaxle, lest he reveal my identity in this place. It is not without promise, however, and I may have opportunity to loot the tower as well as the House Jae'llat in this deal. I have one day to do it.~ */ EXIT
END

IF ~PartyHasItem("miscbh")~ THEN BEGIN 22 // from:
  SAY #57148 /* ~And here you are, once again, with gems in hand!  Really, <CHARNAME>, you have lived up to my expectations and then some!  I'll take those gems, thank you.~ */
  IF ~~ THEN DO ~TakePartyItem("miscbh")
SetGlobal("StopJarTimer","GLOBAL",1)~ GOTO 23
END

IF ~~ THEN BEGIN 23 // from: 22.0
  SAY #57150 /* ~Ahhh, precious, aren't they?  To think the Jae'llat have squirreled away such beauty for a millennium.   What do you figure they'll get on the market, Visaj?~ */
  IF ~~ THEN EXTERN ~BREG01~ 36
END

IF ~~ THEN BEGIN 24 // from:
  SAY #57152 /* ~True enough.  I wish I could be there to see the Matron Mother's face when she finds out we got our payment, anyway.~ */
  IF ~!IsValidForPartyDialog("Imoen2")
!IsValidForPartyDialog("HaerDalis")
!IsValidForPartyDialog("Nalia")~ THEN REPLY #57153 /* ~Wait a minute!  I thought you said those gems contained the souls of your men!~ */ GOTO 25
  IF ~IsValidForPartyDialog("Imoen2")~ THEN EXTERN ~IMOEN2J~ 37
  IF ~!IsValidForPartyDialog("Imoen2")
IsValidForPartyDialog("HaerDalis")~ THEN EXTERN ~HAERDAJ~ 136
  IF ~!IsValidForPartyDialog("Imoen2")
!IsValidForPartyDialog("HaerDalis")
IsValidForPartyDialog("Nalia")~ THEN EXTERN ~NALIAJ~ 302
END

IF ~~ THEN BEGIN 25 // from: NALIAJ:302.0 24.0 IMOEN2J:37.0
  SAY #57158 /* ~Would I risk my men against the lich?  I just wanted the payment I was due, as well as collecting the price of the Matron Mother's insult to the Bregan D'aerthe.~ */
  IF ~Dead("JarLich")~ THEN GOTO 26
  IF ~!Dead("JarLich")~ THEN GOTO 27
END

IF ~~ THEN BEGIN 26 // from: 25.0
  SAY #57160 /* ~I have not only collected the soul gems of the Matron who founded the Jae'llat, but you killed their ally Deirex, a member of their own House.~ */
  IF ~~ THEN GOTO 28
END

IF ~~ THEN BEGIN 27 // from: 25.1
  SAY #57161 /* ~I have collected for myself one of the most valuable possessions that the Jae'llat had... the soul gems of the Matron who founded their clan.~ */
  IF ~~ THEN GOTO 28
END

IF ~~ THEN BEGIN 28 // from: 27.0 26.0
  SAY #57164 /* ~I think matters between the Bregan D'aerthe and House Jae'llat are pretty much even, now, wouldn't you agree, <CHARNAME>?~ */
  IF ~~ THEN REPLY #57166 /* ~Fine.  You've gotten what you wanted.  Now send us back.~ */ GOTO 29
  IF ~~ THEN REPLY #57169 /* ~You used us to get your payment?!~ */ GOTO 35
  IF ~~ THEN REPLY #57170 /* ~But you and I are not even.  I am not one of your lackeys and I demand payment!~ */ GOTO 36
  IF ~~ THEN REPLY #57171 /* ~I'll kill you for trying to manipulate me!~ */ GOTO 37
END

IF ~~ THEN BEGIN 29 // from: 28.0
  SAY #57172 /* ~Ah, you are a good sport, <CHARNAME>, for a surface <PRO_RACE>.  I do not know what you are doing in Ust Natha, but I'll allow you your secret.  Do as you wish, I care not.~ */
  IF ~PartyHasItem("miscbe")~ THEN GOTO 30
  IF ~!PartyHasItem("miscbe")~ THEN GOTO 31
END

IF ~~ THEN BEGIN 30 // from: 42.0 36.0 35.0 29.0
  SAY #57173 /* ~I would like my rope back, now, so I shall relieve you of it.  A bit of gold, my friend, for your trouble.~ */
  IF ~~ THEN DO ~GivePartyGold(2500)
TakePartyItem("miscbe")~ GOTO 31
END

IF ~~ THEN BEGIN 31 // from: 42.1 36.1 35.1 30.0 29.1
  SAY #57174 /* ~As for what you choose to make of your encounter with me, that is up to you.  You may choose to be bitter, or you can take advantage of your situation.~ */
  IF ~Dead("JarLich")~ THEN GOTO 32
  IF ~!Dead("JarLich")~ THEN GOTO 34
END

IF ~~ THEN BEGIN 32 // from: 31.0
  SAY #57175 /* ~Deirex is dead.  Loot his tower before the mages of Sorcere close it up with magic.  You can use the Jae'llat wardstone to enter and loot their House, as well.~ */
  IF ~~ THEN GOTO 33
END

IF ~~ THEN BEGIN 33 // from: 34.0 32.0
  SAY #57176 /* ~If you do, I will ensure that the Jae'llat cannot alert the rest of the city. And if you kill the Matron and ruin her House forever... it would serve her right.~ */
  IF ~!IsValidForPartyDialog("Viconia")
!IsValidForPartyDialog("Korgan")
!IsValidForPartyDialog("Edwin")~ THEN REPLY #57199 /* ~Damn you, drow, I'll kill you for this!  I swear it!~ */ GOTO 39
  IF ~!IsValidForPartyDialog("Viconia")
!IsValidForPartyDialog("Korgan")
!IsValidForPartyDialog("Edwin")~ THEN REPLY #57201 /* ~Whatever.  If you're through with your fun, send me back.~ */ GOTO 40
  IF ~!IsValidForPartyDialog("Viconia")
!IsValidForPartyDialog("Korgan")
!IsValidForPartyDialog("Edwin")~ THEN REPLY #57202 /* ~I'll take that into consideration.~ */ GOTO 40
  IF ~IsValidForPartyDialog("Viconia")~ THEN EXTERN ~VICONIJ~ 174
  IF ~!IsValidForPartyDialog("Viconia")
IsValidForPartyDialog("Korgan")~ THEN EXTERN ~KORGANJ~ 172
  IF ~!IsValidForPartyDialog("Viconia")
!IsValidForPartyDialog("Korgan")
IsValidForPartyDialog("Edwin")~ THEN EXTERN ~EDWINJ~ 143
END

IF ~~ THEN BEGIN 34 // from: 31.1
  SAY #57177 /* ~Kill the lich and loot his tower before the Sorcere mages close it.  Take the wardstone for the Jae'llat household... more riches await you there, if you attack.~ */
  IF ~~ THEN GOTO 33
END

IF ~~ THEN BEGIN 35 // from: 28.1
  SAY #57181 /* ~Why not?  Better you than me.  In return, I'll let you keep your little secret, <PRO_RACE>.  Prance amongst the drow as you wish, I care not.~ */
  IF ~PartyHasItem("miscbe")~ THEN GOTO 30
  IF ~!PartyHasItem("miscbe")~ THEN GOTO 31
END

IF ~~ THEN BEGIN 36 // from: 28.2
  SAY #57182 /* ~But I am allowing you to keep your little secret, <PRO_RACE>.  Is that worth nothing to you?  Dance amongst the drow as long as you wish, I care not.~ */
  IF ~PartyHasItem("miscbe")~ THEN DO ~GivePartyGold(2500)~ GOTO 30
  IF ~!PartyHasItem("miscbe")~ THEN GOTO 31
END

IF ~~ THEN BEGIN 37 // from: 28.3
  SAY #57183 /* ~Such a temper, <CHARNAME>.  It doesn't suit you.  Here I am allowing you to keep your little secret and you're blustering on with threats.  Not good at all.~ */
  IF ~~ THEN GOTO 38
END

IF ~~ THEN BEGIN 38 // from: 37.0
  SAY #57184 /* ~You do remember that my men are not imprisoned... we are able to protect ourselves from the likes of you.  Do you truly wish to pursue this foolishness?~ */
  IF ~~ THEN REPLY #57217 /* ~I'm going to kill you, drow, and nothing's going to stop me!~ */ GOTO 41
  IF ~~ THEN REPLY #57218 /* ~Fine.  Just get this over with, then!~ */ GOTO 42
  IF ~~ THEN REPLY #57219 /* ~No... perhaps not.~ */ GOTO 42
END

IF ~~ THEN BEGIN 39 // from: KORGANJ:172.0 33.0
  SAY #57188 /* ~No.  I'm afraid that you won't.  Frustrating, isn't it?  Best that you just forget about me or you'll just end up getting apoplexy.~ */
  IF ~~ THEN GOTO 40
END

IF ~~ THEN BEGIN 40 // from: 39.0 33.2 33.1
  SAY #57189 /* ~Time for you to return to Ust Natha, then.  You've been quite a sport, <CHARNAME>.  Perhaps we shall meet again.~ */
  IF ~~ THEN DO ~AddExperienceParty(10000)
StartCutSceneMode()
StartCutScene("cut52b")
EraseJournalEntry(55435)
EraseJournalEntry(55458)~ SOLVED_JOURNAL #55459 /* ~Intrigue with Jarlaxle

Lies again, of course. The gems Jarlaxle wished stolen did not contain the souls of his men, whom he never risked by attacking the Lich to begin with. The gems were actually valuable artifacts belonging to House Jae'llat, of which the Lich was an ally. Jarlaxle concocted this whole affair for his original goal of retribution against the House that failed to pay him. I may have gained the means to enter two Drow dwellings, but this chicanery makes my head spin. The Rope will get me back to where I should be.~ */ EXIT
END

IF ~~ THEN BEGIN 41 // from: 38.0
  SAY #57220 /* ~A shame.  Your funeral.~ */
  IF ~~ THEN DO ~ActionOverride("breg01",Enemy())
Enemy()
EraseJournalEntry(55435)
EraseJournalEntry(55458)~ SOLVED_JOURNAL #55459 /* ~Intrigue with Jarlaxle

Lies again, of course. The gems Jarlaxle wished stolen did not contain the souls of his men, whom he never risked by attacking the Lich to begin with. The gems were actually valuable artifacts belonging to House Jae'llat, of which the Lich was an ally. Jarlaxle concocted this whole affair for his original goal of retribution against the House that failed to pay him. I may have gained the means to enter two Drow dwellings, but this chicanery makes my head spin. The Rope will get me back to where I should be.~ */ EXIT
END

IF ~~ THEN BEGIN 42 // from: 38.2 38.1
  SAY #57221 /* ~A very intelligent move.  I knew there had to be a reason you were still alive.~ */
  IF ~PartyHasItem("miscbe")~ THEN GOTO 30
  IF ~!PartyHasItem("miscbe")~ THEN GOTO 31
END
