plot 0
	name <Secret Plan>

	% A combat template for Extra-Random plots.

	% - Edited to v0.901 "light" standard

	% 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 <Character ArchAlly HasMecha>
	Element3 <Scene Town Target !Far 1>
	Element4 <Faction GoodEnemy>

	% V1 = Initialization Counter
	% V2 = Combat Counter


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

	% If Persona E2 dies, load a new plot.
	% start <ifNPCOK E2 else GoDelete if= V1 0 MoveChar E2 E1  V= 1 1  ifG RReact E2 0 Email d5>
	Init_Start <ifNPCOK E2 else GoDelete if= V1 0 goto InitCheckE2>
	InitCheckE2 <ifNPCinPlay E2 else InitCheckFin print 10002 goto InitCheckFin>
	% Msg10002 <\ELEMENT 2 has left this area.>
	Msg10002 <\ELEMENT 2 ϤΥꥢä>
	InitCheckFin <MoveChar E2 E1  V= 1 1  ifG RReact E2 0 SetNPC E2 Email d5>
	start <ifNPCOK E2 else GoDelete if= V1 0 MoveChar E2 E1  V= 1 1  ifG RReact E2 0 SetNPC E2 Email d5>
	GoDelete <S= 101 1 AdvancePlot 0>

	% 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  if= L3 1 else GoPCLost V= 2 3  Reputation 6 1>
	GoPCLost <V= 2 2  Reputation 6  -7>

	% Email messages
	% Msg1 <\ELEMENT 2 @ \ELEMENT 1 :// You might be interested in this: Your old companions are up to no good in \ELEMENT 1 .>
	Msg1 <\ELEMENT 2 @ \ELEMENT 1 :// ʤ̣ʤȤޤʤΤ֤ \ELEMENT 1 Ǥ褫̤ȤǤޤ>
	% Msg2 <\ELEMENT 2 @ \ELEMENT 1 :// Your former boss is causing trouble in \ELEMENT 1 . Come see me.>
	Msg2 <\ELEMENT 2 @ \ELEMENT 1 :// ʤθۤ礬 \ELEMENT 1 ǥȥ֥򵯤ƤޤƤ>
	% Msg3 <\ELEMENT 2 @ \ELEMENT 1 :// I have a lead on something you might be interested in. Meet me in \ELEMENT 1 .>
	Msg3 <\ELEMENT 2 @ \ELEMENT 1 :// ʤ̣ʼ꤬꤬ޤ \ELEMENT 1 ǲ񤤤ޤ礦>
	% Msg4 <\ELEMENT 2 @ \ELEMENT 1 :// Something big is happening in \ELEMENT 1 ; I think you may have a personal interest.>
	Msg4 <\ELEMENT 2 @ \ELEMENT 1 :// \ELEMENT 1 ǲ礭ʤȤꤽǤʤĿŪ˶̣ʤȤȻפޤ>
	% Msg5 <\ELEMENT 2 @ \ELEMENT 1 :// Still thinking about your past? Got something for you in \ELEMENT 1 .>
	Msg5 <\ELEMENT 2 @ \ELEMENT 1 :// ޤʬβˤĤƹͤƤޤ \ELEMENT 1 Ƽ꤬ȤǤ礦>

sub
	Persona 2
	% rumor <!2 has been waiting to speak with you.>
	rumor <!2 ʤääƤ>

	% ********************
	% *** SCRIPT BLOCK ***
	% ********************
	%  V1 = Job offer counter, V1=1 is job offered, V1=-1 if job denied
	%  V2 = Message Randomizer
	%  V3 = Threat value of enemy mecha
	%  V4 = Reward offered to PC for the mission

	greeting <NewChat if= P2 3 else GoCheckLoss  Goto GoPCWon>
	GoCheckLoss <if= P2 2 else GoCheckMission Say 3 N= 3 E3 S= 101 1 S= 105 -1  AdvancePlot 0>
	GoCheckMission <if= V1 1 else GoFirstTime Say 4 AddChat 1 AddChat 2 AddChat 3>

	% Unlike most combat missions, the PC is guaranteed to be offered
	% this one, since it's personal.
	% Set V1, V3, V4 here.
	GoFirstTime <V= 1 1 V= 3 Threat S103 150  V= 4 Reward V3 150 AddChat 4 AddChat 5 AddChat 6 ifFaction N2 else GoCheckPersona Say 51 Memo 61>
	GoCheckPersona <ifNPCOK N1 else GoUnknownEnemy Say 52 Memo 62>
	GoUnknownEnemy <Say 53>

	% Combat being entered
	result1 <EndChat Say 5 SavePos P= 2 1 SavePos Staged .scene V3>
	.scene <SCENE_StopCourier.txt>
	% Combat being delayed
	result2 <NewChat Say 7>
	% How many points do the enemy have?
	result3 <NewChat Say 8 AddChat 1 AddChat 2>

	% Result 4 - may add Reputation command or whatnot
	result4 <NewChat Reputation 1 1 Say 9 AddChat 1 AddChat 2 AddChat 3>

	% Result 5 - may add Reputation command or whatnot
	result5 <NewChat Reputation 4 -d6 Say 9 AddChat 1 AddChat 2 AddChat 3>

	result6 <NewChat Say 10 S= 101 1 N= 3 E3 AdvancePlot 0>

	% 3 : Player has lost mission
	% Msg3 <The courier got away. Now, we might never learn what they were up to... At least, not until it's too late.>
	Msg3 <̩ȤƨƤޤޤϤ䡢ۤ餬ǤΤΤ뤳ȤϤǤޤġʤȤ⡢Ȥߤ˽ФޤǤϡޤλˤϼ٤Ǥ>

	% 4 : Player has accepted mission, has returned from repair
	% Msg4 <Are you ready to head out yet? We have to act quickly, before the courier can leave this area...>
	Msg4 <⤦ȯϤǤޤ桹᤯ưʤФʤޤ̩Ȥϰ褫ФƹԤʤˡġ>

	% 5 : Combat is starting
	% Msg5 <I'll upload the data I've collected to your navigation computer. Once in the area I'll identify which enemy is the courier. You must stop him, at all costs.>
	Msg5 <ʤΥʥӤ˻䤬᤿ǡ򥢥åץɤޤ礦ϰä䤬̩ȤŨʬޤ礦Ǥ⡢ߤƤ>

	% 7 : PC needs some time to get ready
	% Msg7 <Make sure you're in top condition, and get out your best mecha, because if we fail we aren't going to get a second chance.>
	Msg7 <ĴˤơǺǤͥ줿åȤäƤʤʤ鼺ԤܤϤʤǤ>

	% 8 : How many points? Use "\VAL V3 " for that
	% Msg8 <Initial reports indicate that he'll be protected by around \VAL V3 tac points worth of equipment. That's an awful lot of hardware to be taking on by yourself... Fortunately, you just have to stop one of them.>
	Msg8 <ˤȡ̩Ȥ \VAL V3 ݥȤϤķǼƤ褦ǤʤȤǤ٤Ƥˤˤ礭ϤǤġΤΰͤߤǤΤϹʤȤǤ͡>

	% 9 : Response to Prompt4
	% Msg9 <A courier will be traveling through this area soon. If we can stop his mecha, we can learn exactly what they're planning. We'll only get one chance to do this so you better be ready.>
	Msg9 <̩Ȥޤʤϰ̲ᤷޤΥåߤ뤳ȤǤСδߤΤ뤳ȤǤޤκԤϰ٤ޤ󤫤顢ۤǤ礦>

	% Msg10 <You can try to forget your past, but sometimes you just have to face up to it.>
	Msg10 <ʤϲ˺褦ȤƤ褦Ǥ̤ȸʤФʤʤ١Ǥ礦>

	% Msg51 <Your old buddies \NARRATIVE 2 have something cooking in \ELEMENT 1 . I've been tracing their actions for a while, and think we may have a chance to find out what they're plotting, if you're willing to help...>
	Msg51 <ʤΤ \NARRATIVE 2  \ELEMENT 1 ǲǤޤϤΤȤۤưɤäƤޤƤ⤷ʤϤƤСۤδߤΤ뵡뤫⤷ޤġ>
	% Msg52 <Remember \NARRATIVE 1 ? Well, he's got something in store for \ELEMENT 1 . I've been tracing his actions for a while, and think we may have a chance to find out what his gang is plotting, if you're willing to help...>
	Msg52 <\NARRATIVE 1 ФƤޤब \ELEMENT 1 ǲνƤޤϤΤȤۤưɤäƤޤƤ⤷ʤϤƤСۤδߤΤ뵡뤫⤷ޤġ>
	% Msg53 <Some people you once associated with have been plotting something for \ELEMENT 1 . I've been tracing their actions for a while, and think we may have a chance to find out what they're plotting, if you're willing to help...>
	Msg53 <ʤĤ֤äʪ \ELEMENT 1 ǲǤԤޤϤΤȤۤưɤäƤޤƤ⤷ʤϤƤСۤδߤΤ뵡뤫⤷ޤġ>

	% Msg61 <\ELEMENT 2 in \ELEMENT 1 asked you to help uncover the \NARRATIVE 2 plan.>
	Msg61 <\ELEMENT 1  \ELEMENT 2  \NARRATIVE 2 ηײ˽褦ޤ줿>
	% Msg62 <\ELEMENT 2 in \ELEMENT 1 asked you to help uncover the plans of \NARRATIVE 1 .>
	Msg62 <\ELEMENT 1  \ELEMENT 2  \NARRATIVE 1 ηײ˽褦ޤ줿>


	% 1 - 3 :  Standard combat entry options:
	%         Start Mission, Delay Mission, Mission Details
	% Prompt1 <I'm ready to go right now.>
	Prompt1 <Ԥ%JG>
	% Prompt2 <Maybe I should prepare first.>
	Prompt2 <ޤϽʤȡ>
	% Prompt3 <How well is this courier guarded?>
	Prompt3 <̩ȤθҤϤɤΤ餤>

	% 4 - 5 :  PC can have different reactions to Msg6 above
	% Prompt4 <I can't allow them to do more harm...>
	Prompt4 <ۤ餬ʾ峲ڤܤΤ򸫲ᤴʤġ>
	% Prompt5 <I will have my revenge upon them!>
	Prompt5 <ۤƤ롪>
	% Prompt6 <That doesn't concern me, anymore.>
	Prompt6 <%JFˤϤ⤦طʤ͡>



	% THe PC won the mission... Time for a big revelation of some kind.
	GoPCWon <AddChat 101 ifFaction N2 else GoWonNoFac Say 101>
	GoWonNoFac <N= 2 E4 XREnemy NAV_XREFaction  Say 102>

	result101 <NewChat AddChat 102 if= d2 1 else GoR101BiotechEnding Say 103 History 151 XRMystery NAV_XRMResolved Goto GoEndMission>
	GoR101BiotechEnding <Say 104 History 153 XRMystery NAV_XRMNotHuman Goto GoEndMission>

	% Do everything here that has to be done. If some of the ExtraRandom
	% parameters need to be changed, do that here as well.
	GoEndMission <S= 101 1 S+ 102 1 S= 105 1 N= 3 E3 AdvancePlot 0>

	result102 <NewChat Say 110>

	% Msg101 <You did well out there. I've recovered the courier's datapack.>
	Msg101 <褯äƤޤ̩ȤΥǡѥåϲޤ>
	% Msg102 <Good job capturing the courier's datapack. The first thing that you should know, I've found that your old comrades were taking orders from \NARRATIVE 2 .>
	Msg102 <̩ȤΥǡѥåݤƤƤ꤬ȤޤˤʤΤäƤ٤ʤΤϡʤΤ֤ \NARRATIVE 2 ̿ƤȤǤ>
	% Msg103 <It looks like \NARRATIVE 2 has been stockpiling arms, including banned munitions like nukes and biosoldiers. There's only one possible reason... They must be preparing for a full-scale takeover.>
	Msg103 <\NARRATIVE 2 ʼ̤ߤƤ褦ǤˤϳʼʪʼΤȤäʼ⤢ޤͳϰĤͤޤġۤѰդ򤷤Ƥˤޤ>
	% Msg104 <You ever hear of "Idealist"? That was an ancient human-genome biotech program... \NARRATIVE 2 has been searching for info on it, and has even used the tech on their members. You may have been subjected while you worked for them.>
	Msg104 <ۿפΤȤʹȤޤΥҥȥΥ¤ײǤġ \NARRATIVE 2 Ϥ˴ؤõƤꡢΥƥΥСŬѤƤޤʤβƯƤ֤ŬѤ⤷ޤ>

	% Msg110 <Only that the mecha gang you encountered was on the way to \ELEMENT 3 . I'd guess that they have some kind of operation there, but we aren't sure what.>
	Msg110 <ʤåΰ̣ \ELEMENT 3 ظäƤǤۤϤǲ餫κ¹ԤĤǤ礦줬ɤʺʤΤʬޤ>

	% Msg151 <Discovered that \NARRATIVE 2 is planning a takeover of the FedTer.>
	Msg151 <\NARRATIVE 2 ϢˮüȤƤ뤳Ȥʬä>
	% Msg153 <Discovered that \NARRATIVE 2 did genetic modification to its agents.>
	Msg153 <\NARRATIVE 2 С˰ܤƤȤʬä>

	% Prompt101 <So, what are they planning?>
	Prompt101 <ǡۤδߤȤϡ>
	% Prompt102 <Can you tell me anything else?>
	Prompt102 <¾ˤϡ>

end
