%%
%% *CrimeWave Plots
%%
%%  A criminal faction is running amok in town. There will be missions to fight them,
%%  and maybe some random encounters.
%%
%% Mood Spec:
%%  E1 = The city itself
%%  E2 = The enemy faction
%%

Plot
	name <Rampaging Criminals>
	% desc <Some mecha from the criminal faction may attack the PC.>
	desc <犯罪勢力のメック隊が PC を攻撃するかもしれない。>
	requires <*CrimeWave -!Ne>

	% E1 is an outdoors scene
	% E2 is an encounter to place there
	% E3 is the faction that's rampaging
	Element1 <Scene Environs>
	Element2 <Prefab>
	Place2 <1>
	Element3 <Grab 2>

	% P1 = Time Limit/Initialization Counter
	start <if# P1 0 ifG ComTime P1 EndPlot>
	update <if= P1 0 P= 1 ComTime P+ 1 21600>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		SetFaction 3

		start <if= L2 0 L= 2 1 Alert 1>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1    AddRenown -1        EndPlot>
		nu2 <if= T2 0   if= V1 0 V= 1 1   AddRenown 1 Alert 2   XPV 100   SALVAGE   EndPlot>

		% Msg1 <You are attacked by mecha from %name3%!>
		% Msg2 <You have defeated the mecha.>
		Msg1 <%name3% のメックが攻撃を仕掛けてきた！>
		Msg2 <敵メックを撃破した。>

		% Random scene content- there's a small chance that an enemy or an ally will show up.
		Content1 <Some 1 5 Sub *CRC_Nemesis   na>
		Content2 <Some 1 5 Sub *CRC_Backup    na>

		sub
			team 1
			SetEnemy 2
			SetAlly 3
			ParaX 5
			ParaY 5

			team 2
			name <Enemies>
			SetEnemy 1 3
			Deploy <SetSelfFaction %3% WMecha 2 %threat% 100>
			ParaX 45
			ParaY 45

			team 3
			name <Allies>
			SetEnemy 2
			SetAlly 3
			ParaX 5
			ParaY 5
		end
	end
	inv
		STC ENCOUNTER-WANDER
		name <Criminals>
		name_I18N <犯罪者>
		EncounterMove 20
		ATTACK <ifG StatVal STAT_MetaVisibility -1   ifG PCScale 0   if# PCFac %3%   ifUStealth 15 else GoAutoAttack ifYesNo 3 -4 -5 else GoAvoidAttack Goto GoAutoAttack>
		% Msg3 <You are suddenly confronted by mecha from %name3%.>
		Msg3 <突然、%name3% のメックが行く手に現れた。>
	end

Plot
	name <Crime Stoppers>
	% The basic patrol job is a fight against some generic enemy mecha.
	% As a police job, this misssion doesn't offer salvage but it will
	% give a point of Lawful reputation.
	% This job will result in the PC making an enemy.
	requires <*CrimeWave>
	PayRate 135

	% E1 is the town itself
	% E2 is a character who will offer the mission
	% E3 is a scene where the encounter will take place
	% E4 is the enemy faction
	Element1 <Scene Town>
	Element2 <Character (POLIC|POLIT|Bounty) !Okay 1 !Xclude -2>
	Element3 <Scene Outdoors>
	Element4 <Grab 2>

	% SubPlot1 is the combat encounter
	SubPlot1 <*MECHAMISSION_Versus 2 3 4>

	% P1 = Time Limit
	% P2 = Email Indicator
	start <if= PlotStatus %plotid% 0 ifNPCOK %2% else GoDelete ifG ComTime P1 EndPlot>
	GoDelete <EndPlot>
	update <if= PlotStatus %plotid% 0 if= P1 0 P= 1 ComTime P+ 1 86400>

	% Insert email here
	5min <if= PlotStatus %plotid% 0 if= P2 0  if# NPCFac %2% 0  if= PCFac NPCFac %2%  if= RootSceneID %1% ifG PCCharm d30  SetNPC %2% Email 1 P= 2 1>
	% Msg1   <%name2%@ \SCENE NPCSCene %2% :// Hey \RANK , I've got a mission for you in %name1%.>
	% Msg1_1 <%name2%@ \SCENE NPCSCene %2% :// Report to \SCENE NPCSCene %2% for a mission at once.>
	% Msg1_2 <%name2%@ \SCENE NPCSCene %2% :// Your services are required by \FACTION NPCFac %2% . Come see me for mission briefing.>
	% Msg1_3 <%name2%@ \SCENE NPCSCene %2% :// I've got a mission for you. Come to \SCENE NPCSCene %2% for the briefing.>
	Msg1   <%name2%@ \SCENE NPCSCene %2% :// \RANK殿、%name1% で%JS2に任務%JV_M_DA%JV_F_YO。>
	Msg1_1 <%name2%@ \SCENE NPCSCene %2% :// 任務のため、ただちに \SCENE NPCScene %2% へ出頭せよ。>
	Msg1_2 <%name2%@ \SCENE NPCSCene %2% :// \FACTION NPCFac %2% は%JS2の貢献を必要としている%JV_F_WA。ブリーフィングを受けに%JF2のところまで来るように。>
	Msg1_3 <%name2%@ \SCENE NPCSCene %2% :// %JS2にミッション%JV_M_DA%JV_F_YO。ブリーフィングに \SCENE NPCScene %2% まで来るように。>

	sub
		Persona 2
		% rumor0 <%name2% needs a pilot to fight %name4%.>
		rumor0 <%name2% は %name4% と戦えるパイロットを探している>
		greeting <if= PlotStatus %plotid% %id1% else GoCheckOffer Goto GoRemind>
		*GoRemind <*MechaMissionReminder %3%>
		GoCheckOffer <if# PlotStatus %plotid% 0 else GoCheckEnemy NewChat SayAnything>
		*GoCheckEnemy <*ENEMY_CHECK GoCheckEmail ChatNPCFac GoEnd>
		GoCheckEmail <if= P2 1 else GoCheckMember Goto GoGotEmail>
		*GoGotEmail <*DidYouGetEmail GoMissionBriefing>
		GoCheckMember <if= PCFac ChatNPCFac else GoCheckAuto  Goto GoIsMember>
		*GoIsMember <*IHaveAJobForYou GoMissionBriefing>
		*GoCheckAuto <*AutoMissionTest&Mecha GoMissionBriefing GoRejectMission GoCheckSkill ChatNPCFac %4%>
		*GoCheckSkill <*GenericMissionTest&Mecha  GoMissionBriefing GoEnd GoRejectMission ChatNPCFac %4% %threat%>
		*GoRejectMission <*RejectMission GoEnd>
		GoEnd <EndPlot>
		GoMissionBriefing <NewChat Say 1  AddChat 1 AddChat 2>
		*result1 <*GoodLuckOnMission GoR1Final ChatNPCFac %4%>
		GoR1Final <Memo 2 SetPlotStatus %plotid% %id1%>
		result2 <Goto GoRejectMission>
		% Msg1 <Criminals from %name4% have been operating in %name3%. If you could defeat them, it'd be worth $ \VAL Reward %threat% PayRate and salvage.>
		% Msg1_1 <>
		% CMsg1_1 <ifNPCSociable Accept>
		% Msg1_2 <>
		% CMsg1_2 <ifNPCShy Accept>
		% Msg1_3 <>
		% CMsg1_3 <ifNPCEasygoing Accept>
		% Msg1_4 <>
		% CMsg1_4 <ifNPCPassionate Accept>
		% Msg1_5 <>
		% CMsg1_5 <ifNPCCheerful Accept>
		% Msg1_6 <>
		% CMsg1_6 <ifNPCMelancholy Accept>
		% Msg2 <%name2% in \SCENE NPCSCene %2% hired you to fight %name4% in %name3%.>
		% Prompt1 <That sounds easy enough.>
		% Prompt1_1 <Alright, I can do that.>
		% Prompt1_2 <I'll do it.>
		% Prompt2 <This isn't my kind of mission.>
		% CPrompt2 <if# PCFac ChatNPCFac Accept>
		% Prompt2_1 <Sorry, I'm not interested.>
		% Prompt2_2 <Really, I don't want to get involved.>
		Msg1 <%name4% からの犯罪者集団が %name3% で活動している%JG_NDA。奴らを撃破してくれれば、$ \VAL Reward %threat% PayRate の報酬とサルベージ権が得られる%JV_ZO。>
		Msg1_1 <>
		CMsg1_1 <ifNPCSociable Accept>
		Msg1_2 <>
		CMsg1_2 <ifNPCShy Accept>
		Msg1_3 <>
		CMsg1_3 <ifNPCEasygoing Accept>
		Msg1_4 <>
		CMsg1_4 <ifNPCPassionate Accept>
		Msg1_5 <>
		CMsg1_5 <ifNPCCheerful Accept>
		Msg1_6 <>
		CMsg1_6 <ifNPCMelancholy Accept>
		Msg2 <\SCENE NPCSCene %2% の %name2% は、%name3% で %name4% と戦うためにあなたを雇った。>
		Prompt1 <簡単そうな仕事%JG_DANE。>
		Prompt1_1 <分かった、やる%JG_YO。>
		Prompt1_2 <引き受け%JV_YOU。>
		Prompt2 <%JF2のやる仕事じゃない%JV_F_WA%JV_NA。>
		CPrompt2 <if# PCFac ChatNPCFac Accept>
		Prompt2_1 <悪い%JG_GA、興味ない%JV_F_WA%JV_NA。>
		Prompt2_2 <正直、関わりたくない%JV_F_WA%JV_NA。>
	end

