/* Change the Hell Selfish trial to reflect the Imoen-Aerie Friendship */

ADD_TRANS_TRIGGER HELLSELF 24 ~!InParty("Imoen2")~ DO 0

EXTEND_BOTTOM HELLSELF 24
  IF ~InParty("Imoen2")~ THEN GOTO MRHellReplace
END

APPEND HELLSELF
	IF ~~ THEN BEGIN MRHellReplace
		SAY ~How about you, Child of Bhaal? Yes, you would do nicely indeed. But here even your essence has power... power enough to prevent one such as I from taking you against your will.~
		IF ~~ THEN EXTERN IMOEN2J MRHellReplace
	END
END

CHAIN IMOEN2J MRHellReplace
~Huh. Who knew being the daughter of an evil god would ever keep someone OUT of trouble?~
== HELLSELF IF ~Name("Aerie",Player2) !Dead("Aerie") InParty("Aerie")~ THEN
~It matters not. There are better choices than you, yes... The avariel girl will place you in a dire situation, Child of Murder.~
== AERIEJ IF ~Name("Aerie",Player2) !Dead("Aerie") InParty("Aerie")~ THEN
~No!~
== HELLSELF IF ~Name("Aerie",Player2) !Dead("Aerie") InParty("Aerie")~ THEN
~Silence. I will see you on the other side.~ DO ~SetGlobal("MRHellTookAerie","GLOBAL",1)~
// He takes Jaheira //
== HELLSELF IF ~Name("Jaheira",Player2) !Dead("Jaheira") InParty("Jaheira")~ THEN
~It matters not. There are other choices, yes... the half-elven woman will place you in a dire situation, Child of Murder.~
== JAHEIRAJ IF ~Name("Jaheira",Player2) !Dead("Jaheira") InParty("Jaheira")~ THEN
~Do not worry about me, <CHARNAME>! Do what you must!~
== HELLSELF IF ~Name("Jaheira",Player2) !Dead("Jaheira") InParty("Jaheira")~ THEN
~Silence. I will see you on the other side.~ DO ~SetGlobal("MRHellTookJaheira","GLOBAL",1)~
// He takes Nalia //
== HELLSELF IF ~Name("Nalia",Player2) !Dead("Nalia") InParty("Nalia")~ THEN
~It matters not. There are other choices, yes... the human girl will place you in a dire situation, Child of Murder.~
== NALIAJ IF ~Name("Nalia",Player2) !Dead("Nalia") InParty("Nalia")~ THEN
~No!~
== HELLSELF IF ~Name("Nalia",Player2) !Dead("Nalia") InParty("Nalia")~ THEN
~Silence. I will see you on the other side.~ DO ~SetGlobal("MRHellTookNalia","GLOBAL",1)~
// He takes Minsc //
== HELLSELF IF ~Name("Minsc",Player2) !Dead("Minsc") InParty("Minsc")~ THEN
~It matters not. There are other choices. The human warrior will place you in a dire situation, Child of Murder.~
== MINSCJ IF ~Name("Minsc",Player2) !Dead("Minsc") InParty("Minsc")~ THEN
~We do not fear you, fiend!~
== HELLSELF IF ~Name("Minsc",Player2) !Dead("Minsc") InParty("Minsc")~ THEN
~Silence. I will see you on the other side.~ DO ~SetGlobal("MRHellTookMinsc","GLOBAL",1)~
// He takes Keldorn //
== HELLSELF IF ~Name("Keldorn",Player2) !Dead("Keldorn") InParty("Keldorn")~ THEN
~It matters not. There are other choices. The human paladin will place you in a dire situation, Child of Murder.~
== KELDORJ IF ~Name("Keldorn",Player2) !Dead("Keldorn") InParty("Keldorn")~ THEN
~Do not worry about me, <CHARNAME>! Do what you must!~
== HELLSELF IF ~Name("Keldorn",Player2) !Dead("Keldorn") InParty("Keldorn")~ THEN
~Silence. I will see you on the other side.~ DO ~SetGlobal("MRHellTookKeldorn","GLOBAL",1)~
// He takes someone that isn't one of those //
== HELLSELF IF ~NumInPartyGT(2) InPartyAllowDead(Player2) InParty(Player2) !Name("Imoen2",Player2)
OR(3) !Name("Aerie",Player2) Dead("Aerie") !InParty("Aerie") 
OR(3) !Name("Jaheira",Player2) Dead("Jaheira") !InParty("Jaheira") 
OR(3) !Name("Nalia",Player2) Dead("Nalia") !InParty("Nalia") 
OR(3) !Name("Minsc",Player2) Dead("Minsc") !InParty("Minsc") 
OR(3) !Name("Keldorn",Player2) Dead("Keldorn") !InParty("Keldorn")~ THEN
~It matters not. There are other choices. Your other companion will place you in a dire situation, Child of Murder.~  DO ~SetGlobal("MRHellTookNPC","GLOBAL",1)~
END 
 IF ~NumInPartyGT(1) InPartyAllowDead(Player2) InParty(Player2) !Name("Imoen2",Player2)~ EXTERN HELLSELF 25
  IF ~NumInPartyGT(1) InPartyAllowDead(Player2) InParty(Player2) Name("Imoen2",Player2)~ EXTERN HELLSELF 26

APPEND IMOEN2J
	IF ~Global("MRSelfishTalk","GLOBAL",1) Global("MRHellTookAerie","GLOBAL",1)~ THEN BEGIN MRHellSelfAerie
		SAY ~Aerie, no! <CHARNAME>, you have to do something!~
		IF ~GlobalGT("MRAerImFriend","GLOBAL",8)~ THEN DO ~SetGlobal("MRSelfishTalk","GLOBAL",2)~GOTO MRHellSelfAerie2
		IF ~!GlobalGT("MRAerImFriend","GLOBAL",8)~ THEN DO ~SetGlobal("MRSelfishTalk","GLOBAL",2)~GOTO MRHellSelfTookF
	END

	IF ~Global("MRSelfishTalk","GLOBAL",1) Global("MRHellTookJaheira","GLOBAL",1)~ THEN BEGIN MRHellSelfJaheira
		SAY ~Jaheira! <CHARNAME>, you have to do something!~
		IF ~~ THEN DO ~SetGlobal("MRSelfishTalk","GLOBAL",2)~ GOTO MRHellSelfTookF
	END

	IF ~Global("MRSelfishTalk","GLOBAL",1) Global("MRHellTookNalia","GLOBAL",1)~ THEN BEGIN MRHellSelfNalia
		SAY ~Nalia! <CHARNAME>, you have to do something!~
		IF ~~ THEN DO ~SetGlobal("MRSelfishTalk","GLOBAL",2)~GOTO MRHellSelfTookF
	END

	IF ~Global("MRSelfishTalk","GLOBAL",1) Global("MRHellTookMinsc","GLOBAL",1)~ THEN BEGIN MRHellSelfMinsc
		SAY ~Oh, no, Minsc...~
		IF ~~ THEN DO ~SetGlobal("MRSelfishTalk","GLOBAL",2)~ GOTO MRHellSelfTookM
	END

	IF ~ Global("MRSelfishTalk","GLOBAL",1) Global("MRHellTookKeldorn","GLOBAL",1)~ THEN BEGIN HellSelfKeldorn
		SAY ~Oh, no, Keldorn...~
		IF ~~ THEN DO ~SetGlobal("MRSelfishTalk","GLOBAL",2)~ GOTO MRHellSelfTookM
	END

	IF ~ Global("MRSelfishTalk","GLOBAL",1) Global("MRHellTookNPC","GLOBAL",1)~ THEN BEGIN HS2com
		SAY ~Oh, no...~
		IF ~~ THEN DO ~SetGlobal("MRSelfishTalk","GLOBAL",2)~ GOTO MRHellSelfTookC
	END

	/* Aerie and Imoen are friends */

	IF ~~ THEN BEGIN MRHellSelfAerie2
		SAY ~Don't let Aerie die! Please, please <CHARNAME>...~
		IF ~~ THEN REPLY ~I would never let any of my companions die, Imoen. I know which path I must choose.~ GOTO MRHellSelfAerieChoice1
		IF ~~ THEN REPLY ~That is exactly what I will do. I don't need her.~ GOTO MRHellSelfAerieChoice2
		IF ~~ THEN REPLY ~I will save her... for you, my love.~ GOTO MRHellSelfAerieChoice1
		IF ~~ THEN REPLY ~But Imoen, I need all of my strength for the battle that is to come. It is a difficult decision but if we want to survive, she must be sacrificed.~ GOTO MRHellSelfAerieChoice2a
		IF ~CheckStatGT(Player1,11,INT)~ THEN REPLY ~Don't worry, I have a plan. I will take the path to the demon's right, but then I will raise her from the dead and everything will be fine.~ GOTO MRHellSelfAerieChoice3
	END

	IF ~~ THEN BEGIN MRHellSelfAerieChoice1
		SAY ~That's... good. Be careful... I'm sure it won't be pleasant to go through that passage. But you can take anything they throw at ya, and Aerie doesn't deserve to die like this after all she's done for us.~
		IF ~~ THEN EXIT
	END

	IF ~~ THEN BEGIN MRHellSelfAerieChoice2
		SAY ~No, <CHARNAME>! She doesn't deserve that, after all she's done for us! Save her... please! Do it for me?~
		IF ~~ THEN REPLY ~Uh, of course, of course. I'd never let any of my companions die, I... guess.~ GOTO MRHellSelfAerieChoice1
		IF ~~ THEN REPLY ~No. I need my strength, and I don't need her. It's an easy choice.~ GOTO MRHellSelfAerieChoice2a
		IF ~~ THEN REPLY ~Very well, I will save her... for you, my love.~ GOTO MRHellSelfAerieChoice1
		IF ~~ THEN REPLY ~But Imoen, I need all of my strength for the battle that is to come. It is a difficult decision, but she must be sacrificed.~ GOTO MRHellSelfAerieChoice2a
		IF ~CheckStatGT(Player1,11,INT)~ THEN REPLY ~Don't worry, I have a plan. I will take the path to the demon's right, but then I will raise her from the dead and everything will be fine.~ GOTO MRHellSelfAerieChoice3
	END

	IF ~~ THEN BEGIN MRHellSelfAerieChoice2a
		SAY ~No, no! Don't be selfish, don't fall for Bhaal's trap!~
		=
		~Do... what you must. I guess I can't judge you on this. With- with luck we'll be able to raise her again.~
		=
		~I... I can't look, I can't... (Imoen turns away and covers her face with both hands.)~
		IF ~~ THEN EXIT
	END

	IF ~~ THEN BEGIN MRHellSelfAerieChoice3
		SAY ~But... what if we can't raise her afterwards? What if this... 'fiend' kills *both* her body and soul?~
		= ~Do... what you must, I guess. I can't really judge you on this. With luck, she'll be alright.~
		= ~I... I can't look, I can't... (Imoen turns away and covers her face with both hands.)~
		IF ~~ THEN EXIT
	END

	IF ~~ THEN BEGIN MRHellSelfTookF
		SAY ~Don't let that creature do- uh. Hmmm...~
		=
		~Y'know... for a demon, this guy isn't very smart. What stops you from just raising her from the dead? Feels like you can do whatever you want here.~
                = ~Though, well, it's pretty mean to watch her die an' all. Not the nicest thing to do...~
		=
		~But, agh, you'll need all of your strength to face Irenicus! I just don't know, it's your choice. I'll support you whatever you do.~
		IF ~~ THEN DO ~SetGlobal("MRHellTookCompanion","GLOBAL",2)~ EXIT
	END

	IF ~~ THEN BEGIN MRHellSelfTookM
		SAY ~Don't let that creature do- uh. Hmmm...~
		=
		~Y'know... for a demon, this guy isn't very smart. What stops you from just raising her from the dead? Feels like you can do whatever you want here.~
                = ~Though, well, it's pretty mean to watch him die an' all. Not the nicest thing to do...~
		=
		~But, agh, you'll need all of your strength to face Irenicus! I just don't know, it's your choice. I'll support you whatever you do.~
		IF ~~ THEN DO ~SetGlobal("MRHellTookCompanion","GLOBAL",2)~ EXIT
	END

	IF ~~ THEN BEGIN MRHellSelfTookC
		SAY ~Don't let that creature do- uh. Hmmm...~
		=
		~Y'know... for a demon, this guy isn't very smart. What stops you from just raising the dead? Feels like you can do whatever you want here.~
                = ~Though, well, it's pretty mean to watch our friend die an' all. Not the nicest thing to do...~
		=
		~But, agh, you'll need all of your strength to face Irenicus! I just don't know, it's your choice. I'll support you whatever you do.~
		IF ~~ THEN DO ~SetGlobal("MRHellTookCompanion","GLOBAL",2)~ EXIT
	END
END
// aerie killed and raised ~~

APPEND IMOEN2J
	IF ~Global("MRSelfishTalk","GLOBAL",3) Global("Player1Selfish","GLOBAL",2)~ THEN BEGIN MRSelfishAerieRaised1
		SAY ~Aerie, are you... alright?~ 
		IF ~~ THEN DO ~SetGlobal("MRSelfishTalk","GLOBAL",4)~ EXTERN AERIEJ MRSelfishAerieRaised2
	END
END

CHAIN AERIEJ MRSelfishAerieRaised2
~I... I think so...~ 
=
~What happened? My head hurts. I- I only remember being taken by that monster and... and now I'm here again.~
== IMOEN2J
~<CHARNAME> just raised you back from the dead. I was so afraid that you wouldn't come back! (Imoen smothers her friend in a tight hug.)~
== AERIEJ
~Imoen... Imoen you are hurting me, don't squeeze that much! I am glad to draw breath again, you know.~
== IMOEN2J
~(Imoen releases her) Sorry, sorry... it's great to see you're okay.~
=
~Let's see what comes next then.~
EXIT

// ~~ aerie Didn't die ~~

APPEND IMOEN2J
	IF ~Global("MRSelfishTalk","GLOBAL",3) Global("Player1Selfish","GLOBAL",1)~ THEN BEGIN MRSelfishAerieNotDead
	SAY ~Aerie, are you... alright?~
	IF ~~ THEN DO ~SetGlobal("MRSelfishTalk","GLOBAL",4)~ EXTERN AERIEJ MRSelfishAerieNotDead2
	END
END

CHAIN AERIEJ MRSelfishAerieNotDead2
~I... I think so...~
= ~What... what happened? (Aerie looks as if she has come out of a dreadful dream. She puts a hand on her forehead, leaning on Imoen for support) My vision is still blurry.~
= ~I- I only remember being taken by that monster and... and now I'm here again.~
== IMOEN2J ~<CHARNAME> sacrificed part of <PRO_HIMHER>self to save you.~
== AERIEJ ~<PRO_HESHE> did that? (She looks at you, admiration in her eyes.)~
= ~I... thank you, <CHARNAME>. You chose the selfless path... although I cannot believe Imoen let you sacrifice yourself for me. (She turns to her friend) There's too much at stake!~
== IMOEN2J ~I know, I know! I just couldn't think right, I was so afraid that you wouldn't survive! (Imoen smothers her friend in a tight hug.)~
== AERIEJ ~Imoen... Imoen you are hurting me, don't squeeze that much! I'm glad to be free, but... you should not have told <PRO_HIMHER> to go down one path or the other. You coerced <PRO_HIMHER> to make the decision you wanted instead of letting <PRO_HIMHER> choose freely.~
== IMOEN2J ~Oohh, just don't tell me off, alright? I know I shouldn't have, it was just, just... oh leave me be, it's done and can't be changed!~
== IMOEN2J IF ~Global("ImoenRomanceActive","GLOBAL",2)~ THEN ~'Sides, I'm confident in my ability to nurse <CHARNAME> back to health. (She winks at you mischievously.)~
== IMOEN2J IF ~!Global("ImoenRomanceActive","GLOBAL",2)~ THEN ~'Sides, <CHARNAME> can take anything. (She looks up at you adoringly) Oooh, you're sooo powerful and great, <CHARNAME>! And a paladin of virtue, righteousness and selflessness!~
== AERIEJ IF ~Global("ImoenRomanceActive","GLOBAL",2)~ THEN ~Well, then... one way or another, thank you, <CHARNAME>. You saved me. I will continue to do all I can to help.~
== AERIEJ IF ~!Global("ImoenRomanceActive","GLOBAL",2)~ THEN ~Does this flattery always work?~
== IMOEN2J IF ~!Global("ImoenRomanceActive","GLOBAL",2)~ THEN ~Far more often than you'd think! You should try it out, it's quite the thing.~
== AERIEJ IF ~!Global("ImoenRomanceActive","GLOBAL",2)~ THEN ~Well, then... one way or another, thank you, <CHARNAME>. You saved me. I will continue to do all I can to help.~
== IMOEN2J IF ~!Global("ImoenRomanceActive","GLOBAL",2)~ THEN ~Yeah, that's right, just like that...~
EXIT





