Plot
	name <Vigilant Police Patrol>
	requires <*GENERAL LAWFUL>
	% This police patrol is tougher, gets reinforcements, and there's no way
	% to talk your way out of it. Ouch.

	% E1 is the Town scene
	% E2 is the outdoors scene for the patrol.
	% E3 is the encounter for the patrol
	% E4 is the local police faction
	% E5 is the police officer to be used
	Element1 <Scene Town>
	Element2 <Scene Outdoors>
	Element3 <Prefab>
	Place3 <2>
	Element4 <Faction POLIC !Ally 1>
	Element5 <Character HasMecha !Near 1 !Comrade 4>
	Place5 <3 (Guards) sd enemy>

	% P1 = Timer
	% P2 = Have entered combat

	start <ifNPCOK %5% else GoDelete ifG V1 0 Goto GoCheckTime>
	update <ifNPCOK %5% else GoDelete if= V1 0 else GoCheckTime V= 1 ComTime V+ 1 43200  ifG %threat% NPCRenown %5%  NPCLevel %5% %threat%>
	GoCheckTime <ifG ComTime V1  if= P2 0  EndPlot>
	GoDelete <EndPlot>

	sub
		MetaScene 3 2
		MapWidth 30
		MapHeight 30

		% L1 = Reinforcements level

		start <if= P2 0  P= 2 1  ForceChat %5% L= 1 %threat%>
		end <EndPlot>
		5min <if= P2 1  Alert 1  L+ 1 d10  WMecha 2 L1 50>

		nu1 <if= T1 0 Return if= P2 1 P= 2 2  AddRenown -3             Goto GoLoss>
		nu2 <if= T2 0        if= P2 1 P= 2 3  XPV 100  AddRenown 1     Goto GoVictory>

		% The PC has won this encounter.
		GoVictory <ifNPCOK %5% ForceChat %5%>

		% The PC has lost this encounter...
		GoLoss <ifNPCOK %5% ForceChat %5%>

		Msg1 <Suddenly, reinforcements arrive!>

		sub
			Team 1
			SetEnemy 2
			ParaX 5
			ParaY 5

			Team 2
			name <Guards>
			SetEnemy 1
			Deploy <SetSelfFaction %4%   WMecha 2 %threat% 100>
			ParaX 25
			ParaY 25
		end

		Persona 5
		special <UNLISTED>
		rumor <%name5% is out on patrol.>
		greeting <if= P2 3 else GoCheckLoss        Goto GoDoWin>
		*GoDoWin <*GetYouNextTime>
		GoCheckLoss <if= P2 2 else GoFightPC       Goto GoDoLoss>
		*GoDoLoss <*YouLose>
		*GoFightPC <*BattleChallenge GoThemeExpo na>
		*GoThemeExpo <*THEME_EXPO&Enemy GoStartCombat>
	end
	inv
		STC ENCOUNTER-WANDER
		name <%name5%'s Patrol>
		&ifShouldAttack <ifPCCriminal>
		use <ifG StatVal STAT_MetaVisibility -1      ifG PCScale 0 else GoTooSmall   &ifShouldAttack else GoNoAttack  Print 7  Exit Destination>
		GoTooSmall <Print 6>
		GoNoAttack <Monologue %5% 5  EndPlot>
		Attack <ifG StatVal STAT_MetaVisibility -1   ifG PCScale 0   &ifShouldAttack    ifUStealth HardSkillTar %threat% else GoAutoAttack Goto GoMakeChoice>
		GoMakeChoice <ifYesNo 1 2 3 else GoAvoidAttack  Print 4 Exit Destination>
		Msg1 <You spot a hostile patrol led by %name5%.>
		Msg2 <Confront them.>
		Msg3 <Avoid them.>
		Msg4 <You slip away unnoticed.>
		Msg5 <Nothing to see here. Move along, citizen.>
		Msg5_1 <Hello \PC ; I'm just doing a routine patrol of \EXACT_SCENE %2% . This is something we have to do regularly. So far I haven't encountered any problems.>
		CMsg5_1 <ifNPCSociable Accept>
		Msg5_2 <I can't talk now; I'm on patrol.>
		CMsg5_2 <ifNPCShy Accept>
		Msg5_3 <I'm doing a patrol of \SCENE RootSceneID . Everything looks OK from here.>
		CMsg5_3 <ifNPCCheerful Accept>
		Msg5_4 <There are a million forces out there who would love to destroy \SCENE RootSceneID . It's my job to defend the city against them.>
		CMsg5_4 <ifNPCMelancholy Accept>
		Msg5_5 <Can't talk now... donuts!>
		CMsg5_5 <ifNPCEasygoing Accept>
		Msg5_6 <The enemies of \SCENE RootSceneID never sleep, so neither shall I...>
		CMsg5_6 <ifNPCPassionate Accept>
		Msg5_7 <The streets are peaceful. I've found no trace of unlicensed mecha.>
		CMsg5_7 <ifNPCLawful Accept>
		Msg5_8 <If you witness any criminal activity, report it to the authorities at once.>
		CMsg5_8 <ifNPCCriminal Accept>
		Msg5_9 <Right now I'm patrolling \EXACT_SCENE %2% . It's my sword duty job to protect this city from criminals.>
		CMsg5_9 <ifNPCHeroic Accept>
		Msg5_10 <Be pure, be vigilant, behave!>
		CMsg5_10 <ifNPCVillainous Accept>
		Msg5_11 <No signs of criminal activity here. Move along, \PC .>
		Msg6 <You fail to attract the attention of %name5%.>
		Msg7 <You confront %name5%.>
		ENCOUNTER_Defense
	end

Plot
	name <Regular Police Patrol>
	requires <*GENERAL -LAWFUL -LAWLESS>

	% E1 is the Town scene
	% E2 is the outdoors scene for the patrol.
	% E3 is the encounter for the patrol
	% E4 is the local police faction
	% E5 is the police officer to be used
	Element1 <Scene Town>
	Element2 <Scene Outdoors>
	Element3 <Prefab>
	Place3 <2>
	Element4 <Faction POLIC !Ally 1>
	Element5 <Character HasMecha !Near 1 !Comrade 4>
	Place5 <3 (Guards) sd enemy>

	% P1 = Timer
	% P2 = Have entered combat

	start <ifNPCOK %5% else GoDelete ifG V1 0 Goto GoCheckTime>
	update <ifNPCOK %5% else GoDelete if= V1 0 else GoCheckTime V= 1 ComTime V+ 1 43200>
	GoCheckTime <ifG ComTime V1  if= P2 0  EndPlot>
	GoDelete <EndPlot>

	sub
		MetaScene 3 2
		MapWidth 30
		MapHeight 30

		% L2 = Encounter Over Indicator

		start <if= P2 0  P= 2 1  ForceChat %5%>
		end <EndPlot>
		5min <if= P2 1  WMecha 2 %threat% 30>

		nu1 <if= T1 0 Return if= P2 1 P= 2 2  AddRenown -3             Goto GoLoss>
		nu2 <if= T2 0        if= P2 1 P= 2 3  XPV 100  AddRenown 1     Goto GoVictory>

		% The PC has won this encounter.
		GoVictory <ifNPCOK %5% ForceChat %5%>

		% The PC has lost this encounter...
		GoLoss <ifNPCOK %5% ForceChat %5%>

		sub
			Team 1
			SetEnemy 2
			ParaX 5
			ParaY 5

			Team 2
			name <Guards>
			SetEnemy 1
			Deploy <SetSelfFaction %4%   WMecha 2 %threat% 80>
			ParaX 25
			ParaY 25
		end

		Persona 5
		special <UNLISTED>
		rumor <%name5% is out on patrol.>
		% If the PC isn't of sufficient level to handle this NPC, the battle
		% will be left up to the lancemates.
		greeting <if= P2 3 else GoCheckLoss        Goto GoDoWin>
		*GoDoWin <*GetYouNextTime>
		GoCheckLoss <if= P2 2 else GoFightPC       Goto GoDoLoss>
		*GoDoLoss <*YouLose>
		*GoFightPC <*BattleChallenge&Avoid GoCheckRenown GoExit>
		GoCheckRenown <ifG ChatNPCRenown PCRenown else GoThemeExpo  EndChat Say 1 RunAway %5% WMecha 2 %threat% 50>
		*GoThemeExpo <*THEME_EXPO&Enemy GoStartCombat>
		GoExit <P= 3 4  Return  EndPlot>
		Msg1 <There's no reason for me to stay here. My lance can take you on their own.>
		Msg1_1 <I have to continue on with the patrol. Men, make sure that \PC doesn't get away.>
		Msg1_2 <It would hardly seem fair to beat you down myself... I'll just have my squad do it instead.>
	end
	inv
		STC ENCOUNTER-WANDER
		name <%name5%'s Patrol>
		&ifShouldAttack <ifPCCriminal>
		use <ifG StatVal STAT_MetaVisibility -1      ifG PCScale 0 else GoTooSmall   &ifShouldAttack else GoNoAttack  Print 7  Exit Destination>
		GoTooSmall <Print 6>
		GoNoAttack <Monologue %5% 5  EndPlot>
		Attack <ifG StatVal STAT_MetaVisibility -1   ifG PCScale 0   &ifShouldAttack    ifUStealth HardSkillTar %threat% else GoAutoAttack Goto GoMakeChoice>
		GoMakeChoice <ifYesNo 1 2 3 else GoAvoidAttack  Print 4 Exit Destination>
		Msg1 <You spot a hostile patrol led by %name5%.>
		Msg2 <Confront them.>
		Msg3 <Avoid them.>
		Msg4 <You slip away unnoticed.>
		Msg5 <Nothing to see here. Move along, citizen.>
		Msg5_1 <Hello \PC ; I'm just doing a routine patrol of \EXACT_SCENE %2% . This is something we have to do regularly. So far I haven't encountered any problems.>
		CMsg5_1 <ifNPCSociable Accept>
		Msg5_2 <I can't talk now; I'm on patrol.>
		CMsg5_2 <ifNPCShy Accept>
		Msg5_3 <I'm doing a patrol of \SCENE RootSceneID . Everything looks OK from here.>
		CMsg5_3 <ifNPCCheerful Accept>
		Msg5_4 <There are a million forces out there who would love to destroy \SCENE RootSceneID . It's my job to defend the city against them.>
		CMsg5_4 <ifNPCMelancholy Accept>
		Msg5_5 <Can't talk now... donuts!>
		CMsg5_5 <ifNPCEasygoing Accept>
		Msg5_6 <The enemies of \SCENE RootSceneID never sleep, so neither shall I...>
		CMsg5_6 <ifNPCPassionate Accept>
		Msg5_7 <The streets are peaceful. I've found no trace of unlicensed mecha.>
		CMsg5_7 <ifNPCLawful Accept>
		Msg5_8 <If you witness any criminal activity, report it to the authorities at once.>
		CMsg5_8 <ifNPCCriminal Accept>
		Msg5_9 <Right now I'm patrolling \EXACT_SCENE %2% . It's my sword duty job to protect this city from criminals.>
		CMsg5_9 <ifNPCHeroic Accept>
		Msg5_10 <Be pure, be vigilant, behave!>
		CMsg5_10 <ifNPCVillainous Accept>
		Msg5_11 <No signs of criminal activity here. Move along, \PC .>
		Msg6 <You fail to attract the attention of %name5%.>
		Msg7 <You confront %name5%.>
		ENCOUNTER_Defense
	end

