//Hey there. Why you'd be looking through these files I don't know, 
//but anyway, I suggest you don't take examples from here, because
//it is coded in fashion which may be offensive to some.

//This mod's file prefix is 'LK#AR'. LK is my personal prefix.


//The variables used in this mod are:

//  LK#ARQuest - Determines how far along in the quest you are.


//VARIABLES FOR INCLUSION IN LATER VERSIONS
//  LK#ARHapp - Variable that controls the happiness of the 'good' NPCs
//  LK#ARPath - Determines which path you're following- 
//     1 = Good
//     2 = Evil



//Arktohl dialogue
BEGIN LK#ARK

IF ~Global("LK#ARQuest","GLOBAL",2)~ THEN BEGIN FirstMeeting
SAY ~You are here, good... I must make this quick; we have little time. I am Arktohl of the Shadovar, from the city of Shade- one of the great cities of ancient Netheril. We are here to aid you in your quest.~

IF ~~ THEN REPLY ~But Netheril fell to the ground thousands of years ago- how...?~ GOTO PC1.1
IF ~~ THEN REPLY ~As you said, we have no time! Get on with it, already!~ GOTO PC1.2
IF ~~ THEN REPLY ~Look, I haven't the time for this- I must leave for the Temple of Amaunator, and find out what sickens it so.~ GOTO PC1.2
END


IF ~~ THEN BEGIN PC1.1
SAY ~The how is not important- suffice to say the ruler of Shade transported the city to the Plane of Shadow before the Time of Troubles, and has only recently gained a way to access the Material Plane. We seek to close this access.~

IF ~~ THEN REPLY ~Ah, I see- so you intend to use us to help you in this? And I suppose this 'portal' or whatever it is would be located within the Temple of Amaunator?~ GOTO PC1.2
IF ~~ THEN REPLY ~But why? And how did you get here in the first place?~ GOTO PC1.2
IF ~~ THEN REPLY ~And what is to be my part in this?~ GOTO PC1.2
END


IF ~~ THEN BEGIN PC1.2
SAY ~Do you remember when you fought the Shade Lord, and he opened a portal, summoning Shadows from the plane of Shadow?~
=
~Shade dwells in the Plane of Shadow, and the ruler of Shade saw a way he could use this portal to send a group of his most trusted scouts to Toril, in an effort to eventually return Shade, and indeed Netheril, to its former glory. According to Lord Shadow, all inhabitants of Shade worship Shar, Goddess of loss, but there are those of us who still follow the old ways.~
=
~We followed the group Lord Shadow intended to send through the portal and, disguised, we went through the portal behind them. Moments later, you destroyed the Shade Lord, shutting off access to the Plane of Shadow. Both groups of Shadovar were stranded, though the other Shadovar knew not of our presence. They scattered, presumably to find other ways for Shade to return. We came here, and waited.~
=
~When you freed Great Amaunator, his presence was strongest at the Templ, so we returned. He came to us, telling us of your efforts in saving him from the Hate Incarnate, and that we were to aid you in stopping Lord Shadow's advance into the Material Plane. And so we have waited for you, <CHARNAME>, and have watched the movements of the other Shadovar.~
IF ~~ THEN REPLY ~I... I see. So have you found any information which could be useful in stopping Lord Shadow's entrance to the Material Plane?~ GOTO PC1.2.1
IF ~~ THEN REPLY ~And what of Amuana? The Mayor mentioned that the villagers were saying she has been reborn. We were the ones who returned her bones so she could rest. Is she truly back?~ GOTO PC1.2.2
IF ~~ THEN REPLY ~Yes, yes, this is all very interesting, but I have other things to do. Tell me what I need to know and I will go and rid the world of this menace.~ GOTO PC1.2.2
END

IF ~~ THEN BEGIN PC1.2.1
SAY ~Their movements have been erratic; it has been hard to deduce anything. They have been recruiting poor farmers and villagers, though Amaunator knows what for. What we do know is that they have a meeting today. It is lucky you arrived when you did, for I do not know what we would have done had you been late.~

IF ~~ THEN REPLY ~Then we must leave, and find out as much as we can from this meeting. We will figure out how to deal with these Shadovar as we travel.~ GOTO PC1.2.1.1
IF ~~ THEN REPLY ~What part are you and your 'good' Shadovar going to play in this scheme, Arktohl? What is your interest in the matter, why would you care?~ GOTO PC1.2.1.2
IF ~~ THEN REPLY ~I don't have time for this, Arktohl, I have my own quest to follow. Could you not do this on your own?~ GOTO PC1.2.1.3
END

IF ~~ THEN BEGIN PC1.2.2
SAY ~Yes. Amuana's part in this is hard to say, but all the signs tell us that the child is indeed her, though she knows it not. This is not important, however; we must leave, and soon. These other Shadovar have been recruiting poor farmers and villagers, though Amaunator knows what for. There is a meeting occuring this very day, and from it we must gain information.~

IF ~~ THEN REPLY ~Then we must leave, and find out as much as we can. We will figure out how to deal with these Shadovar as we travel.~ GOTO PC1.2.1.1
IF ~~ THEN REPLY ~What part are you and your 'good' Shadovar going to play in this scheme, Arktohl? What is your interest in the matter, why would you care?~ GOTO PC1.2.1.2
IF ~~ THEN REPLY ~I don't have time for this, Arktohl, I have my own quest to follow. Could you not do this on your own?~ GOTO PC1.2.1.3
END

IF ~~ THEN BEGIN PC1.2.1.1
SAY ~The entrance to the temple is infested with Shadows; we are knowledgeable of such things, and will attempt to weaken or destroy as many as we can while we wait for you. Do not tarry, for I fear that all will be lost if we fall.~
=
~(One of Arktohl's companions catches your eye as you move towards the door, and she presses a broken rod into your hands and leaves before you can say anything.)~ 
IF ~~ THEN DO ~SetGlobal("LK#ARTRNS","GLOBAL",3)~ EXIT
END

IF ~~ THEN BEGIN PC1.2.1.2
SAY ~<CHARNAME>, we do not have *time* for such things! We must leave now, lest we miss information which could be crucial to our quest. We have our reasons, believe that.~
=
~The entrance to the temple is infested with Shadows; we are knowledgeable of such things, and will attempt to weaken or destroy as many as we can while we wait for you. Do not tarry, for I fear that all will be lost if we fall.~
=
~(One of Arktohl's companions catches your eye as you move towards the door, and she presses a broken rod into your hands and leaves before you can say anything.)~ 
IF ~~ THEN DO ~SetGlobal("LK#ARTRNS","GLOBAL",3)~ EXIT
END

IF ~~ THEN BEGIN PC1.2.1.3
SAY ~We Shadovar can only do so much before we are discovered, <CHARNAME>- we are not powerful enough for a confrontation, if it happened. Will you aid us, or not?~

IF ~~ THEN REPLY ~Yes, I will. Tell me what I need to know.~ GOTO PC1.2.1.1
IF ~~ THEN REPLY ~I... we cannot, I am afraid to say, Arktohl. We are in a hurry ourselves, and cannot afford to spend too much time doing other peoples quests. I wish you luck in your endeavor, and I sincerely hope you can find someone else to help you.~ GOTO PC1.2.1.3.1
END

IF ~~ THEN BEGIN PC1.2.1.3.1
SAY ~If that is the way it must be... We hope your quest is successful.~ IF ~~ THEN EXIT
END


//In the foresty area, Shadow fight

CHAIN 
IF ~
Global("LK#ARQuest", "GLOBAL", 4)
Global("LK#ARShadows", "GLOBAL", 1)
~
THEN ARKTOHL shadows
~We have weakened them, <CHARNAME>, but it will take more than that to defeat them!~
EXIT


CHAIN 
IF ~
Global("LK#ARQuest", "GLOBAL", 4)
Global("LK#ARShadows", "GLOBAL", 2)
~
THEN ARKTOHL shadows_defeated
~Let us go down into the Temple, and discover what information we can.~ THEN DO ~DestroySelf()~
EXIT


IF ~
Global("NeriaSummoning", "LK#TEM", 6)
~
THEN BEGIN scroll
~I... I apologise for not telling you earlier, <CHARNAME>...~

++ ~Damn you, Shadovar, you could have got us killed!~ THEN GOTO PC1.1
++ ~What was that about, Arktohl? 'My love'? Were you and this... this 'Neria' involved?~ GOTO PC1.1
++ ~Its alright, Arktohl... we all have our sordid histories, I suppose. Let us get going.~ GOTO PC1.2
END

IF ~~ THEN BEGIN ARKTOHL PC1.1
SAY ~I... there is nothing to say, <CHARNAME>. We all have our sordid histories... and I apologise for shocking you with mine so suddenly.~

++ ~I do not know if I can trust you, knowing this... how do I know you won't betray me to her?~ GOTO PC1.1.1
++ ~It's alright, Arktohl... I too have a somewhat sordid history. I understand what it is like to have a dark love.~ GOTO PC1.1.2
++ ~(From between clenched teeth) I trust you will tell me of any further... sordid histories, as you put it?~ GOTO PC1.1.1
END

IF ~~ THEN BEGIN ARKTOHL PC1.2
SAY ~In his haste to escape, it seems, Iros left this scroll... I will take it back to the Inn with me. Come as soon as is possible, we have much to discuss.~ EXIT
END

IF ~~ THEN BEGIN PC1.1.1
SAY ~There is no way for you to trust me, <CHARNAME>- you will just have to let your feelings guide you. Right now, I and the other good Shadovar know how these people think; we know... have known, them. Look into my eyes and tell me I am lying.~

++ ~I trust you, Arktohl... but please inform me if you have anything that could be helpful next time, alright? Now... what were you going to say?~ GOTO PC1.2
++ ~I don't trust you, but I have no choice in the matter. I will aid you, until I can be sure of your treachery... when I will strike you down. Do not betray me, Arktohl- those who do suffer a fate worse than death.~ GOTO PC1.1.1.1
END

IF ~~ THEN BEGIN PC1.1.1.1
SAY ~I understand. I will not betray you, <CHARNAME>.~ THEN GOTO PC1.2
END