// creator  : weidu.exe (version 23600)
// argument : EMERSO.DLG
// game     : .
// source   : ./override/EMERSO.DLG
// dialog   : lang\en_us/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 */
~  Global("SpokeToEmerson","GLOBAL",0)
ReactionGT(LastTalkedToBy(Myself),NEUTRAL_UPPER)
~ THEN BEGIN 0 // from:
  SAY #766 /* ~So, you want to enter the mines? 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(26839)
EraseJournalEntry(31444)
AddJournalEntry(31444,QUEST_DONE)
AddJournalEntry(31445,QUEST)
~ UNSOLVED_JOURNAL #27042 /* ~Investigating the Nashkel Mines
Emerson has allowed me to search the Nashkel mines. 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~ 87
END

IF WEIGHT #2 /* Triggers after states #: 4 even though they appear after this state */
~  Global("SpokeToEmerson","GLOBAL",0)
ReactionLT(LastTalkedToBy(Myself),FRIENDLY_LOWER)
~ THEN BEGIN 1 // from:
  SAY #767 /* ~I really don't be needing adventuring fools wandering about me mines! 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(26839)
EraseJournalEntry(31444)
AddJournalEntry(31444,QUEST_DONE)
AddJournalEntry(31445,QUEST)
~ UNSOLVED_JOURNAL #27043 /* ~Investigating the Nashkel Mines
Emerson has given me a day to conduct a search of the Nashkel mines. 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~ 271
  IF ~Global("X#EMERSO1","GLOBAL",0)
InParty("imoen")
InMyArea("imoen")
!StateCheck("imoen",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#EMERSO1","GLOBAL",1)~ EXTERN ~IMOEN2~ 493
END

IF WEIGHT #3 /* Triggers after states #: 4 even though they appear after this state */
~  Global("SpokeToEmerson","GLOBAL",1)
GlobalLT("CHAPTER","GLOBAL",3)
~ THEN BEGIN 2 // from:
  SAY #6133 /* ~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 */
~  Global("SpokeToEmerson","GLOBAL",1)
GlobalGT("CHAPTER","GLOBAL",2)
~ THEN BEGIN 3 // from:
  SAY #6134 /* ~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)
~ THEN BEGIN 4 // from:
  SAY #6135 /* ~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("EmersonPermission","GLOBAL",1)
SetGlobal("SpokeToEmerson","GLOBAL",1)
EraseJournalEntry(31444)
AddJournalEntry(31444,QUEST_DONE)
AddJournalEntry(31445,QUEST)
~ UNSOLVED_JOURNAL #27044 /* ~Investigating the Nashkel Mines
I charmed the foreman of the Nashkel mines. He claimed there were "dog-like" creatures causing trouble below.~ */ EXIT
END

IF WEIGHT #5 ~  Global("SpokeToEmerson","GLOBAL",3)
~ THEN BEGIN 5 // from:
  SAY #8982 /* ~You've made no friends here! Move along!~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 6 // from:
  SAY #46315 /* ~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(26839)
EraseJournalEntry(31444)
AddJournalEntry(31444,QUEST_DONE)
AddJournalEntry(31445,QUEST)
~ UNSOLVED_JOURNAL #27042 /* ~Investigating the Nashkel Mines
Emerson has allowed me to search the Nashkel mines. He does not know what lies below, though.~ */ EXIT
END
