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

BEGIN ~PPSAEM2~

IF ~Global("AsylumPlot","GLOBAL",50)~ THEN BEGIN 0 // from:
  SAY #43873 /* ~Ah! There you are. I see that you have weathered the storms of this place with reasonable pluck and health. It does me good to see you alive.~ [PPSAEM16] */
  IF ~~ THEN REPLY #44919 /* ~I face treachery at every turn! Tell me why I shouldn't kill you!~ */ DO ~SetGlobal("AsylumPlot","GLOBAL",51)~ GOTO 1
  IF ~~ THEN REPLY #44920 /* ~And what do you wish from me?~ */ DO ~SetGlobal("AsylumPlot","GLOBAL",51)~ GOTO 2
  IF ~~ THEN REPLY #44921 /* ~Stand aside! I will not hesitate to kill you.~ */ DO ~SetGlobal("AsylumPlot","GLOBAL",51)~ GOTO 3
END

IF ~~ THEN BEGIN 1 // from: 0.0
  SAY #44922 /* ~Such hostility, and I wager it is well-earned. It is, however, misdirected. I do not wish to be your enemy here.~ */
  IF ~~ THEN GOTO 4
END

IF ~~ THEN BEGIN 2 // from: 0.1
  SAY #44923 /* ~I wish nothing from you, save the satisfaction that you succeed in your goal. The winds are changing, and I must heed their gentle push.~ */
  IF ~~ THEN GOTO 4
END

IF ~~ THEN BEGIN 3 // from: 0.2
  SAY #44924 /* ~Ahh, but a single moment of hesitation will not alter your course. I wish only that you heed my words, for they are worth the wait that you can spare.~ */
  IF ~~ THEN GOTO 4
END

IF ~~ THEN BEGIN 4 // from: 3.0 2.0 1.0
  SAY #44925 /* ~Irenicus pushes ever forward, though I cannot see how I will profit. The blade he gave me is hardly compensation. Better that this place were free for the looting.~ */
  IF ~~ THEN GOTO 5
END

IF ~~ THEN BEGIN 5 // from: 4.0
  SAY #44926 /* ~I offer advice to foster a trust, and you may determine the value as you wish. It is simple enough for the moment, and will save you in the long run.~ */
  IF ~~ THEN REPLY #44928 /* ~Speak then, and I will listen.~ */ GOTO 6
  IF ~~ THEN REPLY #44929 /* ~Make your words count. They will determine your lifespan.~ */ GOTO 6
END

IF ~~ THEN BEGIN 6 // from: 5.1 5.0
  SAY #44927 /* ~Irenicus is a power, indeed. I have seen no chips in his armor of spells. You would need an army to face him, and I suggest that there is one to be had.~ */
  IF ~~ THEN GOTO 7
END

IF ~~ THEN BEGIN 7 // from: 6.0
  SAY #44930 /* ~The inmates of this place are a resource to be tapped. Release them and their anger and frustrations will strike at Irenicus.~ */
  IF ~~ THEN GOTO 8
END

IF ~~ THEN BEGIN 8 // from: 7.0
  SAY #44931 /* ~That is my suggestion, and I leave the workings of it to you. Upstairs your army awaits. Use it, or you will perish.~ */
  IF ~!IsValidForPartyDialog("Jaheira")
!IsValidForPartyDialog("Anomen")
!IsValidForPartyDialog("Edwin")
!IsValidForPartyDialog("Viconia")~ THEN DO ~SetGlobal("WackoArmy","GLOBAL",1)
OpenDoor("DOOR12")
EscapeArea()~ UNSOLVED_JOURNAL #7045 /* ~Escaping the Asylum

After the maze I encountered Saemon Havarian again.  I don't know if I can trust him, but he seemed genuine in abandoning Irenicus' unprofitable plans.  He offered advice: if I am to challenge Irenicus I will need an army, and there is one to be had in the asylum... the captive mages.  Of course I would be mad to free them, but he may have a point.  Saemon left before I could question him further.~ */ EXIT
  IF ~IsValidForPartyDialog("Jaheira")~ THEN DO ~SetGlobal("WackoArmy","GLOBAL",1)
OpenDoor("DOOR12")
EscapeArea()~ UNSOLVED_JOURNAL #7045 /* ~Escaping the Asylum

After the maze I encountered Saemon Havarian again.  I don't know if I can trust him, but he seemed genuine in abandoning Irenicus' unprofitable plans.  He offered advice: if I am to challenge Irenicus I will need an army, and there is one to be had in the asylum... the captive mages.  Of course I would be mad to free them, but he may have a point.  Saemon left before I could question him further.~ */ EXTERN ~JAHEIRAJ~ 459
  IF ~!IsValidForPartyDialog("Jaheira")
IsValidForPartyDialog("Anomen")~ THEN DO ~SetGlobal("WackoArmy","GLOBAL",1)
OpenDoor("DOOR12")
EscapeArea()~ UNSOLVED_JOURNAL #7045 /* ~Escaping the Asylum

After the maze I encountered Saemon Havarian again.  I don't know if I can trust him, but he seemed genuine in abandoning Irenicus' unprofitable plans.  He offered advice: if I am to challenge Irenicus I will need an army, and there is one to be had in the asylum... the captive mages.  Of course I would be mad to free them, but he may have a point.  Saemon left before I could question him further.~ */ EXTERN ~ANOMENJ~ 265
  IF ~!IsValidForPartyDialog("Jaheira")
!IsValidForPartyDialog("Anomen")
IsValidForPartyDialog("Edwin")~ THEN DO ~SetGlobal("WackoArmy","GLOBAL",1)
OpenDoor("DOOR12")
EscapeArea()~ UNSOLVED_JOURNAL #7045 /* ~Escaping the Asylum

After the maze I encountered Saemon Havarian again.  I don't know if I can trust him, but he seemed genuine in abandoning Irenicus' unprofitable plans.  He offered advice: if I am to challenge Irenicus I will need an army, and there is one to be had in the asylum... the captive mages.  Of course I would be mad to free them, but he may have a point.  Saemon left before I could question him further.~ */ EXTERN ~EDWINJ~ 106
  IF ~!IsValidForPartyDialog("Jaheira")
!IsValidForPartyDialog("Anomen")
!IsValidForPartyDialog("Edwin")
IsValidForPartyDialog("Viconia")~ THEN DO ~SetGlobal("WackoArmy","GLOBAL",1)
OpenDoor("DOOR12")
EscapeArea()~ UNSOLVED_JOURNAL #7045 /* ~Escaping the Asylum

After the maze I encountered Saemon Havarian again.  I don't know if I can trust him, but he seemed genuine in abandoning Irenicus' unprofitable plans.  He offered advice: if I am to challenge Irenicus I will need an army, and there is one to be had in the asylum... the captive mages.  Of course I would be mad to free them, but he may have a point.  Saemon left before I could question him further.~ */ EXTERN ~VICONIJ~ 129
END

IF ~Global("AsylumPlot","GLOBAL",55)~ THEN BEGIN 9 // from:
  SAY #44932 /* ~Gone and off like the shadow flees the morn. You aren't going to let him fall away so easy, are you?~ [PPSAEM17] */
  IF ~~ THEN REPLY #45248 /* ~Why would you encourage me so? You were in his service!~ */ DO ~SetGlobal("AsylumPlot","GLOBAL",56)~ GOTO 10
  IF ~~ THEN REPLY #45249 /* ~I won't let any of you get away. You helped them, and will join him in death.~ */ DO ~SetGlobal("AsylumPlot","GLOBAL",56)~ GOTO 14
  IF ~~ THEN REPLY #45250 /* ~What are you doing here? Your cowardly masters didn't take you with them?~ */ DO ~SetGlobal("AsylumPlot","GLOBAL",56)~ GOTO 14
  IF ~~ THEN REPLY #45251 /* ~I ruined his plans for the moment, but he has escaped with my soul.  I intend to follow him.~ */ DO ~SetGlobal("AsylumPlot","GLOBAL",56)~ GOTO 15
END

IF ~~ THEN BEGIN 10 // from: 9.0
  SAY #45252 /* ~That I was, but only for the favors of Mistress Bodhi. Powerful people cast off powerful things, and a blade of novelty to them is a fine sight to such as I.~ */
  IF ~~ THEN GOTO 11
END

IF ~~ THEN BEGIN 11 // from: 10.0
  SAY #45253 /* ~But she has no doubt fled with her 'brother' and master, leaving me to deal with the mess they have abandoned. There is no profit in this for the likes of me.~ */
  IF ~~ THEN GOTO 21
END

IF ~~ THEN BEGIN 12 // from: 24.0
  SAY #45254 /* ~So I will offer my service to you, in the hopes that we can benefit one another. I'm sure you can understand the motives of self-preservation.~ */
  IF ~~ THEN REPLY #45258 /* ~What could you possibly offer me?~ */ GOTO 16
  IF ~~ THEN REPLY #45259 /* ~Your tongue may as well be forked. I trust nothing you say.~ */ GOTO 16
  IF ~~ THEN REPLY #45260 /* ~So you propose an allegiance? I only see a benefit for you in this.~ */ GOTO 16
END

IF ~~ THEN BEGIN 13 // from:
  SAY #45255 /* ~Before you bring your anger to bear, please take pause to hear my words. My situation has changed drastically and I pose no threat.~ */
  IF ~~ THEN GOTO 14
END

IF ~~ THEN BEGIN 14 // from: 15.0 13.0 9.2 9.1
  SAY #45256 /* ~It is true that Bodhi employed me, but she is fled now, and I owe her 'brother' no loyalty. The trinket blade they gave is nice, but I have other needs.~ */
  IF ~~ THEN GOTO 21
END

IF ~~ THEN BEGIN 15 // from: 9.3
  SAY #45257 /* ~Truly admirable goal, and I would aid you if you permit it. You may view me with suspicion, but please take a moment to see my situation for what it is.~ */
  IF ~~ THEN GOTO 14
END

IF ~~ THEN BEGIN 16 // from: 12.2 12.1 12.0
  SAY #45261 /* ~Of course I would not impose this upon you without a proper offering of peace. Let me first inform you of the ways you may escape this place.~ */
  IF ~~ THEN GOTO 17
END

IF ~~ THEN BEGIN 17 // from: 16.0
  SAY #45262 /* ~Irenicus left by a magic portal... it could be trapped, and it may even lead into the Underdark.  Not a safe place to go.~ */
  IF ~~ THEN GOTO 18
END

IF ~~ THEN BEGIN 18 // from: 17.0
  SAY #45263 /* ~He sealed the doors, but I think I can get us to the surface.  I suggest we go back to my ship.  I know where he's *headed*... we may even cut him off.~ */
  IF ~~ THEN REPLY #45264 /* ~That seems convenient. What is the catch?~ */ GOTO 19
  IF ~~ THEN REPLY #45265 /* ~And what will you require in return? I suppose gold or the like?~ */ GOTO 19
END

IF ~~ THEN BEGIN 19 // from: 18.1 18.0
  SAY #45266 /* ~There are no secret conditions on my help. I merely seek your friendship, or at least your pardon. I require allies if I am to survive.~ */
  IF ~!IsValidForPartyDialog("Korgan")
!IsValidForPartyDialog("Viconia")
!IsValidForPartyDialog("Aerie")
!IsValidForPartyDialog("Imoen2")~ THEN GOTO 20
  IF ~IsValidForPartyDialog("Korgan")~ THEN EXTERN ~KORGANJ~ 127
  IF ~!IsValidForPartyDialog("Korgan")
IsValidForPartyDialog("Viconia")~ THEN EXTERN ~VICONIJ~ 130
  IF ~!IsValidForPartyDialog("Korgan")
!IsValidForPartyDialog("Viconia")
IsValidForPartyDialog("Aerie")~ THEN EXTERN ~AERIEJ~ 135
  IF ~!IsValidForPartyDialog("Korgan")
!IsValidForPartyDialog("Viconia")
!IsValidForPartyDialog("Aerie")
IsValidForPartyDialog("Imoen2")~ THEN EXTERN ~IMOEN2J~ 18
END

IF ~~ THEN BEGIN 20 // from: 19.0
  SAY #45268 /* ~So, will you try the portal or accompany me to the surface? Perhaps I will throw in the blade I was paid, to show you my good intent.~ */
  IF ~~ THEN REPLY #45269 /* ~I think I'll take the portal. Dark or murky, it is clearer than your motives.~ */ GOTO 25
  IF ~~ THEN REPLY #45270 /* ~I'll find my own way and kill you as well!~ */ GOTO 26
  IF ~~ THEN REPLY #45271 /* ~Very well. Lead the way out and we shall take your ship.~ */ GOTO 27
END

IF ~~ THEN BEGIN 21 // from: 14.0 11.0
  SAY #45272 /* ~Besides, I know a little of his plans through a peek or two at his journal.  It's little enough, but I figure we're all in trouble if he isn't stopped.~ */
  IF ~!IsValidForPartyDialog("Jan")
!IsValidForPartyDialog("Imoen2")
!IsValidForPartyDialog("Nalia")~ THEN REPLY #45275 /* ~What plans does Irenicus have? He has proven tightlipped so far.~ */ GOTO 22
  IF ~!IsValidForPartyDialog("Jan")
!IsValidForPartyDialog("Imoen2")
!IsValidForPartyDialog("Nalia")~ THEN REPLY #45276 /* ~His goal is a mystery to me. I know only that he plans to use my divinity in some way.~ */ GOTO 22
  IF ~IsValidForPartyDialog("Jan")~ THEN EXTERN ~JANJ~ 153
  IF ~!IsValidForPartyDialog("Jan")
IsValidForPartyDialog("Imoen2")~ THEN EXTERN ~IMOEN2J~ 17
  IF ~!IsValidForPartyDialog("Jan")
!IsValidForPartyDialog("Imoen2")
IsValidForPartyDialog("Nalia")~ THEN EXTERN ~NALIAJ~ 276
END

IF ~~ THEN BEGIN 22 // from: 21.1 21.0
  SAY #45274 /* ~No doubt he feels a villain is always undone in the exposition. I cannot say I blame him. I have many a dead friend that boasted when silence would have served.~ */
  IF ~~ THEN GOTO 23
END

IF ~~ THEN BEGIN 23 // from: 22.0
  SAY #45277 /* ~From what I saw of his journal and from overhearing chats with Bodhi, I know his destination to be an elven city in the Forest of Tethir... Suldanessellar.~ */
  IF ~~ THEN GOTO 24
END

IF ~~ THEN BEGIN 24 // from: 23.0
  SAY #45278 /* ~What he plans on doing there, exactly, I don't know, but he seems to expect to become more powerful than anything... than the gods even, and that can't be good.~ */
  IF ~!IsValidForPartyDialog("Edwin")
!IsValidForPartyDialog("Aerie")
!IsValidForPartyDialog("Nalia")
!IsValidForPartyDialog("Jan")~ THEN GOTO 12
  IF ~IsValidForPartyDialog("Edwin")~ THEN EXTERN ~EDWINJ~ 108
  IF ~!IsValidForPartyDialog("Edwin")
IsValidForPartyDialog("Aerie")~ THEN EXTERN ~AERIEJ~ 134
  IF ~!IsValidForPartyDialog("Edwin")
!IsValidForPartyDialog("Aerie")
IsValidForPartyDialog("Nalia")~ THEN EXTERN ~NALIAJ~ 277
  IF ~!IsValidForPartyDialog("Edwin")
!IsValidForPartyDialog("Aerie")
!IsValidForPartyDialog("Nalia")
IsValidForPartyDialog("Jan")~ THEN EXTERN ~JANJ~ 156
END

IF ~~ THEN BEGIN 25 // from: 20.0
  SAY #45279 /* ~As you wish, though I fail to see a benefit. It is the magic portal a level below us. The passage to the portal requires the key in his chambers, near the Asylum's former exit. Fare ye well.~ */
  IF ~~ THEN DO ~SetGlobal("TakeSaemonRoute","GLOBAL",1)
EraseJournalEntry(5801)
EraseJournalEntry(5802)
EraseJournalEntry(7045)
EraseJournalEntry(23523)
EraseJournalEntry(15720)
EraseJournalEntry(15719)
EraseJournalEntry(10140)
EraseJournalEntry(22934)
EraseJournalEntry(23404)
ForceSpell(Myself,DRYAD_TELEPORT)~ SOLVED_JOURNAL #7701 /* ~Escaping the Asylum

I released the inmates of the asylum and drove Irenicus off, but I will have to follow. He still has Imoen's soul, and mine.  According to Saemon Havarian, Irenicus has plans in an elven city called Suldanessellar.  The traitor offered to take me to the Forest of Tethir on his ship but I don't trust him.  I will follow the way Irenicus left, through the magic portal below.  If I don't get my soul back, I will die.  Or worse.

I'll need to find the key from Irenicus' bedroom so that I can unlock the door to the portal.~ */ EXIT
END

IF ~~ THEN BEGIN 26 // from: 20.1
  SAY #45280 /* ~That would be a harsh response to my act of charity. I fear I must deny you the pleasure. Fare ye well, I must away.~ */
  IF ~~ THEN DO ~EraseJournalEntry(5801)
EraseJournalEntry(5802)
EraseJournalEntry(7045)
EraseJournalEntry(23523)
EraseJournalEntry(15720)
EraseJournalEntry(15719)
EraseJournalEntry(10140)
EraseJournalEntry(22934)
EraseJournalEntry(23404)
ReallyForceSpell(Myself,DRYAD_TELEPORT)~ SOLVED_JOURNAL #7701 /* ~Escaping the Asylum

I released the inmates of the asylum and drove Irenicus off, but I will have to follow. He still has Imoen's soul, and mine.  According to Saemon Havarian, Irenicus has plans in an elven city called Suldanessellar.  The traitor offered to take me to the Forest of Tethir on his ship but I don't trust him.  I will follow the way Irenicus left, through the magic portal below.  If I don't get my soul back, I will die.  Or worse.

I'll need to find the key from Irenicus' bedroom so that I can unlock the door to the portal.~ */ EXIT
END

IF ~~ THEN BEGIN 27 // from: 20.2
  SAY #45281 /* ~A sensible choice. Allow me to use my magics to penetrate Irenicus' wards, and then teleport us to surface and sun.~ */
  IF ~~ THEN DO ~EraseJournalEntry(5801)
EraseJournalEntry(5802)
EraseJournalEntry(7045)
EraseJournalEntry(23523)
EraseJournalEntry(15720)
EraseJournalEntry(15719)
EraseJournalEntry(10140)
EraseJournalEntry(22934)
EraseJournalEntry(23404)
SetGlobal("TakeSaemonRoute","GLOBAL",1)
StartCutSceneMode()
StartCutScene("Cut41n")~ SOLVED_JOURNAL #4354 /* ~Escaping the Asylum

I released the inmates of the asylum to perform an assault on Irenicus, driving the wizard off for the moment. He still has both Imoen's soul and mine, however, and I must follow. According to Saemon Havarian, Irenicus has plans in an elven city called Suldanessellar. Saemon offered to take me to the Forest of Tethir on his ship, and I have accepted. He may not be trustworthy, but he's all I've got.  If I don't get my soul back, I will die. Or worse.~ */ EXIT
END

IF ~AreaCheck("ar1500")
Global("AsylumPlot","GLOBAL",56)~ THEN BEGIN 28 // from:
  SAY #45520 /* ~Good to see your person well and sound. As you can see, the way is clear and we are free. Now to the business at hand.~ [PPSAEM18] */
  IF ~~ THEN DO ~SetGlobal("SaemonOut","GLOBAL",1)~ GOTO 29
END

IF ~~ THEN BEGIN 29 // from: 28.0
  SAY #45558 /* ~Go about the town and get what supplies you need. We shall meet at the tavern and make our plans for the voyage when you are ready.~ [PPSAEM19] */
  IF ~~ THEN DO ~SetGlobal("AsylumPlot","GLOBAL",60)
ApplySpell(Myself,DRYAD_TELEPORT)~ UNSOLVED_JOURNAL #16563 /* ~Leaving the Island

Saemon suggests I collect whatever gear I require, and when I am ready to leave the island I should speak to him at the tavern.~ */ EXIT
END
