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

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

IF WEIGHT #0 ~NumTimesTalkedTo(0)
//InPartySlot(LastTalkedToBy,0)
Global("HelpDryads","GLOBAL",0)
!Dead("Cania")
!StateCheck("Cania",STATE_SLEEPING)
!Dead("Elyme")
!StateCheck("Elyme",STATE_SLEEPING)~ THEN BEGIN 0 // from:
  SAY #11016 /* ~Protect me!~ [DRYAD06] */
  IF ~~ THEN DO ~

~ EXTERN ~IDRYAD2~ 0
END

IF ~~ THEN BEGIN 1 // from: IDRYAD3:0.0
  SAY #11080 /* ~We are his possessions.~ */
  IF ~~ THEN EXTERN ~IDRYAD2~ 1
END

IF ~~ THEN BEGIN 2 // from: IDRYAD3:1.0 IDRYAD3:0.1
  SAY #11100 /* ~But you must help us get free of this... creature Irenicus!~ */
  IF ~~ THEN EXTERN ~IDRYAD2~ 2
END

IF ~~ THEN BEGIN 3 // from: IDRYAD3:1.1 IDRYAD3:0.2
  SAY #11172 /* ~Please stay and help us! We must escape from this... this Irenicus!~ */
  IF ~Global("NamedCaptor","AR0602",0)
!IsValidForPartyDialog("Jaheira")
!IsValidForPartyDialog("Minsc")~ THEN REPLY #38656 /* ~The name of our captor, though we are no nearer understanding his motive.~ */ DO ~SetGlobal("NamedCaptor","AR0602",1)
~ EXTERN ~IDRYAD2~ 15
  IF ~IsValidForPartyDialog("Jaheira")~ THEN DO ~SetGlobal("NamedCaptor","AR0602",1)~ EXTERN ~JAHEIRAJ~ 332
  IF ~!IsValidForPartyDialog("Jaheira")
IsValidForPartyDialog("Minsc")~ THEN DO ~SetGlobal("NamedCaptor","AR0602",1)~ EXTERN ~MINSCJ~ 85
  IF ~Global("NamedCaptor","AR0602",1)
!IsValidForPartyDialog("Jaheira")
!IsValidForPartyDialog("Minsc")~ THEN EXTERN ~IDRYAD3~ 2
END

IF ~~ THEN BEGIN 4 // from: IDRYAD3:2.0 IDRYAD3:1.2 IDRYAD2:4.0
  SAY #11174 /* ~If you can escape, you must take our acorns to the Queen. Tell her of our plight in this creature's lair.~ */
  IF ~~ THEN EXTERN ~IDRYAD2~ 3
END

IF ~~ THEN BEGIN 5 // from: IDRYAD3:3.3
  SAY #11264 /* ~We cannot leave our trees!~ */
  IF ~~ THEN EXTERN ~IDRYAD2~ 5
END

IF ~~ THEN BEGIN 6 // from: IDRYAD3:11.0 IDRYAD3:6.0 IDRYAD3:3.0 IDRYAD2:9.0 IDRYAD2:6.1 8.0
  SAY #11354 /* ~Thank you! You must take the acorns and deliver them to the Fairy Queen in the south end of the Windspear Hills.~ */
  IF ~~ THEN EXTERN ~IDRYAD2~ 12
END

IF ~~ THEN BEGIN 7 // from: IDRYAD3:7.0
  SAY #11378 /* ~May the forest always open a path for you!~ */
  IF ~~ THEN DO ~IncrementGlobal("ImoenDryad","AR0602",1)
AddexperienceParty(9500)
SetGlobal("HelpDryads","GLOBAL",2)
~ UNSOLVED_JOURNAL #34093 /* ~Helping Irenicus' captive dryads.

In order to free the captive dryads from their imprisonment, I must bring their acorns to the Fairy Queen, who is apparently located in an area called the Windspear Hills.~ */ EXIT
END

IF WEIGHT #3 /* Triggers after states #: 10 11 even though they appear after this state */
~Global("Acorns","AR0602",0)
!Dead("Cania")
!StateCheck("Cania",STATE_SLEEPING)
!Dead("Elyme")
!StateCheck("Elyme",STATE_SLEEPING)~ THEN BEGIN 8 // from:
  SAY #11427 /* ~Will you help to free us now?~ */
  IF ~~ THEN REPLY #11428 /* ~I will help you. What do you wish me to do?~ */ GOTO 6
  IF ~Global("HelpDjinni","GLOBAL",1)
~ THEN REPLY #11429 /* ~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?~ */ EXTERN ~IDRYAD2~ 8
  IF ~InParty("Minsc")
!IsGabber("Minsc")
!Dead("Minsc")
!StateCheck("Minsc",STATE_SLEEPING)
~ THEN REPLY #11430 /* ~I refuse to help you.~ */ EXTERN ~IDRYAD3~ 5
  IF ~OR(4)
!InParty("Minsc")
IsGabber("Minsc")
Dead("Minsc")
StateCheck("Minsc",STATE_SLEEPING)
~ THEN REPLY #11431 /* ~I cannot help you.~ */ EXTERN ~IDRYAD3~ 4
END

IF WEIGHT #4 /* Triggers after states #: 10 11 even though they appear after this state */
~Global("Acorns","AR0602",2)
!Dead("Cania")
!StateCheck("Cania",STATE_SLEEPING)
!Dead("Elyme")
!StateCheck("Elyme",STATE_SLEEPING)~ THEN BEGIN 9 // from:
  SAY #11444 /* ~You have returned, <RACE>. Is there something else that you require of us?~ */
  IF ~~ THEN REPLY #11445 /* ~I require nothing else. I must return to my search for an exit.~ */ EXTERN ~IDRYAD3~ 19
  IF ~~ THEN REPLY #11446 /* ~Could you repeat the advice that you gave me earlier?~ */ EXTERN ~IDRYAD2~ 10
  IF ~Global("HelpDjinni","GLOBAL",1)
~ THEN REPLY #11447 /* ~I search for a flask in order to free a djinni. Have you seen such a thing?~ */ EXTERN ~IDRYAD3~ 18
END

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

IF WEIGHT #2 ~PartyHasItem("misc4n")
Global("Acorns","AR0602",1)
!Dead("Cania")
!StateCheck("Cania",STATE_SLEEPING)
!Dead("Elyme")
!StateCheck("Elyme",STATE_SLEEPING)
~ THEN BEGIN 11 // from:
  SAY #17788 /* ~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.~ */ EXTERN ~IDRYAD2~ 7
END

IF ~~ THEN BEGIN 12 // from:
  SAY #37425 /* ~My Queen! <CHARNAME> has saved us. Can our trees be saved? Has Irenicus doomed us?~ */
  IF ~~ THEN DO ~AddExperienceParty(9750)
SetNumTimesTalkedTo(2)
~ EXTERN ~VAELASA~ 6
END

IF ~~ THEN BEGIN 13 // from:
  SAY #37428 /* ~Thank you, my Queen.~ */
  IF ~~ THEN EXTERN ~VAELASA~ 8
END

IF ~~ THEN BEGIN 14 // from: IMOENJ:36.0
  SAY #38648 /* ~You are welcome among us, girl. Youthful exuberance is music that we have not heard in such a long time.~ */
  IF ~~ THEN EXTERN ~IMOENJ~ 37
END

IF ~~ THEN BEGIN 15 // from: IMOENJ:37.0
  SAY #38650 /* ~How do you know of this? He has touched you as we, hasn't he? Irenicus searches for something he cannot find, and he looks within those that have no more idea than he.~ */
  IF ~~ THEN EXTERN ~IMOENJ~ 38
END

IF ~~ THEN BEGIN 16 // from: IMOENJ:38.0
  SAY #38652 /* ~A name that is synonymous with death and ugliness.~ */
  IF ~~ THEN EXTERN ~IMOENJ~ 39
END

IF ~~ THEN BEGIN 17 // from: IMOENJ:39.0
  SAY #38654 /* ~Live as you can where you must, young woman. You will not survive if you give in. We have learned this.~ */
  IF ~~ THEN EXTERN ~IMOENJ~ 40
END
