BEGIN ~vai~

IF WEIGHT #1 ~NumTimesTalkedTo(0)~ THEN BEGIN 0
  SAY @19449
  IF ~~ THEN REPLY @19453 GOTO 1
  IF ~~ THEN REPLY @19454 GOTO 4
END

IF ~~ THEN BEGIN 1
  SAY @19456
  IF ~~ THEN REPLY @19462 GOTO 2
  IF ~~ THEN REPLY @19463 GOTO 3
END

IF ~~ THEN BEGIN 2
  SAY @19466
  IF ~~ THEN UNSOLVED_JOURNAL @310054 EXIT
END

IF ~~ THEN BEGIN 3
  SAY @19469
  IF ~~ THEN UNSOLVED_JOURNAL @310054 EXIT
END

IF ~~ THEN BEGIN 4
  SAY @19470
  IF ~~ THEN UNSOLVED_JOURNAL @310054 EXIT
END

IF WEIGHT #2 ~PartyHasItem("MISC86")~ THEN BEGIN 5
  SAY @19472
  IF ~~ THEN DO ~StartStore("stovai",LastTalkedToBy())~ EXIT
END

IF WEIGHT #3 ~GlobalGT("Chapter","GLOBAL",4)~ THEN BEGIN 6
  SAY @19473
  IF ~~ THEN DO ~EraseJournalEntry(@310054)
EraseJournalEntry(@310336)
ReputationInc(1)
SetGlobal("VaiLeaves","GLOBAL",1)
EscapeArea()~ SOLVED_JOURNAL @311054 EXIT
END

IF WEIGHT #4 ~True()~ THEN BEGIN 7
  SAY @19703
  IF ~~ THEN EXIT
END

IF WEIGHT #0 ~ReputationLT(LastTalkedToBy,5)~ THEN BEGIN 8
  SAY @11019
  IF ~~ THEN DO ~Enemy()~ EXIT
END
