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

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

IF WEIGHT #3 /* Triggers after states #: 13 even though they appear after this state */
~RandomNum(17,1)
~ THEN BEGIN 0 // from:
  SAY #853 /* ~This is the hand that you've obtained from the dead vampire, Dace.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #4 /* Triggers after states #: 13 even though they appear after this state */
~RandomNum(17,2)
~ THEN BEGIN 1 // from:
  SAY #854 /* ~Is that snow?~ */
  IF ~~ THEN JOURNAL #7261 /* ~~ */ EXIT
END

IF WEIGHT #5 /* Triggers after states #: 13 even though they appear after this state */
~RandomNum(17,3)
~ THEN BEGIN 2 // from:
  SAY #855 /* ~Gauntlets of Crushing~ */
  IF ~~ THEN JOURNAL #7261 /* ~~ */ EXIT
END

IF WEIGHT #6 /* Triggers after states #: 13 even though they appear after this state */
~RandomNum(17,4)
~ THEN BEGIN 3 // from:
  SAY #856 /* ~The journal lists a number of experiments, apparently conducted by a mage known as Lium the Lucky. The section dealing with the machine in front of you draws your eye:

"What a wondrous contraption! It creates, enchants, and dispenses magical equipment of no small power by pulling these six levers in the correct order. The ranking of the levers seems to change daily and pulling them in the incorrect order results in painful and instant death, as I've deduced from the bloodstains on the floor. I've gotten the order correct for the last few days and sent the items home with Pooky. It is well that I found the machine when I did for it hasn't much life left. Each item it creates damages the inner workings further and soon I fear it shall fall apart. The previous order was:
1) Ruby
2) Jade
3) Mithril
4) Onyx
5) Emerald
6) Sandalwood. 

I've taken apart what pieces of the machine I could, and found the device that sets the ranking of the levers. With it, as stated, the order for the past several days was clear. Now the cursed thing has broken and I've garnered hardly any information from it at all. This is what I *have* discovered:
A) The Jade Lever's change in ranking was the greatest of the six levers.
B) The product of the Onyx Lever's rankings for the two days (when multiplied) is same as the product of the Sandalwood Lever's last two rankings when multiplied.
C) None of the levers are ever in the exact same place in line as they were yesterday.
D) Obviously, due to the change in the Jade Lever's order, there are only two possibilities regarding the change in the orders of the Onyx and Sandalwood Levers, one of which contradicts another clue.
E)  It is likely that the Mithril lever moved the same number of rankings as the Sandalwood Lever.

Quite the dilemma and the guesswork is risky. However, the items I've obtained are worth the risk and, with logic, I'm sure that I'll discover the correct order for today."

The journal says no more.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #7 /* Triggers after states #: 13 even though they appear after this state */
~RandomNum(17,5)
~ THEN BEGIN 4 // from:
  SAY #857 /* ~Gauntlets of Crushing
A foreigner from the east who went by the name of Floating Bear became well known through the Sword Coast.  Unarmed and unarmored he bested many powerful warriors.  One night, in the arms of a lady of the night he whispered his secret.  His martial arts training was supplemented by the thin gauntlets he wore, which allowed him to hit more accurately and with harder punches than bare fists would normally allow.  The woman stole the gloves and took the next boat out.  Floating Bear soon left, returning to his homeland.

STATISTICS

THAC0: +4 bonus when attacking with fists
Damage: +4 bonus when attacking with fists~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 5 // from:
  SAY #858 /* ~Kirinaldo~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #8 /* Triggers after states #: 13 even though they appear after this state */
~RandomNum(17,6)
~ THEN BEGIN 6 // from:
  SAY #859 /* ~Kirinaldo~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #9 /* Triggers after states #: 13 even though they appear after this state */
~RandomNum(17,7)
~ THEN BEGIN 7 // from:
  SAY #1471 /* ~Burst~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #10 /* Triggers after states #: 13 even though they appear after this state */
~RandomNum(17,8)
~ THEN BEGIN 8 // from:
  SAY #1472 /* ~You are weak and laughable. Look at yourself, groveling. Pathetic.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #11 /* Triggers after states #: 13 even though they appear after this state */
~RandomNum(17,9)
~ THEN BEGIN 9 // from:
  SAY #1473 /* ~Held~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #12 /* Triggers after states #: 13 even though they appear after this state */
~RandomNum(17,10)
~ THEN BEGIN 10 // from:
  SAY #1474 /* ~Blinded~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #13 /* Triggers after states #: 13 even though they appear after this state */
~RandomNum(17,11)
~ THEN BEGIN 11 // from:
  SAY #3457 /* ~This passage leads below to a small cellar of no interest.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #14 /* Triggers after states #: 13 even though they appear after this state */
~RandomNum(17,12)
~ THEN BEGIN 12 // from:
  SAY #3458 /* ~This thin bar vibrates softly in your hand.  It looks as if it could be used as either a key or a lever.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #1 ~StateCheck(Myself,STATE_CHARMED)
~ THEN BEGIN 13 // from:
  SAY #6423 /* ~Don't be foolish. I have seen the maneuvering you have done. Mae'Var is out of favor. If you ally yourselves with his lost cause you'll suffer the same fate!~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 14 // from:
  SAY #9044 /* ~You are the ones! I said I would come for you! I was worthy, and now I will take revenge for your slight! Death comes! Embrace him!~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #15 ~RandomNum(17,13)
~ THEN BEGIN 15 // from:
  SAY #15949 /* ~Very well, let's see what you have.~ */
  IF ~~ THEN DO ~~ EXIT
END

IF WEIGHT #16 ~RandomNum(17,14)
~ THEN BEGIN 16 // from:
  SAY #16036 /* ~Excuse me, I'm afraid I must be going.~ */
  IF ~~ THEN DO ~~ EXIT
END

IF WEIGHT #17 ~RandomNum(17,15)
~ THEN BEGIN 17 // from:
  SAY #16037 /* ~Foreclosing on me so soon?  Ah, very well.  You are welcome to my humble shop at any time, however.~ */
  IF ~~ THEN DO ~~ EXIT
END

IF WEIGHT #19 /* Triggers after states #: 21 even though they appear after this state */
~RandomNum(17,17)
~ THEN BEGIN 18 // from:
  SAY #17731 /* ~Where is the book then, Korgan?~ */
  IF ~~ THEN REPLY #17733 /* ~O bold warriors all... the sundial be turnin' on me appointed task, and I prevail upon ye all to hasten it.~ [KORGAN79] */ GOTO 19
  IF ~~ THEN REPLY #17734 /* ~~ */ GOTO 20
END

IF ~~ THEN BEGIN 19 // from: 18.0
  SAY #17735 /* ~I will, but only as a comrade in arms.  Perhaps there was a chance for more, but no longer.  It is for the best; we have friends to avenge.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 20 // from: 18.1
  SAY #17736 /* ~Be wary of intruders... there may be a few of the lowlifes lingerin' about inside, stinkin' up the place.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #18 ~RandomNum(17,16)
~ THEN BEGIN 21 // from:
  SAY #17756 /* ~At least I am no hypocrite, Anomen.  There nay be a heart so holy that evil nay make a nest of black twigs in it.~ [KORGAN65] */
  IF ~~ THEN REPLY #17757 /* ~Air Mephit~ */ GOTO 22
  IF ~~ THEN REPLY #17758 /* ~Air Mephit~ */ GOTO 23
END

IF ~~ THEN BEGIN 22 // from: 21.0
  SAY #17759 /* ~You have done a noble thing for us. Please take these acorns to the Fairy Queen who lives north east of the human settlement called Trademeet.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 23 // from: 21.1
  SAY #17763 /* ~Ye deserve the full wrath of my ire, weakling!  Ye deserve it because ye're a coddled, privileged imbecile, a sad, little nobleman's offspring!~ */
  IF ~~ THEN EXIT
END
