%%
%%  *:Q_MinorMission Content
%%
%% The PC will be assigned a minor task by an NPC.
%%
%% Param1 is the NPC providing the mission
%%   note: Persona 1 must have a .%id%_GoInit script
%%	The parent quest must handle E1's reaction to
%%	successfully completing/losing this subquest,
%%	though this SQ should have a reminder message
%%	in Persona 1.
%%
%% Set REQUIRES to *:Q_DMinorMission to load into the debugging stub.
%%
%% The parent quest should set a QMemo when this subquest either succeeds
%% or fails.
%%

Content
	name <Go Beat Rivals>
	% desc <A rival gang has moved into the city. See what you can do.>
	desc <対立しているギャングが街に入ってきた。対応に当たれ。>
	requires <*:Q_MinorMission 1:THIEF>
	special <REUSABLE>

	% E1 is the NPC offering the mission
	% E2 is the encounter that is the mission
	% E3 is an outdoors scene for it
	Element2 <Prefab>
	Place2 <3>
	Element3 <Scene Environs>

	%% FAIL CONDITIONS:
	%% - E1 dies
	end <ifNPCDead %1% LoseSubPlot %plotid%>

	sub
		Persona 1
		Greeting <if= PlotStatus %plotid% %id% else %pop% NewChat Say %id%01>
		.%id%_GoInit <SetPlotStatus %plotid% %id% NewChat Say %id%02 QMemo %plotid% %id%03>
		% Msg%id%01 <I'm still waiting for you to deal with my rivals.>
		% Msg%id%02 <A rival gang has moved into %name3% . Obviously, they need to be moved back out. I want you to go there and give them a message from me... make sure none of those bastards escape.>
		% Msg%id%03 <%name1% asked you to locate and eliminate a rival gang in %name3%.>
		Msg%id%01 <%JS2が奴らを片付けるのを待ってる%JV_ZO。>
		Msg%id%02 <ウチのライバルギャングが %name3% に侵入してきたみたい%JG_DANE。もちろん追い返す必要がある%JV_F_WA。奴らにそのメッセージを伝える仕事を%JS2に頼む%JG_YO%JV_SIL_Rただの一人も逃がしちゃいけない%JV_OJO_WA%JV_YO。>
		Msg%id%03 <%name3% にいるライバルギャングを探して殲滅するように %name1% に言われた。>
	end
	inv
		Encounter
		name <%name1%'s Rivals>
		name_I18N <ライバルギャング %name1%>
		Special <NoMSID>
		% V1 = Visibility Clock.
		%      If ComTime > V1 and PlotStatus %plotid% = %id%, encounter is active
		&EnemyFac <0>
		update <if= PlotStatus %plotid% %id% else GoHide ifG ComTime V1 else GoHide  SetStat STAT_MetaVisibility 0  ShowEncounter  Goto GoSetOrders>
		GoSetOrders <GrabSource GSetNAtt NAG_EpisodeData NAS_Orders 3>
		use <ifG StatVal STAT_MetaVisibility -1  Print -1  Goto GoStartCombat>
		ATTACK <ifG StatVal STAT_MetaVisibility -1    ifUStealth 15 else GoAutoAttack ifYesNo -3 -4 -5 else GoAvoidAttack Goto GoAutoAttack>
		GoAutoAttack <Alert -2 Goto GoStartCombat>
		GoAvoidAttack <Print -6 AddSociable -1>
		GoStartCombat <V= 1 ComTime V+ 1 86400  SavePos Dynamic 2 %threat% 100 .nu1 .nu2 ComposeD Msg1 .Msg1  DynaFaction &EnemyFac>
		.nu1 <if= T1 0  Return   if= L2 0  L= 2 1  LoseRenown  ItemVar= %2% 1 ComTime ItemVar+ %2% 1 d86400 ItemVar+ %2% 1 43200>
		.nu2 <if= T2 0           if= L2 0  L= 2 1  XPV 100     Alert 1  WinSubPlot %plotid% DeleteItem %2%>
		% .msg1 <You have defeated the rival gang.>
		.msg1 <ライバルギャングを倒した。>
		EncounterMove 50
	end


Content
	name <Go Beat Invaders>
	% desc <Some unauthorized mecha have shown up in the city. See what you can do.>
	desc <所属不明のメックが街の中に出現した。対応に当たれ。>
	requires <*:Q_MinorMission (1:MILIT|1:POLIT|1:ADVEN)>
	special <REUSABLE>

	% E1 is the NPC offering the mission
	% E2 is the encounter that is the mission
	% E3 is an outdoors scene for it
	Element2 <Prefab>
	Place2 <3>
	Element3 <Scene Outdoors>

	%% FAIL CONDITIONS:
	%% - E1 dies
	end <ifNPCDead %1% LoseSubPlot %plotid%>

	sub
		Persona 1
		Greeting <if= PlotStatus %plotid% %id% else %pop% NewChat Say %id%01>
		.%id%_GoInit <SetPlotStatus %plotid% %id% NewChat Say %id%02 QMemo %plotid% %id%03>
		% Msg%id%01 <The infiltrators in \SCENE %3% have not yet been dealt with.>
		% Msg%id%02 <A team of unknown mecha has been detected in %name3% . We don't yet know their intentions, but they must be stopped before they have a chance to do any damage.>
		% Msg%id%03 <%name1% asked you to locate and eliminate some mecha infiltrators in %name3%.>
		Msg%id%01 <\SCENE %3% への侵入者がまだ野放しになっている%JV_ZO。>
		Msg%id%02 <所属不明のメックの一団が %name3% で確認された%JV_F_WA。目的はまだ不明だ%JG_GA、被害を出す前に止めなければ。>
		Msg%id%03 <%name3% に侵入したメックの一団を探して殲滅するように %name1% に言われた。>
	end
	inv
		Encounter
		name <Invaders>
		name_I18N <侵入者>
		Special <NoMSID>
		% V1 = Visibility Clock.
		%      If ComTime > V1 and PlotStatus %plotid% = %id%, encounter is active
		&EnemyFac <0>
		update <if= PlotStatus %plotid% %id% else GoHide ifG ComTime V1 else GoHide  SetStat STAT_MetaVisibility 0  ShowEncounter  Goto GoSetOrders>
		GoSetOrders <GrabSource GSetNAtt NAG_EpisodeData NAS_Orders 3>
		use <ifG StatVal STAT_MetaVisibility -1  Print -1  Goto GoStartCombat>
		ATTACK <ifG StatVal STAT_MetaVisibility -1    ifUStealth 15 else GoAutoAttack ifYesNo -3 -4 -5 else GoAvoidAttack Goto GoAutoAttack>
		GoAutoAttack <Alert -2 Goto GoStartCombat>
		GoAvoidAttack <Print -6 AddSociable -1>
		GoStartCombat <V= 1 ComTime V+ 1 86400  SavePos Dynamic 2 %threat% 100 .nu1 .nu2 ComposeD Msg1 .Msg1  DynaFaction &EnemyFac>
		.nu1 <if= T1 0  Return   if= L2 0  L= 2 1  LoseRenown  ItemVar= %2% 1 ComTime ItemVar+ %2% 1 d86400 ItemVar+ %2% 1 43200>
		.nu2 <if= T2 0           if= L2 0  L= 2 1  XPV 100     Alert 1  WinSubPlot %plotid% DeleteItem %2%>
		% .msg1 <You have defeated the invaders.>
		.msg1 <侵入者たちを倒した。>
		EncounterMove 50
	end

Content
	name <Go Beat Thieves>
	% desc <Some mecha have been stolen, and are galavanting around. See what you can do.>
	desc <複数のメックが盗まれ、辺りをうろついている。対応に当たれ。>
	requires <*:Q_MinorMission (1:POLIC|1:CRAFT)>
	special <REUSABLE>

	% E1 is the NPC offering the mission
	% E2 is the encounter that is the mission
	% E3 is an outdoors scene for it
	Element2 <Prefab>
	Place2 <3>
	Element3 <Scene Outdoors>

	%% FAIL CONDITIONS:
	%% - E1 dies
	end <ifNPCDead %1% LoseSubPlot %plotid%>

	sub
		Persona 1
		Greeting <if= PlotStatus %plotid% %id% else %pop% NewChat Say %id%01>
		.%id%_GoInit <SetPlotStatus %plotid% %id% NewChat Say %id%02 QMemo %plotid% %id%03>
		% Msg%id%01 <Those mecha thieves have not yet been brought to justice.>
		% Msg%id%02 <Recently, a number of mecha have been stolen. The thieves are thought to be somewhere in the %name3% area. If you could catch them, I'd have a reward for you.>
		% Msg%id%03 <%name1% asked you to catch a gang of mecha thieves in %name3% .>
		Msg%id%01 <メックを盗んだ一団がまだ野放しになっている%JV_ZO。>
		Msg%id%02 <この前、複数のメックが盗まれる事件があった%JV_F_NO。その集団は %name3% のエリアのどこかにいるはず%JG_DAYO。奴らを捕まえることができたら、報酬が待ってる%JV_ZO。>
		Msg%id%03 <%name3% にいるメック泥棒の一団を捕まえるように %name1% に言われた。>
	end
	inv
		Encounter
		name <Stolen Mecha>
		name_I18N <盗まれたメック>
		Special <NoMSID>
		% V1 = Visibility Clock.
		%      If ComTime > V1 and PlotStatus %plotid% = %id%, encounter is active
		&EnemyFac <0>
		update <if= PlotStatus %plotid% %id% else GoHide ifG ComTime V1 else GoHide  SetStat STAT_MetaVisibility 0  ShowEncounter  Goto GoSetOrders>
		GoSetOrders <GrabSource GSetNAtt NAG_EpisodeData NAS_Orders 3>
		use <ifG StatVal STAT_MetaVisibility -1  Print -1  Goto GoStartCombat>
		ATTACK <ifG StatVal STAT_MetaVisibility -1    ifUStealth 15 else GoAutoAttack ifYesNo -3 -4 -5 else GoAvoidAttack Goto GoAutoAttack>
		GoAutoAttack <Alert -2 Goto GoStartCombat>
		GoAvoidAttack <Print -6 AddSociable -1>
		GoStartCombat <V= 1 ComTime V+ 1 86400  SavePos Dynamic 2 %threat% 100 .nu1 .nu2 ComposeD Msg1 .Msg1  DynaFaction &EnemyFac>
		.nu1 <if= T1 0  Return   if= L2 0  L= 2 1  LoseRenown  ItemVar= %2% 1 ComTime ItemVar+ %2% 1 d86400 ItemVar+ %2% 1 43200>
		.nu2 <if= T2 0           if= L2 0  L= 2 1  XPV 100     Alert 1  WinSubPlot %plotid% DeleteItem %2%>
		% .msg1 <You have defeated the mecha thieves.>
		.msg1 <メック泥棒たちを倒した。>
		EncounterMove 50
	end

Content
	name <Go Beat Rishiri>
	% desc <What could be better than blowing up some Rishiri mecha?>
	desc <Rishiri のメックを吹っ飛ばすよりイイ事なんてあるかな？>
	requires <*:Q_MinorMission 1:CRIHN ("RISHI"|"ROCKE")>

	% E1 is the NPC offering the mission
	% E2 is the encounter that is the mission
	% E3 is an outdoors scene for it
	Element2 <Prefab>
	Place2 <3>
	Element3 <Scene Outdoors>

	%% FAIL CONDITIONS:
	%% - E1 dies
	end <ifNPCDead %1% LoseSubPlot %plotid%>

	sub
		Persona 1
		Greeting <if= PlotStatus %plotid% %id% else %pop% NewChat Say %id%01>
		.%id%_GoInit <SetPlotStatus %plotid% %id% NewChat Say %id%02 QMemo %plotid% %id%03>
		% Msg%id%01 <The mecha force in %name3% hasn't been destroyed yet. What are you waiting for?>
		% Msg%id%02 <A Rishiri Spinner mecha force has been training in %name3% ; seems like they're gearing up to sweep the dusty ring. I want you to find this mecha force and destroy it. Leave no survivors.>
		% Msg%id%03 <%name1% asked you to locate and eliminate the Rishiri mecha force currrently training in %name3% .>
		Msg%id%01 <%name3% のメック部隊はまだ健在%JG_DA。%JS2は何をしている%JV_N%JV_M_DA？>
		Msg%id%02 <Rishiri Spinner のメック部隊が %name3% で訓練をしている%JV_F_WA…… Dusty Ring を掃討する準備のよう%JV_M_DA%JV_F_NE。%JS2には、この部隊を探し出して破壊して欲しい%JV_F_NO。生存者は出さないように。>
		Msg%id%03 <%name3% で訓練中の Rishiri のメック部隊を探して殲滅するように %name1% に言われた。>
	end
	inv
		Encounter
		name <Rishiri Mecha Force>
		name_I18N <Rishiri メック隊>
		Special <NoMSID>
		% V1 = Visibility Clock.
		%      If ComTime > V1 and PlotStatus %plotid% = %id%, encounter is active
		&EnemyFac <11>
		update <if= PlotStatus %plotid% %id% else GoHide ifG ComTime V1 else GoHide  SetStat STAT_MetaVisibility 0  ShowEncounter  Goto GoSetOrders>
		GoSetOrders <GrabSource GSetNAtt NAG_EpisodeData NAS_Orders 3>
		use <ifG StatVal STAT_MetaVisibility -1  Print -1  Goto GoStartCombat>
		ATTACK <ifG StatVal STAT_MetaVisibility -1    ifUStealth 15 else GoAutoAttack ifYesNo -3 -4 -5 else GoAvoidAttack Goto GoAutoAttack>
		GoAutoAttack <Alert -2 Goto GoStartCombat>
		GoAvoidAttack <Print -6 AddSociable -1>
		GoStartCombat <V= 1 ComTime V+ 1 86400  SavePos Dynamic 2 %threat% 100 .nu1 .nu2 ComposeD Msg1 .Msg1  DynaFaction &EnemyFac>
		.nu1 <if= T1 0  Return   if= L2 0  L= 2 1  LoseRenown  ItemVar= %2% 1 ComTime ItemVar+ %2% 1 d86400 ItemVar+ %2% 1 43200>
		.nu2 <if= T2 0           if= L2 0  L= 2 1  XPV 100     Alert 1  Salvage  WinSubPlot %plotid% DeleteItem %2%>
		% .msg1 <You have defeated the mecha.>
		.msg1 <メック部隊を倒した。>
		EncounterMove 50
	end


Content
	name <Go Beat Bandits>
	% desc <Some bandits have been attacking truckers. See what you can do.>
	desc <賊による輸送トラックへの攻撃が続いている。対応に当たれ。>
	requires <*:Q_MinorMission (1:CORPO|1:TRADE|1:LABOR)>
	special <REUSABLE>

	% E1 is the NPC offering the mission
	% E2 is the encounter that is the mission
	% E3 is an outdoors scene for it
	Element2 <Prefab>
	Place2 <3>
	Element3 <Scene Environs>

	%% FAIL CONDITIONS:
	%% - E1 dies
	end <ifNPCDead %1% LoseSubPlot %plotid%>

	sub
		Persona 1
		Greeting <if= PlotStatus %plotid% %id% else %pop% NewChat Say %id%01>
		.%id%_GoInit <SetPlotStatus %plotid% %id% NewChat Say %id%02 QMemo %plotid% %id%03>
		% Msg%id%01 <The bandits who have been attacking our truckers are still on the loose.>
		% Msg%id%02 <Several of our truckers have been attacked by bandits in %name3% . If you could locate these bandits and eliminate them, I'd have a reward for you.>
		% Msg%id%03 <%name1% asked you to locate some bandits in %name3% that have been attacking truckers.>
		Msg%id%01 <%JF2%JF_TACHIのトラックを襲ってる賊どもはまだ逃げ回ってる%JV_ZO。>
		Msg%id%02 <仲間のトラックが %name3% で賊に襲われた%JV_F_NO。賊どもを見つけ出して殲滅してくれれば、報酬を出す%JV_ZO。>
		Msg%id%03 <%name3% で仲間のトラックを攻撃している賊を探して殲滅するように %name1% に言われた。>
	end
	inv
		Encounter
		name <Bandits>
		name_I18N <賊>
		Special <NoMSID>
		% V1 = Visibility Clock.
		%      If ComTime > V1 and PlotStatus %plotid% = %id%, encounter is active
		update <if= PlotStatus %plotid% %id% else GoHide ifG ComTime V1 else GoHide  SetStat STAT_MetaVisibility 0  ShowEncounter  Goto GoSetOrders>
		GoSetOrders <GrabSource GSetNAtt NAG_EpisodeData NAS_Orders 3>
		use <ifG StatVal STAT_MetaVisibility -1  Print -1  Goto GoStartCombat>
		ATTACK <ifG StatVal STAT_MetaVisibility -1    ifUStealth 15 else GoAutoAttack ifYesNo -3 -4 -5 else GoAvoidAttack Goto GoAutoAttack>
		GoAutoAttack <Alert -2 Goto GoStartCombat>
		GoAvoidAttack <Print -6 AddSociable -1>
		GoStartCombat <V= 1 ComTime V+ 1 86400  SavePos Dynamic 2 %threat% 100 .nu1 .nu2 ComposeD Msg1 .Msg1  DynaFaction 0>
		.nu1 <if= T1 0  Return   if= L2 0  L= 2 1  LoseRenown  ItemVar= %2% 1 ComTime ItemVar+ %2% 1 d86400 ItemVar+ %2% 1 43200>
		.nu2 <if= T2 0           if= L2 0  L= 2 1  XPV 100     Alert 1  Salvage  WinSubPlot %plotid% DeleteItem %2%>
		% .msg1 <You have defeated the bandits.>
		.msg1 <賊の一味を倒した。>
		EncounterMove 50
	end


%%
%% *:DebugGiveMission Content
%%
%% Loads a mission into the Cavalier's Club for easy debugging.
%%

Content
	requires <*:Q_DebugGiveMission>
	% desc <The NPC will give the PC a mission, to be handled by a "GiveMission" subquest.>
	desc <NPC が PC にミッションを発行し、続きは "GiveMission" のサブクエストで処理される。>

	% E1 is the person who will be giving the mission.
	% E2 is the CavClub
	Element1 <NewNPC 0 0>
	Place1 <2 (Citizens) ally pass>
	Element2 <Scene CavClub>

	% SubQuest1 is the mission.
	SubPlot1 <*:Q_DMinorMission 1>

	sub
		Persona 1
		% rumor0 <%name1% needs a cavalier for a mission of some kind.>
		rumor0 <%name1% が何かのミッションのためにメック乗りを必要としている>
		greeting <if= PlotStatus %plotid% %id% else GoCheckFirst if= PlotStatus %plotid1% -1 else GoCheckLoss NewChat Say 1 SetPlotStatus %plotid% -1>
		GoCheckLoss <if= PlotStatus %plotid1% -2 else GoCheckFirst SetPlotStatus %plotid% -2 Goto GoEndInLoss>
		*GoEndInLoss <*MissionWasFailure na na na>
		GoCheckFirst <if= PlotStatus %plotid% 0 else GoChat Goto GoOfferQuest>
		*GoOfferQuest <*DoYouWantAJob GoStartQuest>
		GoStartQuest <SetPlotStatus %plotid% %id% Goto .%id1%_GoInit>
		GoChat <NewChat SayAnything>
		% Msg1 <I hear that you succeeded. The debugging of the mission is now over.>
		Msg1 <成功したようだね。このミッションのデバッグは成功だ。>

		MetaScene 1
		sub
			room
			desig <HOME>
			minimap <#&&&#&...&&.1.&&...&&&-&&>
		end
	end

