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

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

IF WEIGHT #0 ~NumTimesTalkedTo(0)~ THEN BEGIN 0 // from:
  SAY #49634 /* ~Hoo-oooh!  Someone has come to play at last!~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 0
END

IF ~~ THEN BEGIN 1 // from: SAHIMP02:0.0
  SAY #49636 /* ~And not that stodgy overgrown fish-King!~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 1
END

IF ~~ THEN BEGIN 2 // from: SAHIMP02:1.0
  SAY #49638 /* ~None!  But now... hee hee!  You big peoples will want the treasure, right?~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 2
END

IF ~~ THEN BEGIN 3 // from: SAHIMP02:2.0
  SAY #49640 /* ~You can have the drow treasure, oh yes!  But you have to play our game, first!  Hee hee!  You have to play our game!~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 3
END

IF ~~ THEN BEGIN 4 // from: SAHIMP02:13.0 SAHIMP02:7.0 SAHIMP02:3.1 SAHIMP02:3.0 18.0
  SAY #49646 /* ~Tee hee!  Well, you COULD go and look in all the chests if you WANTED to...~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 4
END

IF ~~ THEN BEGIN 5 // from: SAHIMP02:4.0
  SAY #49648 /* ~Most of them!  All except for one... one of them is locked up tight and has all of the drow's treasure!  All of it!~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 5
END

IF ~~ THEN BEGIN 6 // from: SAHIMP02:5.0
  SAY #49650 /* ~It has a nasty nasty nasty inside it that will come out and steal your soul!  You'll be forever dead-dead!~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 6
END

IF ~~ THEN BEGIN 7 // from: SAHIMP02:6.0
  SAY #49652 /* ~But only if you plays our game!  Only if you plays, yes!  So what says you, big peoples?  Will you plays our game?~ */
  IF ~~ THEN REPLY #49653 /* ~Very well, I'll play your game, if that's what it takes.~ */ GOTO 9
  IF ~~ THEN REPLY #49654 /* ~I'll take my chances on my own.~ */ GOTO 14
  IF ~~ THEN REPLY #49655 /* ~Begone, imps!  I've no interest in your game or this treasure!~ */ GOTO 14
END

IF ~~ THEN BEGIN 8 // from: SAHIMP02:3.3
  SAY #49656 /* ~Oooh, you wants to look in the chests on your own!  Hee hee!  On your own!~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 7
END

IF ~~ THEN BEGIN 9 // from: SAHIMP02:13.2 SAHIMP02:7.1 SAHIMP02:3.2 18.1 7.0
  SAY #49661 /* ~The big peoples will plays our game!  Hurray!  Hurray!~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 8
END

IF ~~ THEN BEGIN 10 // from: SAHIMP02:8.0
  SAY #49663 /* ~Okay, big peoples... this is how our game will go!  There is five chests here with nothings in them!  In front of each empty chest, a famous big people will appear!~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 9
END

IF ~~ THEN BEGIN 11 // from: SAHIMP02:9.0
  SAY #49665 /* ~Each famous big people will give you a gift that belongs to another famous big people... and they will hints to you what gifts belong to them!~ */
  IF ~~ THEN GOTO 12
END

IF ~~ THEN BEGIN 12 // from: 11.0
  SAY #49666 /* ~If you thinks you knows which famous big people a gift belongs to, you puts it in the empty chest behind them, yes?  Very simple!~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 10
END

IF ~~ THEN BEGIN 13 // from: SAHIMP02:10.0
  SAY #49668 /* ~Lotsa fun!  Okay, we starts now!!~ */
  IF ~~ THEN DO ~SetGlobal("ImpRiddle","GLOBAL",1)
CreateCreature("sahimp03",[457.2926],11)
CreateCreature("sahimp04",[464.2792],14)
CreateCreature("sahimp05",[658.2719],0)
CreateCreature("sahimp06",[866.2823],3)
CreateCreature("sahimp07",[827.2951],5)~ UNSOLVED_JOURNAL #9998 /* ~Riddle of the Imps

A couple of imps have indicated that one of the six chests here is locked and has something inside that will steal my soul... unless they protect me from it. They will only do that if I solve their riddle. I have to match up the items that the illusionary figures give me to the ones they belong to, putting their item in the chest behind them. Then I have to go talk to the imps. When I'm right... well, I assume they'll tell me.~ */ EXIT
END

IF ~~ THEN BEGIN 14 // from: SAHIMP02:13.3 SAHIMP02:7.2 18.2 7.2 7.1
  SAY #49669 /* ~Aaaaaw... you big people is no fun.~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 11
END

IF ~~ THEN BEGIN 15 // from: SAHIMP02:11.0
  SAY #49671 /* ~But it is okays.  Maybe you come later and wants to play.  Or maybe the nasty nasty nasty eats someone's soul.~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 12
END

IF WEIGHT #2 /* Triggers after states #: 24 even though they appear after this state */
~Global("ImpRiddle","GLOBAL",0)~ THEN BEGIN 16 // from:
  SAY #49673 /* ~You comes back!  You comes back!  You wants to play, yes?~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 13
END

IF ~~ THEN BEGIN 17 // from: SAHIMP02:13.1
  SAY #49679 /* ~Sounds fun!~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 14
END

IF ~~ THEN BEGIN 18 // from: SAHIMP02:14.0
  SAY #49680 /* ~And then you'd face the nasty nasty nasty on your own, hee hee!~ */
  IF ~~ THEN REPLY #49682 /* ~What is this 'nasty' you mention?  Is it in one of the chests?  Is there a danger?~ */ GOTO 4
  IF ~~ THEN REPLY #49683 /* ~(sigh)  Fine.  Let's play your game, then, if that's what it takes.~ */ GOTO 9
  IF ~~ THEN REPLY #49684 /* ~I'll take my chances on my own... I'm not worried.~ */ GOTO 14
END

IF WEIGHT #3 /* Triggers after states #: 24 even though they appear after this state */
~Global("ImpRiddle","GLOBAL",1)
OR(5)
!Contains("misc9m","CHEST1")
!Contains("misc9o","CHEST2")
!Contains("misc9n","CHEST3")
!Contains("misc9p","CHEST4")
!Contains("misc9q","CHEST5")~ THEN BEGIN 19 // from:
  SAY #49685 /* ~Nope, nope, nope!  You gots something wrong with the gifts!  Hee hee!  You DID put them in the chests, right?~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #4 /* Triggers after states #: 24 even though they appear after this state */
~Global("ImpRiddle","GLOBAL",2)~ THEN BEGIN 20 // from:
  SAY #49696 /* ~OOoohh!!  You gots it all right, you did!  You outsmarted us but good!~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 16
END

IF ~~ THEN BEGIN 21 // from: SAHIMP02:16.0
  SAY #49698 /* ~Okay, okay.  We keeps the deal.  You goes and opens the last chest, now, and we imps will save you.  We gets to laugh at the nasty nasty nasty!~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 17
END

IF ~~ THEN BEGIN 22 // from: SAHSPC01:3.0
  SAY #49729 /* ~Ha ha!  Poor nasty nasty nasty!~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 18
END

IF ~~ THEN BEGIN 23 // from: SAHSPC01:4.0
  SAY #49733 /* ~Ha ha!  That was fun!~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 19
END

IF WEIGHT #1 ~Global("impsattacked","AR2300",1)~ THEN BEGIN 24 // from:
  SAY #49736 /* ~Spoil-sport!  Cheater!  You mean big people!~ */
  IF ~~ THEN EXTERN ~SAHIMP02~ 20
END
