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

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

IF WEIGHT #4 /* Triggers after states #: 2 3 5 6 even though they appear after this state */
~!InParty("Xzar")
~ THEN BEGIN 0 // from:
  SAY #16699 /* ~No, I'm not interested after all.~ */
  IF ~~ THEN DO ~LeaveParty()
SetDialog("MontaP")
~ EXIT
END

IF WEIGHT #5 /* Triggers after states #: 2 3 5 6 even though they appear after this state */
~InParty("Xzar")
~ THEN BEGIN 1 // from:
  SAY #16700 /* ~Er, yes?  I, I am not supposed to speak to customers, my <LADYLORD>.~ */
  IF ~~ THEN DO ~ActionOverride("Xzar",ChangeAIScript("",DEFAULT))
ActionOverride("Xzar",LeaveParty())
ActionOverride("Xzar",SetDialog("XzarP"))
LeaveParty()
SetDialog("MontaP")
~ EXIT
END

IF WEIGHT #2 /* Triggers after states #: 5 6 even though they appear after this state */
~HappinessLT(Myself,0)
!InParty("Xzar")
~ THEN BEGIN 2 // from:
  SAY #16701 /* ~Really?  Why is that?~ */
  IF ~~ THEN DO ~LeaveParty()
EscapeArea()
~ EXIT
END

IF WEIGHT #3 /* Triggers after states #: 5 6 even though they appear after this state */
~HappinessLT(Myself,0)
InParty("Xzar")
~ THEN BEGIN 3 // from:
  SAY #16702 /* ~I am but a simple slave, my <LADYLORD>.  You must speak to Madame Nin, not I.~ */
  IF ~~ THEN DO ~ActionOverride("Xzar",ChangeAIScript("",DEFAULT))
ActionOverride("Xzar",LeaveParty())
ActionOverride("Xzar",EscapeArea())
LeaveParty()
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 4 // from:
  SAY #16712 /* ~Yes, I think I would like that.  Here is my 50 gold.~ */
  IF ~~ THEN DO ~ActionOverride("Xzar",LeaveParty())
ActionOverride("Xzar",EscapeArea())
LeaveParty()
EscapeArea()
~ EXIT
END

IF WEIGHT #0 ~GlobalTimerExpired("Montaron","GLOBAL")
Global("FindNashkell","GLOBAL",0)
Global("Chapter","GLOBAL",1)
~ THEN BEGIN 5 // from:
  SAY #17206 /* ~Yes, Jaheira, yes I would, because I am not born of evil. This person is proving to be just as I thought <HESHE> would be.~ */
  IF ~~ THEN DO ~SetGlobalTimer("Montaron","GLOBAL",NINE_DAYS)
SetGlobal("FindNashkell","Global",1)
~ EXIT
END

IF WEIGHT #1 ~GlobalTimerExpired("Montaron","GLOBAL")
Global("FindNashkell","GLOBAL",1)
Global("Chapter","GLOBAL",1)
~ THEN BEGIN 6 // from:
  SAY #17207 /* ~Wait!  You already possess the beastmaster's key!  That will unlock the door and free us!  Thank the Gods!~ */
  IF ~~ THEN DO ~ActionOverride("Xzar",LeaveParty())
ActionOverride("Xzar",EscapeArea())
LeaveParty()
EscapeArea()
~ EXIT
END
