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

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

IF WEIGHT #1 /* Triggers after states #: 12 even though they appear after this state */
~True()
~ THEN BEGIN 0 // from:
  SAY #54549 /* ~** THE AVATAR OF THE GREAT OAK STANDS BEFORE YOU, MORTALS.  WHAT TRANSPIRES HERE THAT REQUIRES THE ATTENTION OF THE LEAFLORD? **~ [SUAVAT02] */
  IF ~~ THEN REPLY #54560 /* ~The sorcerer, Jon Irenicus, has --~ */ DO ~SetGlobal("ElvenAvatar","GLOBAL",1)~ GOTO 1
END

IF ~~ THEN BEGIN 1 // from: 0.0
  SAY #54551 /* ~** AH... THE EXILE HAS RETURNED. **~ */
  IF ~~ THEN GOTO 2
END

IF ~~ THEN BEGIN 2 // from: 1.0
  SAY #54552 /* ~** HE WHO ONCE WAS OF THE ELVES BUT IS NO LONGER SURVIVES YET.  ONCE AGAIN HE COMMITS HIS SACRILEGE AGAINST THE TREE OF LIFE. **~ */
  IF ~~ THEN GOTO 3
END

IF ~~ THEN BEGIN 3 // from: 2.0
  SAY #54557 /* ~** THE EXILE PROTECTS HIMSELF WITH POWER THAT CORRUPTS NATURE.  I CANNOT TOUCH HIM.  **~ */
  IF ~~ THEN GOTO 4
END

IF ~~ THEN BEGIN 4 // from: 3.0
  SAY #54564 /* ~** HE HOLDS SHE WHO IS OF MY BLOOD IMPRISONED WITHIN CORRUPTION.  HE USES HER LINK TO THE TREE OF LIFE TO DRAIN ITS POWER.  **~ */
  IF ~~ THEN REPLY #54568 /* ~Why?  What's he going to --~ */ GOTO 5
END

IF ~~ THEN BEGIN 5 // from: 4.0
  SAY #54566 /* ~** THE EXILE SEEKS TO JOIN THE SELDARINE.  THE EXILE SEEKS TO BECOME A GOD, AS HE SOUGHT ONCE BEFORE. **~ */
  IF ~!IsValidForPartyDialog("Aerie")
!IsValidForPartyDialog("Viconia")
!IsValidForPartyDialog("Jaheira")~ THEN GOTO 6
  IF ~IsValidForPartyDialog("Aerie")~ THEN EXTERN ~AERIEJ~ 157
  IF ~!IsValidForPartyDialog("Aerie")
IsValidForPartyDialog("Viconia")~ THEN EXTERN ~VICONIJ~ 156
  IF ~!IsValidForPartyDialog("Aerie")
!IsValidForPartyDialog("Viconia")
IsValidForPartyDialog("Jaheira")~ THEN EXTERN ~JAHEIRAJ~ 479
END

IF ~~ THEN BEGIN 6 // from: 5.0
  SAY #54569 /* ~** THE FIRST OF THE SELDARINE WOULD NEVER PERMIT IT.  THE TREE OF LIFE MUST NOT PERISH, OR OUR CHILDREN WILL SUFFER. **~ */
  IF ~~ THEN GOTO 7
END

IF ~~ THEN BEGIN 7 // from: 6.0
  SAY #54571 /* ~** THE SPIRITS OF THIS WOOD WILL BE CALLED TO DEFEAT THE EVIL THAT THE EXILE HAS BROUGHT INTO OUR MIDST. **~ */
  IF ~~ THEN GOTO 8
END

IF ~~ THEN BEGIN 8 // from: 7.0
  SAY #54575 /* ~** RISE, SPIRITS... IT IS I, RILLIFANE RALLATHIL OF THE SELDARINE WHO CALLS YOU.  DEFEND OUR CHILDREN THIS DAY. **~ */
  IF ~~ THEN GOTO 9
END

IF ~~ THEN BEGIN 9 // from: 8.0
  SAY #54580 /* ~** AND YOU, MORTAL... **~ */
  IF ~~ THEN GOTO 10
END

IF ~~ THEN BEGIN 10 // from: 9.0
  SAY #54581 /* ~** YOU SEEK TO DEFEAT THE EXILE.  FREE SHE WHO IS OF MY BLOOD FROM HIS CORRUPTION, AND SHE WILL SEVER THE LINK HE USES. **~ */
  IF ~~ THEN REPLY #57858 /* ~But Irenicus has sealed --~ */ GOTO 13
END

IF ~~ THEN BEGIN 11 // from: 13.0
  SAY #54583 /* ~** I CAN DO NO MORE. **~ */
  IF ~~ THEN DO ~EraseJournalEntry(6836)
EraseJournalEntry(23506)
EraseJournalEntry(23481)
EraseJournalEntry(23482)
EraseJournalEntry(11883)
EraseJournalEntry(15718)
EraseJournalEntry(15748)
EraseJournalEntry(6496)
EraseJournalEntry(6501)
EraseJournalEntry(6279)
SetInterrupt(FALSE)
GiveItemCreate("staf14",Player1,20,20,20)
CreateVisualEffectObject("SPFLSRIN",Myself)
Wait(1)
CreateVisualEffectObject("SPFLESHS",Myself)
SetGlobal("ElvenSpirits","GLOBAL",1)
SetGlobal("ElvenAvatar","GLOBAL",1)
DestroySelf()~ SOLVED_JOURNAL #23446 /* ~Getting Inside the Palace in Suldanessellar

I summoned the avatar of the elven god Rillifane Rallathil in order to get past Irenicus' seal on the palace gates.  The avatar awakened the guardian spirits of the forest, which attacked the invading monsters throughout the city.  It then told me that Irenicus' plan is to take the power of the Tree of Life for himself... both for power and revenge.  Queen Ellesime is Rillifane's daughter and may be the only one who can stop the mage.
Rillifane broke the seal on the palace gates... my way within is now clear.~ */ EXIT
END

IF WEIGHT #0 ~!CombatCounter(0)
NumTimesTalkedTo(0)
~ THEN BEGIN 12 // from:
  SAY #57571 /* ~** NO MORE SHALL THE TEMPLE BE DEFILED!!! **~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 13 // from: 10.0
  SAY #57857 /* ~** THE EXILE BLOCKS YOUR WAY, SEALING THE GATES TO THE GREAT PALACE.  I SHALL UNSEAL THEM.   ...  IT IS DONE. **~ */
  IF ~~ THEN GOTO 11
END
