// creator  : weidu.exe (version 23600)
// argument : DAVAEO.DLG
// game     : .
// source   : ./override/DAVAEO.DLG
// dialog   : lang\en_us/dialog.tlk
// dialogF  : (none)

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

IF WEIGHT #2 /* Triggers after states #: 1 2 even though they appear after this state */
~  NumberOfTimesTalkedTo(0)
~ THEN BEGIN 0 // from:
  SAY #934 /* ~Why have you come? Is it to steal my riches or perhaps you seek to righteously punish me for my affront to your morality? It matters little, for you will do neither. Before I dispose of you in some horribly gruesome manner, perhaps I should introduce myself. I am known as Davaeorn. I would ask you for your names, but I care little to become acquainted with the dead.~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
  IF ~Global("X#DAVAEO0","GLOBAL",0)~ THEN DO ~SetGlobal("X#DAVAEO0","GLOBAL",1)~ GOTO 4
  IF ~Global("X#DAVAEO0","GLOBAL",0)
InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DAVAEO0","GLOBAL",1)~ EXTERN ~VICONJ~ 167
  IF ~Global("X#DAVAEO0","GLOBAL",0)
InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DAVAEO0","GLOBAL",1)~ EXTERN ~KIVANJ~ 330
  IF ~Global("X#DAVAEO0","GLOBAL",0)
InParty("faldorn")
InMyArea("faldorn")
!StateCheck("faldorn",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DAVAEO0","GLOBAL",1)~ GOTO 7
  IF ~Global("X#DAVAEO0","GLOBAL",0)
InParty("faldorn")
InMyArea("faldorn")
!StateCheck("faldorn",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DAVAEO0","GLOBAL",1)~ EXTERN ~FALDOJ~ 135
  IF ~Global("X#DAVAEO0","GLOBAL",0)
InParty("sharteel")
InMyArea("sharteel")
!StateCheck("sharteel",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DAVAEO0","GLOBAL",1)~ EXTERN ~SHARTJ~ 156
  IF ~Global("X#DAVAEO0","GLOBAL",0)
InParty("coran")
InMyArea("coran")
!StateCheck("coran",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DAVAEO0","GLOBAL",1)~ EXTERN ~CORANJ~ 544
  IF ~Global("X#DAVAEO0","GLOBAL",0)
InParty("imoen")
InMyArea("imoen")
!StateCheck("imoen",CD_STATE_NOTVALID)
!Class("imoen",MAGE_ALL)
~ THEN DO ~SetGlobal("X#DAVAEO0","GLOBAL",1)~ EXTERN ~IMOEN2~ 408
  IF ~Global("X#DAVAEO0","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DAVAEO0","GLOBAL",1)~ EXTERN ~DYNAHJ~ 172
  IF ~Global("X#DAVAEO0","GLOBAL",0)
InParty("yeslick")
InMyArea("yeslick")
!StateCheck("yeslick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DAVAEO0","GLOBAL",1)~ GOTO 19
  IF ~Global("X#DAVAEO0","GLOBAL",0)
InParty("yeslick")
InMyArea("yeslick")
!StateCheck("yeslick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DAVAEO0","GLOBAL",1)~ EXTERN ~YESLIJ~ 100
END

IF WEIGHT #0 ~  False()
~ THEN BEGIN 1 // from:
  SAY #936 /* ~You meddling fools, your victory shall be short-lived.~ [DAVEO02] */
  IF ~~ THEN DO ~SpellPoint([787.445],WIZARD_DIMENSION_DOOR)
DestroySelf()
~ EXIT
END

IF WEIGHT #1 ~  StateCheck(Myself,STATE_CHARMED)
~ THEN BEGIN 2 // from:
  SAY #6116 /* ~As I have told you, I am the mighty magician Davaeorn! I serve Rieltar of the Iron Throne. It is my duty to keep this mine running at peak efficiency. This mine used to be in the possession of a clan of dwarves. They mined into the side of river, and most of the dwarves died in the ensuing flood. The Iron Throne has moved in and plugged the river with a magical seal. If anyone were to use the key I keep in my bedroom chest, they could open the seal and flood the mines. That would be a very bad disaster for the Iron Throne. Indeed, yes it would.~ */
  IF ~~ THEN SOLVED_JOURNAL #26929 /* ~Flooding the Cloakwood Mine
When we charmed Davaeorn, we learned a lot about the Cloakwood mine. He told us how to destroy it! A magical plug exists on the first level. If the plug were released, using a key owned by Davaeorn, we could flood the entire mine! He told us that his key is in a chest in his bedroom.~ */ EXIT
END

IF ~~ THEN BEGIN 3 // from:
  SAY #8964 /* ~You should have left when you had the chance! Now we will bury your lifeless corpses in the bottommost caves!~ */
  IF ~~ THEN DO ~SetGlobal("DAVE","GLOBAL",1)
Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 4 // from: 0.1
  SAY #49934 /* ~Now that we are introduced, prepare to die!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 5 // from:
  SAY #49934 /* ~Now that we are introduced, prepare to die!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 6 // from:
  SAY #49934 /* ~Now that we are introduced, prepare to die!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 7 // from: 0.4
  SAY #49931 /* ~That's a new one, to be sure. But it matters not. You are dead, druid, though I have heard that your ilk gives death little significance.~ */
  IF ~~ THEN GOTO 8
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~VICONJ~ 169
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN EXTERN ~KIVANJ~ 331
END

IF ~~ THEN BEGIN 8 // from: 7.0
  SAY #49934 /* ~Now that we are introduced, prepare to die!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 9 // from:
  SAY #49931 /* ~That's a new one, to be sure. But it matters not. You are dead, druid, though I have heard that your ilk gives death little significance.~ */
  IF ~~ THEN GOTO 10
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~VICONJ~ 170
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN EXTERN ~KIVANJ~ 332
END

IF ~~ THEN BEGIN 10 // from: 9.0
  SAY #49934 /* ~Now that we are introduced, prepare to die!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 11 // from:
  SAY #49931 /* ~That's a new one, to be sure. But it matters not. You are dead, druid, though I have heard that your ilk gives death little significance.~ */
  IF ~~ THEN GOTO 12
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~VICONJ~ 171
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN EXTERN ~KIVANJ~ 333
END

IF ~~ THEN BEGIN 12 // from: 11.0
  SAY #49934 /* ~Now that we are introduced, prepare to die!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 13 // from: CORANJ:544.3
  SAY #49931 /* ~That's a new one, to be sure. But it matters not. You are dead, druid, though I have heard that your ilk gives death little significance.~ */
  IF ~~ THEN GOTO 14
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~VICONJ~ 172
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN EXTERN ~KIVANJ~ 334
END

IF ~~ THEN BEGIN 14 // from: CORANJ:544.0 13.0
  SAY #49934 /* ~Now that we are introduced, prepare to die!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 15 // from: CORANJ:545.3
  SAY #49931 /* ~That's a new one, to be sure. But it matters not. You are dead, druid, though I have heard that your ilk gives death little significance.~ */
  IF ~~ THEN GOTO 16
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~VICONJ~ 173
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN EXTERN ~KIVANJ~ 335
END

IF ~~ THEN BEGIN 16 // from: CORANJ:545.0 15.0
  SAY #49934 /* ~Now that we are introduced, prepare to die!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 17 // from: CORANJ:546.3 DYNAHJ:172.3
  SAY #49931 /* ~That's a new one, to be sure. But it matters not. You are dead, druid, though I have heard that your ilk gives death little significance.~ */
  IF ~~ THEN GOTO 18
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~VICONJ~ 174
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN EXTERN ~KIVANJ~ 336
END

IF ~~ THEN BEGIN 18 // from: CORANJ:546.0 17.0 DYNAHJ:172.0
  SAY #49934 /* ~Now that we are introduced, prepare to die!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 19 // from: 0.10
  SAY #49925 /* ~Well, well... the fool escapes, does he? Then let us see whose graves shall be filled!~ */
  IF ~~ THEN GOTO 21
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~VICONJ~ 175
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN EXTERN ~KIVANJ~ 337
  IF ~  InParty("faldorn")
InMyArea("faldorn")
!StateCheck("faldorn",CD_STATE_NOTVALID)
~ THEN GOTO 20
  IF ~  InParty("faldorn")
InMyArea("faldorn")
!StateCheck("faldorn",CD_STATE_NOTVALID)
~ THEN EXTERN ~FALDOJ~ 140
  IF ~  InParty("sharteel")
InMyArea("sharteel")
!StateCheck("sharteel",CD_STATE_NOTVALID)
~ THEN EXTERN ~SHARTJ~ 160
  IF ~  InParty("coran")
InMyArea("coran")
!StateCheck("coran",CD_STATE_NOTVALID)
~ THEN EXTERN ~CORANJ~ 547
  IF ~  InParty("imoen")
InMyArea("imoen")
!StateCheck("imoen",CD_STATE_NOTVALID)
!Class("imoen",MAGE_ALL)
~ THEN EXTERN ~IMOEN2~ 410
  IF ~  InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN EXTERN ~DYNAHJ~ 173
END

IF ~~ THEN BEGIN 20 // from: CORANJ:547.3 19.3 DYNAHJ:173.3
  SAY #49931 /* ~That's a new one, to be sure. But it matters not. You are dead, druid, though I have heard that your ilk gives death little significance.~ */
  IF ~~ THEN GOTO 21
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~VICONJ~ 175
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN EXTERN ~KIVANJ~ 337
END

IF ~~ THEN BEGIN 21 // from: CORANJ:547.0 20.0 19.0 DYNAHJ:173.0
  SAY #49934 /* ~Now that we are introduced, prepare to die!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 22 // from:
  SAY #49925 /* ~Well, well... the fool escapes, does he? Then let us see whose graves shall be filled!~ */
  IF ~~ THEN GOTO 24
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~VICONJ~ 176
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN EXTERN ~KIVANJ~ 338
  IF ~  InParty("faldorn")
InMyArea("faldorn")
!StateCheck("faldorn",CD_STATE_NOTVALID)
~ THEN GOTO 23
  IF ~  InParty("faldorn")
InMyArea("faldorn")
!StateCheck("faldorn",CD_STATE_NOTVALID)
~ THEN EXTERN ~FALDOJ~ 141
  IF ~  InParty("sharteel")
InMyArea("sharteel")
!StateCheck("sharteel",CD_STATE_NOTVALID)
~ THEN EXTERN ~SHARTJ~ 161
  IF ~  InParty("coran")
InMyArea("coran")
!StateCheck("coran",CD_STATE_NOTVALID)
~ THEN EXTERN ~CORANJ~ 548
  IF ~  InParty("imoen")
InMyArea("imoen")
!StateCheck("imoen",CD_STATE_NOTVALID)
!Class("imoen",MAGE_ALL)
~ THEN EXTERN ~IMOEN2~ 411
  IF ~  InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN EXTERN ~DYNAHJ~ 174
END

IF ~~ THEN BEGIN 23 // from: CORANJ:548.3 22.3 DYNAHJ:174.3
  SAY #49931 /* ~That's a new one, to be sure. But it matters not. You are dead, druid, though I have heard that your ilk gives death little significance.~ */
  IF ~~ THEN GOTO 24
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~VICONJ~ 176
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN EXTERN ~KIVANJ~ 338
END

IF ~~ THEN BEGIN 24 // from: CORANJ:548.0 23.0 22.0 DYNAHJ:174.0
  SAY #49934 /* ~Now that we are introduced, prepare to die!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END
