Plot 0
	name <Combat Template>
	% [[Ver1.6]]
	% retain version number when writing derivative plots
	% v1.1 :  Added memo
	% v1.2 :  Bug fixed: Third option added to GoNoAutomatic
	% v1.3 :  Added <ENEMY> lines;
	%         PC will be denied mission if he aided the enemy
	% v1.4 :  Fixed typo in comments; added FacXP
	% v1.5 :  E2 should not send email after
	%         accepting or rejecting PC for mission
	% v1.6 :  Uses advanced message system

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

	% If this mission is being offered by the enemy of the story's
	% controlling faction, do a search for <ENEMY> and follow the
	% instructions each time this label is found.

	% **********************
	% *** 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>
	% <ENEMY> If this mission is against the story's faction...
	% Element1 <Grab 2>
	% This assumes, of course, that the enemy is ELEMENT2 of the story.

	% E2 is the NPC who will give the PC the mission.
	% Right now it will just be a member of E1.
	Element2 <Character !Comrade 1>

	% Or, if you want something different, delete the above line
	% and uncomment one of the following:
	%  Element2 <Character Guardian>
	%  Element2 <Character Bandit>
	%  Element2 <Character Corporate>
	%  Element2 <Character Bounty Hunter>
	%  Element2 <Character Leader>
	% This will make E2 an enemy of the faction...
	%  Element2 <Character !Enemy 1>


	% ********************
	% *** SCRIPT BLOCK ***
	% ********************
	%  V1 = Time Limit
	%  V2 = Combat Indicator, if V2=1 combat has been entered
	%  V3 = Email sent indicator.
	%       If P3=-1, PC has been denied the job

	%  S101 = Faction Victory Count
	%  S102 = Enemy Victory Count (if appropriate)
	%  S103 = How many times PC fought for faction
	%  S104 = How many times PC fought against faction


	% 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 is killed.
	start <ifPersona E2 else GoDelete if= V1 0 else GoCheckTime V= 1 ComTime V+ 1 86400>
	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 -5>
	nu2 <if= T2 0 if= V2 1  V= 2 3  Reputation 6  1  XPV 50  S+ 101 1 FacXP+ E1 1>
	% <ENEMY> If this is an enemy mission, use the following line.
	% nu2 <if= T2 0 if= V2 1  V= 2 3  Reputation 6  1  XPV 50  S+ 102 1>


	% Email check. If the PC belongs to the same faction as the NPC,
	% he may receive an email about the mission. Make a check every
	% 5 minutes.
	5Min <if= d50 23 if= V3 0 if= PCFac E1 V= 3 1 Email 1>
	% Alternate Version: send email if PC is well-liked, regardless
	% of faction affiliation.
	% 5Min <if= d50 23 if= V3 0 ifG RReact E2 d70 V= 3 1 Email 1>


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

	% 01 :  Email Messages.
	%  The NPC is offering the PC a mission via email.
	Msg1 <\PERSONA E2 @ \SCENE EScene 2 :// >

sub
	% This next bit is the conversation which will happen when the
	% PC speaks to E2.
	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 <>
	% 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.
	% Here are the variables used in this conversation:
	%  V1 = Job offer counter, V1=1 is job offered, V1=-1 if job denied
	%  V3 = Threat value of enemy mecha
	%  V4 = Reward offered to PC for the mission
	% At startup, first check to see whether the PC has already
	% completed the mission or not.
	Greeting <NewChat if= P2 3 else GoCheckLoss Say 1 CashPrize V4 AdvancePlot 0>
	GoCheckLoss <if= P2 2 else GoCheckJob Say 6 AdvancePlot 0>
	GoCheckJob <if= V1 1 else GoCheckFirst Say 101 Goto GoAddComOps>

	% The first time the PC meets the NPC, the PC will be given the
	% mission automatically if he's part of the same faction, or if
	% he is a friend of the NPC, or if he's already been sent email.

	% The PC will be denied the mission if he's helped the enemy.
	GoCheckFirst <if= S104 0 else GoDenied if= V1 0 else GoDenied V= 1 -1 V= 3 Threat FacVar N1 1000 100 V= 4 Reward V3 100 Goto GoCheckFaction>
	% <ENEMY> If this is an enemy mission, use the following line.
	% GoCheckFirst <if= S103 0 else GoDenied if= V1 0 else GoDenied V= 1 -1 V= 3 Threat FacVar N1 1000 100 V= 4 Reward V3 100 Goto GoCheckFaction>

	GoCheckFaction <if= PCFac E1 else GoCheckEmail Say 11 Goto GoAddComOps>
	GoCheckEmail <if= P3 1 else GoCheckFriend Say 11 Goto GoAddComOps>
	% If the reaction score is greater than 40, PC will automatically
	% be offered the job, but unlike above will not be automatically
	% expected to accept it,
	GoCheckFriend <ifG React 40 else GoNoAutomatic Say 16 AddChat 7 AddChat 9>
	% If the PC is not automatically offered the job, there's still
	% a chance to get the job... as long as the NPC doesn't hate him.
	GoNoAutomatic <ifG React -d10 else GoDenied Say 21 AddChat 11 AddChat 14 AddChat 17>
	GoDenied <V= 1 -1 P= 3 -1 SayAnything>

	GoAddComOps <V= 1 1 P= 3 1 AddChat 1 AddChat 3 AddChat 5 Memo 107>

	% The PC will enter combat here.
	result1 <EndChat Say 36 Goto GoStartCombat>

	% Alternate Version: PC gains point of Lawfulness for mission
	% result1 <EndChat Say 36 Reputation 2 1  Goto GoStartCombat>

	% Alternate Version: PC gains point of Chaoticness for mission
	% result1 <EndChat Say 36 Reputation 2 -3  Goto GoStartCombat>

	GoStartCombat <SavePos S+ 103 1 P= 2 1 Dynamic 2 V3 .nu1 .nu2>
	% <ENEMY> If this is an enemy mission, use the following line.
	% GoStartCombat <SavePos S+ 104 1 P= 2 1 Dynamic 2 V3 .nu1 .nu2>

	.nu1 <if= T1 0 Return>
	.nu2 <if= T2 0 Salvage Return>

	% The PC needs some time to get ready.
	result3 <NewChat Say 103>

	% The PC will be told the enemy's point value.
	result5 <NewChat Say 26 AddChat 1 AddChat 3>

	% The PC accepts the job offer.
	result7 <NewChat Say 11 Goto GoAddComOps>

	% The PC refuses the job offer.
	result9 <NewChat Say 102 V= 1 -1 P= 3 -1>

	% The PC tries to get the job via "PLAN A"- be forceful and
	% convincing. This plan uses Intimidation skill in order to
	% succeed. If you want to change it, some alternate "PLAN A"
	% types are presented... uncomment the one you like.
	result11 <NewChat ifG Intimidation 10 else GoR11Lose Say 31 AddChat 7 AddChat 9>

	% The PC will impress the NPC with LAWFUL reputation...
	% result11 <NewChat ifG PCRep 2 30 else GoR11Lose Say 31 AddChat 7 AddChat 9>

	% The PC will impress the NPC with HEROIC reputation...
	% result11 <NewChat ifG PCRep 1 30 else GoR11Lose Say 31 AddChat 7 AddChat 9>


	% PLAN "A", whatever it was, has failed...
	GoR11Lose <NewChat Say 104 V= 1 -1 P= 3 -1>


	% The PC tries to get the job via "PLAN B"- be friendly.
	% This is done with the Conversation skill.
	result14 <NewChat ifG Conversation 15 else GoR14Lose Say 31 AddChat 7 AddChat 9>

	% The PC will impress the NPC with RENOWNED reputation...
	% result14 <NewChat ifG PCRep 6 FacVar E1 1000 else GoR14Lose Say 31 AddChat 7 AddChat 9>

	% The PC will impress the NPC with HEROIC reputation...
	% result14 <NewChat ifG PCRep 1 30 else GoR14Lose Say 31 AddChat 7 AddChat 9>


	% PLAN "B", whatever it was, has failed...
	GoR14Lose <NewChat Say 105 V= 1 -1 P= 3 -1>

	% The player doesn't want this stinkin' job.
	result17 <NewChat Say 106 V= 1 -1 P= 3 -1>


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

	% 01 :  Player has won the battle and is being paid.
	Msg1 <>

	% 06 :  Player has lost the battle.
	Msg6 <>

	% 11 :  Description of mission.
	%  use "$ \VAL V4 " to insert the pay for the mission,
	%  and don't forget to mention that the PC also gets salvage.
	Msg11 <>

	% 16 :  Player is asked if he is looking for a job.
	Msg16 <>

	% 21 :  NPC implies job, PC might have chance to get it.
	Msg21 <>

	% 26 :  PC will be told exact enemy point value.
	%  use "\VAL V3 " to insert the value.
	Msg26 <Our reports indicate that you'll be up against \VAL V3 threat points worth of enemy hardware. Do you feel up to the challenge?>

	% 31 :  "PLAN A" or "PLAN B" worked... the PC is offered
	%  a job and may choose either prompt7/8 to accept or prompt9/10
	%  to reject it.
	Msg31 <>

	% 36 :  Combat is starting.
	Msg36 <>

	% 101 :  Player accepted job, then left to get ready.
	Msg101 <Are you ready to start the mission?>
	% 102 :  Player has refused to take job; answer to prompts 9-10.
	Msg102 <That's too bad.>
	% 103 :  Player has asked for some time to get ready.
	Msg103 <Okay. Hurry back once your equipment is in shape and we can start the mission then.>
	% 104 :  "PLAN A" has failed, and the PC is not offered a job.
	Msg104 <I don't think so.>
	% 105 :  "PLAN B" has failed, and the PC is not offered a job.
	Msg105 <Sorry, we are not currently hiring anyone.>
	% 106 :  Player doesn't want job; answer to prompts 17-19.
	msg106 <I should get back to work now.>
	% 107 :  Memo
	msg107 <\ELEMENT 2 in \SCENE EScene 2 offered you a combat mission.>

	% 01 :  Ready to start the mission
	Prompt1 <I'm ready to go.>

	% 03 :  Need time to get ready first.
	Prompt3 <Give me some time to get ready.>

	% 05 :  What is the enemy point value?
	Prompt5 <What am I up against out there?>

	% 07 :  After being asked if he wants a job, PC says yes.
	Prompt7 <Absolutely.>

	% 09 :  After being asked if he wants a job, PC says no.
	Prompt9 <Definitely not.>

	% 11 : Player tries to get job using PLAN "A".
	%   By default, PLAN "A" is to sound tough and experienced.
	Prompt11 <I'm the greatest pilot. You need me.>

	% 14 : Player tries to get job using PLAN "B".
	%   By default, PLAN "B" is to be friendly and personable.
	Prompt14 <Maybe I could help you with that.>

	% 17 : Player doesn't much care for the job.
	Prompt17 <Sounds boring.>


end

