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

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

IF WEIGHT #3 /* Triggers after states #: 23 41 48 even though they appear after this state */
~Global("TalkedTozGorCamb","GLOBAL",0)~ THEN BEGIN 0 // from:
  SAY #63481 /* ~Why, hello there.  A Prime, is it?  I *thought* we'd been drawn into the Prime Material Plane, but I couldn't be sure with all this... interference.~ [GORCAM06] */
  IF ~OR(2)
!IsValidForPartyDialog("HaerDalis")
!Global("INTOB","GLOBAL",1)
~ THEN DO ~AddXP2DA("PLOT2C")~ GOTO 1
  IF ~IsValidForPartyDialog("HaerDalis")
Global("INTOB","GLOBAL",1)
~ THEN DO ~AddXP2DA("PLOT2C")~ EXTERN ~HAERD25J~ 10
END

IF ~~ THEN BEGIN 1 // from: HAERD25J:11.0 0.0
  SAY #63482 /* ~Pardon my atrocious manners.  I sometimes forget that you Primes are civilized.  My name is Aesgareth, and these are my servants and pets.~ [GORCAM07] */
  IF ~~ THEN REPLY #63483 /* ~And just what manner of creature are you?~ */ GOTO 2
  IF ~~ THEN REPLY #63484 /* ~My name is <GABBER>.  Ahhh... pleased to meet you, too.~ */ GOTO 3
  IF ~~ THEN REPLY #63485 /* ~You are a demon, fool, and you'll die as every other demon here has!~ */ GOTO 5
END

IF ~~ THEN BEGIN 2 // from: 1.0
  SAY #63486 /* ~Well, how rude.  If you must know, I am a Cambion of a noble house from a place called Curst.  Any other questions?~ */
  IF ~~ THEN REPLY #63487 /* ~I've met Cambions before.  Evil demons, they are, and you shall be treated as such!~ */ GOTO 5
  IF ~~ THEN REPLY #63488 /* ~How did you come to be here?~ */ GOTO 7
  IF ~~ THEN REPLY #63491 /* ~Perhaps.  I am <GABBER>, by the way.~ */ GOTO 3
END

IF ~~ THEN BEGIN 3 // from: 7.1 5.1 2.2 1.1
  SAY #63492 /* ~Well, now.  Nice to meet someone pleasant, instead of a host of frustrated fiends.  Had to destroy several after we found ourselves here, the rude beasts.~ */
  IF ~~ THEN GOTO 4
END

IF ~~ THEN BEGIN 4 // from: 3.0
  SAY #63494 /* ~But what does one expect from the lower planes, eh?  Me, I'll take Sigil any day, and avoid the Blood War entirely.  But that's neither here nor there.~ */
  IF ~~ THEN GOTO 8
END

IF ~~ THEN BEGIN 5 // from: 7.0 2.0 1.2
  SAY #63495 /* ~Ahhh, you Primes are such limited creatures.  You sound like those fools that spill out of Excelsior once a generation.  We can fight, I suppose, but all I asked for was your name.~ */
  IF ~~ THEN REPLY #63496 /* ~Never!  To arms, fool!~ */ GOTO 6
  IF ~~ THEN REPLY #63497 /* ~Very well.  I am <GABBER>.  But I'm watching you...~ */ GOTO 3
END

IF ~~ THEN BEGIN 6 // from: 5.0
  SAY #63499 /* ~As you wish.  Too bad... I was hoping for a half-challenging game of cards before I found my way out of here.  Well, off we go...~ */
  IF ~~ THEN DO ~Shout(151)
Enemy()~ EXIT
END

IF ~~ THEN BEGIN 7 // from: 2.1
  SAY #63500 /* ~Well, I imagine I arrived here like any other planar has... drawn through the broken portal on the eastern side of this cavern, here.  I really would prefer to know who I'm addressing, though.~ */
  IF ~~ THEN REPLY #63501 /* ~Never!  You are a demon and shall fall where you stand!~ */ GOTO 5
  IF ~~ THEN REPLY #63502 /* ~Fine.  My name is <GABBER>.~ */ GOTO 3
END

IF ~~ THEN BEGIN 8 // from: 4.0
  SAY #63503 /* ~We found ourselves in this place after being... drawn, somehow.  I imagine the magic of the broken portal on the east side of this cavern has something to do with that.~ */
  IF ~~ THEN GOTO 9
END

IF ~~ THEN BEGIN 9 // from: 8.0
  SAY #63506 /* ~Wherever this place is, it allows me to gate in things... minor things... but not to open a gate back out.  Interesting, no?~ */
  IF ~~ THEN GOTO 10
END

IF ~~ THEN BEGIN 10 // from: 9.0
  SAY #63510 /* ~I could gate out of this place, but the magic here is very powerful and specific.  Likely I need some manner of key to pierce the shields of this place.  Do you know of such a thing?~ */
  IF ~~ THEN REPLY #63515 /* ~If I knew a way out, I wouldn't tell you.~ */ GOTO 11
  IF ~~ THEN REPLY #63519 /* ~I might.  Why should I let you out?~ */ GOTO 12
  IF ~PartyHasItem("PLOT01b")
~ THEN REPLY #63520 /* ~I believe I do... I can arrange for your exit, if you wish.~ */ GOTO 13
  IF ~PartyHasItem("PLOT01b")
~ THEN REPLY #63522 /* ~I could let you out... for a price.~ */ GOTO 14
  IF ~~ THEN REPLY #63524 /* ~No, I don't have a way out of here.~ */ GOTO 15
END

IF ~~ THEN BEGIN 11 // from: 10.0
  SAY #63527 /* ~Well, have it your way, <RACE>.  Should you get it into your heart that you're willing to risk a little... maybe then the two of us can have a bit of excitement, yes?~ */
  IF ~~ THEN GOTO 16
END

IF ~~ THEN BEGIN 12 // from: 10.1
  SAY #63528 /* ~I wouldn't expect you to let me out of here based on the goodness of your heart... but I'll play you for it.~ */
  IF ~~ THEN GOTO 16
END

IF ~~ THEN BEGIN 13 // from: 10.2
  SAY #63529 /* ~Oh, no no.  I don't just want to leave.  I want some fun before I go back to Sigil... you Primes can be decent gamblers, sometimes.~ */
  IF ~~ THEN GOTO 16
END

IF ~~ THEN BEGIN 14 // from: 10.3
  SAY #63530 /* ~I've no wish to purchase my way out of here, at any price.  That is so boring.  Tell you what... I'll play you for it.~ */
  IF ~~ THEN GOTO 16
END

IF ~~ THEN BEGIN 15 // from: 10.4
  SAY #63531 /* ~Well, you might have some other things you could put up as stakes... if you're game, that is, for a bit of excitement.~ */
  IF ~~ THEN GOTO 16
END

IF ~~ THEN BEGIN 16 // from: 15.0 14.0 13.0 12.0 11.0
  SAY #63532 /* ~Allow me to explain: I have a certain penchant for games of chance.  I enjoy all kinds of gambling, but today I have something with me of particular interest.~ */
  IF ~~ THEN GOTO 17
END

IF ~~ THEN BEGIN 17 // from: 16.0
  SAY #63651 /* ~You see, I just finished winning a Deck of Many Things from a relative of mine, Duke Rowan.  It's a beautiful deck, a variation on the norm by a Genasi wizard of some repute.~ */
  IF ~True()~ THEN GOTO 18
  IF ~IsValidForPartyDialog("Minsc")
GlobalGT("Chapter","GLOBAL",7)
~ THEN EXTERN ~MINSC25J~ 6
  IF ~IsValidForPartyDialog("Imoen2")
GlobalGT("Chapter","GLOBAL",7)
~ THEN EXTERN ~IMOEN25J~ 31
  IF ~IsValidForPartyDialog("HaerDalis")
GlobalGT("Chapter","GLOBAL",7)
~ THEN EXTERN ~HAERD25J~ 12
END

IF ~~ THEN BEGIN 18 // from: HAERD25J:12.0 17.0
  SAY #63653 /* ~I'm eager to try it.  I'll play you for the item that exits this place... or other things, if you've something of value.  What do you say, <GABBER>?  Pique your interest at all?~ */
  IF ~~ THEN REPLY #63654 /* ~You possess nothing that interests me.~ */ GOTO 19
  IF ~~ THEN REPLY #63655 /* ~I might be.  I'd have to think about it.~ */ GOTO 22
  IF ~~ THEN REPLY #63656 /* ~Yes, I think I'd be interested.~ */ GOTO 22
  IF ~~ THEN REPLY #63666 /* ~And what's to stop me from just taking whatever you have by force?~ */ GOTO 25
END

IF ~~ THEN BEGIN 19 // from: 18.0
  SAY #63657 /* ~No?  I have a gem, here.  Its magic has something to do with the broken portal.  I'll wager it for the way out of here.~ */
  IF ~~ THEN GOTO 20
END

IF ~~ THEN BEGIN 20 // from: 22.0 19.0
  SAY #63658 /* ~But you'll probably wish to prepare yourself and so forth.  Take as much time as you need.  It *is* a Deck of Many Things, after all, and not for the faint of heart.~ */
  IF ~~ THEN GOTO 21
END

IF ~~ THEN BEGIN 21 // from: 20.0
  SAY #63659 /* ~If you or some companion of yours is ready to play, come and speak to me.  Unless, of course, you're too frightened...~ [GORCAM08] */
  IF ~~ THEN DO ~SetGlobal("TalkedTozGorCamb","GLOBAL",1)~ UNSOLVED_JOURNAL #63733 /* ~The Gambling Cambion

I have encountered a Cambion and his retinue inside of the maze.  This one seems friendly enough and is mostly interested in gaming with me for a chance at his freedom from this place.  In return for me putting up the holy symbol as stakes, he is willing to offer me a gem he has found... all based off of draws from a Deck of Many Things.~ */ EXIT
END

IF ~~ THEN BEGIN 22 // from: 25.0 18.2 18.1
  SAY #63660 /* ~Well, here's something to entice you.  I have a gem... I believe its magic has something to do with the broken portal behind me.  I'll wager it for the way out of this place.~ */
  IF ~~ THEN GOTO 20
END

IF WEIGHT #0 ~Global("zGorCambAttacked","GLOBAL",1)~ THEN BEGIN 23 // from: 60.2
  SAY #63661 /* ~I see we've got some rather unsporting Primes to deal with.~ [GORCAM09] */
  IF ~~ THEN DO ~EraseJournalEntry(63733)
Shout(151)
Enemy()~ EXIT
END

IF WEIGHT #4 /* Triggers after states #: 41 48 even though they appear after this state */
~Global("TalkedTozGorCamb","GLOBAL",1)
GlobalLT("GamesPlayed","GLOBAL",2)
Global("PlayerWager","GLOBAL",0)
Global("CambionWager","GLOBAL",0)~ THEN BEGIN 24 // from: 28.0
  SAY #63662 /* ~So, then.  What do you say, my good <RACE>?  Ready to play?~ [GORCAM10] */
  IF ~~ THEN REPLY #63663 /* ~How is your game played?~ */ GOTO 27
  IF ~~ THEN REPLY #63664 /* ~I'm ready.  What are the stakes?~ */ GOTO 29
  IF ~~ THEN REPLY #63665 /* ~No, I'm not ready to play just yet.~ */ GOTO 26
END

IF ~~ THEN BEGIN 25 // from: 18.3
  SAY #63667 /* ~Too cowardly to take your chances on the Deck of Many Things?  I understand.  Be unsporting if you wish. The choice is yours.~ */
  IF ~~ THEN GOTO 22
END

IF ~~ THEN BEGIN 26 // from: 65.0 31.0 30.0 24.2
  SAY #63669 /* ~No?  Very well.  Never let it be said that Aesgareth is an impatient half-fiend, eh?  Heh heh.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 27 // from: 24.0
  SAY #63670 /* ~It's rather simple, actually.  We'll use the rules established by the renowned match between Tandem the Sensate and Bal'evoreth in Sigil.~ */
  IF ~~ THEN GOTO 28
END

IF ~~ THEN BEGIN 28 // from: 27.0
  SAY #63672 /* ~Each of us draws a card from the deck.  Whichever of us survives the effect and has the higher card wins the draw.  Simple, see?~ */
  IF ~~ THEN GOTO 24
END

IF ~~ THEN BEGIN 29 // from: 24.1
  SAY #63673 /* ~Well, first you must offer a wager.  A tiny portion of your soul, like... hmmm... experience or vitality.  Or wager whatever allows me to leave this place.~ */
  IF ~~ THEN GOTO 30
END

IF ~~ THEN BEGIN 30 // from: 29.0
  SAY #63674 /* ~Keep in mind, though, that I'll only wager the gem for the way out of here.  And, don't worry... whatever it is, you'll get it back when I go.~ */
  IF ~~ THEN REPLY #63676 /* ~I'm not ready to play just yet, then.~ */ DO ~SetGlobal("PlayerWager","GLOBAL",0)~ GOTO 26
  IF ~PartyHasItem("PLOT01b")
~ THEN REPLY #63677 /* ~I shall wager you the way out of here.~ */ DO ~SetGlobal("PlayerWager","GLOBAL",3)~ GOTO 65
  IF ~~ THEN REPLY #63678 /* ~I will wager some of my experience.~ */ DO ~SetGlobal("PlayerWager","GLOBAL",2)~ GOTO 31
  IF ~~ THEN REPLY #63679 /* ~I will wager some of my vitality.~ */ DO ~SetGlobal("PlayerWager","GLOBAL",1)~ GOTO 31
END

IF ~~ THEN BEGIN 31 // from: 30.3 30.2
  SAY #63681 /* ~Excellent.  I have access to a Spectral Brand and a Scroll of Wish, both rather impressive items.  And there is the gem, as well.  What would you wish to play for?~ */
  IF ~~ THEN REPLY #63682 /* ~I'm not ready to play just yet.~ */ DO ~SetGlobal("CambionWager","GLOBAL",0)
SetGlobal("PlayerWager","GLOBAL",0)~ GOTO 26
  IF ~Global("Item1","GLOBAL",0)~ THEN REPLY #63683 /* ~I will play for the Spectral Brand.~ */ DO ~SetGlobal("CambionWager","GLOBAL",1)~ GOTO 32
  IF ~Global("Item2","GLOBAL",0)~ THEN REPLY #63684 /* ~I will play for the Scroll of Wish.~ */ DO ~SetGlobal("CambionWager","GLOBAL",2)~ GOTO 32
  IF ~Global("PlayerWager","GLOBAL",3)~ THEN REPLY #63685 /* ~I will play for the gem.~ */ DO ~SetGlobal("CambionWager","GLOBAL",3)~ GOTO 32
END

IF ~~ THEN BEGIN 32 // from: 65.3 65.2 65.1 60.0 31.3 31.2 31.1
  SAY #63687 /* ~As you wish.  Alright, my friend... I shall allow you to draw from the deck first.~ */
  IF ~Global("GamesPlayed","GLOBAL",0)~ THEN DO ~TriggerActivation("Tran3014",FALSE)
TriggerActivation("Tran3016",FALSE)
~ GOTO 39
  IF ~Global("GamesPlayed","GLOBAL",1)~ THEN DO ~TriggerActivation("Tran3014",FALSE)
TriggerActivation("Tran3016",FALSE)
~ GOTO 40
  IF ~Global("GamesPlayed","GLOBAL",2)~ THEN DO ~TriggerActivation("Tran3014",FALSE)
TriggerActivation("Tran3016",FALSE)
~ GOTO 62
END

IF ~~ THEN BEGIN 33 // from: 39.0
  SAY #63688 /* ~Ahhh...'Plague'.  A low card, and not a good draw, either.  Such is the luck of the draw.~ */
  IF ~~ THEN DO ~DialogueInterrupt(FALSE)
ClearAllActions()
MoveViewObject(Myself,0)
ReallyForceSpell(LastTalkedToBy,DECK_PLAGUE)
Wait(3)
SetGlobal("DrawEffect","GLOBAL",1)
DialogueInterrupt(TRUE)
StartDialogNoSet(LastTalkedToBy)
~ EXIT
END

IF ~~ THEN BEGIN 34 // from: 40.0
  SAY #63689 /* ~'Guile', is it?  An interesting draw, although not a high suit.  I expect you'll have a fight on your hands in a moment, <GABBER>.~ */
  IF ~~ THEN DO ~DialogueInterrupt(FALSE)
ClearAllActions()
MoveViewObject(Myself,0)
CreateCreatureObjectEffect("GORDECK5","SPFLESHS",LastTalkedToBy)
CreateCreatureObjectEffect("GORDECK6","SPFLESHS",LastTalkedToBy)
CreateCreatureObjectEffect("GORDECK7","SPFLESHS",LastTalkedToBy)
CreateCreatureObjectEffect("GORDECK8","SPFLESHS",LastTalkedToBy)
CreateCreatureObjectEffect("GORDECK9","SPFLESHS",LastTalkedToBy)
CreateCreatureObjectEffect("GORDECKA","SPFLESHS",LastTalkedToBy)
DialogInterrupt(FALSE)
SetGlobal("PostCombatReinit","GLOBAL",1)
Wait(1)
SetGlobal("DrawEffect","GLOBAL",1)
~ EXIT
END

IF ~~ THEN BEGIN 35 // from: 39.1
  SAY #63691 /* ~'Strife'?  A decent draw, although I wonder what the effect will be.~ */
  IF ~~ THEN DO ~DialogueInterrupt(FALSE)
ClearAllActions()
MoveViewObject(Myself,0)
ReallyForceSpell(LastTalkedToBy,DECK_STRIFE)
Wait(3)
SetGlobal("DrawEffect","GLOBAL",1)
DialogueInterrupt(TRUE)
StartDialogNoSet(LastTalkedToBy)
~ EXIT
END

IF ~~ THEN BEGIN 36 // from: 62.0
  SAY #63692 /* ~'High Priestess'.  An excellent draw.  The plate depicts a scene of secrets, however.~ */
  IF ~~ THEN DO ~DialogueInterrupt(FALSE)
ClearAllActions()
MoveViewObject(Myself,0)
ReallyForceSpell(LastTalkedToBy,DECK_HIGH_PRIESTESS)
Wait(3)
SetGlobal("DrawEffect","GLOBAL",1)
DialogueInterrupt(TRUE)
StartDialogNoSet(LastTalkedToBy)
~ EXIT
END

IF ~~ THEN BEGIN 37 // from: 62.1
  SAY #63693 /* ~Ahhh... the 'Emperor'!  A very good draw, my friend... and a beneficial card.~ */
  IF ~~ THEN DO ~DialogueInterrupt(FALSE)
ClearAllActions()
MoveViewObject(Myself,0)
ReallyForceSpell(LastTalkedToBy,DECK_EMPEROR)
Wait(3)
SetGlobal("DrawEffect","GLOBAL",1)
DialogueInterrupt(TRUE)
StartDialogNoSet(LastTalkedToBy)
~ EXIT
END

IF ~~ THEN BEGIN 38 // from: 40.1
  SAY #63695 /* ~'Strength'.  An extremely high suit.  I wonder, though, whether this represents growing stronger... or a lack of strength?  A curse, perhaps?  Do you have a means of breaking curses, mortal?~ */
  IF ~~ THEN DO ~DialogueInterrupt(FALSE)
ClearAllActions()
MoveViewObject(Myself,0)
ReallyForceSpell(LastTalkedToBy,DECK_STRENGTH)
Wait(2)
SetGlobal("DrawEffect","GLOBAL",1)
DialogueInterrupt(TRUE)
StartDialogNoSet(LastTalkedToBy)
~ EXIT
END

IF ~~ THEN BEGIN 39 // from: 32.0
  SAY #63698 /* ~I shall spread out the cards for you like so.  Choose a card as soon as you are ready.~ */
  IF ~RandomNum(2,1)~ THEN DO ~SetGlobal("PlayerDraw","GLOBAL",1)~ GOTO 33
  IF ~RandomNum(2,2)~ THEN DO ~SetGlobal("PlayerDraw","GLOBAL",3)~ GOTO 35
END

IF ~~ THEN BEGIN 40 // from: 32.1
  SAY #63699 /* ~I shall spread out the cards for you like so.  Choose a card as soon as you are ready.~ */
  IF ~RandomNum(2,1)~ THEN DO ~SetGlobal("PlayerDraw","GLOBAL",2)~ GOTO 34
  IF ~RandomNum(2,2)~ THEN DO ~SetGlobal("PlayerDraw","GLOBAL",6)~ GOTO 38
END

IF WEIGHT #1 ~Global("DrawEffect","GLOBAL",1)~ THEN BEGIN 41 // from:
  SAY #63701 /* ~Interesting.  Most interesting.  The Genasi was a genius, if you ask me.~ [GORCAM11] */
  IF ~Global("GamesPlayed","GLOBAL",0)~ THEN GOTO 42
  IF ~Global("GamesPlayed","GLOBAL",1)~ THEN GOTO 43
  IF ~Global("GamesPlayed","GLOBAL",2)~ THEN GOTO 63
END

IF ~~ THEN BEGIN 42 // from: 41.0
  SAY #63702 /* ~Now, of course it is my turn.  You may wish to step back... just in case.~ */
  IF ~RandomNum(2,1)~ THEN DO ~SetGlobal("CambionDraw","GLOBAL",1)~ GOTO 44
  IF ~RandomNum(2,2)~ THEN DO ~SetGlobal("CambionDraw","GLOBAL",4)~ GOTO 47
END

IF ~~ THEN BEGIN 43 // from: 41.1
  SAY #63703 /* ~Now, of course it is my turn.  You may wish to step back... just in case.~ */
  IF ~RandomNum(2,1)~ THEN DO ~SetGlobal("CambionDraw","GLOBAL",2)~ GOTO 45
  IF ~RandomNum(2,2)~ THEN DO ~SetGlobal("CambionDraw","GLOBAL",3)~ GOTO 46
END

IF ~~ THEN BEGIN 44 // from: 42.0
  SAY #63704 /* ~'Triumph'?  Ahhhh... I sense a fight oncoming.  Give me a few moments, my friend.~ */
  IF ~~ THEN DO ~DialogInterrupt(FALSE)
ClearAllActions()
MoveViewObject(Myself,0)
CreateCreatureObjectEffect("GORDECK1","SPFLESHS",Myself)
CreateCreatureObjectEffect("GORDECK2","SPFLESHS",Myself)
CreateCreatureObjectEffect("GORDECK3","SPFLESHS",Myself)
CreateCreatureObjectEffect("GORDECK4","SPFLESHS",Myself)
SetGlobal("PostCombatReinit","GLOBAL",2)
Wait(1)
SetGlobal("DrawEffect","GLOBAL",2)
EndCutSceneMode()
~ EXIT
END

IF ~~ THEN BEGIN 45 // from: 43.0
  SAY #63705 /* ~'Defiance', is it?  To defy the gods?  I wonder what the effect is?~ */
  IF ~~ THEN DO ~DialogInterrupt(FALSE)
ClearAllActions()
MoveViewObject(Myself,0)
ReallyForceSpell(Myself,DECK_DEFIANCE)
Wait(3)
SetGlobal("DrawEffect","GLOBAL",2)
DialogInterrupt(TRUE)
StartDialogNoSet(LastTalkedToBy)
~ EXIT
END

IF ~~ THEN BEGIN 46 // from: 43.1
  SAY #63706 /* ~Ah.  The 'Empress'.  An excellent card with a high suit.  Luck is with me today!~ */
  IF ~~ THEN DO ~DialogInterrupt(FALSE)
ClearAllActions()
MoveViewObject(Myself,0)
ReallyForceSpell(Myself,DECK_EMPRESS)
Wait(2)
SetGlobal("DrawEffect","GLOBAL",2)
DialogInterrupt(TRUE)
StartDialogNoSet(LastTalkedToBy)
~ EXIT
END

IF ~~ THEN BEGIN 47 // from: 42.1
  SAY #63707 /* ~What's this?  'Construct'?  Another battle, is it?~ */
  IF ~~ THEN DO ~DialogInterrupt(FALSE)
ClearAllActions()
MoveViewObject(Myself,0)
CreateCreatureObjectEffect("GORDECKB","SPFLESHS",Myself)
SetGlobal("PostCombatReinit","GLOBAL",3)
Wait(1)
SetGlobal("DrawEffect","GLOBAL",2)~ EXIT
END

IF WEIGHT #2 ~Global("DrawEffect","GLOBAL",2)~ THEN BEGIN 48 // from:
  SAY #63708 /* ~So... that is it?  A dangerous game, and yet it seems we have survived relatively unscathed, yes?~ [GORCAM12] */
  IF ~Global("CambionDraw","GLOBAL",1)
GlobalLT("PlayerDraw","GLOBAL",2)~ THEN GOTO 49
  IF ~Global("CambionDraw","GLOBAL",2)
GlobalLT("PlayerDraw","GLOBAL",3)~ THEN GOTO 49
  IF ~Global("CambionDraw","GLOBAL",3)
GlobalLT("PlayerDraw","GLOBAL",5)~ THEN GOTO 49
  IF ~Global("CambionDraw","GLOBAL",4)
GlobalLT("PlayerDraw","GLOBAL",6)~ THEN GOTO 49
  IF ~Global("CambionDraw","GLOBAL",1)
GlobalGT("PlayerDraw","GLOBAL",1)~ THEN GOTO 50
  IF ~Global("CambionDraw","GLOBAL",2)
GlobalGT("PlayerDraw","GLOBAL",2)~ THEN GOTO 50
  IF ~Global("CambionDraw","GLOBAL",3)
GlobalGT("PlayerDraw","GLOBAL",4)~ THEN GOTO 50
  IF ~Global("CambionDraw","GLOBAL",4)
GlobalGT("PlayerDraw","GLOBAL",5)~ THEN GOTO 50
  IF ~Global("CambionDraw","GLOBAL",5)~ THEN GOTO 49
END

IF ~~ THEN BEGIN 49 // from: 48.8 48.3 48.2 48.1 48.0
  SAY #63709 /* ~The card I drew is, however, of a higher suit than yours.  I win the draw!~ */
  IF ~Global("PlayerWager","GLOBAL",1)~ THEN DO ~TriggerActivation("Tran3014",TRUE)
TriggerActivation("Tran3016",TRUE)
~ GOTO 51
  IF ~Global("PlayerWager","GLOBAL",2)~ THEN DO ~TriggerActivation("Tran3014",TRUE)
TriggerActivation("Tran3016",TRUE)
~ GOTO 52
  IF ~Global("PlayerWager","GLOBAL",3)~ THEN DO ~TriggerActivation("Tran3014",TRUE)
TriggerActivation("Tran3016",TRUE)
~ GOTO 53
END

IF ~~ THEN BEGIN 50 // from: 48.7 48.6 48.5 48.4
  SAY #63710 /* ~The card you drew is of a higher suit than mine, however.  You have won the draw!~ */
  IF ~Global("CambionWager","GLOBAL",1)~ THEN DO ~TriggerActivation("Tran3014",TRUE)
TriggerActivation("Tran3016",TRUE)
AddXP2DA("PLOT2A")~ GOTO 56
  IF ~Global("CambionWager","GLOBAL",2)~ THEN DO ~TriggerActivation("Tran3014",TRUE)
TriggerActivation("Tran3016",TRUE)
AddXP2DA("PLOT2A")~ GOTO 57
  IF ~Global("CambionWager","GLOBAL",3)~ THEN DO ~TriggerActivation("Tran3014",TRUE)
TriggerActivation("Tran3016",TRUE)
AddXP2DA("PLOT2A")~ GOTO 58
END

IF ~~ THEN BEGIN 51 // from: 49.0
  SAY #63711 /* ~You wagered some of your vitality... I shall take my prize now.  And, no... you may not have it back.  Return if you wish to play again.~ */
  IF ~~ THEN DO ~IncrementGlobal("GamesPlayed","GLOBAL",1)
SetGlobal("DrawEffect","GLOBAL",0)
SetGlobal("CambionWager","GLOBAL",0)
SetGlobal("PlayerWager","GLOBAL",0)
ReallyForceSpell(LastTalkedToBy,DECK_VITALITY_DRAIN)
~ EXIT
END

IF ~~ THEN BEGIN 52 // from: 49.1
  SAY #63712 /* ~You wagered some of your experience... I shall take my prize now.  And, no... you may not have it back. Return, if you wish to play again.~ */
  IF ~~ THEN DO ~IncrementGlobal("GamesPlayed","GLOBAL",1)
SetGlobal("DrawEffect","GLOBAL",0)
SetGlobal("CambionWager","GLOBAL",0)
SetGlobal("PlayerWager","GLOBAL",0)
ReallyForceSpell(LastTalkedToBy,DECK_XP_DRAIN)
~ EXIT
END

IF ~~ THEN BEGIN 53 // from: 49.2
  SAY #63713 /* ~I have won my freedom!  The way out of here is mine!   You may have the gem, regardless... it means nothing to me, now.  May I have my prize?~ */
  IF ~~ THEN REPLY #63714 /* ~So long as I get it back, here you go.~ */ GOTO 54
  IF ~~ THEN REPLY #63715 /* ~Forget it!  No doubt you'll leave me here, trapped!~ */ GOTO 55
END

IF ~~ THEN BEGIN 54 // from: 53.0
  SAY #63717 /* ~Thank you!  For a Prime, you aren't so bad.  Come, my minions... let us return to the planes before someone actually begins to miss us!  Onwards!~ [GORCAM13] */
  IF ~~ THEN DO ~AddXP2DA("PLOT2B")
ClearAllActions()
StartCutSceneMode()
StartCutScene("cut203a")
~ SOLVED_JOURNAL #63735 /* ~The Gambling Cambion

A Cambion with a penchant for playing games of chance with his Deck of Many Things won his freedom from me by the luck of the draw.  He not only returned the holy symbol as promised, but also gave me a gem he had found, here, that was now worthless to him.~ */ EXIT
END

IF ~~ THEN BEGIN 55 // from: 53.1
  SAY #63718 /* ~(sigh)  Then you leave me little choice.  What a poor sport you are!~ [GORCAM14] */
  IF ~~ THEN DO ~EraseJournalEntry(63733)
Shout(151)
Enemy()~ EXIT
END

IF ~~ THEN BEGIN 56 // from: 50.0
  SAY #63719 /* ~You desire the Spectral Brand, and here it is.  If you wish to play again, I'd appreciate a chance to gain my freedom, friend.~ */
  IF ~~ THEN DO ~IncrementGlobal("GamesPlayed","GLOBAL",1)
SetGlobal("DrawEffect","GLOBAL",0)
SetGlobal("Item1","GLOBAL",1)
SetGlobal("CambionWager","GLOBAL",0)
SetGlobal("PlayerWager","GLOBAL",0)
GiveItemCreate("SW1H68",LastTalkedToBy,0,0,0)
~ EXIT
END

IF ~~ THEN BEGIN 57 // from: 50.1
  SAY #63720 /* ~You desire the Scroll of Wish, and here it is.  If you wish to play again, I'd appreciate a chance to gain my freedom, friend.~ */
  IF ~~ THEN DO ~IncrementGlobal("GamesPlayed","GLOBAL",1)
SetGlobal("DrawEffect","GLOBAL",0)
SetGlobal("Item2","GLOBAL",1)
SetGlobal("CambionWager","GLOBAL",0)
SetGlobal("PlayerWager","GLOBAL",0)
GiveItemCreate("SCRLB4",LastTalkedToBy,0,0,0)
~ EXIT
END

IF ~~ THEN BEGIN 58 // from: 50.2
  SAY #63721 /* ~And so the gem is yours, fair and square.  It means little enough to me.~ */
  IF ~~ THEN DO ~GiveItem("PLOT02e",LastTalkedToBy)~ GOTO 59
END

IF ~~ THEN BEGIN 59 // from: 60.1 58.0
  SAY #63722 /* ~(sigh)  Alas, this leaves me little choice.  I hate being unsportsmanlike, but I also wish to get out of here.  My apologies, <RACE>.~ [GORCAM15] */
  IF ~~ THEN DO ~EraseJournalEntry(63733)
Shout(151)
Enemy()~ SOLVED_JOURNAL #63734 /* ~The Gambling Cambion

The Cambion with an urge to play games of chance with his Deck of Many Things wasn't about to let me walk out of here with Helm's holy symbol... his key to freedom.  The matter ended in violence, as it usually does... a bad gamble on his part.~ */ EXIT
END

IF WEIGHT #5 ~Global("TalkedTozGorCamb","GLOBAL",1)
Global("GamesPlayed","GLOBAL",2)
Global("PlayerWager","GLOBAL",0)
Global("CambionWager","GLOBAL",0)~ THEN BEGIN 60 // from:
  SAY #63723 /* ~I'm willing to play another game, certainly.  But this time I will only play for the way out of here... in exchange for the gem.  What do you say?~ */
  IF ~PartyHasItem("PLOT01b")~ THEN REPLY #63724 /* ~Agreed.~ */ DO ~SetGlobal("CambionWager","GLOBAL",3)
SetGlobal("PlayerWager","GLOBAL",3)
AddXP2DA("PLOT2B")~ GOTO 32
  IF ~~ THEN REPLY #63725 /* ~Forget it.  I won't take the risk.~ */ FLAGS 128 GOTO 59
  IF ~~ THEN REPLY #63727 /* ~I'd say I'd rather kill you here and now and get this over with.~ */ GOTO 23
  IF ~!PartyHasItem("PLOT01b")~ THEN REPLY #63728 /* ~I don't actually have that item with me right now.~ */ GOTO 61
END

IF ~~ THEN BEGIN 61 // from: 60.3
  SAY #63729 /* ~I see.  Well, I suppose I can wait until you retrieve it.  I *would* like to get out of here at some point... and better sooner than later, eh?~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 62 // from: 32.2
  SAY #63730 /* ~I shall spread out the cards for you like so.  Choose a card as soon as you are ready.~ */
  IF ~RandomNum(2,1)~ THEN DO ~SetGlobal("PlayerDraw","GLOBAL",4)~ GOTO 36
  IF ~RandomNum(2,2)~ THEN DO ~SetGlobal("PlayerDraw","GLOBAL",5)~ GOTO 37
END

IF ~~ THEN BEGIN 63 // from: 41.2
  SAY #63731 /* ~Now, of course it is my turn.  You may wish to step back... just in case.~ */
  IF ~~ THEN GOTO 64
END

IF ~~ THEN BEGIN 64 // from: 63.0
  SAY #63732 /* ~Oho!  It is the 'Wheel', one of the highest suits in the deck!  Most fortuitous!~ */
  IF ~~ THEN DO ~ClearAllActions()
MoveViewObject(Myself,0)
ReallyForceSpell(Myself,DECK_WHEEL)
Wait(3)
SetGlobal("DrawEffect","GLOBAL",2)
SetGlobal("CambionDraw","GLOBAL",5)
StartDialogNoSet(LastTalkedToBy)
~ EXIT
END

IF ~~ THEN BEGIN 65 // from: 30.1
  SAY #64609 /* ~Excellent.  I have access to a Spectral Brand and a Scroll of Wish, both rather impressive items.  And there is the gem, of course.  What would you wish to play for?~ */
  IF ~~ THEN REPLY #64610 /* ~I'm not ready to play just yet.~ */ DO ~SetGlobal("CambionWager","GLOBAL",0)
SetGlobal("PlayerWager","GLOBAL",0)~ GOTO 26
  IF ~Global("Item1","GLOBAL",0)~ THEN REPLY #64611 /* ~I will play for the Spectral Brand.~ */ DO ~SetGlobal("CambionWager","GLOBAL",1)~ GOTO 32
  IF ~Global("Item2","GLOBAL",0)~ THEN REPLY #64613 /* ~I will play for the Scroll of Wish.~ */ DO ~SetGlobal("CambionWager","GLOBAL",2)~ GOTO 32
  IF ~PartyHasItem("PLOT01b")
~ THEN REPLY #64615 /* ~I will play for the gem.~ */ DO ~SetGlobal("CambionWager","GLOBAL",3)~ GOTO 32
END

IF ~~ THEN BEGIN 66 // from: HAERD25J:10.0
  SAY #70543 /* ~I wouldn't know about 'wondrous', but 'tis fair enough... for what little I have seen.  Hmm... a tiefling, is it?  You remind me of an actor I once saw, in a play, in a dream.~ */
  IF ~~ THEN EXTERN ~HAERD25J~ 11
END
