plot 0
	name <PLOT: Waiting For You>

	% E1 is the scene for the current episode.
	% E2 is the character who will give the PC a mission.
	% E3 is the scene to be used in the next episode.
	Element1 <Grab 3>
	Element2 <Grab 1>
	Element3 <Scene Town Target !Far 1>
	Element4 <Faction GoodEnemy>

	% V1 = Initialization Counter
	% V2 = Combat Counter
	% V3 = Conversation Counter


	% On a cleanup request just delete this plot.
	cleanup <AdvancePlot 0>

	% If Persona E2 dies, load a new plot.
	start <ifPersona E2 else GoDelete ifG P2 1 else GoCheckStartCombat ForceChat E2>
	GoCheckStartCombat <if= P2 1 else GoCheckInit ifNPCInPlay E2 else GoCheckInit if= V3 0 V= 3 1 ForceChat E2>
	GoCheckInit <if= V1 0 V= 1 1 Compose EWM E1 .comstart Compose UTD E2 .e2dies if# d3 2 Mail d5>
	GoDelete <S= 101 1 AdvancePlot 0>


	.comstart <Print 101 Block SavePos P= 2 1 Dynamic 2 Threat S103 80 .nu1 .nu2 DynaNPC E2 2>
	.e2dies <ForceChat E2 Retreat 2>
	.nu1 <if= T1 0 Return>
	.nu2 <if= T2 0 Salvage>

	% Combat check. If combat has been entered, V2=1.
	% Combat ends in victory if the number of active masters on
	% team two drops to zero, or ends in defeat is the number of
	% active masters on team one drops to zero. After combat, V2=3
	% if the player was victorious or V2=2 is the player lost.
	nu1 <if= T1 0 if= V2 1  V= 2 2  Reputation 6 -7>
	nu2 <if= T2 0 if= V2 1  V= 2 3  Reputation 6  1  XPV 100 ifPersona E2 ForceChat E2>

	Msg1 <\ELEMENT 2 @???:// I'm waiting for you in \ELEMENT 1 . Let's finish this.>
	Msg2 <\ELEMENT 2 @???:// If you want to see me, I'm waiting in \ELEMENT 1 .>
	Msg3 <\ELEMENT 2 @???:// Come see me in \ELEMENT 1 and we'll settle this once and for all.>
	Msg4 <\ELEMENT 2 @???:// If you want to end this, meet me in \ELEMENT 1 . I'll be waiting.>
	Msg5 <\ELEMENT 2 @???:// Come to \ELEMENT 1 and we can settle this.>

	Msg101 <While approaching \ELEMENT 1 , you are attacked by mecha!>

sub
	Persona 2
	greeting <EndChat ifPersona E2 else GoE2Dead if= P2 3 else GoCheckLoss Say 2 S= 101 1 S+ 102 1 N= 3 E3 History 8 AdvancePlot 0>
	GoE2Dead <ifFaction N2 else GoSetFaction Goto GoFinishFaction>
	GoSetFaction <N= 2 E4 Goto GoFinishFaction>
	GoFinishFaction <Say 1 S= 101 1 S+ 102 1 N= 3 E3 XREnemy NAV_XREFaction History 9 AdvancePlot 0>
	GoCheckLoss <if= P2 2 else GoCheckFirst Say 3 AdvancePlot 1>
	GoCheckFirst <Say 4 AddChat 1 AddChat 2 AddChat 3>

	result1 <EndChat Say 5>
	result2 <EndChat Say 6>
	result3 <EndChat Say 7 Reputation 6 -5 Retreat 1 AdvancePlot 1>

	Msg1 <You have defeated me... but \NARRATIVE 2 will not be defeated so easily... my death shall be avenged...>
	Msg2 <You are stronger than I thought. I will have to train my skills before facing you again.>
	Msg3 <Just as I thought, you are pathetically weak. It's not worth my time to kill you. You're going to have to improve if you hope to face me again.>
	Msg4 <I expected you to make it here eventually. Now, we will settle everything, with your death...>
	Msg5 <Prepare to die!>
	Msg6 <You're spirited... that's good. It would be terrible to have to face a boring enemy. Let's begin this dance!>
	Msg7 <No condition to fight? You are pathetic. It's beneath my dignity to kill you now... Maybe someday we can meet again if you prove yourself worthy.>
	Msg8 <You defeated \ELEMENT 2 in a duel.>
	Msg9 <You killed \ELEMENT 2 , who told you that \NARRATIVE 2 would seek revenge.>

	Prompt1 <Alright, let's do this.>
	Prompt2 <You will die if you face me here today.>
	Prompt3 <I'm in no condition to fight.>

	Plot 1
		% PC must prove himself worthy to fight NPC again.
		% This means, his Renowned reputation must increase to
		% at least the level of S103; then the NPC can be met
		% as a world map encounter.

		% On a cleanup request just delete this plot.
		cleanup <AdvancePlot 0>

		% If Persona E2 dies, load a new plot.
		start <ifPersona E2 else GoDelete if= V2 2 else GoCheckStartCombat ForceChat E2>
		GoCheckStartCombat <if= V2 1 else GoCheckInit if= V3 0 V= 3 1  ForceChat E2>
		GoCheckInit <if= V1 0 V= 1 1 memo 102>
		GoDelete <S= 101 1 AdvancePlot 0>


		ENC1 <if= d3 1 ifG PCRep 6 S103 Block Goto GoStartCombat>
		ENC2 <if= d2 1 ifG PCRep 6 S103 Block Goto GoStartCombat>
		ENC3 <         ifG PCRep 6 S103 Block Goto GoStartCombat>
		GoStartCombat <Print 101 SavePos P= 2 1 Dynamic 2 Threat S103 100 .nu1 .nu2>
		.nu1 <if= T1 0 Return>
		.nu2 <if= T2 0 Salvage>

		nu1 <if= T1 0 if= V2 1  V= 2 2  Reputation 6 -7>
		nu2 <if= T2 0 if= V2 1  V= 2 3  Reputation 6  1  XPV 100  ForceChat E2>

		Msg101 <You are attacked by mecha!>
		Msg102 <\ELEMENT 2 said that you must prove yourself worthy before the two of you will fight again.>

	sub
		Persona 2
		greeting <EndChat ifPersona E2 else GoE2Dead if= P2 3 else GoCheckLoss Say 2 S= 101 1 S+ 102 1 N= 3 E3 History 8 AdvancePlot 0>
		GoE2Dead <Say 1 S= 101 1 S+ 102 1 N= 3 E3 XREnemy NAV_XREFaction History 9 AdvancePlot 0>
		GoCheckLoss <if= P2 2 else GoCheckFirst Say 3 P= 2 0>
		GoCheckFirst <Say 4 AddChat 1 AddChat 2 AddChat 3>

		result1 <EndChat Say 5>
		result2 <EndChat Say 6>
		result3 <EndChat Say 7>

		Msg1 <You have defeated me... but \NARRATIVE 2 will not be defeated so easily... my death shall be avenged...>
		Msg2 <You are much better than the last time we met. You may yet be a challenge worthy of me. Until we meet again...>
		Msg3 <Once again you've proven yourself unworthy. It is mere good fortune that you survived today... The next time we meet, I intend to make sure you are not so lucky.>
		Msg4 <So we meet again. I have no time to waste on you today; I am certain that my underlings will be able to defeat you all by themselves.>
		Msg5 <I shall defeat you!>
		Msg6 <That's quite a boast, given your past record. Once again I will destroy you.>
		Msg7 <Last time I allowed you to live, but my patience is ended. There will be no quarter for you today. Prepare to defend yourself.>
		Msg8 <You defeated \ELEMENT 2 in a duel.>
		Msg9 <You killed \ELEMENT 2 , who told you that \NARRATIVE 2 would seek revenge.>

		Prompt1 <Okay, let's fight.>
		Prompt2 <All of your men are about to die.>
		Prompt3 <I'm in no condition to fight.>

	end

end
