Plot 0
	name <ARC: Escort Trucker>

	% NPC E2 will tell the PC to go meet NPC E3. NPC E3 will then
	% give the PC a combat mission. The PC should then go back to
	% the same town as NPC E2, where he will be paid for the mission.

	% You can make it into a complete combat mission just
	% by filling in the blanks in the MESSAGE BLOCKs below.


	% **********************
	% *** ELEMENTS BLOCK ***
	% **********************
	% This plot will likely be called from a faction story.
	% So, it will grab the identity of the faction as its first
	% element, and a member of the faction to give the job to
	% the PC.

	% E1 is the faction behind the story
	Element1 <Grab 1>

	% E2 is the NPC who will give the PC the mission.
	Element2 <Character !Comrade 1>

	% E3 is the character who will give the PC the combat mission.
	% You better fill in some more details- Trucker, Shopkeeper, etc.
	Element3 <Character !Far 2>


	% ********************
	% *** SCRIPT BLOCK ***
	% ********************
	% V1 = Time Limit
	% V3 = Email sent indicator.

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

	% Time limit. This plot will conclude in one day, or immediately
	% if NPC E2 or NPC E3 are killed.
	start <ifPersona E2 else GoDelete ifPersona E3 else GoDelete if= V1 0 else GoCheckTime V= 1 ComTime V+ 1 86400>
	GoCheckTime <if= V2 0 ifG ComTime V1 AdvancePlot 0 S+ 101 -1 ifG E3 0 Reputation 6 -d8>
	GoDelete <AdvancePlot 0>

	% Email check. If the PC belongs to the same faction as the NPC,
	% he may recieve an email about the mission. Make a check every
	% 5 minutes.
	5Min <if= d70 23 if= V3 0 if= PCFac E1 V= 3 1 Email d5>


	% *********************
	% *** MESSAGE BLOCK ***
	% *********************

	% 01 - 05 :  Email Messages.
	%  The NPC is offering the PC a mission via email.
	Msg1 <\PERSONA E2 : \NARRATIVE 1 @ \SCENE EScene 2 :// Report to \SCENE EScene 2 for mission details at once.>
	Msg2 <\PERSONA E2 : \NARRATIVE 1 @ \SCENE EScene 2 :// Pilot ugrently needed for upcoming mission. Report here immediately.>
	Msg3 <\PERSONA E2 : \NARRATIVE 1 @ \SCENE EScene 2 :// Convoy escort needed. Report to me at once for job details.>
	Msg4 <\PERSONA E2 : \NARRATIVE 1 @ \SCENE EScene 2 :// You are needed for convoy escort duty. Come here right away.>
	Msg5 <\PERSONA E2 : \NARRATIVE 1 @ \SCENE EScene 2 :// You are to provide convoy escort service. Report here for mission briefing at once.>

sub
	% Note that in this root adventure, NPC E3 doesn't get a persona.
	% That's because we want him to continue with his regular actions
	% until the adventure is activated by speaking with NPC E2.
	% Sub-Plot 1 contains the conversation with NPC E3 and also the
	% combat code.

	Persona 2

	% Fill in something for the rumor string, so the PC will know who
	% has a job to offer. !2 will add the name of the NPC, while !1
	% will add the name of the faction.
	rumor <!2 needs a pilot to do a convoy escort.>
	% eg., rumor <!2 might have a job for you.>

	% ********************
	% *** SCRIPT BLOCK ***
	% ********************
	% If you're feeling faint of heart, just skip this
	% and jump straight to the messages block below.
	% First, check to see if the PC will automatically be given
	% the job.
	% When the job is activated, advance to sub-plot 1.
	% Here are the variables used in this conversation:
	%  V1 = if mission denied, V1 <> 0
	%  V2 = message randomizer
	%  V4 = mission reward
	greeting <NewChat V= 4 Reward Threat FacVar E1 1000 100 200 if= V1 0 else GoDenied if= PCFac E1 else GoCheckEmail Goto GoStartJob>
	GoCheckEmail <if= P3 1 else GoCheckFriend Say d2 AddChat d2>
	GoCheckFriend <ifG React 20 else GoNoAutomatic ifG PCRep 2 -1 else GoNoAutomatic V= 2 2 V+ 2 d3 Say V2 AddChat d2 V= 2 2 V+ 2 d2 AddChat V2>

	% If not automatically offered the mission, the PC may be able to
	% get the job through the use of skills/reputation, as long as he
	% is not hated by the NPC...
	GoNoAutomatic <ifG React d10 else GoDenied V= 2 5 V+ 2 d5 Say V2 V= 2 4 V+ 2 d2 AddChat V2 V= 2 6 V+ 2 d2 AddChat V2 V= 2 8 V+ 2 d2 AddChat V2>

	GoDenied <V= 1 -1 SayAnything>

	GoStartJob <V= 2 10 V+ 2 d5 Say V2 AdvancePlot 1>

	% PC has accepted the job.
	result1 <NewChat Goto GoStartJob>
	result2 <Goto result1>

	% PC has rejected the job.
	result3 <NewChat Say 16 V= 1 -1>
	result4 <Goto result3>

	% PC will try to get job by "Plan A"... in this case,
	% counting on a high RENOWNED reputation.
	result5 <NewChat ifG PCRep 6 FacVar E1 1000 else GoR5Lose V= 2 20 V+ 2 d5 Say V2 AddChat d2 V= 2 2 V+ 2 d2 AddChat V2>
	GoR5Lose <V= 1 -1 Say 18>
	result6 <Goto result5>

	% PC will try to get job by "Plan B"... in this case,
	% asking a question using CONVERSATION skill.
	result7 <NewChat ifG Conversation 20 else GoR7Lose V= 2 20 V+ 2 d5 Say V2 AddChat d2 V= 2 2 V+ 2 d2 AddChat V2>
	GoR7Lose <V= 1 -1 Say 19>
	result8 <Goto result7>

	result9 <NewChat Say 17 V= 1 -1>
	result10 <Goto result9>

	% *********************
	% *** MESSAGE BLOCK ***
	% *********************

	% 01 - 02 :  Player has recieved email asking to do mission.
	%   Pay for the job will be "$ \VAL V4".
	Msg1 <Good, I guess you received my email. One of our convoys needs some mecha support. As you may know, our company has been under attack from a vicious bandit. I need you to protect this shipment.>
	Msg2 <You got here in time. As you've probably heard, \NARRATIVE 1 is under attack from a crime lord. I need you to escort one of our convoys, to protect it from raiders.>

	% 03 - 05 :  Player is friend of NPC, will be asked to do mission.
	%   Pay for the job will be "$ \VAL V4".
	Msg3 <Are you looking for a job? I have a well-paying contract avaliable, $ \VAL V4 for a successful mission. All you have to do is escort one of our trucks from \SCENE EScene 3 to here.>
	Msg4 <I have a position avaliable for a mecha pilot, if you're looking for a job. I can offer $ \VAL V4 to escort one of our convoys from \SCENE EScene 3 to here.>
	Msg5 <If you're looking for work, I have something you may be interested in. One of our convoys needs an escort. The pay is $ \VAL V4 for a single trip.>

	% 06 - 10 :  NPC will imply mission, PC has chance to get it.
	Msg6 <There are too many bandits recently. It's been difficult to ensure the safety of our convoys.>
	Msg7 <Our company has lost far too many shipments to bandits recently. All the extra paperwork is really giving me a headache...>
	Msg8 <We've had a number of bandit attacks recently, but stockholders should rest assured that there is nothing to worry about.>
	Msg9 <\NARRATIVE 1 has seen better times than these. We have been the victims of numerous bandit attacks.>
	Msg10 <Our company is under siege from bandits.>

	% 11 - 15 :  PC has accepted job, now recieves instructions.
	%   use "\Element 3" for NPC E3's name, and "\SCENE EScene 3" for
	%   NPC E3's location. You should provide both.
	%   Also, you may want to mention that there's a 24-hour time limit,
	%   or you may remove the time limit by editing Sub-Plot 1's
	%   scripts block below.
	Msg11 <Go to \SCENE EScene 3 and meet with \ELEMENT 3 . Escort his truck back to here and I'll give you your pay then. You have six hours to complete this job.>
	Msg12 <Our trucks are in \SCENE EScene 3 . Go speak with \ELEMENT 3 , then escort him to the destination zone. You may have to fight raiders along the way. Then, come back here and I'll give you your pay. You have six hours to complete this job.>
	Msg13 <Go meet \ELEMENT 3 in \SCENE EScene 3 ; escort his truck safely to its destination, then come back here and I'll give you your pay. You have six hours to complete this job.>
	Msg14 <Head to \SCENE EScene 3 to meet up with our convoy. \ELEMENT 3 is in charge of that; speak to him. You'll have to do this quickly as the shipment needs to be delivered within six hours.>
	Msg15 <\ELEMENT 3 is the head of the convoy. Go to \SCENE EScene 3 and you can join them there. The shipment absolutely has to be delivered within six hours, so you better hurry.>

	% 16 : PC rejected mission by prompt 03-04.
	Msg16 <I'll find someone else to complete this task, then.>
	% 17 : PC rejected mission by prompt 09-10.
	Msg17 <I hope so.>
	% 18 : Plan "A" (prompts 5-6) failed.
	Msg18 <We have all the pilots we need.>
	% 19 : Plan "B" (prompts 7-8) failed.
	Msg19 <It's private corp business; I don't want to discuss it with you.>

	% 21 - 25 :  Player convinced NPC to maybe give job.
	%   Pay for the job will be "$ \VAL V4".
	Msg21 <Maybe you could help us out. I need an escort for one of our convoys; pay is $ \VAL V4 . Interested?>
	Msg22 <I just may have a job for you, if that's what you're looking for. I can pay $ \VAL V4 if you'll escort one of our convoys and protect it from bandits.>
	Msg23 <If you're a mecha pilot, I may have a position for you. Pay is $ \VAL V4 for a single escort mission.>
	Msg24 <Looking for work? I can offer $ \VAL V4 if you'll escort one of our convoys from \SCENE EScene 3 to here.>
	Msg25 <These days our trucks can't drive 10km without being attacked. If you'd like to help protect them, I can offer you $ \VAL V4 for the job.>


	% 01 - 02 :  PC will accept the mission
	Prompt1 <I'll do it.>
	Prompt2 <Sounds good. I'll do it.>

	% 03 - 04 :  PC doesn't want to do this mission
	Prompt3 <I'm too busy to help you right now.>
	Prompt4 <Sorry, I don't think I can help.>

	% 05 - 06 :  PC will try to get mission by RENOWNED reputation
	Prompt5 <What you need is an ace pilot on your team.>
	Prompt6 <Hire me and I'll protect them for you.>

	% 07 - 08 :  PC will try to get mission by CONVERSATION skill
	Prompt7 <What are you going to do about it?>
	Prompt8 <Have you considered hiring extra protection?>

	% 09 - 10 :  PC doesn't want the mission
	Prompt7 <I hope it clears up soon.>
	Prompt8 <Have fun fighting the bandits.>


	Plot 1
		name <Sub-Plot 1>

		% ********************
		% *** SCRIPT BLOCK ***
		% ********************
		% V1 = Time Limit
		% V2 = Combat Indicator, if V2=1 combat has been entered

		% On a cleanup request, delete this plot unless combat has been
		% entered.
		cleanup <if= V2 0 AdvancePlot 0>

		% Time limit. This plot will conclude in one day, or immediately
		% if NPC E2 or NPC E3 are killed. 86400 is the number of seconds
		% in a single day. You can alter the time limit by altering the
		% value added to V1 below.
		% Also, at the first startup, set the memo.
		start <ifPersona E2 else GoDelete ifPersona E3 else GoDelete if= V1 0 else GoCheckTime V= 1 ComTime V+ 1 21600 Memo 1>

		% If you don't want a time limit, comment out the above line
		% and uncomment the following:
		% start <ifPersona E2 else GoDelete ifPersona E3 else GoDelete if= V1 0  V= 1 1 Memo 1>

		GoCheckTime <if= V2 0 ifG ComTime V1 AdvancePlot 0>
		GoDelete <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.
		% Finally, if the player won, the calling story's faction victory
		% count (by default now story variable 101) will be increased.
		nu1 <if= T1 0 if= V2 1  V= 2 2  Reputation 6 -7 S+ 101 -d3>
		nu2 <if= T2 0 if= V2 1  V= 2 3  Reputation 6  1  XPV 50  S+ 101 d3>


		% *********************
		% *** MESSAGE BLOCK ***
		% *********************
		% The adventure memo.
		msg1 <\ELEMENT 2 in \SCENE EScene 2 asked you to meet \ELEMENT 3 in \SCENE Escene 3 for an escort mission.>

	sub
		Persona 2
		% The character who hired the PC...
		% ********************
		% *** SCRIPT BLOCK ***
		% ********************
		%  V2 = message randomizer
		% First thing to check is whether or not the combat has
		% already been finished- if so, the NPC will reward PC.
		% If not, the NPC will just remind the PC where he's
		% supposed to go.
		greeting <NewChat V= 4 Reward Threat FacVar E1 1000 100 200 if= P2 3 else GoCheckLoss V= 2 10 V+ 2 d5 Say V2 CashPrize V4 AdvancePlot 0>

		% if the PC lost, print a message then end the story.
		GoCheckLoss <if= P2 2 else GoNoCombat V= 2 5 V+ 2 d5 Say V2 AdvancePlot 0>

		% if the PC hasn't done the combat yet, browbeat him.
		GoNoCombat <Say d5>

		% *********************
		% *** MESSAGE BLOCK ***
		% *********************
		% 01 - 05 :  Player will be reminded of the job.
		%   use "\Element 3" for NPC E3's name, and "\SCENE EScene 3" for
		%   NPC E3's location. You should provide both.
		Msg1 <Go to \ELEMENT 3 in \SCENE EScene 3 and escort the convoy back here. You have to hurry, that shipment needs to get here soon!>
		Msg2 <Go to \ELEMENT 3 in \SCENE EScene 3 and escort the convoy back here. You have to hurry, that shipment needs to get here soon!>
		Msg3 <Go to \ELEMENT 3 in \SCENE EScene 3 and escort the convoy back here. You have to hurry, that shipment needs to get here soon!>
		Msg4 <Go to \ELEMENT 3 in \SCENE EScene 3 and escort the convoy back here. You have to hurry, that shipment needs to get here soon!>
		Msg5 <Go to \ELEMENT 3 in \SCENE EScene 3 and escort the convoy back here. You have to hurry, that shipment needs to get here soon!>

		% 06 - 10 :  The PC lost the mission.
		Msg6 <Our shipment was lost... Those bandits are going to ruin this company...>
		Msg7 <You failed me.>
		Msg8 <The mission was a complete disaster.>
		Msg9 <The convoy has been lost, along with our merchandise. Someone is going to pay for this.>
		Msg10 <The bandits took everything... you failed.>

		% 11 - 15 :  The PC won the mission.
		Msg11 <You brought the shipment home safely. Here's your pay.>
		Msg12 <Here's the cash you earned. Good job.>
		Msg13 <Here's your salary for protecting the convoy.>
		Msg14 <Here's the money you earned for that job.>
		Msg15 <Here's your pay.>


		Persona 3
		% The character who will start the combat mission...
		% ********************
		% *** SCRIPT BLOCK ***
		% ********************
		% This NPC will really just offer the combat mission and
		% get on with it, but first we better check to see if the
		% PC has already completed the mission.
		%  V2 = Message Randomizer
		%  V3 = Enemy threat value
		%  V4 = Eventual cash reward
		greeting <NewChat V= 3 Threat FacVar E1 1000 100 V= 4 Reward V3 200 ifG P2 0 else GoLetsGo Say 6>
		GoLetsGo <Say d5 AddChat d2 V= 2 2 V+ 2 d2 AddChat V2 V= 2 4 V+ 2 d2 AddCHat V2>

		% Start combat now.
		result1 <EndChat V= 2 6 V+ 2 d4 Say V2 SavePos P= 2 1 Dynamic 2 V3 .nu1 .nu2 PassVar 1 EScene 2>
		.nu1 <if= T1 0 Exit V1>
		.nu2 <if= T2 0 Salvage Exit V1>
		result2 <Goto Result1>

		% Need more time
		result3 <NewChat Say 11>
		result4 <Goto result3>

		% What are we facing?
		result5 <NewChat V= 2 11 V+ 2 d4 Say V2 AddChat 1 AddChat 3>
		result6 <Goto result5>

		% *********************
		% *** MESSAGE BLOCK ***
		% *********************

		% 01 - 05 :  NPC is ready to start the mission.
		Msg1 <So, you were sent here to escort the trucks, huh? Well, let's get rolling.>
		Msg2 <\ELEMENT 2 sent you to be my escort? Let's get started... I've been sitting here too long already.>
		Msg3 <You're my escort? Let's get rolling.>
		Msg4 <It's time for my shipment to move. We're probably going to be late even as it is.>
		Msg5 <Let's get started. These trucks need to be in \SCENE EScene 2 soon.>

		% 06 :  PC should report back to NPC E2.
		Msg6 <I think you should go report to \ELEMENT 2 in \SCENE EScene 2 now.>

		% 07 - 10 :  Starting mission, good luck to PC.
		Msg7 <Good luck out there.>
		Msg8 <Do a good job, and keep the rest of us alive, OK?>
		Msg9 <I'm pretty sure we're going to be attacked, you with us or not.>
		Msg10 <Keep it safe. Let's go.>

		% 11 :  PC needs some time to get ready.
		Msg11 <We don't have a lot of time. Hurry back once you've been serviced.>

		% 12 - 15 :  Give overview of enemy forces.
		%  use "\VAL V3" for the enemy threat level.
		Msg12 <Usually they attack with around \VAL V3 points worth of mecha. We can't realistically expect to not be attacked.>
		Msg13 <They've been fielding around \VAL V3 threat points in each raid.>
		Msg14 <If we encounter \NARRATIVE 2 , his forces usually contain at least \VAL V3 points worth of mecha.>
		Msg15 <I'd say that we can expect a threat value of at least \VAL V3 if we encounter bandits.>


		% 01 - 02 :  Start the mission
		prompt1 <Alright, let's go.>
		prompt2 <Let's move out.>

		% 03 - 04 :  Need time to prepare
		prompt3 <I need some time to prepare.>
		prompt4 <My mecha is damaged, I need time for repairs.>

		% 05 - 06 :  How many enemies?
		prompt5 <What will I be fighting out there?>
		prompt6 <How many meks do the bandits have?>

	end

end



