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

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

IF WEIGHT #2 /* Triggers after states #: 2 3 even though they appear after this state */
~HappinessLT(Myself,0)
~ THEN BEGIN 0 // from:
  SAY #16652 /* ~I see.  Perhaps I will do that.~ */
  IF ~~ THEN DO ~LeaveParty()
EscapeArea()
~ EXIT
END

IF WEIGHT #3 /* Triggers after states #: 2 3 even though they appear after this state */
~True()
~ THEN BEGIN 1 // from:
  SAY #16653 /* ~I do not think that I --~ */
  IF ~~ THEN DO ~LeaveParty()
SetDialog("SafanP")
~ EXIT
END

IF WEIGHT #0 ~GlobalTimerExpired("Safana","GLOBAL")
Global("PirateTreasure","GLOBAL",0)
!PartyHasItem("BOOK03")
~ THEN BEGIN 2 // from:
  SAY #16771 /* ~Oh!  (sniffle)  O-o-okay.  (sob!)~ */
  IF ~~ THEN DO ~SetGlobal("PirateTreasure","GLOBAL",1)
~ EXIT
END

IF WEIGHT #1 ~GlobalLT("PirateTreasure","GLOBAL",2)
PartyHasItem("BOOK03")
~ THEN BEGIN 3 // from:
  SAY #16773 /* ~Shadow Thief~ */
  IF ~~ THEN REPLY #16774 /* ~My name's D-d-delon. I was sent to f-find someone, but things have been gone all wrong! (sniffle) I've had all me money stolen, and I'm lost and everyone's so mean. (sniff)~ */ DO ~SetGlobal("PirateTreasure","GLOBAL",2)
~ GOTO 4
  IF ~~ THEN REPLY #16775 /* ~~ */ DO ~SetGlobal("PirateTreasure","GLOBAL",2)
~ GOTO 5
END

IF ~~ THEN BEGIN 4 // from: 3.0
  SAY #16776 /* ~~ */
  IF ~~ THEN DO ~LeaveParty()
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 5 // from: 3.1
  SAY #16777 /* ~Shadow Thief~ */
  IF ~~ THEN EXIT
END
