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

BEGIN ~UDDEMON~

IF ~NumTimesTalkedTo(0)~ THEN BEGIN 0 // from:
  SAY #52128 /* ~** I HAVE COME... YOU HAVE WRESTED ME FROM MY PLANE, DARKLING... HAVE GOOD REASON, OR I SHALL TAKE MY PRICE IN DARKLING BLOOD... **~ */
  IF ~~ THEN EXTERN ~UDARDUL~ 58
END

IF ~~ THEN BEGIN 1 // from: UDARDUL:58.0
  SAY #52130 /* ~** AND WHAT MANNER OF TITHE WOULD YOU OFFER ME FOR SUCH A DEED, DARKLING?  WHAT MANNER OF PAYMENT WARRANTS MY AID? **~ */
  IF ~~ THEN EXTERN ~UDARDUL~ 59
END

IF ~~ THEN BEGIN 2 // from: UDARDUL:59.2 UDARDUL:59.1
  SAY #52132 /* ~** AAAAHHHH, THIS IS A MOST EXCELLENT TITHE, DARKLING. **~ */
  IF ~~ THEN EXTERN ~UDARDUL~ 60
END

IF ~~ THEN BEGIN 3 // from: UDARDUL:60.0
  SAY #52134 /* ~** ARE YOU AWARE, DARKLING, THAT ALLIES OF YOUR ELVEN FOES ARE PRESENT HERE?  PERHAPS YOU ARE NOT.  GAZE, THEN, UPON THEIR NATURAL FORMS. **~ */
  IF ~~ THEN DO ~ActionOverride(Player1,ApplySpell(Myself,UNDER_NORM))
ActionOverride(Player2,ApplySpell(Myself,UNDER_NORM))
ActionOverride(Player3,ApplySpell(Myself,UNDER_NORM))
ActionOverride(Player4,ApplySpell(Myself,UNDER_NORM))
ActionOverride(Player5,ApplySpell(Myself,UNDER_NORM))
ActionOverride(Player6,ApplySpell(Myself,UNDER_NORM))
SetGlobal("udDrowPlot","GLOBAL",35)~ EXIT
END

IF ~~ THEN BEGIN 4 // from: UDARDUL:61.0
  SAY #52136 /* ~** IT SHALL BE A PLEASURE. **~ */
  IF ~~ THEN DO ~EraseJournalEntry(5810)
EraseJournalEntry(6535)
EraseJournalEntry(16529)
EraseJournalEntry(6943)
EraseJournalEntry(16339)
EraseJournalEntry(9649)
EraseJournalEntry(6405)
EraseJournalEntry(6403)
EraseJournalEntry(6590)
EraseJournalEntry(7147)
EraseJournalEntry(7148)
EraseJournalEntry(15793)
EraseJournalEntry(15792)
EraseJournalEntry(23424)
EraseJournalEntry(5810)
EraseJournalEntry(6535)
EraseJournalEntry(16529)
EraseJournalEntry(6943)
EraseJournalEntry(16339)
EraseJournalEntry(9649)
EraseJournalEntry(6405)
EraseJournalEntry(6403)
EraseJournalEntry(6590)
EraseJournalEntry(7147)
EraseJournalEntry(7148)
EraseJournalEntry(15793)
EraseJournalEntry(15792)
EraseJournalEntry(23424)
EraseJournalEntry(15797)
SetGlobal("DrowCityHostile","GLOBAL",1)
Enemy()~ SOLVED_JOURNAL #6582 /* ~The Drow Summoning Ritual

Perhaps allowing the ritual to be completed was a mistake... not only has the demon detected our presence and lowered our disguises, but we now have a hostile drow city and demon to face before we can even think about escaping.  And then there will be an angry silver dragon to deal with, as well...~ */ EXIT
END

IF ~~ THEN BEGIN 5 // from: UDARDUL:59.0
  SAY #52137 /* ~** FOOLISH DARKLING.  DO YOU THINK I WOULD BE TAKEN IN BY SUCH A SIMPLISTIC DECEPTION?  I? **~ */
  IF ~~ THEN EXTERN ~UDARDUL~ 62
END

IF ~~ THEN BEGIN 6 // from: UDARDUL:62.0
  SAY #52139 /* ~** THEY ARE FALSE, DARKLING.  I WOULD TAKE SUCH A TITHE, WERE IT REAL, BUT NOW YOU HAVE OFFENDED ME.  PERISH, LITTLE DARKLING WOMAN. **~ */
  IF ~~ THEN EXTERN ~UDARDUL~ 63
END

IF ~Global("udDrowPlot","GLOBAL",40)~ THEN BEGIN 7 // from:
  SAY #52141 /* ~** HOW DARE YOU CALL ME FORTH!!  HOW DARE YOU TEMPT ME WITH EGGS OF HATED SILVER, BUT THEN DECEIVE ME!!  I AM TEMPTED TO RAZE THIS CITY TO ASHES!! **~ */
  IF ~IsValidForPartyDialog("Nalia")
Dead("Phaere")
PartyHasItem("MISC9t")
Alignment(Player1,MASK_EVIL)~ THEN REPLY #52142 /* ~Hold, demon!  I have the eggs of the silver dragon here!  I offer them to you in return for a service!~ */ EXTERN ~NALIAJ~ 280
  IF ~!IsValidForPartyDialog("Nalia")
IsValidForPartyDialog("Cernd")
Dead("Phaere")
PartyHasItem("MISC9t")
Alignment(Player1,MASK_EVIL)~ THEN REPLY #55898 /* ~Hold, demon!  I have the eggs of the silver dragon here!  I offer them to you in return for a service!~ */ EXTERN ~CERNDJ~ 111
  IF ~!IsValidForPartyDialog("Nalia")
!IsValidForPartyDialog("Cernd")
IsValidForPartyDialog("Aerie")
Dead("Phaere")
PartyHasItem("MISC9t")
Alignment(Player1,MASK_EVIL)~ THEN REPLY #55899 /* ~Hold, demon!  I have the eggs of the silver dragon here!  I offer them to you in return for a service!~ */ EXTERN ~AERIEJ~ 149
  IF ~!IsValidForPartyDialog("Nalia")
!IsValidForPartyDialog("Cernd")
!IsValidForPartyDialog("Aerie")
IsValidForPartyDialog("Keldorn")
Dead("Phaere")
PartyHasItem("MISC9t")
Alignment(Player1,MASK_EVIL)~ THEN REPLY #55900 /* ~Hold, demon!  I have the eggs of the silver dragon here!  I offer them to you in return for a service!~ */ EXTERN ~KELDORJ~ 201
  IF ~!IsValidForPartyDialog("Nalia")
!IsValidForPartyDialog("Cernd")
!IsValidForPartyDialog("Aerie")
!IsValidForPartyDialog("Keldorn")
IsValidForPartyDialog("Valygar")
Dead("Phaere")
PartyHasItem("MISC9t")
Alignment(Player1,MASK_EVIL)~ THEN REPLY #55901 /* ~Hold, demon!  I have the eggs of the silver dragon here!  I offer them to you in return for a service!~ */ EXTERN ~VALYGARJ~ 85
  IF ~!IsValidForPartyDialog("Nalia")
!IsValidForPartyDialog("Cernd")
!IsValidForPartyDialog("Aerie")
!IsValidForPartyDialog("Keldorn")
!IsValidForPartyDialog("Valygar")
IsValidForPartyDialog("Mazzy")
Dead("Phaere")
PartyHasItem("MISC9t")
Alignment(Player1,MASK_EVIL)~ THEN REPLY #55902 /* ~Hold, demon!  I have the eggs of the silver dragon here!  I offer them to you in return for a service!~ */ EXTERN ~MAZZYJ~ 175
  IF ~!IsValidForPartyDialog("Nalia")
!IsValidForPartyDialog("Cernd")
!IsValidForPartyDialog("Aerie")
!IsValidForPartyDialog("Keldorn")
!IsValidForPartyDialog("Valygar")
!IsValidForPartyDialog("Mazzy")
IsValidForPartyDialog("Anomen")
Alignment("Anomen",LAWFUL_GOOD)
Dead("Phaere")
PartyHasItem("MISC9t")
Alignment(Player1,MASK_EVIL)~ THEN REPLY #55903 /* ~Hold, demon!  I have the eggs of the silver dragon here!  I offer them to you in return for a service!~ */ EXTERN ~ANOMENJ~ 271
  IF ~!IsValidForPartyDialog("Nalia")
!IsValidForPartyDialog("Cernd")
!IsValidForPartyDialog("Aerie")
!IsValidForPartyDialog("Keldorn")
!IsValidForPartyDialog("Valygar")
!IsValidForPartyDialog("Mazzy")
OR(2)
!IsValidForPartyDialog("Anomen")
!Alignment("Anomen",LAWFUL_GOOD)
IsValidForPartyDialog("Jaheira")
Dead("Phaere")
PartyHasItem("MISC9t")
Alignment(Player1,MASK_EVIL)~ THEN REPLY #55904 /* ~Hold, demon!  I have the eggs of the silver dragon here!  I offer them to you in return for a service!~ */ EXTERN ~JAHEIRAJ~ 470
  IF ~!IsValidForPartyDialog("Nalia")
!IsValidForPartyDialog("Cernd")
!IsValidForPartyDialog("Aerie")
!IsValidForPartyDialog("Keldorn")
!IsValidForPartyDialog("Valygar")
!IsValidForPartyDialog("Mazzy")
OR(2)
!IsValidForPartyDialog("Anomen")
!Alignment("Anomen",LAWFUL_GOOD)
!IsValidForPartyDialog("Jaheira")
IsValidForPartyDialog("Minsc")
Dead("Phaere")
PartyHasItem("MISC9t")
Alignment(Player1,MASK_EVIL)~ THEN REPLY #55905 /* ~Hold, demon!  I have the eggs of the silver dragon here!  I offer them to you in return for a service!~ */ EXTERN ~MINSCJ~ 170
  IF ~!IsValidForPartyDialog("Nalia")
!IsValidForPartyDialog("Cernd")
!IsValidForPartyDialog("Aerie")
!IsValidForPartyDialog("Keldorn")
!IsValidForPartyDialog("Valygar")
!IsValidForPartyDialog("Mazzy")
OR(2)
!IsValidForPartyDialog("Anomen")
!Alignment("Anomen",LAWFUL_GOOD)
!IsValidForPartyDialog("Jaheira")
!IsValidForPartyDialog("Minsc")
Dead("Phaere")
PartyHasItem("MISC9t")
Alignment(Player1,MASK_EVIL)~ THEN REPLY #55919 /* ~Hold, demon!  I have the eggs of the silver dragon here!  I offer them to you in return for a service!~ */ GOTO 8
  IF ~Dead("Phaere")~ THEN REPLY #52143 /* ~Begone, demon!  There is nothing for you here.  She who has summoned you is dead.~ */ GOTO 13
  IF ~Dead("Phaere")~ THEN REPLY #52144 /* ~(remain silent)~ */ GOTO 13
  IF ~!Dead("Phaere")~ THEN EXTERN ~UDPHAE01~ 159
END

IF ~~ THEN BEGIN 8 // from: 20.0 7.9
  SAY #52145 /* ~** IS THAT SO?  I SEE WHAT YOU TRULY ARE, BHAAL-CHILD, AND I AM AMUSED.  WHAT IS IT THAT YOU REQUEST FROM ME FOR YOUR TITHE? **~ */
  IF ~~ THEN REPLY #52146 /* ~I wish to get out of here, out of the Underdark... safely!~ */ DO ~TakePartyItem("MISC9t")
SetGlobal("EggsDie","GLOBAL",1)~ GOTO 9
  IF ~~ THEN REPLY #52147 /* ~I desire a vast amount of wealth!~ */ GOTO 10
  IF ~~ THEN REPLY #52148 /* ~I desire a powerful magic item!~ */ DO ~TakePartyItem("MISC9t")
SetGlobal("EggsDie","GLOBAL",1)
GiveItemCreate("HALB06",Player1,0,0,0)~ GOTO 11
  IF ~~ THEN REPLY #52149 /* ~I want you to give me power, great power beyond belief!~ */ GOTO 10
  IF ~~ THEN REPLY #52150 /* ~Er... I've changed my mind.  Maybe this isn't a good idea.~ */ GOTO 12
END

IF ~~ THEN BEGIN 9 // from: 8.0
  SAY #52151 /* ~** EASILY DONE, BHAAL-CHILD.  I SHALL WALK TO THE EXIT AND DESTROY ALL WHO ARE YOUR ENEMIES IN MY PATH.  FOLLOW ME, EVIL ONE. **~ */
  IF ~~ THEN DO ~EraseJournalEntry(5810)
EraseJournalEntry(6535)
EraseJournalEntry(16529)
EraseJournalEntry(6943)
EraseJournalEntry(16339)
EraseJournalEntry(9649)
EraseJournalEntry(6405)
EraseJournalEntry(6403)
EraseJournalEntry(6590)
EraseJournalEntry(7147)
EraseJournalEntry(7148)
EraseJournalEntry(15793)
EraseJournalEntry(15792)
EraseJournalEntry(23424)
SetGlobal("DrowCityHostile","GLOBAL",1)
SetGlobal("DemonWalks","GLOBAL",1)~ SOLVED_JOURNAL #6999 /* ~The Drow Summoning Ritual

With the drow summoners dead and their plans ruined, I have sacrificed the silver dragon eggs to the demon in return for a service... he will lead me to the exit from the drow city and destroy everything that blocks my path.  A fitting use of the drow's own magic.~ */ EXIT
END

IF ~~ THEN BEGIN 10 // from: 8.3 8.1
  SAY #52152 /* ~** BAH.  I HAVE NO PATIENCE FOR SUCH ABSURDITY.  EASIER BY FAR FOR ME TO KILL YOU, FOOLISH BHAAL-CHILD. **~ */
  IF ~~ THEN DO ~ReallyForceSpell(Player1,CLERIC_FLAME_STRIKE)
Wait(1)
Kill(Player1)~ EXIT
END

IF ~~ THEN BEGIN 11 // from: 8.2
  SAY #52153 /* ~** IT IS DONE.  A WORTHY TRADE.  NOW DISTURB ME NO FURTHER. **~ */
  IF ~~ THEN DO ~EraseJournalEntry(5810)
EraseJournalEntry(6535)
EraseJournalEntry(16529)
EraseJournalEntry(6943)
EraseJournalEntry(16339)
EraseJournalEntry(9649)
EraseJournalEntry(6405)
EraseJournalEntry(6403)
EraseJournalEntry(6590)
EraseJournalEntry(7147)
EraseJournalEntry(7148)
EraseJournalEntry(15793)
EraseJournalEntry(15792)
EraseJournalEntry(23424)
SetGlobalTimer("udEscape","GLOBAL",120)
SetGlobal("DrowCityHostile","GLOBAL",0)
CreateVisualEffectObject("SPPORTAL",Myself)
Wait(1)
DestroySelf()~ SOLVED_JOURNAL #7001 /* ~The Drow Summoning Ritual

With the drow summoners dead and their plans ruined, I have traded the silver dragon's eggs to the demon in exchange for a powerful magical weapon.  Now, however, I have only minutes in order to flee this city before my disguise is discovered... and with a likely hostile silver dragon hunting for me, as well.~ */ EXIT
END

IF ~~ THEN BEGIN 12 // from: 8.4
  SAY #52154 /* ~** I HAVE NO PATIENCE FOR FOOLS.  IF I SHALL NOT HAVE THE EGGS, I SHALL HAVE YOUR BLOOD, BHAAL-CHILD.  **~ */
  IF ~~ THEN DO ~ReallyForceSpell(Player1,CLERIC_FLAME_STRIKE)
Wait(1)
Kill(Player1)~ EXIT
END

IF ~~ THEN BEGIN 13 // from: 7.11 7.10
  SAY #52155 /* ~** BAH!  IT WOULD NOT BE WORTH MY TIME TO DEAL WITH SUCH INSECTS.  DISTURB ME NO FURTHER OR SUFFER AT MY HANDS, FOOLISH DARKLINGS!! **~ */
  IF ~~ THEN DO ~EraseJournalEntry(5810)
EraseJournalEntry(6535)
EraseJournalEntry(16529)
EraseJournalEntry(6943)
EraseJournalEntry(16339)
EraseJournalEntry(9649)
EraseJournalEntry(6405)
EraseJournalEntry(6403)
EraseJournalEntry(6590)
EraseJournalEntry(7147)
EraseJournalEntry(7148)
EraseJournalEntry(15793)
EraseJournalEntry(15792)
EraseJournalEntry(23424)
SetGlobalTimer("udEscape","GLOBAL",120)
SetGlobal("DrowCityHostile","GLOBAL",0)
CreateVisualEffectObject("SPPORTAL",Myself)
Wait(1)
DestroySelf()~ SOLVED_JOURNAL #16668 /* ~The Drow Summoning Ritual

The demon has vanished in anger, having gone without his silver dragon eggs, and with Ardulace dead that means the seal on the city entrance has been lifted.  According to the imp, that means that I have only a couple of minutes to flee with the eggs before my disguise is discovered!~ */ EXIT
END

IF ~~ THEN BEGIN 14 // from: UDPHAE01:159.0
  SAY #52157 /* ~** HAHAHAHA!  A GREAT JOKE HAS BEEN PLAYED ON YOU, DAUGHTER-DARKLING.  THE EGGS YOU HOLD ARE ALSO FALSE. **~ */
  IF ~~ THEN EXTERN ~UDPHAE01~ 160
END

IF ~~ THEN BEGIN 15 // from: UDPHAE01:160.0
  SAY #52159 /* ~** THE BHAAL-CHILD HAS MURDERED YOU, DAUGHTER-DARKLING.  MOST AMUSING, IT IS.  HAHAHAHA!  COME, NOW, AND BE MURDERED. **~ */
  IF ~~ THEN EXTERN ~UDPHAE01~ 161
END

IF ~~ THEN BEGIN 16 // from: UDPHAE01:162.0
  SAY #52163 /* ~** YOU COMMAND NOTHING, DARKLING CHILD!!  I WILL SUFFER NO MORE OF THIS!!  I WILL FEAST ON THE EGGS AFTER I HAVE DESTROYED YOU ALL!! **~ */
  IF ~~ THEN EXTERN ~UDPHAE01~ 163
END

IF ~~ THEN BEGIN 17 // from: UDPHAE01:159.2
  SAY #52166 /* ~** AAAAHHHH, THIS IS A MOST EXCELLENT TITHE, DARKLING CHILD.  I AM APPEASED. **~ */
  IF ~~ THEN EXTERN ~UDPHAE01~ 164
END

IF ~~ THEN BEGIN 18 // from: UDPHAE01:164.0
  SAY #52167 /* ~** ARE YOU AWARE, DARKLING, THAT ALLIES OF YOUR ELVEN FOES ARE PRESENT HERE?  PERHAPS YOU ARE NOT.  GAZE, THEN, UPON THEIR NATURAL FORMS. **~ */
  IF ~~ THEN DO ~ActionOverride(Player1,ApplySpell(Myself,UNDER_NORM))
ActionOverride(Player2,ApplySpell(Myself,UNDER_NORM))
ActionOverride(Player3,ApplySpell(Myself,UNDER_NORM))
ActionOverride(Player4,ApplySpell(Myself,UNDER_NORM))
ActionOverride(Player5,ApplySpell(Myself,UNDER_NORM))
ActionOverride(Player6,ApplySpell(Myself,UNDER_NORM))
SetGlobal("udDrowPlot","GLOBAL",35)~ EXIT
END

IF ~~ THEN BEGIN 19 // from: UDPHAE01:165.0
  SAY #52170 /* ~** IT SHALL BE A PLEASURE TO DESTROY THE BHAAL-CHILD. **~ */
  IF ~~ THEN DO ~EraseJournalEntry(5810)
EraseJournalEntry(6535)
EraseJournalEntry(16529)
EraseJournalEntry(6943)
EraseJournalEntry(16339)
EraseJournalEntry(9649)
EraseJournalEntry(6405)
EraseJournalEntry(6403)
EraseJournalEntry(6590)
EraseJournalEntry(7147)
EraseJournalEntry(7148)
EraseJournalEntry(15793)
EraseJournalEntry(15792)
EraseJournalEntry(15797)
EraseJournalEntry(23424)
ActionOverride("Phaere",Enemy())
SetGlobal("DrowCityHostile","GLOBAL",1)
Enemy()~ SOLVED_JOURNAL #6582 /* ~The Drow Summoning Ritual

Perhaps allowing the ritual to be completed was a mistake... not only has the demon detected our presence and lowered our disguises, but we now have a hostile drow city and demon to face before we can even think about escaping.  And then there will be an angry silver dragon to deal with, as well...~ */ EXIT
END

IF ~Global("udDrowPlot","GLOBAL",45)~ THEN BEGIN 20 // from:
  SAY #52171 /* ~** NOW... IT SEEMS THERE ARE NO *ACTUAL* DRAGON EGGS TO BE HAD.  A PITY.  UNLESS THERE IS A BETTER OFFER, I SHALL DEPART. **~ */
  IF ~Dead("Phaere")
PartyHasItem("MISC9t")
Alignment(Player1,MASK_EVIL)~ THEN REPLY #52172 /* ~I have the eggs, demon.  I shall give them to you in return for a boon.~ */ DO ~AddXPObject(Player1,25000)
AddXPObject(Player2,25000)
AddXPObject(Player3,25000)
AddXPObject(Player4,25000)
AddXPObject(Player5,25000)
AddXPObject(Player6,25000)~ GOTO 8
  IF ~~ THEN REPLY #52173 /* ~Return to whence you came, demon... your summoners are dead.~ */ DO ~AddXPObject(Player1,25000)
AddXPObject(Player2,25000)
AddXPObject(Player3,25000)
AddXPObject(Player4,25000)
AddXPObject(Player5,25000)
AddXPObject(Player6,25000)~ GOTO 21
  IF ~~ THEN REPLY #52174 /* ~(remain silent)~ */ DO ~AddXPObject(Player1,25000)
AddXPObject(Player2,25000)
AddXPObject(Player3,25000)
AddXPObject(Player4,25000)
AddXPObject(Player5,25000)
AddXPObject(Player6,25000)~ GOTO 21
END

IF ~~ THEN BEGIN 21 // from: 20.2 20.1
  SAY #52175 /* ~** SO BE IT.  MORTALS ARE EVER FOOLS. **~ */
  IF ~~ THEN DO ~EraseJournalEntry(5810)
EraseJournalEntry(6535)
EraseJournalEntry(16529)
EraseJournalEntry(6943)
EraseJournalEntry(16339)
EraseJournalEntry(9649)
EraseJournalEntry(6405)
EraseJournalEntry(6403)
EraseJournalEntry(6590)
EraseJournalEntry(7147)
EraseJournalEntry(7148)
EraseJournalEntry(15793)
EraseJournalEntry(15792)
EraseJournalEntry(23424)
SetGlobalTimer("udEscape","GLOBAL",120)
DestroySelf()~ SOLVED_JOURNAL #10104 /* ~The Drow Summoning Ritual

Both Phaere and Matron Mother Ardulace have been fooled into offering the demon fake silver dragon eggs... and the demon has finally vanished, finding the whole thing amusing.  According to the imp, the seal on the city should be lifted... but I have only a couple of minutes to get out before my disguise is revealed!~ */ EXIT
END

IF ~~ THEN BEGIN 22 // from: VALYGARJ:85.0
  SAY #55906 /* ~** BAH!!  I HAVE NO PATIENCE TO PUT UP WITH PETTY MORTAL CONCERNS!!  DRAW YOUR OWN BLOOD IF YOU WISH, BUT DISTURB ME NO FURTHER!! **~ */
  IF ~~ THEN DO ~EraseJournalEntry(5810)
EraseJournalEntry(6535)
EraseJournalEntry(16529)
EraseJournalEntry(6943)
EraseJournalEntry(16339)
EraseJournalEntry(9649)
EraseJournalEntry(6405)
EraseJournalEntry(6403)
EraseJournalEntry(6590)
EraseJournalEntry(7147)
EraseJournalEntry(7148)
EraseJournalEntry(15793)
EraseJournalEntry(15792)
EraseJournalEntry(23424)
SetGlobalTimer("udEscape","GLOBAL",120)
DestroySelf()~ SOLVED_JOURNAL #6545 /* ~The Drow Summoning Ritual

I attempted to offer the silver dragon eggs up to the demon, myself, in return for what would probably have been greater services than anything the dragon could have given me.  Certain self-righteous members of my party, however, decided to interfere... and the demon grew impatient and left.  That means I not only have to deal with my party, I also have only a couple of minutes to flee the city before my disguise is discovered.~ */ EXIT
END
