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

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

IF ~~ THEN BEGIN 0 // from: UHFARM02:1.0
  SAY #31989 /* ~Umar?  Don't be tellin' that folk tale now!  Can't ye see that it's the ogres, plain as th' truth?!~ */
  IF ~~ THEN EXTERN ~UHMAY01~ 4
END

IF WEIGHT #2 /* Triggers after states #: 5 6 even though they appear after this state */
~Global("VillageSaved","GLOBAL",0)
RandomNum(4,1)
~ THEN BEGIN 1 // from:
  SAY #32365 /* ~We ain't fond of strangers, here, at the moment.  There's been too many of the villagers gone missin', there has.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #3 /* Triggers after states #: 5 6 even though they appear after this state */
~Global("VillageSaved","GLOBAL",0)
RandomNum(4,2)
~ THEN BEGIN 2 // from:
  SAY #32368 /* ~They've brought in most of the outlyin' farmers and herders... no one's safe if they're alone for a minute.  And even here ye ain't safe!~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #4 /* Triggers after states #: 5 6 even though they appear after this state */
~Global("VillageSaved","GLOBAL",0)
RandomNum(4,3)
~ THEN BEGIN 3 // from:
  SAY #32369 /* ~Me an' Johanna have been tryin' the best we can... fool son Dirbert is jus' goin' to get himself into trouble with no work to do, though.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #5 /* Triggers after states #: 5 6 even though they appear after this state */
~Global("VillageSaved","GLOBAL",0)
RandomNum(4,4)
~ THEN BEGIN 4 // from:
  SAY #32370 /* ~If ye wants anythin', ye should be speakin' to the mayor.  Minister Lloyd can help ye out.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #0 ~InParty("Mazzy")
!Dead("Mazzy")
!StateCheck("Mazzy",STATE_SLEEPING)
See("Mazzy")
RandomNum(2,1)
Global("Mazzy","LOCALS",0)
~ THEN BEGIN 5 // from:
  SAY #32371 /* ~Ay, now... aren't ye the wee halfling lass that the mayor hired?  What happened to all yer other fellas?~ */
  IF ~~ THEN DO ~SetGlobal("Mazzy","LOCALS",1)
~ EXTERN ~MAZZYJ~ 94
END

IF WEIGHT #1 ~Global("VillageSaved","GLOBAL",1)
!GlobalGT("rangerprotector","GLOBAL",0)~ THEN BEGIN 6 // from:
  SAY #32378 /* ~I jus' want ye t' know that we're might appreciative of all ye've done.  Johanna and I can go back t' the farmhouse, soon as it's fixed up.~ */
  IF ~Global("ParentsUpset","GLOBAL",1)
Global("AUpset","LOCALS",0)
~ THEN GOTO 7
  IF ~Global("ParentsUpset","GLOBAL",2)
Global("AUpset","LOCALS",0)
~ THEN GOTO 8
  IF ~Global("ParentsUpset","GLOBAL",3)
Global("AUpset","LOCALS",0)~ THEN GOTO 9
  IF ~

~ THEN EXIT
END

IF ~~ THEN BEGIN 7 // from: 6.0
  SAY #32385 /* ~Now... if I could only find me fool son Dirbert.  Some fool bought the boy a sword an' off he ran like a yardape.~ */
  IF ~~ THEN DO ~SetGlobal("AUpset","LOCALS",1)~ EXIT
END

IF ~~ THEN BEGIN 8 // from: 6.1
  SAY #32387 /* ~Now... if I could only find me son Dirbert.  Damn fool somehow got 'hold of ale and is likely off turning some outhouse into a vomitorium.  Ah, well...~ */
  IF ~~ THEN DO ~SetGlobal("AUpset","LOCALS",1)~ EXIT
END

IF ~~ THEN BEGIN 9 // from: 6.2
  SAY #32392 /* ~Now... If I could only find me son, Dirbert.  Damn fool got 'hold of a sword and some ale.  Ran off t' be a bloody adventurer.  Watch, now, he'll be hacked t' pieces by a kobold, no less.~ */
  IF ~~ THEN DO ~SetGlobal("AUpset","LOCALS",1)~ EXIT
END

IF WEIGHT #6 ~GlobalGT("rangerprotector","GLOBAL",0)
!GlobalGT("rangerprotector","GLOBAL",4)
!Global("ogronattack","GLOBAL",1)
!Global("umarplot","GLOBAL",1)
!InPartySlot(LastTalkedToBy,0)~ THEN BEGIN 10 // from:
  SAY #37968 /* ~Yer one o' the friends of our ranger, aye?  Mighty pleased to see you again, here.  Hope you all feel at home in our village.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #7 ~GlobalGT("rangerprotector","GLOBAL",4)
!InPartySlot(LastTalkedToBy,0)~ THEN BEGIN 11 // from:
  SAY #37969 /* ~Yer friend is no longer deservin' of the position he had... wouldn't it be best if ye all just left, now?  Imnesvale is not such a place fer folks like you an' that ranger.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #8 ~Global("rangerprotector","GLOBAL",1)
!Global("ogronattack","GLOBAL",1)
!Global("umarplot","GLOBAL",1)
InPartySlot(LastTalkedToBy,0)~ THEN BEGIN 12 // from:
  SAY #37970 /* ~Mighty pleased t' see ye, ranger... hope yer findin' our village to yer likin'.  We all appreciate havin' someone like you t' replace Merella, an' all.  Such a tragic thing, her dyin'.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #9 ~GlobalGT("rangerprotector","GLOBAL",1)
!GlobalGT("rangerprotector","GLOBAL",4)
!Global("ogronattack","GLOBAL",1)
!Global("umarplot","GLOBAL",1)
InPartySlot(LastTalkedToBy,0)~ THEN BEGIN 13 // from:
  SAY #37971 /* ~Greetings to ye, ranger.  Might I say we're mighty pleased to have a fine <PRO_MANWOMAN> like yerself helpin' us all.  Ye've proven yerself... I hope the gods continue t' smile on ye, truly.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #10 ~GlobalGT("rangerprotector","GLOBAL",4)
InPartySlot(LastTalkedToBy,0)~ THEN BEGIN 14 // from:
  SAY #37972 /* ~Ye has no place here, ranger.  Best ye goes somewhere more t' yer tastes, where ye'll be welcome.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #11 ~Global("umarplot","GLOBAL",1)~ THEN BEGIN 15 // from:
  SAY #37973 /* ~That foul witch, Umar... or whoever it might be... has cast her shadow over us all.  It's up to you... an yer friends... t' save us all.  Go an' speak to the Minister, if ye haven't already.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #12 ~Global("ogronattack","GLOBAL",1)
Global("ogrealliance","GLOBAL",1)
!Dead("Madulf")~ THEN BEGIN 16 // from:
  SAY #37974 /* ~I wouldn'a believed it if I hadn't seen it myself... that ogre's lived up to his word and saved us all from the initial attack.  It's up t' you, though, now... ye has to go to the cave near here and save him.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #13 ~Global("ogronattack","GLOBAL",1)
Global("ogrealliance","GLOBAL",0)
!Dead("Madulf")~ THEN BEGIN 17 // from:
  SAY #37975 /* ~I can't believe it... that ogre an' his creatures... they went an' protected us from those ogrons come from th' hills.  But now they're in trouble... you plannin' on helpin' him out o' this trouble?~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #14 ~Global("ogronattack","GLOBAL",1)
Dead("Madulf")~ THEN BEGIN 18 // from:
  SAY #37976 /* ~Ogrons have come down from th' hills an' are plannin' to attack us... you must help the village, ranger!  Go, quickly!~ */
  IF ~~ THEN EXIT
END
