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

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

IF WEIGHT #1 /* Triggers after states #: 4 even though they appear after this state */
~ReactionGT(LastTalkedToBy(Myself),NEUTRAL_UPPER)
Global("EmersonPermission","GLOBAL",0)
~ THEN BEGIN 0 // from:
  SAY #77270 /* ~You here to investigate the mine?  Well I see no harm.  Indeed, we could be using the help.  There be problems in the lower level, where we lost some workers.  The men talk of things a-movin' below, but who's to say.  The earth, she hides many things from sight.~ */
  IF ~~ THEN DO ~SetGlobal("EmersonPermission","GLOBAL",1)
SetGlobal("SpokeToEmerson","GLOBAL",1)
EraseJournalEntry(77259)
~ UNSOLVED_JOURNAL #77271 /* ~Investigating the Nashkel mines

Emerson has allowed me to search the Nashkel mine.  He does not know what lies below, though.~ */ EXIT
  IF ~Global("X#DynaheirEmerson2","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DynaheirEmerson2","GLOBAL",1)~ EXTERN ~_DYNAHJ~ 86
END

IF WEIGHT #2 /* Triggers after states #: 4 even though they appear after this state */
~ReactionLT(LastTalkedToBy(Myself),FRIENDLY_LOWER)
Global("EmersonPermission","GLOBAL",0)
~ THEN BEGIN 1 // from:
  SAY #77272 /* ~I really don't be needing adventuring fools wandering about me mine!  Especially ones that think they can tromp about with nary a thought about askin' permission!  Hmph!... you've got one day.  If I see you after that, I'll have a new shaft dug fer each of ya!  Got that?!  Good!~ */
  IF ~~ THEN DO ~SetGlobal("EmersonPermission","GLOBAL",1)
SetGlobal("SpokeToEmerson","GLOBAL",1)
EraseJournalEntry(77259)
~ UNSOLVED_JOURNAL #77273 /* ~Investigating the Nashkel mines

Emerson has given me a day to conduct a search of the Nashkel mine.  I doubt he would turn the guards on me for taking longer, though.  There are apparently more dangerous things to worry about down there.~ */ EXIT
  IF ~Global("X#EMERSO1","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#EMERSO1","GLOBAL",1)~ EXTERN ~_DYNAHJ~ 270
  IF ~Global("X#EMERSO1","GLOBAL",0)
InParty("imoen")
InMyArea("imoen")
!StateCheck("imoen",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#EMERSO1","GLOBAL",1)~ EXTERN ~_IMOEN2~ 488
END

IF WEIGHT #3 /* Triggers after states #: 4 even though they appear after this state */
~GlobalLT("Chapter","GLOBAL",3)
~ THEN BEGIN 2 // from:
  SAY #77274 /* ~I hope yer mine explorin' goes well.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #4 /* Triggers after states #: 4 even though they appear after this state */
~GlobalGT("Chapter","GLOBAL",2)
~ THEN BEGIN 3 // from:
  SAY #77275 /* ~You've... done real well.  I wish ya the best luck on yer coming journeys.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #0 ~StateCheck(Myself,STATE_CHARMED)
GlobalLT("Chapter","GLOBAL",3)
~ THEN BEGIN 4 // from:
  SAY #77276 /* ~Being a good friend of yours and all, I can tell you this: there's a bunch a mean dog like creatures killin' me men in the mine.  Ya gotta stop 'em!~ */
  IF ~~ THEN DO ~SetGlobal("SpokeToEmerson","GLOBAL",1)
~ UNSOLVED_JOURNAL #77277 /* ~Investigating the Nashkel mines

I charmed the foreman of the Nashkel mine.  He claimed there were "dog-like" creatures causing trouble below.~ */ EXIT
END

IF ~~ THEN BEGIN 5 // from:
  SAY #75411 /* ~You've made no friends here!  Move along!~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 6 // from: _DYNAHJ:86.1
  SAY #99666 /* ~Little enough, lady. I can tell you this: there's a bunch a mean dog like creatures killin' me men in the mine. Ya gotta stop 'em!~ */
  IF ~~ THEN DO ~SetGlobal("EmersonPermission","GLOBAL",1)
SetGlobal("SpokeToEmerson","GLOBAL",1)
EraseJournalEntry(77259)
~ UNSOLVED_JOURNAL #77271 /* ~Investigating the Nashkel mines

Emerson has allowed me to search the Nashkel mine.  He does not know what lies below, though.~ */ EXIT
END
