// creator  : weidu.exe (version 23100)
// argument : _FARMBR.DLG
// game		 : .
// source	 : ./override/_FARMBR.DLG
// dialog	 : ./DIALOG.TLK
// dialogF  : (none)

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

IF WEIGHT #1 /* Triggers after states #: 13 even though they appear after this state */
~NumberOfTimesTalkedTo(0)
ReactionGT(LastTalkedToBy,NEUTRAL_UPPER)
~ THEN BEGIN 0 // from:
  SAY #85604 /* ~Please... will no one help me?  Anyone?  I've nowhere else to be turnin'.
I beseech thee kind sirs, please help.  It's strange happenings at my farm and I've not the strength I once had.  I've nothing to offer, and even if I did I doubt such as you would have need of it.  Please.~ */
  IF ~~ THEN REPLY #85605 /* ~You need look no further for aid.  What can I do?~ */ GOTO 6
  IF ~~ THEN REPLY #85606 /* ~I could help, but surely you must be able to pay something.~ */ GOTO 3
  IF ~~ THEN REPLY #85607 /* ~This is not my concern, old man.~ */ GOTO 4
  IF ~Global("X#FARMBR0","GLOBAL",0)
Global("X#EdwinSonner","GLOBAL",1)
InParty("edwin")
InMyArea("edwin")
!StateCheck("edwin",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FARMBR0","GLOBAL",1)~ EXTERN ~_EDWINJ~ 144
  IF ~Global("X#FARMBR0","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FARMBR0","GLOBAL",1)~ EXTERN ~_DYNAHJ~ 200
END

IF WEIGHT #2 /* Triggers after states #: 13 even though they appear after this state */
~NumberOfTimesTalkedTo(0)
ReactionLT(LastTalkedToBy,FRIENDLY_LOWER)
ReactionGT(LastTalkedToBy,HOSTILE_UPPER)
~ THEN BEGIN 1 // from:
  SAY #85608 /* ~Please... will no one help me?  Anyone?  I've nowhere else to be turnin'.  Please, you're young and strapping, can you lend a neighbor a hand?  There's somethin' going on at my farm and I can't afford to hire help.  I've nothing to offer you, save my gratitude.~ */
  IF ~~ THEN REPLY #85605 /* ~You need look no further for aid.  What can I do?~ */ GOTO 6
  IF ~~ THEN REPLY #85606 /* ~I could help, but surely you must be able to pay something.~ */ GOTO 3
  IF ~~ THEN REPLY #85607 /* ~This is not my concern, old man.~ */ GOTO 4
  IF ~Global("X#FARMBR1","GLOBAL",0)
Global("X#EdwinSonner","GLOBAL",1)
InParty("edwin")
InMyArea("edwin")
!StateCheck("edwin",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FARMBR1","GLOBAL",1)~ EXTERN ~_EDWINJ~ 146
  IF ~Global("X#FARMBR1","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FARMBR1","GLOBAL",1)~ EXTERN ~_DYNAHJ~ 201
END

IF WEIGHT #3 /* Triggers after states #: 13 even though they appear after this state */
~NumberOfTimesTalkedTo(0)
ReactionLT(LastTalkedToBy,NEUTRAL_LOWER)
~ THEN BEGIN 2 // from:
  SAY #85609 /* ~Please... will no one help me?  Anyone?  I've nowhere else to be turnin'.
I'm not the kind to be hiring mercenaries, and neither can I afford it, but I need your aid.  Please, out of the goodness of your hearts, can you help an old man?~ */
  IF ~~ THEN REPLY #85605 /* ~You need look no further for aid.  What can I do?~ */ GOTO 6
  IF ~~ THEN REPLY #85606 /* ~I could help, but surely you must be able to pay something.~ */ GOTO 3
  IF ~~ THEN REPLY #85607 /* ~This is not my concern, old man.~ */ GOTO 4
  IF ~Global("X#FARMBR2","GLOBAL",0)
Global("X#EdwinSonner","GLOBAL",1)
InParty("edwin")
InMyArea("edwin")
!StateCheck("edwin",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FARMBR2","GLOBAL",1)~ EXTERN ~_EDWINJ~ 148
  IF ~Global("X#FARMBR2","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FARMBR2","GLOBAL",1)~ EXTERN ~_DYNAHJ~ 202
END

IF ~~ THEN BEGIN 3 // from: 2.1 1.1 0.1 _EDWINJ:149.1 _EDWINJ:148.1 _EDWINJ:147.1 _EDWINJ:146.1 _EDWINJ:145.1 _EDWINJ:144.1 _DYNAHJ:202.1 _DYNAHJ:201.1 _DYNAHJ:200.1
  SAY #85610 /* ~Because of this damnable iron shortage it cost the last of my savings to repair the plow.  I've nothing left but my son Nathan, and now he is missing.  By Chauntea, it was hard enough just asking for help!  Please!~ */
  IF ~~ THEN REPLY #85605 /* ~You need look no further for aid.  What can I do?~ */ GOTO 6
  IF ~~ THEN REPLY #85611 /* ~Save your breath, your words fall on deaf ears.  I've no interest if there is no money involved.~ */ GOTO 4
  IF ~~ THEN REPLY #85607 /* ~This is not my concern, old man.~ */ GOTO 4
END

IF ~~ THEN BEGIN 4 // from: 3.2 3.1 2.2 1.2 0.2 _EDWINJ:149.2 _EDWINJ:148.2 _EDWINJ:147.2 _EDWINJ:146.2 _EDWINJ:145.2 _EDWINJ:144.2 _DYNAHJ:202.2 _DYNAHJ:201.2 _DYNAHJ:200.2
  SAY #85612 /* ~You'll not come?  Then I've no hope.  Nothing left...~ */
  IF ~~ THEN SOLVED_JOURNAL #85613 /* ~Farmer Brun's missing son

An old man was begging for help on his farm north of the Friendly Arm.  Something about his son disappearing.  'Twas not worth my time.~ */ EXIT
  IF ~Global("X#AjantisHelpBrun","GLOBAL",0)
InParty("ajantis")
InMyArea("ajantis")
!StateCheck("ajantis",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#AjantisHelpBrun","GLOBAL",1)~ EXTERN ~_AJANTJ~ 68
  IF ~Global("X#DynaheirBrun4","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DynaheirBrun4","GLOBAL",1)~ EXTERN ~_DYNAHJ~ 71
END

IF WEIGHT #4 /* Triggers after states #: 13 even though they appear after this state */
~Global("BrunQuest","GLOBAL",0)
~ THEN BEGIN 5 // from:
  SAY #85614 /* ~There's nothing I can do.  Nothing...~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 6 // from: 3.0 2.0 1.0 0.0 _EDWINJ:149.0 _EDWINJ:148.0 _EDWINJ:147.0 _EDWINJ:146.0 _EDWINJ:145.0 _EDWINJ:144.0 _DYNAHJ:202.0 _DYNAHJ:201.0 _DYNAHJ:200.0 _AJANTJ:68.0
  SAY #85615 /* ~Oh by the Great Mother, thank you!  My son Nathan and his friends went looking for our missing cattle, then they just up and disappeared!  Been gone for days now and, with all the bandits around, who knows what's happened.  I don't know where they were heading, but I saw some sort o' tracks to the west.  Please find Nathan; I can't afford to keep the farm without my son.~ */
  IF ~~ THEN DO ~SetGlobal("BrunQuest","GLOBAL",1)
~ UNSOLVED_JOURNAL #85616 /* ~Farmer Brun's missing son

I was north of the Friendly Arm when a farmer named Brun asked me to help find his son, Nathan.  He is worried that bandits may have waylaid the boy.  I shall start looking to the west of their farm, as Brun said he saw some strange tracks in that direction.~ */ EXIT
  IF ~Global("X#FARMBR6","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FARMBR6","GLOBAL",1)~ EXTERN ~_DYNAHJ~ 203
  IF ~Global("X#FARMBR6","GLOBAL",0)
InParty("faldorn")
InMyArea("faldorn")
!StateCheck("faldorn",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FARMBR6","GLOBAL",1)~ EXTERN ~_FALDOJ~ 159
END

IF WEIGHT #5 /* Triggers after states #: 13 even though they appear after this state */
~Global("BrunQuest","GLOBAL",1)
Global("FoundNathan","GLOBAL",0)
~ THEN BEGIN 7 // from:
  SAY #85617 /* ~Have you found my son?  Is he well?~ */
  IF ~~ THEN REPLY #85618 /* ~I've not been able to find your son, but I'll not stop 'til I do.~ */ GOTO 8
  IF ~~ THEN REPLY #85619 /* ~I can't find him at all.  It's beyond me.~ */ GOTO 8
  IF ~PartyHasItem("_MISC67")
~ THEN REPLY #85620 /* ~I am afraid Nathan is dead, sir.  He died defending your farm from a nest of strange beasts.~ */ DO ~SetGlobal("FoundNathan","GLOBAL",1)
~ GOTO 9
END

IF ~~ THEN BEGIN 8 // from: 7.1 7.0
  SAY #85621 /* ~Please keep looking.  He's out there somewhere, and I must know his fate.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 9 // from: 7.2
  SAY #85622 /* ~... No...  my only son...  It is a black day.  He died for this farm, but I am too old to work it and too poor to hire someone else.  I've lost him AND the land.  At least now I know... Thank you for your help but... I wish to be alone now.~ */
  IF ~~ THEN DO ~TakePartyItem("_MISC67")
AddexperienceParty(500)
SetGlobal("MACBrunQuestDone","GLOBAL",1)
EraseJournalEntry(85616)
EraseJournalEntry(75156)
~ SOLVED_JOURNAL #85623 /* ~Farmer Brun's missing son

We delivered Nathan's body to Farmer Brun.  He was quite distraught.  Perhaps there is more we could do... but I'm not sure what.~ */ EXIT
  IF ~Global("X#AjantisBrunMoney","GLOBAL",0)
InParty("ajantis")
InMyArea("ajantis")
!StateCheck("ajantis",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#AjantisBrunMoney","GLOBAL",1)~ EXTERN ~_AJANTJ~ 69
END

IF ~~ THEN BEGIN 10 // from: 12.1 12.0
  SAY #85624 /* ~Well... if it's causin' you strife to hang on to it, I suppose I could... hold it for ya.  Thank you, strangers.  I don't believe I'll see the like of you again.~ */
  IF ~~ THEN DO ~AddexperienceParty(1000)
ReputationInc(1)
~ SOLVED_JOURNAL #85625 /* ~Farmer Brun's missing son

We gave Farmer Brun some gold, though we didn't want him to think it was charity.  He's a very proud man.~ */ EXIT
  IF ~Global("X#FARMBR10","GLOBAL",0)
InParty("ajantis")
InMyArea("ajantis")
!StateCheck("ajantis",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FARMBR10","GLOBAL",1)~ EXTERN ~_AJANTJ~ 247
  IF ~Global("X#FARMBR10","GLOBAL",0)
InParty("ajantis")
InMyArea("ajantis")
!StateCheck("ajantis",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FARMBR10","GLOBAL",1)~ EXTERN ~_AJANTJ~ 248
  IF ~Global("X#FARMBR10","GLOBAL",0)
InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FARMBR10","GLOBAL",1)~ EXTERN ~_KIVANJ~ 358
  IF ~Global("X#FARMBR10","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#FARMBR10","GLOBAL",1)~ EXTERN ~_DYNAHJ~ 205
END

IF ~~ THEN BEGIN 11 // from: 12.2
  SAY #85626 /* ~Thanks but no thanks.  I'll not be takin' yer pity-money.  I've lost a lot, but not my dignity.~ */
  IF ~~ THEN EXIT
  IF ~Global("X#AjantisBrun11","GLOBAL",0)
InParty("ajantis")
InMyArea("ajantis")
!StateCheck("ajantis",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#AjantisBrun11","GLOBAL",1)~ EXTERN ~_AJANTJ~ 106
END

IF WEIGHT #6 /* Triggers after states #: 13 even though they appear after this state */
~Global("BrunQuest","GLOBAL",1)
Global("FoundNathan","GLOBAL",1)
Global("GaveAnkheg","GLOBAL",0)
~ THEN BEGIN 12 // from:
  SAY #85627 /* ~What am I to do...~ */
  IF ~PartyHasItem("_RING19")
~ THEN REPLY #85628 /* ~Brun... this is the horde that the creatures had.  It's more than we can carry, and more than we could use.  Do us a favor and take it off our hands, will you?~ */ DO ~TakePartyGold(100)
TakePartyItem("_RING19")
SetGlobal("GaveAnkheg","GLOBAL",1)
~ GOTO 10
  IF ~!PartyHasItem("_RING19")
~ THEN REPLY #85629 /* ~Brun... we have all we need.  In fact, you'd be doing us a favor if you would take this extra 100 gold off our hands.  It's a burden for us to carry.~ */ DO ~TakePartyGold(100)
SetGlobal("GaveAnkheg","GLOBAL",1)
~ GOTO 10
  IF ~~ THEN REPLY #85630 /* ~Hey old man, we can spot you some gold 'til you're on you're feet again.~ */ GOTO 11
  IF ~~ THEN REPLY #85631 /* ~Tough luck I guess.  See ya.~ */ EXIT
END

IF WEIGHT #0 ~StateCheck(Myself,STATE_CHARMED)
~ THEN BEGIN 13 // from:
  SAY #74939 /* ~I'm just a simple farmer, I don't know much.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 14 // from:
  SAY #85632 /* ~I don't want no help from the likes of you.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 15 // from: _AJANTJ:69.1
  SAY #99461 /* ~You've done all I could ask of you, bringing me his body. You can't help it if I'm a poor old farmer.~ */
  IF ~~ THEN DO ~TakePartyItem("_MISC67")
AddexperienceParty(500)
SetGlobal("MACBrunQuestDone","GLOBAL",1)
EraseJournalEntry(85616)
EraseJournalEntry(75156)
~ SOLVED_JOURNAL #85623 /* ~Farmer Brun's missing son

We delivered Nathan's body to Farmer Brun.  He was quite distraught.  Perhaps there is more we could do... but I'm not sure what.~ */ EXIT
END
