Plot
	name <Regular Defense Patrol>
	requires <*GENERAL>

	% E1 is the Town scene
	% E2 is the outdoors scene for the patrol.
	% E3 is the encounter for the patrol
	% E4 is the pilot to be used
	Element1 <Scene Town>
	Element2 <Scene Outdoors>
	Element3 <Prefab>
	Place3 <2>
	Element4 <Character HasMecha !Ally 1>
	Place4 <3 (Guards) sd enemy>

	% P1 = Timer
	% P2 = Have entered combat

	start <ifNPCOK %4% else GoDelete ifG V1 0 Goto GoCheckTime>
	update <ifNPCOK %4% 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 %4%>
		start <GrabPlot ifGOK if= P2 0  P= 2 1  ifNPCOK %4% ForceChat %4%>
		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>
		nu1 <if= T1 0 Return GrabPlot ifGOK if= P2 1 P= 2 2  AddRenown -3             Goto GoLoss>
		nu2 <if= T2 0        GrabPlot ifGOK if= P2 1 P= 2 3  XPV 100  AddRenown 1     Goto GoVictory>

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

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

		sub
			Team 1
			SetEnemy 2
			ParaX 5
			ParaY 5

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

		Persona 4
		special <UNLISTED>
		% rumor <%name4% is out on patrol.>
		rumor <%name4% はパトロールに出ている>
		% 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 %4% 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.>
		Msg1 <%JF2がここに留まる理由はない%JV_F_WA%JV_NA。%JS_AGGの相手なら部下だけで十分%JG_DA。>
		Msg1_1 <%JF2はパトロールを続けないといけない%JV_F_WA。全員、\PC を絶対に逃がさないように。>
		Msg1_2 <%JF2が相手をしてしまうのは不公平に過ぎる%JV_F_WA%JV_NA……ここは部下に任せる%JV_ZO。>
	end
	inv
		STC ENCOUNTER-WANDER
		name <%name4%'s Patrol>
		name_I18N <%name4% のパトロール隊>
		&ifShouldAttack <IFFACTIONENEMY RootSceneFac>
		use <ifG StatVal STAT_MetaVisibility -1      ifG PCScale 0 else GoTooSmall   &ifShouldAttack else GoNoAttack  Print 7  Exit Destination>
		GoTooSmall <Print 6>
		GoNoAttack <Monologue %4% 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 defense patrol led by %name4%.>
		% Msg2 <Confront them.>
		% Msg3 <Avoid them.>
		% Msg4 <You slip away unnoticed.>
		% Msg5 <I'm just doing a routine patrol of the city. Nothing to see here.>
		% Msg5_1 <Hello \PC ; I'm just doing a routine patrol of %name2%. 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 %name1%. Everything looks OK from here.>
		% CMsg5_3 <ifNPCCheerful Accept>
		% Msg5_4 <There are a million forces out there who would love to destroy %name1%. It's our job to defend the city against them.>
		% CMsg5_4 <ifNPCMelancholy Accept>
		% Msg5_5 <This is %name4%; I have nothing to report from my city patrol.>
		% CMsg5_5 <ifNPCEasygoing Accept>
		% Msg5_6 <The enemies of %name1% 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 <I'm not looking for trouble, I'm doing a bona fide patrol!>
		% CMsg5_8 <ifNPCCriminal Accept>
		% Msg5_9 <Right now I'm patrolling %name2%. It's our job to keep the city safe.>
		% CMsg5_9 <ifNPCHeroic Accept>
		% Msg5_10 <I'm looking for someone to fight. Not you, not today...>
		% CMsg5_10 <ifNPCVillainous Accept>
		% Msg5_11 <I'm out patrolling the city. If I run into any problems, I'll give you a call.>
		% Msg6 <You fail to attract the attention of %name4%.>
		% Msg7 <You confront %name4%.>
		Msg1 <%name4% の率いる防衛パトロール隊を発見した。>
		Msg2 <戦いを挑む。>
		Msg3 <離れる。>
		Msg4 <気付かれずに離脱した。>
		Msg5 <こちらはただの定期パトロール中%JG_DAYO。特に何も起こってない%JV_F_WA%JV_NA。>
		Msg5_1 <やあ \PC、こちらはただの \EXACT_SCENE %2% の定期パトロール中%JG_DAYO。こういうのを続けるのが仕事だから%JV_NA。今のところ何も問題は発生してない%JG_YO。>
		CMsg5_1 <ifNPCSociable Accept>
		Msg5_2 <今はお喋りは無し%JG_DA%JV_SIL_Rパトロール中%JV_M_DA。>
		CMsg5_2 <ifNPCShy Accept>
		Msg5_3 <\SCENE RootSceneID のパトロール中%JG_DAYO。この辺は何も異常無しみたい%JG_DANE。>
		CMsg5_3 <ifNPCCheerful Accept>
		Msg5_4 <\SCENE RootSceneID を滅ぼしたがってる奴らはごまんといるから%JV_NA。そいつらから街を守るのが%JF2の仕事%JG_DAYO。>
		CMsg5_4 <ifNPCMelancholy Accept>
		Msg5_5 <こちら %name4%。現在は市街パトロール中、何も異常無し%JG_DA。>
		CMsg5_5 <ifNPCEasygoing Accept>
		Msg5_6 <\SCENE RootSceneID の敵は眠らない……だから%JF2も%JG_DA。>
		CMsg5_6 <ifNPCPassionate Accept>
		Msg5_7 <街は平和そのもの%JG_DANE。無許可のメックの姿もない%JG_YO。>
		CMsg5_7 <ifNPCLawful Accept>
		Msg5_8 <面倒事には近寄らない%JV_F_WA。パトロールだから%JV_NA、真面目に "巡回" してる%JG_SK！>
		CMsg5_8 <ifNPCCriminal Accept>
		Msg5_9 <今は %name2% のパトロールをしてる%JG_NDA。街の安全を保つのが%JF2%JT_TACHIの仕事だから%JV_NA。>
		CMsg5_9 <ifNPCHeroic Accept>
		Msg5_10 <何処かにぶっ放してもいい相手はいないの%JV_Q……。%JR_NO、%JS_AGGじゃない%JV_ZO……今のところは。>
		CMsg5_10 <ifNPCVillainous Accept>
		Msg5_11 <現在、市街のパトロール中%JG_DAYO。何か問題に出くわしたら、%JS2にも連絡する%JG_YO。>
		Msg6 <%name4% の注意を引くことができなかった。>
		Msg7 <%name4% の部隊に接近した。>
		ENCOUNTER_Defense
	end

