//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


//AR1100.BAF
IF
     Alignment("Player1",MASK_GOOD)
     Global("LK#ARQuest",0)
     Global("LK#ARArkExists",0)
     Dead("SHADEL")
THEN
     RESPONSE #100
           SetGlobal("LK#ARQuest",1)
           SetGlobal("LK#ARArkExists",1)
           CreateCreature("lk#ark",[-1.-1],0)
END

//LK#ARK.BAF

IF
See([PC])
NumTimesTalkedTo(0)
THEN
RESPONSE #100
Dialogue(Nearest([PC]))
END


IF
See([PC])
Global("LK#ARQuest",2")
THEN
RESPONSE #100
Dialogue(Nearest([PC]))
END




//Arktohl dialogue
BEGIN ~LK#ARK~

IF ~
Global("LK#ARQuest",1)
~
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.~

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

++ ~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?~ THEN GOTO PC1.2
++ ~But why? And how did you get here in the first place?~ THEN GOTO PC1.2
++ ~And what is to be my part in this?~ THEN 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 Temple, 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.~

++ ~I... I see. So have you found any information which could be useful in stopping Lord Shadow's entrance to the Material Plane?~ THEN GOTO PC1.2.1
++ ~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?~ THEN GOTO PC1.2.2
++ ~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.~ THEN 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.~

++ ~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.~ THEN GOTO PC1.2.1.1
++ ~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?~ THEN GOTO PC1.2.1.2
++ ~I don't have time for this, Arktohl, I have my own quest to follow. Could you not do this on your own?~ THEN 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.~

++ ~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.~ THEN GOTO PC1.2.1.1
++ ~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?~ THEN GOTO PC1.2.1.2
++ ~I don't have time for this, Arktohl, I have my own quest to follow. Could you not do this on your own?~ THEN 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 ~SetGlobal("LK#ARTRNS",1)~ EXIT

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 ~SetGlobal("LK#ARTRNS",1)~ EXIT

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?~

++ ~Yes, I will. Tell me what I need to know.~ THEN GOTO PC1.2.1.1
++ ~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.~ THEN GOTO PC1.2.1.3.1

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