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

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

IF ~~ THEN BEGIN 0 // from: SAHIMP01:0.0
  SAY #49635 /* ~Yes yes yes!  Someone will play with us, now!~ */
  IF ~~ THEN EXTERN ~SAHIMP01~ 1
END

IF ~~ THEN BEGIN 1 // from: SAHIMP01:1.0
  SAY #49637 /* ~Yeah!  That old fish-King!  Pheee-eeeww!  No sense of humor!~ */
  IF ~~ THEN EXTERN ~SAHIMP01~ 2
END

IF ~~ THEN BEGIN 2 // from: SAHIMP01:2.0
  SAY #49639 /* ~Big peoples always wants the drow's treasures!  Yes!~ */
  IF ~~ THEN EXTERN ~SAHIMP01~ 3
END

IF ~~ THEN BEGIN 3 // from: SAHIMP01:3.0
  SAY #49641 /* ~What say you, big people?  You are wanting the treasure?  You wants to plays our game, yes?~ */
  IF ~~ THEN REPLY #49642 /* ~Why would I want to play this game of yours?~ */ EXTERN ~SAHIMP01~ 4
  IF ~~ THEN REPLY #49643 /* ~What's to stop me from taking the treasure myself?~ */ EXTERN ~SAHIMP01~ 4
  IF ~~ THEN REPLY #49644 /* ~Alright, I'll play your game.~ */ EXTERN ~SAHIMP01~ 9
  IF ~~ THEN REPLY #49645 /* ~Forget it.  Move aside, imps, and be silent.~ */ EXTERN ~SAHIMP01~ 8
END

IF ~~ THEN BEGIN 4 // from: SAHIMP01:4.0
  SAY #49647 /* ~Yes, yes you could!  Hee hee!  Most of them are empty, now, anyway!~ */
  IF ~~ THEN EXTERN ~SAHIMP01~ 5
END

IF ~~ THEN BEGIN 5 // from: SAHIMP01:5.0
  SAY #49649 /* ~And something else, too!~ */
  IF ~~ THEN EXTERN ~SAHIMP01~ 6
END

IF ~~ THEN BEGIN 6 // from: SAHIMP01:6.0
  SAY #49651 /* ~Hee hee!  We can unlock the chest and protect you from the nasty nasty nasty...~ */
  IF ~~ THEN EXTERN ~SAHIMP01~ 7
END

IF ~~ THEN BEGIN 7 // from: SAHIMP01:8.0
  SAY #49657 /* ~If you does that, big peoples, you in big trouble!  Oh, yes, big trouble!  But not unless you plays our game, first!~ */
  IF ~~ THEN REPLY #49658 /* ~Why?  What's to stop me from looking in these chests?~ */ EXTERN ~SAHIMP01~ 4
  IF ~~ THEN REPLY #49659 /* ~Very well... I'll play your game, then.~ */ EXTERN ~SAHIMP01~ 9
  IF ~~ THEN REPLY #49660 /* ~I'll take my chances, imps.  Begone.~ */ EXTERN ~SAHIMP01~ 14
END

IF ~~ THEN BEGIN 8 // from: SAHIMP01:9.0
  SAY #49662 /* ~Hurray!  Hurray!~ */
  IF ~~ THEN EXTERN ~SAHIMP01~ 10
END

IF ~~ THEN BEGIN 9 // from: SAHIMP01:10.0
  SAY #49664 /* ~Famous big people!  Oh, yes, powerful famous big people!~ */
  IF ~~ THEN EXTERN ~SAHIMP01~ 11
END

IF ~~ THEN BEGIN 10 // from: SAHIMP01:12.0
  SAY #49667 /* ~Once you places all five, you comes and asks us!  If you wrong, we laugh at you!  If you right, we open the sixth chest and you can laugh at the nasty nasty nasty!~ */
  IF ~~ THEN EXTERN ~SAHIMP01~ 13
END

IF ~~ THEN BEGIN 11 // from: SAHIMP01:14.0
  SAY #49670 /* ~No fun, just like big stinky fish-King.~ */
  IF ~~ THEN EXTERN ~SAHIMP01~ 15
END

IF ~~ THEN BEGIN 12 // from: SAHIMP01:15.0
  SAY #49672 /* ~Either way, is all okay for us!~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #1 /* Triggers after states #: 21 even though they appear after this state */
~Global("ImpRiddle","GLOBAL",0)~ THEN BEGIN 13 // from: SAHIMP01:16.0
  SAY #49674 /* ~Yes, yes!  Tell us that you wants to play!  Tells us!~ */
  IF ~~ THEN REPLY #49675 /* ~First tell me what the danger is with these chests.~ */ EXTERN ~SAHIMP01~ 4
  IF ~~ THEN REPLY #49676 /* ~You'll give me the treasure, imps... or you'll have a sword in your gullet faster than you can blink!~ */ EXTERN ~SAHIMP01~ 17
  IF ~~ THEN REPLY #49677 /* ~Very well.  I'll play your little game.~ */ EXTERN ~SAHIMP01~ 9
  IF ~~ THEN REPLY #49678 /* ~Forget it.~ */ EXTERN ~SAHIMP01~ 14
END

IF ~~ THEN BEGIN 14 // from: SAHIMP01:17.0
  SAY #49681 /* ~But we would just go somewhere else and leave you spoil-sports alone!~ */
  IF ~~ THEN EXTERN ~SAHIMP01~ 18
END

IF WEIGHT #2 /* Triggers after states #: 21 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 15 // from:
  SAY #49686 /* ~Hee hee!  You can't outsmart an imp, you can't!  Hee hee!  You got something wrong, but I'm not telling what!~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 16 // from: SAHIMP01:20.0
  SAY #49697 /* ~Awwww, is the games over already?~ */
  IF ~~ THEN EXTERN ~SAHIMP01~ 21
END

IF ~~ THEN BEGIN 17 // from: SAHIMP01:21.0
  SAY #49699 /* ~Oh, goody!  Goes and opens it, big people!~ */
  IF ~~ THEN DO ~AddXPObject(Player1,18500)
AddXPObject(Player2,18500)
AddXPObject(Player3,18500)
AddXPObject(Player4,18500)
AddXPObject(Player5,18500)
AddXPObject(Player6,18500)
SetGlobal("ImpRiddle","GLOBAL",3)
CreateVisualEffectObject("SPSTRENH,"CHEST6")
Unlock("CHEST6")
//ActionOverride("sahimp01",DestroySelf())
//ActionOverride("sahimp02",DestroySelf())
ActionOverride("sahimp03",DestroySelf())
ActionOverride("sahimp04",DestroySelf())
ActionOverride("sahimp05",DestroySelf())
ActionOverride("sahimp06",DestroySelf())
ActionOverride("sahimp07",DestroySelf())
CreateCreature("sahspc01",[668.3080],8)~ UNSOLVED_JOURNAL #6572 /* ~Riddle of the Imps

Apparently, I have solved the imps' riddle correctly and may now open the 6th chest while they protect me from... whatever is inside.~ */ EXIT
END

IF ~~ THEN BEGIN 18 // from: SAHIMP01:22.0
  SAY #49730 /* ~You can't do nothing, nasty!  We protectings the big people!  Thpppppfffft!~ */
  IF ~~ THEN EXTERN ~SAHSPC01~ 4
END

IF ~~ THEN BEGIN 19 // from: SAHIMP01:23.0
  SAY #49735 /* ~You funny big peoples!  We go now.~ */
  IF ~~ THEN DO ~EraseJournalEntry(9998)
EraseJournalEntry(6572)
ActionOverride("sahimp01",ForceSpell(Myself,DRYAD_TELEPORT))
ForceSpell(Myself,DRYAD_TELEPORT)
~ SOLVED_JOURNAL #6830 /* ~Riddle of the Imps

The imps were true to their word and protected me from the specter that laid inside the chest.  The specter disappeared and the imps, having had their fun, did the same.~ */ EXIT
END

IF ~~ THEN BEGIN 20 // from: 21.0 SAHIMP01:24.0
  SAY #49737 /* ~You no fun!  You stink!  We leaving, now!~ */
  IF ~~ THEN DO ~SetGlobal("ImpsFled","GLOBAL",1)
ActionOverride("sahimp01",ForceSpell(Myself,DRYAD_TELEPORT))
ForceSpell(Myself,DRYAD_TELEPORT)
~ EXIT
END

IF WEIGHT #0 ~Global("impsattacked","AR2300",1)~ THEN BEGIN 21 // from:
  SAY #49738 /* ~Cheater cheater cheater!  Spoiler big people!~ */
  IF ~~ THEN GOTO 20
END
