Plot 0
	name <TEMPLATE XRAND WORLD MAP ENCOUNTER>

	% The PC will be informed that someone is looking for him
	% somewhere. Yeah, real specific, I know... When the PC goes
	% to the place/does the thing where the someone is looking,
	% a fight happens, and the PC can win or lose or whatever.

	% Normally, these templates feature plenty of messages which are
	% randomized. This template features just one message for each
	% thing the NPC might want to say. Why? Because a regular combat
	% mission might be encountered dozens of times over the course of
	% a campaign, while this one will likely just be encountered once.

	% E1 is the scene for the current episode.
	% E2 is the character who will tell the PC where to go.
	% E3 is the scene to be used in the next episode.
	Element1 <Grab 3>
	Element2 <Character !Near 1>
	Element3 <Scene Town Target !Far 1>


	% V2 = Combat Indicator
	% V3 = WME can take place now

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

	% If Persona E2 dies, load a new plot.
	start <ifNPCOK E2 else GoDelete>
	GoDelete <S= 101 1 AdvancePlot 0>

	ENC1 <if= V3 1  if= V2 0  if= d3 1  Block Goto GoStartCombat>
	ENC2 <if= V3 1  if= V2 0  if= d2 1  Block Goto GoStartCombat>
	ENC3 <if= V3 1  if= V2 0            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 Return>

	% 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  LoseRenown>
	nu2 <if= T2 0 if= V2 1  V= 2 3  Reputation 6  1  XPV 100>


	Msg101 <You are attacked by mecha!>

sub
	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 knows who killed your parents.>

	greeting <NewChat if= P2 3 else GoCheckLoss Say 1 Goto GoEndMission>
	GoCheckLoss <if= P2 2 else GoFirstTime Say 2 S= 101 1 N= 3 E3 AdvancePlot 0>

	% 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 N= 3 E3 AdvancePlot 0>


	% I won't even bother to try and anticipate how this conversation
	% might work out. So, it will just 
	GoFirstTime <Say 3 P= 3 1>

	% 1 :  Player won the combat
	Msg1 <>

	% 2 :  Player lost the combat
	Msg2 <>

	% 3 :  Player will be told about the combat
	Msg3 <>

end
