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

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

IF ~~ THEN BEGIN 0 // from:
  SAY #24303 /* ~Mazzy, I'm so happy you returned! Pala's been poisoned by the old gnome peddler.~ */
  IF ~~ THEN DO ~SetGlobal("Pala","GLOBAL",2)
SetGlobal("FindWallace","GLOBAL",1)
SetGlobalTimer("MazzyComplainWallaceTimer","GLOBAL",TWO_DAYS)~ EXTERN ~MAZZYJ~ 16
END

IF ~~ THEN BEGIN 1 // from:
  SAY #24304 /* ~I've no clue, Mazzy. You need to find him. Perhaps there is yet hope for Pala.~ */
  IF ~~ THEN EXTERN ~MAZZYJ~ 22
END

IF ~~ THEN BEGIN 2 // from:
  SAY #24305 /* ~I believe in you, daughter. Go now, and save Pala. May the gods be with you.~ */
  IF ~~ THEN EXTERN ~MAZZYJ~ 17
END

IF WEIGHT #4 /* Triggers after states #: 14 16 17 19 even though they appear after this state */
~Global("PalaCureFound","GLOBAL",1)~ THEN BEGIN 3 // from:
  SAY #24462 /* ~Welcome home, daughter. Do your return bearing good tidings?~ */
  IF ~~ THEN DO ~SetGlobal("PalaCureFound","GLOBAL",2)
SetGlobalTimer("PalaWakeUp","GLOBAL",ONE_DAY)~ EXTERN ~MAZZYJ~ 53
END

IF ~~ THEN BEGIN 4 // from:
  SAY #24463 /* ~Are you sure it's safe, Mazzy?~ */
  IF ~~ THEN DO ~TakePartyItem("misc7d")
DestroyItem("misc7d")~ EXTERN ~MAZZYJ~ 54
END

IF ~~ THEN BEGIN 5 // from:
  SAY #24464 /* ~I trust in the gods, daughter. Use it on your sister and pray.~ */
  IF ~~ THEN DO ~StartCutSceneMode()
StartCutScene("Cut40e")~ EXIT
END

IF ~~ THEN BEGIN 6 // from:
  SAY #24465 /* ~Praise the heavens.~ */
  IF ~~ THEN EXTERN ~MAZZYJ~ 58
END

IF WEIGHT #5 /* Triggers after states #: 14 16 17 19 even though they appear after this state */
~Global("Pala","GLOBAL",2)
!Dead("Walla")~ THEN BEGIN 7 // from:
  SAY #46903 /* ~Wallace is a good person. Perhaps he didn't realize that his Love Potion was poisoned. Please help Mazzy find some way to bring my Pala back!~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #6 /* Triggers after states #: 14 16 17 19 even though they appear after this state */
~GlobalGT("PalaCureFound","GLOBAL",2)
!GlobalTimerExpired("PalaWakeUp","GLOBAL")~ THEN BEGIN 8 // from:
  SAY #46904 /* ~Thank you, <GABBER>, for helping Pala. She is resting now. With luck, she will be awake soon.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #7 /* Triggers after states #: 14 16 17 19 even though they appear after this state */
~GlobalGT("PalaCureFound","GLOBAL",2)
GlobalTimerExpired("PalaWakeUp","GLOBAL")~ THEN BEGIN 9 // from:
  SAY #46905 /* ~Thanks to you, my daughter Pala has awakened. I shall hold you dear in my heart, <CHARNAME>.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #8 /* Triggers after states #: 14 16 17 19 even though they appear after this state */
~Global("Pala","GLOBAL",0)
InParty("Mazzy")
Detect("Mazzy")~ THEN BEGIN 10 // from:
  SAY #46906 /* ~Mazzy, my daughter! It is so good to see you home. I am always worried that you will be hurt in your adventures.~ */
  IF ~~ THEN EXTERN ~MAZZYJ~ 108
END

IF ~~ THEN BEGIN 11 // from:
  SAY #46908 /* ~I know, my dear. I do reserve the right to worry. It is a mother's place to do so. Pala will be happy to see you. I welcome you and your friends.~ */
  IF ~~ THEN EXTERN ~MAZZYJ~ 109
END

IF WEIGHT #9 /* Triggers after states #: 14 16 17 19 even though they appear after this state */
~Global("Pala","GLOBAL",0)
OR(2)
!Detect("Mazzy")
!InParty("Mazzy")
!Dead("Mazzy")~ THEN BEGIN 12 // from:
  SAY #46910 /* ~You must be friends of Mazzy's, decked out in warrior garb as you are. It is a pleasure to meet you.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #10 /* Triggers after states #: 14 16 17 19 even though they appear after this state */
~Global("Pala","GLOBAL",0)
Dead("Mazzy")~ THEN BEGIN 13 // from:
  SAY #46911 /* ~Please leave. I do not wish to be rude but I have just received word of my daughter's passing. Our family wishes to be alone.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #0 ~Global("MazzyDeadAllFailed","GLOBAL",1)
!GlobalTimerExpired("PalaDead","GLOBAL")
PartyHasItem("misc7d")
Global("PalaCureFound","GLOBAL",0)~ THEN BEGIN 14 // from:
  SAY #61213 /* ~The Overgold sent word of poor Mazzy.  It's... it's a terrible thing.  Hopefully the antidote you carry with you will help Pala.  I could not bear to lose two daughters...~ */
  IF ~~ THEN DO ~SetGlobal("PalaCureFound","GLOBAL",3)
TakePartyItem("misc7d")
DestroyItem("misc7d")~ GOTO 15
END

IF ~~ THEN BEGIN 15 // from: 14.0
  SAY #61214 /* ~It... it seems to be working.  Thank you, thank you!  I... I think she will be fine, soon.  Despite the fate of Mazzy, at least it was not in vain.  I cannot thank you enough.~ */
  IF ~~ THEN DO ~AddExperienceParty(10000)
SetGlobalTimer("PalaWakeUp","GLOBAL",TWO_DAYS)~ EXIT
END

IF WEIGHT #1 ~Global("MazzyDeadAllFailed","GLOBAL",1)
!GlobalTimerExpired("PalaDead","GLOBAL")
!PartyHasItem("misc7d")
Global("PalaCureFound","GLOBAL",0)~ THEN BEGIN 16 // from:
  SAY #61215 /* ~Without a cure for poor Pala, I... I will have lost both my daughters.  I almost cannot bear the thought...~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #2 ~Global("MazzyDeadAllFailed","GLOBAL",1)
GlobalTimerExpired("PalaDead","GLOBAL")
Global("PalaCureFound","GLOBAL",0)~ THEN BEGIN 17 // from:
  SAY #61216 /* ~Pala is... is gone.  I have lost both of my daughters.  Excuse me... I... I must see to their arrangements.~ */
  IF ~~ THEN DO ~ActionOverride("danno",EscapeArea())
EscapeArea()~ EXIT
END

IF WEIGHT #11 /* Triggers after states #: 19 even though they appear after this state */
~GlobalGT("Pala","GLOBAL",0)
!Global("MazzyNoCure","GLOBAL",1)
OR(2)
!InPartyAllowDead("Mazzy")
!Detect("Mazzy")~ THEN BEGIN 18 // from:
  SAY #61411 /* ~My daughter is sick.  I will kindly ask you to leave, please.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #3 ~OR(2)
Global("MazzyNoCure","GLOBAL",1)
Dead("Pala02")~ THEN BEGIN 19 // from:
  SAY #61542 /* ~Leave at once.  Your coldness towards my daughters is proof enough to me that you are no friend to this family.~ */
  IF ~~ THEN EXIT
END
