BEGIN YSTMCPTN

/*
IF ~Global("TalkedToYSTMCPTN","GLOBAL",1)
!PartyHasItem("DIVRING")
GlobalTimerExpired("YasraenaCountdown","GLOBAL")~
THEN BEGIN YasraenaKilledNoProof
SAY ~I see that we were correct. The drow's ruse did nothing but buy her more time. She has been executed as she deserved.~
IF ~~ THEN DO ~
EraseJournalEntry(@5015)
EraseJournalEntry(@5018)~
AddJournalEntry(@5022,QUEST_DONE)
EXIT
END
*/

IF ~Global("TalkedToYSTMCPTN","GLOBAL",1)
!PartyHasItem("DIVRING")~
THEN BEGIN NoDivRingYet
SAY ~You have not returned with the necessary proof. Do not delay. The drow dies when the appointed time comes.~
IF ~~ THEN EXIT
END



IF ~Global("TalkedToYSTMCPTN","GLOBAL",1)
PartyHasItem("DIVRING")~
THEN BEGIN GotDivRing
SAY ~You have Divalir's ring! And it still glows! The drow was not lying.~
 ++ ~*The drow's* name is Yasraena!~ GOTO GotDivRing1a
 ++ ~And now you will set Yasraena free!~ GOTO GotDivRing2a
 ++ ~You will release Yasraena and apologize!~ GOTO GotDivRing3a
END

IF ~~ THEN BEGIN GotDivRing1a
SAY ~Of course. Well, you may have her back. I will release her from the spell. We are satisfied.~
IF ~~ THEN DO ~TakePartyItem("DIVRING")
DestroyItem("DIVRING")
SetGlobal("YasraenaRescued","GLOBAL",1)
MoveGlobal("AR0511","YASRAENA",[721.568])
ReallyForceSpell("YSTMCPTN",DRYAD_TELEPORT)
MoveGlobal("AR0018","YSTMELF",[710.509])~ EXIT
END

IF ~~ THEN BEGIN GotDivRing2a
SAY ~Of course. I will release her from the spell. She is free to go. We are satisfied.~
IF ~~ THEN DO ~TakePartyItem("DIVRING")
DestroyItem("DIVRING")
SetGlobal("YasraenaRescued","GLOBAL",1)
MoveGlobal("AR0511","YASRAENA",[721.568])
ReallyForceSpell("YSTMCPTN",DRYAD_TELEPORT)
MoveGlobal("AR0018","YSTMELF",[710.509])~ EXIT
END

IF ~~ THEN BEGIN GotDivRing3a
SAY ~Of course. We are not infallible. I will release her from the spell. This was all a simple mistake.~
IF ~~ THEN DO ~TakePartyItem("DIVRING")
DestroyItem("DIVRING")
SetGlobal("YasraenaRescued","GLOBAL",1)
MoveGlobal("AR0511","YASRAENA",[721.568])
ReallyForceSpell("YSTMCPTN",DRYAD_TELEPORT)
MoveGlobal("AR0018","YSTMELF",[710.509])~ EXIT
END



CHAIN
IF ~InParty("Yasraena")
!StateCheck("Yasraena",STATE_SLEEPING)~
THEN YSTMCPTN ArrestYasraena
~We have tracked you down at last, foul drow! You will answer for the death of Divalir!~ DO ~SetGlobal("TalkedToYSTMCPTN","GLOBAL",1)~
== BYASRAEN
~What? Who are you?~
== YSTMCPTN
~I am Kinalluth, soldier of Suldanessellar, and I have been ordered to track you down and execute you for your crimes.~
== BYASRAEN
~But I have committed no crime! Divalir was taken from me!~
=
~He saved me by allowing himself to be captured!~
== YSTMCPTN
~What is this? A lie? Why would Divalir save you? An elf would never help a drow!~
== BYASRAEN
~You come in the name of justice yet know nothing of it! Divalir was more just than you are, for he looked past my black skin and saw my heart.~
== YSTMCPTN
~Your lies are convenient, for Divalir, the only one who could verify your story, is dead.~
== BYASRAEN
~He is not dead! He was captured and still lives. I know it in my heart.~
=
~Drow unfamiliar to me attacked our raiding party that night. He allowed himself to be taken.~
=
~I only pray that they have not discovered his true identity.~
== YSTMCPTN
~If the drow realize he is a surface elf, he will be eternally tortured.~
=
~But enough of this! You will produce proof of your innocence, or we will avenge Divalir's blood!~
== BYASRAEN
~<CHARNAME>, there is a chance I can prove my innocence. I can prove that Divalir still lives!~
=
~Before Divalir left for Menzoberranzan, before he began living the drow facade, he gave to his friend a ring.  This ring glows as long as Divalir lives. It would tell his friend whether he still lived or had been discovered and killed.~
=
~This ring is here, in Athkatla. It is in the possession of an elf, Nethrin. When I entered Irenicus' Dungeon, he was staying at the Mithrest Inn in Waukeen's Promanade.~
=
~He comes often to Athkalta on business. I pray you will find him there.~
=
~Will you help me, <CHARNAME>?~
END
 ++ ~Of course. We will find this elf and get the proof!~ DO ~SetGlobal("PCSearchNethrin","GLOBAL",1)~ GOTO ArrestYasraena1a
 ++ ~No, Yasraena. I will not help you. Kinalluth, this drow is lying to you. Take her away and execute her!~ DO ~SetGlobal("YasraenaExecuted","GLOBAL",1)~ GOTO ArrestYasraena2a
 ++ ~I will not go on any errand. It is easier to just slay you all!~ DO ~SetGlobal("PCSlaughteredKinalluth","GLOBAL",1)~ GOTO ArrestYasraena3a

CHAIN YSTMCPTN ArrestYasraena1a
~Very well. The drow will be magically imprisoned, and we will await you in the upper rooms of the Five Flagons Inn, in the Bridge District. You have three days!~
== BYASRAEN
~Go quickly, I beg you, <CHARNAME>.~
DO ~AddJournalEntry(@5015,QUEST)SetGlobal("YasraenaArrested","GLOBAL",1)
ClearAllActions()StartCutSceneMode()StartCutScene("YSARREST")~
EXIT


CHAIN YSTMCPTN ArrestYasraena2a
~It is as I thought! You will die this day, drow!~
=
~<CHARNAME>, you have done the elves a great service. We will not forget this.~
== BYASRAEN
~<CHARNAME>, you fiend! There is a horrible punishment in Hell reserved for the traitor! Divalir will avenge my death!~
DO ~SetGlobal("PCBetrayedYasraena","GLOBAL",1)AddJournalEntry(@5016,QUEST)ClearAllActions()StartCutSceneMode() StartCutScene("YSDEATH")~
EXIT

CHAIN YSTMCPTN ArrestYasraena3a
~Fool! You will die this day for consorting with the drow!~
DO ~AddJournalEntry(@5017,QUEST)
Enemy()~
EXIT
