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

BEGIN ~RILLPUZZ~

IF ~Global("TalkedtoRillpuzz","AR2809",0)~ THEN BEGIN 0 // from:
  SAY #57984 /* ~The odd, distinctly elven container is locked and no amount of pressure will force it open.~ */
  IF ~~ THEN GOTO 1
END

IF ~~ THEN BEGIN 1 // from: 0.0
  SAY #57985 /* ~The lid holds five pressure plates, each adorned with symbols common to Suldanessellar: Rillifane, the Tree of Life, a rune of Suldanessellar, Corellan Lotharian (the father of the Elven Pantheon), and the elven Symbol of Water.
~ */
  IF ~~ THEN DO ~SetGlobal("TalkedtoRillpuzz","AR2809",1)~ GOTO 10
END

IF ~Global("TalkedtoRillpuzz","AR2809",1)~ THEN BEGIN 2 // from: 10.0
  SAY #57986 /* ~Obviously the Runes on the box must be pressed in a certain order to access the contents. The edge of the box seems corroded, as if by acid. Which Rune will you press?~ */
  IF ~~ THEN REPLY #57987 /* ~Press the Symbol of Rillifane.~ */ GOTO 3
  IF ~~ THEN REPLY #57988 /* ~Press the Rune that denotes the Tree of Life.~ */ GOTO 3
  IF ~~ THEN REPLY #57989 /* ~Press the Rune of Suldanessellar.~ */ GOTO 3
  IF ~~ THEN REPLY #57990 /* ~Press the Rune of Corellan Lotharian.~ */ GOTO 5
  IF ~~ THEN REPLY #57991 /* ~Press the elven Symbol of Water.~ */ GOTO 3
  IF ~~ THEN REPLY #57993 /* ~Leave the box for now.~ */ GOTO 4
END

IF ~~ THEN BEGIN 3 // from: 7.0 6.1 6.0 5.3 5.2 5.1 2.4 2.2 2.1 2.0
  SAY #57992 /* ~You press the Rune and an acid-tipped dart shoots from the box. The plates reset to their original position. That was the wrong Rune, you shall have to start over.~ */
  IF ~~ THEN DO ~ReallyForceSpell(LastTalkedToBy,WIZARD_MELF_ACID_ARROW)
~ EXIT
END

IF ~~ THEN BEGIN 4 // from: 7.2 6.3 5.4 2.5
  SAY #57994 /* ~The symbols lead you to believe that the mystery of the puzzle lies with elven religion. Something within the city must be able to offer a clue.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 5 // from: 2.3
  SAY #57995 /* ~The plate moves in to the lid and stays. What shall you press next?~ */
  IF ~~ THEN REPLY #57996 /* ~Press the Symbol of Rillifane.~ */ GOTO 6
  IF ~~ THEN REPLY #57997 /* ~Press the Rune that denotes the Tree of Life.~ */ GOTO 3
  IF ~~ THEN REPLY #57998 /* ~Press the Rune of Suldanessellar.~ */ GOTO 3
  IF ~~ THEN REPLY #57999 /* ~Press the elven Symbol of Water.~ */ GOTO 3
  IF ~~ THEN REPLY #58000 /* ~Leave the box for now.~ */ GOTO 4
END

IF ~~ THEN BEGIN 6 // from: 5.0
  SAY #58004 /* ~The plate moves in to the lid and stays. What shall you press next?~ */
  IF ~~ THEN REPLY #58005 /* ~Press the Rune that denotes the Tree of Life.~ */ GOTO 3
  IF ~~ THEN REPLY #58006 /* ~Press the Rune of Suldanessellar.~ */ GOTO 3
  IF ~~ THEN REPLY #58007 /* ~Press the elven Symbol of Water.~ */ GOTO 7
  IF ~~ THEN REPLY #58008 /* ~Leave the box for now.~ */ GOTO 4
END

IF ~~ THEN BEGIN 7 // from: 6.2
  SAY #58012 /* ~The plate moves in to the lid and stays. What shall you press next?~ */
  IF ~~ THEN REPLY #58013 /* ~Press the Rune of Suldanessellar.~ */ GOTO 3
  IF ~~ THEN REPLY #58014 /* ~Press the Rune that denotes the Tree of Life.~ */ GOTO 8
  IF ~~ THEN REPLY #58015 /* ~Leave the box for now.~ */ GOTO 4
END

IF ~~ THEN BEGIN 8 // from: 7.1
  SAY #58016 /* ~It works. There is only one Rune left, that which represents Suldanessellar. You press it and the box opens.~ */
  IF ~~ THEN GOTO 9
END

IF ~~ THEN BEGIN 9 // from: 8.0
  SAY #58017 /* ~Within, you find the Talisman of Rillifane.~ */
  IF ~~ THEN DO ~GiveItemCreate("miscb1",LastTalkedToBy,0,0,0)
TakePartyItem("miscbt")
SetGlobal("TalkedtoRillpuzz","AR2809",2)
EraseJournalEntry(61279)
DestroySelf()~ SOLVED_JOURNAL #61280 /* ~The Elven Puzzle Box

I have opened the puzzle box. Within, I found the Talisman of Rillifane!~ */ EXIT
END

IF ~~ THEN BEGIN 10 // from: 1.0
  SAY #61276 /* ~Cryptic text below the runes makes reference to a Priest's Stone in the room above. A clue to the puzzle perhaps? Above the runes the inscription reads: 'The Natural Order shall prevail!'~ */
  IF ~~ THEN UNSOLVED_JOURNAL #61279 /* ~The Elven Puzzle Box

I have found a puzzle box that obviously holds something of value to the elves of Suldanessellar. To open it, I must press a series of runes in a certain order. The box makes reference to a Priest's Stone in the room above. The Stone holds the key to this puzzle and I must find it if I am to open the box with minimal risk.~ */ GOTO 2
END
