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

BEGIN ~TOKCRE01~

IF ~NumTimesTalkedTo(0)
~ THEN BEGIN 0 // from:
  SAY #51760 /* ~This bizarre contraption has a small slot set in a beautifully engraved panel. A message is written on an old board which has been carelessly tucked into a crack in the machine.~ */
  IF ~~ THEN GOTO 1
END

IF ~~ THEN BEGIN 1 // from: 0.0
  SAY #51762 /* ~The message reads: 'Master, thy boots are well recombobulated. I have destinkified the soles.  'Twas a rapturous experience to lend mine hand to the task. Thou art, sir, a man of distinguished valor...' - the flattery goes on for some time.~ */
  IF ~~ THEN GOTO 2
END

IF ~~ THEN BEGIN 2 // from: 1.0
  SAY #51770 /* ~'The system of tokenage has been set to thy precise specifications. The machine will dispense quality footwear upon the placement of mithril tokens within the slot. Surreptitiously, Grophinet - thy Jester'~ */
  IF ~~ THEN GOTO 3
END

IF ~OR(4)
Global("Item1","AR1514",0)
Global("Item2","AR1514",0)
Global("Item3","AR1514",0)
Global("Item4","AR1514",0)
~ THEN BEGIN 3 // from: 2.0
  SAY #51772 /* ~The machine can be activated by placing an appropriate number of tokens within the slot. You must have enough tokens to use it. What do you wish to do?~ */
  IF ~Global("Item1","AR1514",0)
NumItemsPartyGT("MISCAL",4)
~ THEN REPLY #51773 /* ~Place 5 tokens in the slot.~ */ GOTO 4
  IF ~Global("Item2","AR1514",0)
NumItemsPartyGT("MISCAL",9)
~ THEN REPLY #51774 /* ~Place 10 tokens in the slot.~ */ GOTO 5
  IF ~Global("Item3","AR1514",0)
NumItemsPartyGT("MISCAL",14)
~ THEN REPLY #51776 /* ~Place 15 tokens in the slot.~ */ GOTO 6
  IF ~Global("Item4","AR1514",0)
NumItemsPartyGT("MISCAL",19)
~ THEN REPLY #51778 /* ~Place 20 tokens in the slot.~ */ GOTO 7
  IF ~~ THEN REPLY #51829 /* ~Leave the machine for now to look for more tokens.~ */ DO ~DestroySelf()
~ EXIT
END

IF ~~ THEN BEGIN 4 // from: 3.0
  SAY #51793 /* ~With a quiet 'PING!' the machine dispenses a pair of boots.~ */
  IF ~~ THEN DO ~GiveItemCreate("BOOT03",LastTalkedToBy,0,0,0)
SetGlobal("Item1","AR1514",1)
TakePartyItemNum("MISCAL",5)
DestroySelf()
~ EXIT
END

IF ~~ THEN BEGIN 5 // from: 3.1
  SAY #51821 /* ~With a quiet 'PING!' the machine dispenses a pair of boots.~ */
  IF ~~ THEN DO ~GiveItemCreate("BOOT05",LastTalkedToBy,0,0,0)
SetGlobal("Item2","AR1514",1)
TakePartyItemNum("MISCAL",10)
DestroySelf()
~ EXIT
END

IF ~~ THEN BEGIN 6 // from: 3.2
  SAY #51822 /* ~With a quiet 'PING!' the machine dispenses a pair of boots.~ */
  IF ~~ THEN DO ~GiveItemCreate("BOOT01",LastTalkedToBy,0,0,0)
SetGlobal("Item3","AR1514",1)
TakePartyItemNum("MISCAL",15)
DestroySelf()
~ EXIT
END

IF ~~ THEN BEGIN 7 // from: 3.3
  SAY #51831 /* ~With a jarring rattle, the machine dispenses a suit of armor!~ */
  IF ~~ THEN DO ~GiveItemCreate("CHAN10",LastTalkedToBy,0,0,0)
SetGlobal("Item4","AR1514",1)
TakePartyItemNum("MISCAL",20)
DestroySelf()
~ EXIT
END

IF ~True()
~ THEN BEGIN 8 // from:
  SAY #51833 /* ~The machine has nothing else to dispense.~ */
  IF ~~ THEN DO ~DestroySelf()
~ EXIT
END
