Plot 0

	% The organ thief's hideout has been located. The PC can
	% choose to take part in the operation either on foot or
	% in mecha.

	% This story has a time limit of 3 hours and will likely
	% fail without the PC's involvement.

	% VARIABLES USED
	% 1 -> Time Limit Timer
	% 2 -> Combat Indicator


	element1 <Character Guardian>
	% Element 2 tracks email.

	% Time limit - this plot will fade after a short time.
	START <ifPersona E1 else GoDelete if= V1 0 else GotoCheckTime V= 1 ComTime V+ 1 10800>
	GotoCheckTime <ifG ComTime V1 if= V2 0  ifG S101 d100 else GoLoss S= 103 1 AdvancePlot 2>
	GoLoss <AdvancePlot 1>
	GoDelete <AdvancePlot 0>

	% Upon recieving a cleanup trigger, just clean up,
	% unless there's a reward pending.
	Cleanup <if= V2 0 AdvancePlot 0>

	% Check for email every five minutes.
	% The PC will only get email if he's a guardian.
	5min <if= E2 0 if= PCFac N1 ifG RReact E1 d20 E= 2 1 Email d5>

	Msg1 <\ELEMENT 1 @ \SCENE EScene 1 //: We've located the organ thief. Get over here quickly!>
	Msg2 <\ELEMENT 1 @ \SCENE EScene 1 //: The serial killer we've been searching for has been found. Get here as soon as possible!>
	Msg3 <\ELEMENT 1 @ \SCENE EScene 1 //: I need you in \SCENE EScene 1 right away. We've located \NARRATIVE 2 and are ready to start operations.>
	Msg4 <\ELEMENT 1 @ \SCENE EScene 1 //: I have a lead on the serial killer. Get here right away, we have to act quickly.>
	Msg5 <\ELEMENT 1 @ \SCENE EScene 1 //: The serial killer we're looking for is in the area. Get over here for the capture operation.>

	% If combat has been entered, V2 = 1. This is important to keep
	% the events below from activating in scenes other than the
	% plot's combat...
	% If the PC wins the combat, V2 = 3
	% If the PC loses the combat, V2 = 2
	NU1 <if= T1 0 if= V2 1 V= 2 2 Reputation 6 -4>
	NU2 <if= T2 0 if= V2 1 V= 2 3 XPV 250 Reputation 6 1 S= 103 1>

sub
	Persona 1
	% Standard NPC-offers-PC-combat-job persona.
	% V1 = Phase counter, 1=Offered Mission, -1=Denied Mission
	% V2 = Randomizer
	% V3 = Encounter level
	rumor <!1 has been working on the organ thief case.>
	% First, since the PC is talking to the NPC, cancel the email var
	% Then, check to see whether or not the PC has already completed
	% the mission for the guardian, or whether he has already been
	% offered the job.
	greeting <NewChat E= 2 1 if= P2 3 else GoCheckLoss Say 18 Reputation 1 d6 AdvancePlot 0>
	GoCheckLoss <if= P2 2 else GoCheckMission Say 16 AdvancePlot 0>
	GoCheckMission <if= V1 1 else GoFirstTime Say 11  AddChat 3 AddChat 4 AddChat 5 Memo 17>
	GoFirstTime <if= V1 0 else GoNoChance V= 3 PCRep 6 V+ 3 d8 V+ 3 -d8 if= PCFac N1 else GoNoGuardian V= 1 1 V= 2 6 V+ 2 d4 Say V2 AddChat 3 AddChat 4 AddChat 5 Memo 17>

	% If the PC isn't a guardian, it's very likely that she won't
	% be offered a chance to take part in the mission.
	GoNoGuardian <ifG React 50 else GoNoChance ifG PCRep 1 d50 else GoNoChance ifG PCRep 2 d100 else GoNoChance ifG PCRep 6 d100 else GoNoChance V= 1 1 Say 6 AddChat 1 AddChat 2>
	GoNoChance <V= 1 -1 ifG React d100 else GoNothing Say d5>
	GoNothing <SayAnything>

	result1 <NewChat V= 2 6 V+ 2 d4 Say V2 AddChat 3 AddChat 4 AddChat 5 Memo 17>
	result2 <NewChat Say 12 V= 1 -1>
	result3 <EndChat Say 13 Dynamic 2 Threat V3 75 .nu1 .nu2 P= 2 1 Reputation 2 1>
	result4 <EndChat Say 14 MDynamic 0 V3 .mdesc .nu1 .nu2 P= 2 1 Reputation 2 1 SetMapType CityMap>
	result5 <NewChat Say 15>
	.mdesc <CRIMINAL>
	.NU1 <if= T1 0 Return>
	.NU2 <if= T2 0 Salvage Return>

	Msg1 <The organ thief will soon be in police custody. There's no reason for citizens to panic.>
	Msg2 <We are doing everything in our power to aprehend the serial killer, and I assure you that he will be brought to justice shortly.>
	Msg3 <The guardians are hard at work keeping the Federated Territories safe.>
	Msg4 <We expect an arrest to be made in connection with the organ harvesting ring very soon.>
	Msg5 <Nothing to see here, move along.>

	Msg6 <We have discovered the location of the organ harvesters, and are ready to move against their hideout. If you're free to take part in the operation we could use you on the team.>
	Msg7 <The organ harvesters and their boss, \NARRATIVE 2 , have been located. We're ready to strike at their position but we need to act fast. Our mecha team is ready to clear a path so our ground troops can take the building.>
	Msg8 <A strike team is ready to take down the organ thieves. We've located their boss, \NARRATIVE 2 . The mecha division stands ready to clear their defenses, then the ground patrol will sieze their compound.>
	Msg9 <The organ harvesting serial killer as been located. \NARRATIVE 2 is holed up in an abandoned warehouse. There are mecha guarding the place, so our armor squad will have to deal with them first, then the ground troops can move in.>
	Msg10 <We're ready to finish the organ harvesting ring once and for all. We have a mecha squad outside of their stronghold; once the defenses are down, the ground team can move in and capture their leader.>

	Msg11 <Are you ready yet? We're running out of time!>
	Msg12 <Understood. Wish me luck...>
	Msg13 <Here are the coordinates you'll be expected to cover. Eliminate all enemy mecha that you can find, then give the signal for the ground crew to follow up.>
	Msg14 <Here are the coordinates for your mission. Once the mecha squad has done their job, you'll have to rush in and take down all remaining hostiles. It's not likely that they'll surrender peacefully.>
	Msg15 <You better hurrry, we only have a short time before they move on.>

	Msg16 <The operation failed. We have to find \NARRATIVE 2 quickly, before his gang can kill again.>
	Msg17 <\ELEMENT 1 in \SCENE ESCene 1 recruited you for a mission.>
	Msg18 <We did it! \NARRATIVE 2 has been captured and is now in custody.>

	prompt1 <Count me in.>
	prompt2 <Sorry, I really can't.>
	prompt3 <I'll support the mecha division.>
	prompt4 <I'll join the ground crew on foot.>
	prompt5 <Maybe I should get ready first...>

	Plot 1
		% The PC didn't arrive in time and the mission
		% was aborted.

		% Time limit - this plot will fade after a short time.
		START <ifPersona E1 else GoDelete if= V1 0 else GotoCheckTime V= 1 ComTime V+ 1 10800 ifG E2 0 Mail 1 Reputation 6 -1>
		GotoCheckTime <ifG ComTime V1  AdvancePlot 0>
		GoDelete <AdvancePlot 0>
		Msg1 <\ELEMENT 1 @ \SCENE EScene 1 //: The operation has been called off, the criminals have left the area.>

	Plot 2
		% The PC didn't arrive in time and the mission
		% was successful anyways.

		% Time limit - this plot will fade after a short time.
		START <ifPersona E1 else GoDelete if= V1 0 else GotoCheckTime V= 1 ComTime V+ 1 10800 ifG E2 0 Mail 1 Reputation 6 -1>
		GotoCheckTime <ifG ComTime V1  AdvancePlot 0>
		GoDelete <AdvancePlot 0>
		Msg1 <\ELEMENT 1 @ \SCENE EScene 1 //: We just completed the operation I wrote you about, and have captured the serial killer!>

end
