BEGIN dggERMQG //Alignment(Player1,MASK_EVIL) -> checks for Evil alignmnent

//////////////////////////////////
//Starting Quest
/////////////////////////////////

IF ~Global("ggERMQstarted","Global",0)~ THEN BEGIN 0
	SAY ~Ah, <CHARNAME>, you’re arrived. I’m sure you are busy, so I’ll cut to the chase. The Shadow Thieves and Cowled Wizards run this city, despite what the Council of Six would have you believe. They operate without any sort of oversight, free to extend their tyranny in any way they wish. And there is a grave insult to justice in Athkatla - between the corruption in this city and the red-tape preventing the Order of the Radiant Heart from acting in a timely manner, many a criminal has gotten away with their crimes. I would rectify this. I’m not naïve enough to think I can take on the entire Cowled Wizards or Shadow Thieves, but this city needs any justice that we can deliver.~
	++ ~What would you have me do?~ GOTO 1
	++ ~This sounds sketchy.~ GOTO 1
	++ ~What will I get out of this?~ GOTO 2
	++ ~I accept.~ GOTO 3
	++ ~I'm not doing this.~ GOTO 4
END

IF ~~ THEN BEGIN 1
	SAY ~Nothing I would ask is necessarily illegal - unless you choose to break the law yourself. But I would prefer that you avoid that, if you can. Athkatla is chaotic enough as it is.~
		++ ~What will I get out of this?~ GOTO 2
		++ ~I accept.~ GOTO 3
		++ ~I'm not doing this.~ GOTO 4
END

IF ~~ THEN BEGIN 2
	SAY ~Aside from the satisfaction of delivering justice where the city and the Order have failed? The Temple of Lathander is one of the wealthier temples in Athkatla. And I’m an alchemist; I can reward you with potions of various kinds. And finally, when we get to the... bounty hunting, you can keep whatever items the target has. Is that reward enough for you?~
	++ ~What would you have me do?~ GOTO 1
	++ ~This sounds sketchy.~ GOTO 1
	++ ~I accept.~ GOTO 3
	++ ~I'm not doing this.~ GOTO 4
END

IF ~~ THEN BEGIN 4
	SAY ~That’s unfortunate. I will be here should you change your mind.~ IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 3
	SAY ~Excellent! I am still following up on a lead better suited for your skills, but I do have something for you right now. In Athkatla, the rich stay rich and the poor stay poor. The rich hoard their wealth as jealously as dragons - and, like dragons, there are a few that don't need even half of it. I want you to get a particular noble to start paying their fair share.~
	++ ~So, in other words, you want me to convince them to pay their taxes?~ GOTO 5
	++ ~This definitely sounds illegal.~ GOTO 6
	++ ~I'm not doing this.~ GOTO 4
END

IF ~~ THEN BEGIN 6
	SAY ~It doesn't have to be - there are many legal forms of persuasion, <CHARNAME>. If you can't think of how to do this legally, that shows an incredible lack of creativity and imagination on your part.~
	++ ~So, in other words, you want me to convince them to pay their taxes?~ GOTO 5
	++ ~I'm not doing this.~ GOTO 4
END

IF ~~ THEN BEGIN 5
	SAY ~By Lathander, no. Taxes in Athkatla don't better the city; they fund corruption. I want you to get her to donate more to the temple of Ilmater. A recurring donation is better than a one-time donation, of course, but anything is better than nothing.~
	++ ~And if she refuses to donate even once?~ GOTO 7
	++ ~I'm not doing this.~ GOTO 4
	++ ~I'll do it.~ GOTO 8
END

IF ~~ THEN BEGIN 7
	SAY ~There are many ways to persuade someone... and if that doesn't work, I'm sure she has a few trinkets she won't miss. I'd be happy to make a donation in her honor. Anonymously, of course.~
	++ ~I'm not doing this.~ GOTO 4
	++ ~I'll do it.~ GOTO 8
END

IF ~~ THEN BEGIN 8
	SAY ~Excellent! Your first target is Cecilia. You can likely find her wandering around the Governmnet District. Good luck, <CHARNAME>.~
IF ~~ THEN DO ~
	AddJournalEntry(@5100, QUEST) SetGlobal("ggERMQstarted","Global",1) SetGlobal("ggERMQstep", "Global", 1)~ EXIT //first journal entry
END

//////////////////////////////////
//Off to the First Noble 10s
/////////////////////////////////

IF ~OR(3) Global("ggERMQstep", "Global", 1) Global("ggERMQstep", "Global", 2) Global("ggERMQstep", "Global", 3)~ THEN BEGIN 10
	SAY ~Ah, <CHARNAME>, you're back. Good to see you. How goes the task?~
	+~!Global("ggERMQstep", "Global", 3)~+ ~Still working on it.~ GOTO 11
	//if have item ~She made a one-time donation, which I have here.~ GOTO 12
	+~Global("ggERMQstep", "Global", 3)~+ ~Mission accomplished.~ GOTO 12
END

IF ~~ THEN BEGIN 11
	SAY ~Well, then, let me know when you're successful.~ IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 12
	SAY ~Excellent! Thank you, <CHARNAME>. I got another person for you; Sir Elisandran is in the Order of the Radiant Heart. He's wealthy, even by Order standards. I doubt he needs all of his wealth.~
IF ~~ THEN DO ~
	AddJournalEntry(@5103, QUEST) SetGlobal("ggERMQstep", "Global", 4)~ EXIT
END

//////////////////////////////////
//Off to the Knight 20s
/////////////////////////////////
IF ~OR(3) Global("ggERMQstep", "Global", 5) Global("ggERMQstep", "Global", 6) ~ THEN BEGIN210
	SAY ~Ah, <CHARNAME>, you're back. Good to see you. How goes the task?~
	+~!Global("ggERMQstep", "Global", 6)~+ ~Still working on it.~ GOTO 21
	//if have item ~She made a one-time donation, which I have here.~ GOTO 22
	+~Global("ggERMQstep", "Global", 6)~+ ~Mission accomplished.~ GOTO 22
END

IF ~~ THEN BEGIN 21
	SAY ~Well, then, let me know when you're successful.~ IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 22
	SAY ~Excellent! Thank you, <CHARNAME>. You might wonder why I sent you off to collect donations for a Temple that isn't even mine. The Ilmateri do good in Athkatla , helping those who have been mistreated in one way or another. But I had a slightly selfish motivation as well. These next tasks I send you on are going to be dangerous, and there is a very real chance you may die. I wanted to give you the opportunity to be helpful and make some sort of impact before I threw you to the wolves... or at a Zhentarim agent, in this case. This particular Zhent has eluded justice for far too long. I want you to deal with him--and remember, <CHARNAME>, the only good Zhent is a dead one.~
IF ~~ THEN DO ~
	AddJournalEntry(@5106, QUEST) SetGlobal("ggERMQstep", "Global", 7)~ EXIT
END


//////////////////////////////////
//Shent agent
/////////////////////////////////
IF ~Global("ggERMQstep", "Global", 7) ~ THEN BEGIN 30
	SAY ~Ah, <CHARNAME>, you're back and still alive, I see. How goes the task?~
	+~!Dead("ggERShentA")~+ ~Still working on it.~ GOTO 31
	+~Dead("ggERShentA") !PartyHasItem("GGERDaE") ~+ ~Mission accomplished. I also found these documents on the agent.~ GOTO 32
	+~Dead("ggERShentA") PartyHasItem("GGERDaE")~+ ~Mission accomplished. I also found these documents and this dagger on the agent.~ GOTO 33
END

IF ~~ THEN BEGIN 31
	SAY ~Well, then, let me know when you're successful.~ IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 32
	SAY ~Let me see those! Interesting... interesting... <CHARNAME>, do you know what you found? These documents contain the meeting place for the Lone Bridge Bandits! They're a band of rogues and slavers, and appearently, they have their meetings in the Docks District! Unsurprising that a Zhent would be working with them. I want you to go deal with them. It may be worthwhile to speak with Brega in the Council of Six building. If these bandits are working with the Black Network, they may have useful information. If you can convince Brega to give them immunity in exchange for information... well, we won't be bringing the bandits to justice, but if we could get a lead on Zhentarim activity in Athkatla, I think it's a worthwhile trade. Should you find any documents, however, do bring them to me. I'd like to take a look before Brega does.~
IF ~~ THEN DO ~
	AddJournalEntry(@5107, QUEST) SetGlobal("ggERMQstep", "Global", 8)~ EXIT
END

IF ~~ THEN BEGIN 33
	SAY ~Let me see those! This dagger... It's very evil, but I could purify it for you. Though it will take me some time, so you'll have to retrieve it from me later. As for the documents... Interesting... interesting... <CHARNAME>, do you know what you've found? These documents contain the meeting place for the Lone Bridge Bandits! They're a group of bandits and slavers, and appearently, they have their meetings in the Bridge District! Unsprising that a Zhent would be working with them. I want you to go deal with them. It may be worthwhile to speak with Brega in the Council of Six building. If these bandits are working with the Black Network, they may have useful information. If you can convince Brega to give them immunity in exchange for information... well, we won't be bringing the bandits to justice, but if we could get a lead on Zhentarim activity in Athkatla, I think it's a worthwhile trade. Should you find any documents, however, do bring them to me. I'd like to take a look before Brega does.~
	++ ~Yes, please purify it.~ GOTO 34
	++ ~No, I'll keep the dagger as-is.~ GOTO 35
END

IF ~~ THEN BEGIN 34
	SAY ~Alright, hand it over. Let me see if this evil can be removed... Not all evil can be so easily dispelled, I fear, but I'll do my best. Now, go take care of those bandits.~
IF ~~ THEN DO ~
	AddXPObject(Player1,5000) AddXPObject(Player2,5000) AddXPObject(Player3,5000) AddXPObject(Player4,5000) AddXPObject(Player5,5000) AddXPObject(Player6,5000) AddJournalEntry(@5107, QUEST) TakePartyItem("GGERDaE") SetGlobal("ggERMQstep", "Global", 8) SetGlobal("ggDaggerEvil","GLOBAL",0) IncrementGlobal("ggRedemptionPoints","GLOBAL",1)~ EXIT
END

IF ~~ BEGIN 35
	SAY ~Very well. If you use it for a just cause, perhaps its evil can be redeemed, in a sense. Now, go take care of those bandits.~
IF ~~ THEN DO ~
	AddJournalEntry(@5107, QUEST) SetGlobal("ggERMQstep", "Global", 8) SetGlobal("ggDaggerEvil","GLOBAL",1) IncrementGlobal("ggRedemptionPoints","GLOBAL",1)~ EXIT
END



//////////////////////////////////
//CATCHYNAME bandits 40s
/////////////////////////////////
IF ~Global("ggERMQstep", "Global", 8) ~ THEN BEGIN 40
	SAY ~Ah, <CHARNAME>, you're back and still alive, I see. How goes the task?~
	+~!Dead("ggERbanditL")~+ ~Still working on it.~ GOTO 41
	+~Dead("ggERbanditL")~+ ~Mission accomplished. I also found these encoded documents on the bandit leader.~ GOTO 42
END

IF ~~ THEN BEGIN 41
	SAY ~Well, then, let me know when you're successful.~ IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 42
	SAY ~Excellent! Let me take a look at these.... Hm. They're encoded. I want you to take these to a Glyphscribe. There's one visiting the Temple of Oghma in the Docks District. See if he's willing to decipher the documents for us.~
IF ~~ THEN DO ~
	AddJournalEntry(@5108, QUEST) SetGlobal("ggERMQstep", "Global", 10) ~ EXIT
END

//////////////////////////////////
//dropping off the documents 50s
/////////////////////////////////
IF ~OR(2) Global("ggERMQstep", "Global", 10) Global("ggERMQstep", "Global", 11) ~ THEN BEGIN 50
	SAY ~Ah, <CHARNAME>, you're back. How goes the delivery?~
	+~Global("ggERMQstep", "Global", 10)~+ ~Still working on it.~ GOTO 51
	+~Global("ggERMQstep", "Global", 11) Global("ggDaggerEvil","GLOBAL",0)~+ ~The Glyphscribe agreed to decode them.~ GOTO 52
	+~Global("ggERMQstep", "Global", 11) Global("ggDaggerEvil","GLOBAL",1)~+ ~The Glyphscribe agreed to decode them.~ GOTO 53
END

IF ~~ THEN BEGIN 51
	SAY ~Let me know when you've completed that little errand. I'll have something interesting for you afterwards.~ IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 52
	SAY ~Perfect. Onto the next thing: I have two tasks for you. I looked into the bandits, and one of them was missing. A certain Lenovola the Butcher. I heard rumors that she had fled Athkatla, and it seems that the rumors are correct. She likely fled to her old stomping grounds in the Umar Hills. See if you can find her. I've also heard rumors of a group of monsters who supposedly defected from the Sythillisian army. Kill them before they can cause any trouble. Oh, and I was able to purify that dagger for you. I hope it proves useful.~
IF ~~ THEN DO ~ //add item once it exists
	AddJournalEntry(@5110, QUEST) GiveItemCreate("GGERDaG",Player1,1,1,0) SetGlobal("ggERMQstep", "Global", 12) ~ EXIT
END

IF ~~ THEN BEGIN 53
	SAY ~Perfect. Onto the next thing. I have two tasks for you. I looked into the bandits, and one of them was missing. A certain Lenovola the Butcher. I heard rumors that she had fled Athkatla, and it seems the rumors are correct. She likely fled to her old stomping grounds in the Umar Hills. See if you can find her. I've also heard rumors of a group of monsters who supposedly defected from the Sythillisian army. Kill them before they can cause any trouble.~ //the dread CANNIBALNAME!
IF ~~ THEN DO ~
	AddJournalEntry(@5110, QUEST) SetGlobal("ggERMQstep", "Global", 12) ~ EXIT
END

//////////////////////////////////
//Umar Hills 60s
/////////////////////////////////
IF ~Global("ggERMQstep", "Global", 12)~ THEN BEGIN 60
	SAY ~Ah, <CHARNAME>, you're back. How goes the mission?~
	+~Global("ggERMQstep", "Global", 12) !Dead("ggerCannibal")~+ ~Still working on it.~ GOTO 61
	+~Global("ggERMQstep", "Global", 12) Dead("ggerCannibal") Dead("madulf")~+ ~Lenovola the Butcher and the deserters are dead.~ GOTO 62
	+~Global("ggERMQstep", "Global", 12) Dead("ggerCannibal") Global("Lloydy","GLOBAL",1)~+ ~Lenovola the Butcher is dead, but the deserters weren't a threat. They wanted to be left in peace - to protect Imnesvale and live among them, even. I believe that they can be redeemed, so I let them live.~ GOTO 63
	+~Global("ggERMQstep", "Global", 12) Dead("ggerCannibal") Global("OgreAlliance","GLOBAL",1)~+ ~Lenovola the Butcheris dead, but the deserters weren't a threat. They wanted to be left in peace - to protect Imnesvale and live among them, even. I believe that they can be redeemed, so I let them live.~ GOTO 63
END

IF ~~ THEN BEGIN 61
	SAY ~Well, then, let me know when you're successful.~ IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 62 //all dead
	SAY ~Perfect work, as always <CHARNAME>. I'm asking you to go to the Small Teeth Pass next. There's a Shadow Druid there that's been trying to kill travellers, and he's usually rather successful. I want you to deliver justice.~
IF ~~ THEN DO ~
	AddJournalEntry(@5113, QUEST) SetGlobal("ggERMQstep", "Global", 13) ~ EXIT
END

IF ~~ THEN BEGIN 63
	SAY ~<CHARNAME>, you WHAT?! By the Morninglord, why would you do such a thing?!~
	++ ~Because they wanted to change. Doesn't everyone deserve the opportunity to redeem themselves?~ GOTO 64
	++ ~Because they agreed to protect Imnesvale. Sure they've probably done evil in the past, but that doesn't mean they have to keep doing evil.~ GOTO 64
	++ ~I just didn't want to.~ GOTO 65
	++ ~Well, they didn't want to fight, and I'm not about to attack someone for no reason. That's dishonorable.~ GOTO 66
END

IF ~~ THEN BEGIN 64
	SAY ~I hope so, <CHARNAME>. Truly, I do. I'm asking you to go to the Small Teeth Pass next. There's a Shadow Druid there that's been trying to kill travellers, and he's usually rather successful. I want you to deliver justice.~
IF ~~ THEN DO ~
	AddJournalEntry(@5113, QUEST) RevealAreaOnMap("AR1700") SetGlobal("ggERMQstep", "Global", 13) IncrementGlobal("ggRedemptionPoints","GLOBAL",1)~ EXIT
END

IF ~~ THEN BEGIN 65
	SAY ~Well, let's hope that they don't decide that they want to destroy Imnesvale, shall we? There are lives at stake here, <CHARNAME>! I'm asking you to go to the Small Teeth Pass next. There's a Shadow Druid there that's been trying to kill travellers, and he's been rather successful. I want you to deliver justice for his victims.~
IF ~~ THEN DO ~
	AddJournalEntry(@5113, QUEST) RevealAreaOnMap("AR1700") SetGlobal("ggERMQstep", "Global", 13) ~ EXIT
END

IF ~~ THEN BEGIN 66
	SAY ~There are lives at stake, here. Let's hope they share your sense of honor, because if they don't, <CHARNAME>, and they attack the village, it will be a slaughter. I'm asking you to go to the Small Teeth Pass next. There's a Shadow Druid there that's been trying to kill travellers, and he's usually rather successful. I want you to deliver justice.~
IF ~~ THEN DO ~
	AddJournalEntry(@5113, QUEST) SetGlobal("ggERMQstep", "Global", 13) RevealAreaOnMap("AR1700") ~ EXIT
END

//////////////////////////////////
//Shadow Druid 70s
/////////////////////////////////
IF ~OR(2) Global("ggERMQstep", "Global", 14) Global("ggERMQstep", "Global", 13)~ THEN BEGIN 70
	SAY ~Ah, <CHARNAME>, you're back. How goes the mission?~
	+~Global("ggERMQstep", "Global", 13) !Dead("ggERSD")~+ ~Still working on it.~ GOTO 71
	+~Global("ggERMQstep", "Global", 13) Dead("ggERSD")~+ ~The Shadow Druid is dead.~ GOTO 72
	+~Global("ggERMQstep", "Global", 14) !Dead("ggERSD")~+ ~I spared him. The Shadow Druid agreed to go to the Druid Grove near Trademeet.~ GOTO 73
END

IF ~~ THEN BEGIN 71
	SAY ~Well, then, let me know when you're successful.~ IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 72
	SAY ~Perfect work, as always <CHARNAME>. I took the liberty to pick up the decoded documents from the Glyphscribe. The documents point to a Shadow Thief rendezvous at the Five Flagons! And these particular ones are... particularly notorious, even by Shadow Thief standards. You know what you have to do, don't you? Deliver justice.~
IF ~~ THEN DO ~
	AddJournalEntry(@5115, QUEST) SetGlobal("ggERMQstep", "GLOBAL", 15) ~ EXIT
END

IF ~~ THEN BEGIN 73
	SAY ~<CHARNAME>, you WHAT?! By the Morninglord, why would you do such a thing?!~
	++ ~Because Shadow Druids are misguided. He agreed to listen to the good druids at the Grove. There's a chance he could change.~ GOTO 74
	++ ~I didn't want to kill him.~ GOTO 75
END

IF ~~ THEN BEGIN 74
	SAY ~Change? I hope so, <CHARNAME>. Truly, I do. I took the liberty of picking up those documents from the Glyphscribe - decoded, they speak of a Shadow Thief rendezvous at the Five Flagons! And these thieves are... notorious, even by the standards of their fellows. You know what you have to do, don't you? Deliver justice.~
IF ~~ THEN DO ~
	AddXPObject(Player1,10000) AddXPObject(Player2,10000) AddXPObject(Player3,10000) AddXPObject(Player4,10000) AddXPObject(Player5,10000) AddXPObject(Player6,10000) AddJournalEntry(@5115, QUEST) SetGlobal("ggERMQstep", "Global", 15) IncrementGlobal("ggRedemptionPoints","GLOBAL",1)~ EXIT
END

IF ~~ THEN BEGIN 75
	SAY ~Well, let's hope that he decides that he stops wanting to kill people, hm? I took the liberty of picking up those documents from the Glyphscribe - decoded, they speak of a Shadow Thief rendezvous at the Five Flagons! And these thieves are... notorious, even by the standards of their fellows. You know what you have to do, don't you? Deliver justice.~
IF ~~ THEN DO ~
	AddXPObject(Player1,10000) AddXPObject(Player2,10000) AddXPObject(Player3,10000) AddXPObject(Player4,10000) AddXPObject(Player5,10000) AddXPObject(Player6,10000) AddJournalEntry(@5115, QUEST) SetGlobal("ggERMQstep", "Global", 15) ~ EXIT
END


//////////////////////////////////
//Shadow Thieves 80s
/////////////////////////////////
IF ~Global("ggERMQstep", "Global", 15)~ THEN BEGIN 80
	SAY ~Ah, <CHARNAME>, you're back. How goes the mission?~
	+~!Dead("ggERSTL")~+ ~Still working on it.~ GOTO 81
	+~Dead("ggERSTL") Dead("ggERSTT")~+ ~The Shadow Thieves are all dead. One of them turned out to be a double agent, but she's also dead.~ GOTO 82
	+~Dead("ggERSTL") !Dead("ggERSTT")~+ ~The Shadow Thieves are all dead. One of them turned out to be a double agent, and so I let her live.~ GOTO 83
END

IF ~~ THEN BEGIN 81
	SAY ~Well, then, let me know when you're successful.~ IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 82
	SAY ~Perfect work, as always <CHARNAME>. I have bad news. There's a high-ranking Zhent mage in Athkatla, named Cassilor. I don't know where he is, but he does like his luxuries. He's probably some place expensive. I want you to find him and kill him. Remember, the only good Zhent is a dead one. Good luck.~
IF ~~ THEN DO ~
	ReputationInc(1) AddJournalEntry(@5116, QUEST) SetGlobal("ggERMQstep", "Global", 16) ~ EXIT
END

IF ~~ THEN BEGIN 83
	SAY ~Truly, <CHARNAME>? Do you truly believe that someone like a Shadow Thief can be redeemed?~
	++ ~Everyone can change, Eloran.~ GOTO 84
	++ ~I don't know, but I thought it was worth giving him a chance.~ GOTO 84
	++ ~Of course not. I just didn't like the odds if he was against me as well.~ GOTO 85
END

IF ~~ THEN BEGIN 84
	SAY ~I hope you're right, <CHARNAME>. Truly, I do. I have bad news. There's a high-ranking Zhent mage in Athkatla, named Cassilor. I don't know where he is, but he does like his luxuries. He's probably some place expensive. I want you to find him and kill him. Remember, the only good Zhent is a dead one. Good luck.~
IF ~~ THEN DO ~
	ReputationInc(1) AddJournalEntry(@5116, QUEST) SetGlobal("ggERMQstep", "Global", 16) IncrementGlobal("ggRedemptionPoints","GLOBAL",1)~ EXIT
END

IF ~~ THEN BEGIN 85
	SAY ~Well, I can't say that I like the odds of him committing more atrocities in the future. <CHARNAME>, do you know what kind of person you just spared? I have bad news. There's a high-ranking Zhent mage in Athkatla, named Cassilor. I don't know where he is, but he does like his luxuries. He's probably some place expensive. I want you to find him and kill him. Remember, the only good Zhent is a dead one. Good luck.~
IF ~~ THEN DO ~
	ReputationInc(1) AddJournalEntry(@5116, QUEST) SetGlobal("ggERMQstep", "Global", 16) ~ EXIT
END



//////////////////////////////////
//More Zhents. Revealed that Eloran used to be a Zhent herself!  90s
/////////////////////////////////
IF ~Global("ggERMQstep", "Global",16) ~ THEN BEGIN 90
	SAY ~Ah, <CHARNAME>, you're back and still alive, I see. How goes the task?~
	+~!Dead("ggERSL")~+ ~Still working on it.~ GOTO 91
	+~Dead("ggERSL")~+ ~I killed the Zhentarim, though their leader had some interesting things to say.~ GOTO 100
END

IF ~~ THEN BEGIN 91
	SAY ~Well, then, let me know when you're successful.~ IF ~~ THEN EXIT
END

//////////////////////////////////
//Finale 100s
/////////////////////////////////

IF ~~ THEN BEGIN 100
	SAY ~Yes, I thought he might tell you some interesting things. I suppose it's time to tell you some things myself.~
	+~Alignment(Player1,LAWFUL_EVIL)~+ ~Continue.~ GOTO evilPersuadeLE
	+~Alignment(Player1,NEUTRAL_EVIL)~+ ~Continue.~ GOTO evilPersuadeNE
	+~Alignment(Player1,CHAOTIC_EVIL)~+ ~Continue.~ GOTO evilPersuadeCE	
	+~!Alignment(Player1,MASK_EVIL)~+ ~Continue.~ GOTO goodPersuade
END

////////////////////////////////
// Finale for Good Characters
///////////////////////////////

IF ~~ THEN BEGIN goodPersuade
	SAY ~I was once a Zhent, and among the worst of them. I was very, very good at it, and I did things I dare not speak them aloud. I'm not a Zhent anymore - or at least... well. Once a Zhent, always a Zhent, so they say. And it's like I've said. The only good Zhent is a dead Zhent.~
	+~GlobalGT("ggRedemptionPoints","GLOBAL",3)~+ ~Continue.~ GOTO goodPersuadeSuccess
	+~Global("ggRedemptionPoints","GLOBAL",3)~+ ~Continue.~ GOTO goodPersuadeCheck
	+~OR(3) Global("ggRedemptionPoints","GLOBAL",0) Global("ggRedemptionPoints","GLOBAL",1) Global("ggRedemptionPoints","GLOBAL",2)~+ ~Continue.~ GOTO goodPersuadeMegaFail
END

IF ~~ THEN BEGIN goodPersuadeMegaFail
	SAY ~But I've tried, <CHARNAME>. I really have. I converted to Lathander for a chance, and this entire... thing we did together was another attempt to redeem myself, but... well. Once a Zhent, always a Zhent, and the only good Zhent is a dead Zhent. I have one final task for you. I have this poison here, and I want you to witness my death.~
	+~OR(5) CheckStatGT(Player1,15,DEX) InParty("Keldorn") InParty("Jaheira") InParty("Yoshimo") InParty("Imoen")~+ ~Eloran, no! Give us the poison! (try to take the poison from her)~ GOTO goodFailureLivingFinale
	+~!CheckStatGT(Player1,15,DEX) !InParty("Keldorn") !InParty("Jaheira") !InParty("Yoshimo") !InParty("Imoen")~+ ~Eloran, no! Give us the poison! (try to take the poison from her)~ GOTO goodFailureDeadFinale
	++ ~(Do nothing, but watch.)~ GOTO noActDeadFinale
END

//goodPersuade Success
IF ~~ THEN BEGIN goodPersuadeSuccess
	SAY ~But I've tried, <CHARNAME>. I really have. I converted to Lathander for a chance, and this entire... thing we did together was another attempt to redeem myself, but... well. Once a Zhent, always a Zhent, and the only good Zhent is a dead Zhent. I have one final task for you. I have this poison here, and I want you to witness my death.~
	++ ~Eloran, you have already redeemed yourself. Have faith in yourself. Or at least, have faith in Lathander--what you are doing now and the reasons behind it goes against nearly everything he stands for.~ GOTO goodSuccessFinale
	++ ~(Do nothing, but watch.)~ GOTO noActDeadFinale
END


//goodPersuade PartyCheck
IF ~~ THEN BEGIN goodPersuadeCheck
	SAY ~But I've tried, <CHARNAME>. I really have. I converted to Lathander for a chance, and this entire... thing we did together was another attempt to redeem myself, but... well.~
	+~OR(7)InParty("Keldorn") InParty("Rasaad") InParty("Jaheira") Class(Player1, PALADIN) Class(Player1, CLERIC) Class(Player1, MONK) CheckStatGT(Player1,15,CHR) ReputationGT(Player1,15)~+ ~Continue.~ GOTO goodPersuadeCheckSuccess
	+~!InParty("Keldorn") !InParty("Rasaad") !InParty("Jaheira") !Class(Player1, PALADIN) !Class(Player1, CLERIC) !Class(Player1, MONK) !CheckStatGT(Player1,15,CHR) !ReputationGT(Player1,15)~+ ~Continue.~ GOTO goodPersuadeCheckFail
END

//goodPersuade Success 2, saved by companions/Player class
CHAIN IF ~~ THEN dggERMQG goodPersuadeCheckSuccess
	~Once a Zhent, always a Zhent, and the only good Zhent is a dead Zhent. I have one final task for you. I have this poison here, and I want you to witness my death.~
	== KeldorJ IF ~InParty("Keldorn")~ THEN ~Your death would not bring justice, Eloran! Think!~
	== Rasaad IF ~InParty("Rasaad")~ THEN ~Don't! You are showing a lack of faith in both yourself and the Morninglord!~
	== JaheiraJ IF ~InParty("Jaheira")~ THEN ~You have already redeemed yourself! As a Harper, I know this.~ //maybe something about the Balance?
END
	++ ~Eloran, you have already redeemed yourself. Have faith in yourself. Or at least, have faith in Lathander--what you are doing now and the reasons behind it goes against nearly everything he stands for.~ GOTO goodSuccessFinale
	++ ~(Do nothing, but watch.)~ GOTO noActDeadFinale

APPEND dggERMQG 

///good character sucks to suck
IF ~~ THEN BEGIN goodPersuadeCheckFail
	SAY ~Once a Zhent, always a Zhent, and the only good Zhent is a dead Zhent. I have one final task for you. I have this poison here, and I want you to witness my death.~
	+~OR(5) CheckStatGT(Player1,15,DEX) InParty("Keldorn") InParty("Jaheira") InParty("Yoshimo") InParty("Imoen")~+ ~Eloran, no! Give us the poison! (try to take the poison from her)~ GOTO goodFailureLivingFinale
	+~!CheckStatGT(Player1,15,DEX) !InParty("Keldorn") !InParty("Jaheira") !InParty("Yoshimo") !InParty("Imoen")~+ ~Eloran, no! Give us the poison! (try to take the poison from her)~ GOTO goodFailureDeadFinale
END

IF ~~ THEN BEGIN goodSuccessFinale
	SAY ~Perhaps... Do you really have that much faith in me, <CHARNAME>, even now knowing what I am - what I was? You believe that I still should have a chance? I... I need to think on this. And I can't stay in Athkatla any longer, now that the Zhentarim know I'm here. Goodbye, <CHARNAME>. And thank you.~
IF ~~ THEN DO ~
	AddJournalEntry(@5118, QUEST) EscapeArea() AddXPObject(Player1,45000) AddXPObject(Player2,45000) AddXPObject(Player3,45000) AddXPObject(Player4,45000) AddXPObject(Player5,45000) AddXPObject(Player6,45000)~ EXIT
END

IF ~~ THEN BEGIN goodFailureDeadFinale
	SAY ~Did you really think you could stop me? <CHARNAME>, you have dealt decisively with each and every villain in your path - why should I be different? If you had even the slightest idea of what I had done... no. I appreciate that you tried, but this, <CHARNAME>, is goodbye.~
IF ~~ THEN DO ~
	AddJournalEntry(@5117, QUEST) Kill(Myself) AddXPObject(Player1,45000) AddXPObject(Player2,45000) AddXPObject(Player3,45000) AddXPObject(Player4,45000) AddXPObject(Player5,45000) AddXPObject(Player6,45000)~ EXIT
END
END

CHAIN IF ~~ THEN dggERMQG goodFailureLivingFinale
	~What?! No! Stop that! Do you have any idea how long that poison took me to make?! Let go of me!~
	== ImoenJ IF ~InParty("Imoen")~ THEN ~You mean the poison that's all over the floor now?~
	== YoshJ IF ~InParty("Yoshimo")~ THEN ~You mean the poison that's all over the floor now?~
	== KeldorJ IF ~InParty("Keldorn")~ THEN ~Your death would not bring justice, Eloran! Think!~
	== Rasaad IF ~InParty("Rasaad")~ THEN ~You are showing a lack of faith in both yourself and the Morninglord!~
	== JaheiraJ IF ~InParty("Jaheira")~ THEN ~You have already redeemed yourself! As a Harper, I know this.~
END
	++ ~Your plan is ruined, Eloran. Turn yourself into Brega. There's still hope for you - I won't let you die here like this.~ GOTO goodFailureLivingFinalePart2

APPEND dggERMQG 

IF ~~ THEN BEGIN goodFailureLivingFinalePart2
	SAY ~Alright. Fine. I'll turn myself in to Brega. Perhaps... I don't know if redemption is possible for me, but maybe this will bring me a small step closer.~
IF ~~ THEN DO ~
	AddJournalEntry(@5117, QUEST) EscapeArea() AddXPObject(Player1,45000) AddXPObject(Player2,45000) AddXPObject(Player3,45000) AddXPObject(Player4,45000) AddXPObject(Player5,45000) AddXPObject(Player6,45000) ~ EXIT
END


////////////////////////////////
// Finale for Evil Characters
///////////////////////////////

IF ~~ THEN BEGIN evilPersuadeLE
	SAY ~I was once a Zhent, and among the worst of them. I was very, very good at it, and I did things I dare not speak them aloud. I'm not a Zhent anymore - or at least... well. Once a Zhent, always a Zhent, so they say. And it's like I've said. The only good Zhent is a dead Zhent. But I've tried, <CHARNAME>. I really have. I converted to Lathander because I wanted to believe I could walk away from that. I sought out all the evil the city's laws could not touch - this project of ours was supposed to be my redemption. But... well. Once a Zhent, always a Zhent, and the only good Zhent is a dead Zhent. I have one final task for you. I have this poison here, and I want you to witness my death.~
	
	+~OR(2) Global("ggRedemptionPoints","GLOBAL",3) GlobalGT("ggRedemptionPoints","GLOBAL",3)~+ ~Don't be absurd. You realize that I'm no saint either? If you damn yourself, you're damning me alongside with you.~ GOTO evilSuccess
	+~OR(2) Global("ggRedemptionPoints","GLOBAL",3) GlobalGT("ggRedemptionPoints","GLOBAL",3)~+ ~Neither of us are saints, Eloran, but surely who we become matters as much as who we were. (NOTE that this option will change your alignment!)~ GOTO evilSuccessLE
	+~OR(3) Global("ggRedemptionPoints","GLOBAL",0) Global("ggRedemptionPoints","GLOBAL",1) Global("ggRedemptionPoints","GLOBAL",2)~+ ~Don't be absurd. You realize that I'm no saint either? If you damn yourself, you're damning me alongside with you.~ GOTO evilWeDeserve
	+~OR(3) Global("ggRedemptionPoints","GLOBAL",0) Global("ggRedemptionPoints","GLOBAL",1) Global("ggRedemptionPoints","GLOBAL",2)~+ ~Neither of us are saints, Eloran, but surely who we become matters as much as who we were.~ GOTO evilWeDeserve
END

IF ~~ THEN BEGIN evilSuccessLE
	SAY ~Perhaps... Do you really have that much faith in us, <CHARNAME>, even now knowing what I am? What I was? I... I need to think on this. And I can't stay in Athkatla any longer, now that the Zhentarim know I'm here. Goodbye, <CHARNAME>. And thank you.~
IF ~~ THEN DO ~
	AddJournalEntry(@5118, QUEST) ChangeAlignment(Player1,LAWFUL_NEUTRAL) EscapeArea() AddXPObject(Player1,45000) AddXPObject(Player2,45000) AddXPObject(Player3,45000) AddXPObject(Player4,45000) AddXPObject(Player5,45000) AddXPObject(Player6,45000)~ EXIT
END

IF ~~ THEN BEGIN evilPersuadeCE
	SAY ~I was once a Zhent, and among the worst of them. I was very, very good at it, and I did things I dare not speak them aloud. I'm not a Zhent anymore - or at least... well. Once a Zhent, always a Zhent, so they say. And it's like I've said. The only good Zhent is a dead Zhent. But I've tried, <CHARNAME>. I really have. I converted to Lathander because I wanted to believe I could walk away from that. I sought out all the evil the city's laws could not touch - this project of ours was supposed to be my redemption. But... well. Once a Zhent, always a Zhent, and the only good Zhent is a dead Zhent. I have one final task for you. I have this poison here, and I want you to witness my death.~
	+~OR(2) Global("ggRedemptionPoints","GLOBAL",3) GlobalGT("ggRedemptionPoints","GLOBAL",3)~+ ~Don't be absurd. You realize that I'm no saint either? If you damn yourself, you're damning me alongside with you.~ GOTO evilSuccess
	+~OR(2) Global("ggRedemptionPoints","GLOBAL",3) GlobalGT("ggRedemptionPoints","GLOBAL",3)~+ ~Neither of us are saints, Eloran, but surely who we become matters as much--if not more than--who we've been? (NOTE: this option will change your alignment!)~ GOTO evilSuccessCE
	+~OR(3) Global("ggRedemptionPoints","GLOBAL",0) Global("ggRedemptionPoints","GLOBAL",1) Global("ggRedemptionPoints","GLOBAL",2)~+ ~Don't be absurd. You realize that I'm no saint either? If you damn yourself, you're damning me alongside with you.~ GOTO evilWeDeserve
	+~OR(3) Global("ggRedemptionPoints","GLOBAL",0) Global("ggRedemptionPoints","GLOBAL",1) Global("ggRedemptionPoints","GLOBAL",2)~+ ~Neither of us are saints, Eloran, but surely who we become matters as much--if not more than--who we've been?~ GOTO evilWeDeserve

END

IF ~~ THEN BEGIN evilSuccessCE
	SAY ~Perhaps... Do you really have that much faith in us, <CHARNAME>, even now knowing what I am - what I was? I... I need to think on this. And I can't stay in Athkatla any longer, now that the Zhentarim know I'm here. Goodbye, <CHARNAME>. And thank you.~
IF ~~ THEN DO ~
	AddJournalEntry(@5118, QUEST) ChangeAlignment(Player1,CHAOTIC_NEUTRAL) EscapeArea() AddXPObject(Player1,45000) AddXPObject(Player2,45000) AddXPObject(Player3,45000) AddXPObject(Player4,45000) AddXPObject(Player5,45000) AddXPObject(Player6,45000)~ EXIT
END

IF ~~ THEN BEGIN evilPersuadeNE
	SAY ~I was once a Zhent, and among the worst of them. I was very, very good at it, and I did things I dare not speak them aloud. I'm not a Zhent anymore - or at least... well. Once a Zhent, always a Zhent, so they say. And it's like I've said. The only good Zhent is a dead Zhent. But I've tried, <CHARNAME>. I really have. I converted to Lathander because I wanted to believe I could walk away from that. I sought out all the evil the city's laws could not touch - this project of ours was supposed to be my redemption. But... well. Once a Zhent, always a Zhent, and the only good Zhent is a dead Zhent. I have one final task for you. I have this poison here, and I want you to witness my death.~
	+~OR(2) Global("ggRedemptionPoints","GLOBAL",3) GlobalGT("ggRedemptionPoints","GLOBAL",3)~+ ~Don't be absurd. You realize that I'm no saint either? If you damn yourself, you're damning me alongside with you.~ GOTO evilSuccess
	+~OR(2) Global("ggRedemptionPoints","GLOBAL",3) GlobalGT("ggRedemptionPoints","GLOBAL",3)~+~Neither of us are saints, Eloran, but surely who we become matters as much--if not more than--who we've been? (NOTE: this option will change your alignment!)~ GOTO evilSuccessNE
	+~OR(3) Global("ggRedemptionPoints","GLOBAL",0) Global("ggRedemptionPoints","GLOBAL",1) Global("ggRedemptionPoints","GLOBAL",2)~+ ~Don't be absurd. You realize that I'm no saint either? If you damn yourself, you're damning me alongside with you.~ GOTO evilWeDeserve
	+~OR(3) Global("ggRedemptionPoints","GLOBAL",0) Global("ggRedemptionPoints","GLOBAL",1) Global("ggRedemptionPoints","GLOBAL",2)~+ ~Neither of us are saints, Eloran, but surely who we become matters as much--if not more than--who we've been?~ GOTO evilWeDeserve
END

IF ~~ THEN BEGIN evilSuccessNE
	SAY ~Perhaps... Do you really have that much faith in us, <CHARNAME>, even now knowing what I am - what I was? I... I need to think on this. And I can't stay in Athkatla any longer, now that the Zhentarim know I'm here. Goodbye, <CHARNAME>. And thank you.~
IF ~~ THEN DO ~
	AddJournalEntry(@5118, QUEST) ChangeAlignment(Player1,NEUTRAL) EscapeArea() AddXPObject(Player1,45000) AddXPObject(Player2,45000) AddXPObject(Player3,45000) AddXPObject(Player4,45000) AddXPObject(Player5,45000) AddXPObject(Player6,45000)~ EXIT
END

IF ~~ THEN BEGIN evilSuccess
	SAY ~Perhaps... Do you really have that much faith in us, <CHARNAME>, even now knowing what I am - what I was? I... I need to think on this. And I can't stay in Athkatla any longer, now that the Zhentarim know I'm here. Goodbye, <CHARNAME>. And thank you.~
IF ~~ THEN DO ~
	AddJournalEntry(@5118, QUEST) EscapeArea() AddXPObject(Player1,45000) AddXPObject(Player2,45000) AddXPObject(Player3,45000) AddXPObject(Player4,45000) AddXPObject(Player5,45000) AddXPObject(Player6,45000)~ EXIT
END

IF ~~ THEN BEGIN evilWeDeserve
	SAY ~Don't be a hypocrite! We are just as deserving of death as those we've killed - if not more so. Goodbye, <CHARNAME>.~
IF ~~ THEN DO ~
	AddJournalEntry(@5117, QUEST) Kill(Myself) AddXPObject(Player1,45000) AddXPObject(Player2,45000) AddXPObject(Player3,45000) AddXPObject(Player4,45000) AddXPObject(Player5,45000) AddXPObject(Player6,45000)~ EXIT
END

////////////////////////////////
// Just Watched Ending
///////////////////////////////

IF ~~ THEN BEGIN noActDeadFinale
	SAY ~Goodbye, <CHARNAME>.~
IF ~~ THEN DO ~
	AddJournalEntry(@5117, QUEST) Kill(Myself) AddXPObject(Player1,45000) AddXPObject(Player2,45000) AddXPObject(Player3,45000) AddXPObject(Player4,45000) AddXPObject(Player5,45000) AddXPObject(Player6,45000)~ EXIT
END
END	