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

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

IF ~~ THEN BEGIN 0 // from: IDRYAD1:0.0
  SAY #11018 /* ~Yes, help us!~ */
  IF ~~ THEN EXTERN ~IDRYAD3~ 0
END

IF ~~ THEN BEGIN 1 // from: IDRYAD1:1.0
  SAY #11087 /* ~His servants.~ */
  IF ~~ THEN EXTERN ~IDRYAD3~ 1
END

IF ~~ THEN BEGIN 2 // from: IDRYAD1:2.0
  SAY #11135 /* ~Please, <PRO_SIRMAAM>! His dungeon is death all around!~ */
  IF ~Global("NamedCaptor","AR0602",0)
!IsValidForPartyDialog("Jaheira")
!IsValidForPartyDialog("Minsc")~ THEN REPLY #38657 /* ~The name of our captor, but we are no closer to his motive.~ */ DO ~SetGlobal("NamedCaptor","AR0602",1)
~ GOTO 15
  IF ~Global("NamedCaptor","AR0602",0)
IsValidForPartyDialog("Jaheira")~ THEN DO ~SetGlobal("NamedCaptor","AR0602",1)
~ EXTERN ~JAHEIRAJ~ 332
  IF ~Global("NamedCaptor","AR0602",0)
!IsValidForPartyDialog("Jaheira")
IsValidForPartyDialog("Minsc")~ THEN DO ~SetGlobal("NamedCaptor","AR0602",1)
~ EXTERN ~MINSCJ~ 85
  IF ~Global("NamedCaptor","AR0602",1)
~ THEN EXTERN ~IDRYAD3~ 2
END

IF ~~ THEN BEGIN 3 // from: IDRYAD1:4.0
  SAY #11195 /* ~Take them to the Fairy Queen who lives in the south end of the Windspear Hills. This will be our deliverance from this... this Irenicus and his dungeon!~ */
  IF ~Global("NamedCaptor","AR0602",0)
!IsValidForPartyDialog("Jaheira")
!IsValidForPartyDialog("Minsc")~ THEN REPLY #38658 /* ~A name for our captor, though I still do not understand his motive.~ */ DO ~SetGlobal("NamedCaptor","AR0602",1)
~ GOTO 16
  IF ~Global("NamedCaptor","AR0602",0)
IsValidForPartyDialog("Jaheira")~ THEN DO ~SetGlobal("NamedCaptor","AR0602",1)
~ EXTERN ~JAHEIRAJ~ 305
  IF ~Global("NamedCaptor","AR0602",0)
!IsValidForPartyDialog("Jaheira")
IsValidForPartyDialog("Minsc")~ THEN DO ~SetGlobal("NamedCaptor","AR0602",1)
~ EXTERN ~MINSCJ~ 65
  IF ~Global("NamedCaptor","AR0602",1)
~ THEN EXTERN ~IDRYAD3~ 3
END

IF ~~ THEN BEGIN 4 // from: IDRYAD3:5.0
  SAY #11258 /* ~Unless you agree to help us, you cannot have your man back.~ */
  IF ~~ THEN REPLY #11259 /* ~Alright, how can I help you?~ */ EXTERN ~IDRYAD1~ 4
  IF ~~ THEN REPLY #11260 /* ~I will merely kill you to free my friend.~ */ GOTO 6
  IF ~~ THEN REPLY #11263 /* ~Keep him if you wish. I care not.~ */ EXTERN ~IDRYAD3~ 4
END

IF ~~ THEN BEGIN 5 // from: IDRYAD1:5.0
  SAY #11265 /* ~If we are separated from our trees, we will die.~ */
  IF ~~ THEN REPLY #11271 /* ~Alright, how can I help you?~ */ EXTERN ~IDRYAD3~ 6
END

IF ~~ THEN BEGIN 6 // from: 4.1
  SAY #11345 /* ~Have we not suffered enough? Take pity, <LADYLORD>!~ */
  IF ~~ THEN REPLY #11346 /* ~I will not take pity on you. Die, dryads!~ */ DO ~ActionOverride("Ulene",Enemy())
ActionOverride("Elyme",Enemy())
Enemy()
~ EXIT
  IF ~~ THEN REPLY #11347 /* ~Very well, I will help you.~ */ EXTERN ~IDRYAD1~ 6
END

IF ~~ THEN BEGIN 7 // from: IDRYAD3:17.0 14.0 IDRYAD1:11.0
  SAY #11357 /* ~We will help you escape! You must use the portals to travel up to the next level of the complex. This is how Irenicus travels. The portals are triggered by a certain key.~ */
  IF ~~ THEN EXTERN ~IDRYAD3~ 7
END

IF ~~ THEN BEGIN 8 // from: IDRYAD3:16.1 IDRYAD3:11.1 IDRYAD3:6.1 IDRYAD3:3.1 13.1 9.1 IDRYAD1:10.1 IDRYAD1:8.1
  SAY #11379 /* ~We do have such a flask. If you will agree to take our acorns to the Fairy Queen we will give it to you.~ */
  IF ~~ THEN EXTERN ~IDRYAD3~ 8
END

IF WEIGHT #2 /* Triggers after states #: 13 14 even though they appear after this state */
~Global("Acorns","AR0602",0)
!Dead("Ulene")
!Dead("Elyme")~ THEN BEGIN 9 // from:
  SAY #11432 /* ~Will you help to free us now?~ */
  IF ~~ THEN REPLY #11434 /* ~I will help you. What do you wish me to do?~ */ EXTERN ~IDRYAD1~ 6
  IF ~Global("HelpDjinni","GLOBAL",1)
~ THEN REPLY #11435 /* ~I will help you if you will help me. I am looking for a flask in order to free a djinni who is trapped in the Plane of Air. Have you seen one?~ */ GOTO 8
  IF ~InParty("Minsc")
!IsGabber("Minsc")
!Dead("Minsc")
!StateCheck("Minsc",STATE_SLEEPING)
~ THEN REPLY #11436 /* ~I refuse to help you.~ */ EXTERN ~IDRYAD3~ 5
  IF ~OR(2)
!InParty("Minsc")
IsGabber("Minsc")
Dead("Minsc")
StateCheck("Minsc",STATE_SLEEPING)
~ THEN REPLY #11437 /* ~I cannot help you.~ */ EXTERN ~IDRYAD3~ 4
END

IF ~~ THEN BEGIN 10 // from: IDRYAD3:13.1 11.1 IDRYAD1:9.1
  SAY #11449 /* ~You must use Irenicus' portals to travel up to the next level of the complex. The portals must be triggered by a certain key.~ */
  IF ~~ THEN EXTERN ~IDRYAD3~ 12
END

IF WEIGHT #3 /* Triggers after states #: 13 14 even though they appear after this state */
~Global("Acorns","AR0602",2)
!Dead("Ulene")
!Dead("Elyme")~ THEN BEGIN 11 // from:
  SAY #11451 /* ~You have returned, <RACE>. Is there something else that you require of us?~ */
  IF ~~ THEN REPLY #11452 /* ~I require nothing else. I must return to my search for an exit.~ */ EXTERN ~IDRYAD3~ 19
  IF ~~ THEN REPLY #11453 /* ~Could you repeat the advice that you gave me earlier?~ */ GOTO 10
  IF ~Global("HelpDjinni","GLOBAL",1)
~ THEN REPLY #11454 /* ~I search for a flask that will free a djinni trapped by your master in the Plane of Air. Have you seen such a thing?~ */ EXTERN ~IDRYAD3~ 18
END

IF ~~ THEN BEGIN 12 // from: IDRYAD3:9.0 IDRYAD1:6.0
  SAY #17740 /* ~But he has taken the acorns. He knows of our plans. It amuses him.~ */
  IF ~~ THEN EXTERN ~IDRYAD3~ 14
END

IF WEIGHT #0 ~Global("Acorns","AR0602",1)
!PartyHasItem("misc4n")
!Dead("Ulene")
!Dead("Elyme")~ THEN BEGIN 13 // from:
  SAY #17770 /* ~You must get our acorns back from Ilyich, the clan leader of Irenicus' duergar slaves.  He is somewhere within the dungeon.  Return to us when you have the acorns and we will tell you how to escape.~ */
  IF ~~ THEN REPLY #17771 /* ~I will get the acorns and return to you.~ */ EXTERN ~IDRYAD3~ 19
  IF ~Global("HelpDjinni","GLBOAL",1)~ THEN REPLY #17772 /* ~I will help you if you will help me. I am looking for a flask in order to free a djinni who is trapped in the Plane of Air. Have you seen one?~ */ GOTO 8
END

IF WEIGHT #1 ~PartyHasItem("misc4n")
Global("HelpDryads","GLOBAL",1)
!Dead("Ulene")
!Dead("Elyme")
~ THEN BEGIN 14 // from:
  SAY #17774 /* ~You have done a noble thing for us. Please take these acorns to the Fairy Queen who lives in the south end of the Windspear hills.~ */
  IF ~~ THEN DO ~SetGlobal("Acorns","AR0602",2)
~ UNSOLVED_JOURNAL #34092 /* ~Helping Irenicus' captive dryads.

I have agreed to help a trio of dryads return their acorns to the Fairy Queen.  Somewhere in the dungeon is a dwarf by the name of Ilyich who has the acorns.~ */ GOTO 7
END

IF ~~ THEN BEGIN 15 // from: MINSCJ:85.0 JAHEIRAJ:332.0 2.0 IDRYAD1:3.0
  SAY #38659 /* ~We are supposed to instill emotion, but he is barren inside. I am not sure what he expects.~ */
  IF ~~ THEN EXTERN ~IDRYAD3~ 2
END

IF ~~ THEN BEGIN 16 // from: MINSCJ:65.0 JAHEIRAJ:305.0 3.0
  SAY #38660 /* ~We are supposed to instill emotion, but he is barren inside. I am not sure what he expects.~ */
  IF ~~ THEN EXTERN ~IDRYAD3~ 3
END
