%% *CS_GiveMission Content
%%
%% The PC will be given something to do by an NPC.
%% The mission is separated from the plot so that the same mission code
%% can be used in multiple plot instances- the two main instances are
%% in "+Tgt +Fmi" when the PC has to see an NPC about a mission, and
%% also "+T--" when a member of the PC's faction could contact him with
%% a mission.
%%
%% The parent plot sets the plot status to this layer's ID when ready.
%%
%% Param1: The NPC who will be giving the mission. This NPC must have been
%% moved to the correct place by the parent plot.
%%

%%  *******************
%%  ***   DEFAULT   ***
%%  *******************
%% Use this section for truly default missions, or for missions which have wide application
%% across a number of plot states. See below for the state-specific missions.


%% Seto's Bride

Content
	name <Go Duel Someone>
	desc <The PC will be sent to go duel someone.>
	requires <*CS_GiveMission 1:PDASS>
	Size 1

	% E1 is the NPC the PC will speak with
	% E2 is a local public scene
	% E3 is a new NPC for the PC to duel
	Element2 <Scene Public (Building|Meeting|Garage) !Near -7>
	Element3 <NewNPC 2 -7>
	Place3 </>

	end <ifNPCDead %1%   DeleteNPC %3%  LoseComp 0 .%id%_loss>
	.%id%_loss <+T-->

	sub
		Persona 1
		greeting <if= PlotStatus %plotid% %id% else %pop%  Goto .%id%_GoGreet>
		*.%id%_GoGreet <*HowAreYou .%id%_GoBriefing>
		.%id%_GoBriefing <NewChat Say %id%01 AddChat %id%01 AddChat %id%02>
		result%id%01 <NewChat Say %id%02 History %id%03 SMemo %id%04 &SetTargetNPC %3% WinComp %2% .%id%_accept>
		.%id%_accept <+Tgt +Fch>
		result%id%02 <NewChat Say %id%05 History %id%06 SMemo 0   NTBLoseComp 0 .%id%_refuse>
		.%id%_refuse <+T-- +F-->
		Msg%id%01 <Say, how would you like to take part in a duel? I know someone who's been looking for an opponent.>
		Msg%id%02 <Great. You should be able to find %name3% over at %name2%. Good luck, \PC .>
		Msg%id%03 <%name1% suggested that you challenge %name3% to a duel.>
		Msg%id%04 <%name1% suggested that you challenge %name3% to a duel. You can find \OPR %3% in %name2%.>
		Msg%id%05 <Really? That's too bad.>
		Msg%id%06 <You refused %name1%'s offer to set you up with a duel.>
		Prompt%id%01 <I'd like that.>
		Prompt%id%02 <Sorry, I'm not interested.>
		CPrompt%id%02 <if# PCFac ChatNPCFac Accept>
	end


Content
	name <Enemy is working for enemy faction: Stop Them!>
	desc <The PC will be asked to go stop the Enemy from doing something for an enemy faction.>
	requires <*CS_GiveMission ~C:POLIC ~1:POLIC ~P:POLIC E:++ F:-- -1:PDASS>
	changes <F:++>

	% E1 is the NPC that the PC will speak with
	% E2 is the Enemy NPC
	% E3 is the enemy faction that the Enemy is working for
	element2 <Grab 1>
	element3 <Faction ArchEnemy !Enemy 1 !Okay 2>

	% Fail Conditions:
	% - Mission giver dies before encounter is activated

	end <if= PlotStatus %plotid1% 0  ifNPCDead %1% else %pop%  LoseComp 0 .%id%_loss>
	.%id%_loss <+T-->

	.%id1%_%plotid1%_GoWin <SetPlotStatus %plotid2% %id2%     SMemo %id%01>
	.%id1%_%plotid1%_GoLoss <SetPlotStatus %plotid3% %id3%    SMemo %id%02>

	Msg%id%01 <You stopped %name2%'s plan. You should go see %name1% at \SCENE NPCScene %1% about the reward.>
	Msg%id%02 <You failed to stop %name2%. You should go report to %name1% at \SCENE NPCScene %1% .>


	%% SubPlot1 is the combat encounter itself
	%% SubPlot2 is the winning condition
	%% SubPlot3 is the loss condition
	SubPlot1 <*:CS_StopNPCMission&IsEnemyNPC 2>
	SubPlot2 <*CS_CAWinMission 1>
	SubPlot3 <*CS_CALoseMission 1>

	sub
		Persona 1
		greeting <if= PlotStatus %plotid1% 0 else .%id%_GoRemind if# PlotStatus %plotid% %id% else .%id%_GoOfferMission Goto %pop%>
		.%id%_GoOfferMission <ifChatNPCUnknown else .%id%_GoKnownGreeting ifChatNPCAlly else .%id%_GoUnknownGreeting Goto .%id%_GoKnownGreeting>
		*.%id%_GoRemind <*GenericMissionReminder>
		*.%id%_GoKnownGreeting <*IHaveAJobForYou .%id%_GoBriefing>
		*.%id%_GoUnknownGreeting <*AreYouHereAboutJob&Mecha .%id%_GoBriefing>
		*.%id%_GoAccept <*GoodLuckPlusHint .%id%_GoR1Exit %plotid1%>>
		.%id%_GoR1Exit <SetPlotStatus %plotid1% %id1%>
		.%id%_GoBriefing <NewChat Say %id%01 AddChat %id%01 AddChat %id%02 &SetEnemyFac %3% SetNPCFaction %2% %3%>
		result%id%01 <SMemo %id%02 History %id%03 Goto .%id%_GoAccept>
		result%id%02 <SMemo %id%02 History %id%03 Goto .%id%_GoAccept>
		Msg%id%01 <It's been discovered that %name2% is working for %name3%. At this very minute \SPR %2% 's in town on some kind of mission. I want you to find out what \PPR %2% objective is, and to stop \OPR %2% .>
		Msg%id%02 <%name1% hired you to stop %name2% from completing a mission for %name3%.>
		Msg%id%03 <You learned that %name2% was working for %name3%.>
		Prompt%id%01 <No problem. I'll be back when I'm done.>
		Prompt%id%02 <With %name3% involved, I have no choice...>
	end


Content
	name <Basic Stop Enemy Mission>
	desc <The PC will be asked to go stop the Enemy from doing something.>
	requires <*CS_GiveMission ~C:POLIC ~1:POLIC ~P:POLIC E:++ -1:PDASS>

	% E1 is the NPC that the PC will speak with
	% E2 is the Enemy NPC
	element2 <Grab 1>

	% Fail Conditions:
	% - Mission giver dies before encounter is activated

	end <if= PlotStatus %plotid1% 0  ifNPCDead %1% else %pop%  LoseComp 0 .%id%_loss>
	.%id%_loss <+T-->

	.%id1%_%plotid1%_GoWin <SetPlotStatus %plotid2% %id2%     SMemo %id%01>
	.%id1%_%plotid1%_GoLoss <SetPlotStatus %plotid3% %id3%    SMemo %id%02>

	Msg%id%01 <You stopped %name2%'s plan. You should go see %name1% at \SCENE NPCScene %1% about the reward.>
	Msg%id%02 <You failed to stop %name2%. You should go report to %name1% at \SCENE NPCScene %1% .>


	%% SubPlot1 is the combat encounter itself
	%% SubPlot2 is the winning condition
	%% SubPlot3 is the loss condition
	SubPlot1 <*:CS_StopNPCMission&IsEnemyNPC 2>
	SubPlot2 <*CS_CAWinMission 1>
	SubPlot3 <*CS_CALoseMission 1>

	sub
		Persona 1
		greeting <if= PlotStatus %plotid1% 0 else .%id%_GoRemind if# PlotStatus %plotid% %id% else .%id%_GoOfferMission Goto %pop%>
		.%id%_GoOfferMission <ifChatNPCUnknown else .%id%_GoKnownGreeting ifChatNPCAlly else .%id%_GoUnknownGreeting Goto .%id%_GoKnownGreeting>
		*.%id%_GoRemind <*GenericMissionReminder>
		*.%id%_GoKnownGreeting <*IHaveAJobForYou .%id%_GoBriefing>
		*.%id%_GoUnknownGreeting <*AreYouHereAboutJob&Mecha .%id%_GoBriefing>
		*.%id%_GoBriefing <*CS_BasicStopEnemyMission .%id%_GoAccept .%id%_GoDeny>
		*.%id%_GoAccept <*GoodLuckPlusHint .%id%_GoR1Exit %plotid1%>
		.%id%_GoR1Exit <SetPlotStatus %plotid1% %id1%>
		*.%id%_GoDeny <*RejectMission .%id%_GoR2Exit>
		.%id%_GoR2Exit <LoseComp 0 .%id%_changes>
		.%id%_changes <+T-- +F-->
	end


Content
	name <Basic Fetch Mission>
	desc <The PC will be asked to go fetch an item.>
	requires <*CS_GiveMission ~C:THIEF ~1:THIEF ~P:CRIME -1:PDASS>

	% E1 is the NPC that the PC will speak with
	% E2 is the item to fetch
	Element2 <Prefab>

	% Fail Conditions:
	% - Mission giver dies before encounter is activated
	% - Fetch subplot fails

	end <if= PlotStatus %plotid1% 0 else .%id%_GoCheckReveal ifNPCDead %1% else %pop% LoseComp 0 .%id%_loss>
	.%id%_GoCheckReveal <ifSubPlotLost %plotid1% SMemo %id%01 SetPlotStatus %plotid3% %id3%>
	.%id%_loss <+T-->

	% Upon getting the item, set the win subplot.
	Get%2% <SMemo %id%02  SetPlotStatus %plotid2% %id2%>

	Msg%id%01 <You failed to recover the datachip. You should go report to %name1% at \SCENE NPCScene %1% .>
	Msg%id%02 <You should return the datachip to %name1% at \SCENE NPCScene %1% .>


	%% SubPlot1 is Fetch Item
	%% SubPlot2 is the winning condition
	%% SubPlot3 is the loss condition
	SubPlot1 <*:CS_FetchItem 2>
	SubPlot2 <*CS_WinFetchItem 1 2>
	SubPlot3 <*CS_CALoseMission 1>

	sub
		Persona 1
		greeting <if= PlotStatus %plotid1% 0 else .%id%_GoRemind if# PlotStatus %plotid% %id% else .%id%_GoOfferMission Goto %pop%>
		.%id%_GoOfferMission <ifChatNPCUnknown else .%id%_GoKnownGreeting ifChatNPCAlly else .%id%_GoUnknownGreeting Goto .%id%_GoKnownGreeting>
		*.%id%_GoRemind <*GenericMissionReminder>
		*.%id%_GoKnownGreeting <*IHaveAJobForYou .%id%_GoBriefing>
		*.%id%_GoUnknownGreeting <*AreYouHereAboutJob .%id%_GoBriefing>
		.%id%_GoBriefing <NewChat Say %id%01 AddChat %id%01 AddChat %id%02>
		*result%id%01 <*GoodLuckPlusHint .%id%_GoR1Exit %plotid1%>
		.%id%_GoR1Exit <StoryNote %id%02 SetPlotStatus %plotid1% %id1%>
		*Result%id%02 <*RejectMission .%id%_GoR2Exit>
		.%id%_GoR2Exit <LoseComp 0 .%id%_changes>
		.%id%_changes <+T-- +F-->
		Msg%id%01 <We've lost some very sensitive information in the form of a datachip. I need for you to locate this chip and return it to me.>
		Msg%id%02 <%name1% hired you to recover a lost datachip.>
		Prompt%id%01 <I'll be back when I have it.>
		Prompt%id%02 <Sorry, I'm only interested in fighting.>
		CPrompt%id%02 <if# PCFac ChatNPCFac Accept>
	end
	inv
		Treasure
		name <Datachip>
		desc <A mysterious datachip. Who knows what it contains?>
	end

Content
	name <Basic Investigation Mission>
	desc <The PC will be asked to gain some information.>
	requires <*CS_GiveMission ~C:POLIT ~C:ACADE ~C:MEDIA ~1:POLIT ~1:ACADE ~1:MEDIA ~P:POLIT -1:PDASS>

	% E1 is the NPC that the PC will speak with

	% Fail Conditions:
	% - Mission giver dies before mission is activated

	end <if= PlotStatus %plotid1% 0  ifNPCDead %1% LoseComp 0 .%id%_loss>
	.%id%_loss <+T-->

	.%id1%_%plotid1%_GoWin <SetPlotStatus %plotid2% %id2%     SMemo %id%01>
	.%id1%_%plotid1%_GoLoss <SetPlotStatus %plotid3% %id3%    SMemo %id%02>

	Msg%id%01 <You won the mission. You should go see %name1% at \SCENE NPCScene %1% about the reward.>
	Msg%id%02 <You lost the mission. You should go report to %name1% at \SCENE NPCScene %1% .>


	%% SubPlot1 is Gather Information
	%% SubPlot2 is the winning condition
	%% SubPlot3 is the loss condition
	SubPlot1 <*:CS_GatherInformation 1>
	SubPlot2 <*CS_CAWinMission 1>
	SubPlot3 <*CS_CALoseMission 1>

	sub
		Persona 1
		greeting <if= PlotStatus %plotid1% 0 else .%id%_GoRemind if# PlotStatus %plotid% %id% else .%id%_GoOfferMission Goto %pop%>
		.%id%_GoOfferMission <ifChatNPCUnknown else .%id%_GoKnownGreeting ifChatNPCAlly else .%id%_GoUnknownGreeting Goto .%id%_GoKnownGreeting>
		*.%id%_GoRemind <*GenericMissionReminder>
		*.%id%_GoKnownGreeting <*IHaveAJobForYou .%id%_GoBriefing>
		*.%id%_GoUnknownGreeting <*AreYouHereAboutJob&Mecha .%id%_GoBriefing>
		.%id%_GoBriefing <NewChat Say %id%01 AddChat %id%01 AddChat %id%02>
		Result%id%01 <History %id%02 SetPlotStatus %plotid1% %id1% Goto .%id1%_GoInform>
		*Result%id%02 <*RejectMission .%id%_GoR2Exit>
		.%id%_GoR2Exit <LoseComp 0 .%id%_changes>
		.%id%_changes <+T-- +F-->
		Msg%id%01 <We have a situation going on, \PC . I'd like for you to investigate it and see what you can find out.>
		Msg%id%02 <%name1% hired you to investigate things.>
		Prompt%id%01 <I'll do it.>
		Prompt%id%02 <Sorry, I'm only interested in fighting.>
		CPrompt%id%02 <if# PCFac ChatNPCFac Accept>
	end

Content
	name <Basic Fighting Mission>
	desc <The PC will be asked to go fight some mecha.>
	requires <*CS_GiveMission ~C:MILIT ~1:MILIT ~1:ADVEN ~P:MILIT -1:PDASS>

	% E1 is the NPC that the PC will speak with
	% E2 is the outdoors location where the encounter will be placed
	% E3 is the encounter to be found

	element2 <Scene Environs !Near -7>
	element3 <Prefab>
	place3 <2>

	% Fail Conditions:
	% - Mission giver dies before encounter is activated
	% - Revalation subplot fails

	end <if= PlotStatus %plotid1% 0 else .%id%_GoCheckReveal ifNPCDead %1% LoseComp 0 .%id%_loss>
	.%id%_GoCheckReveal <ifSubPlotLost %plotid2% SMemo %id%02 SetPlotStatus %plotid5% %id5%>
	.%id%_loss <+T-->

	.%id1%_%plotid1%_GoWin <SetPlotStatus %plotid3% %id3%     SMemo %id%01>
	.%id1%_%plotid1%_GoLoss <SetPlotStatus %plotid4% %id4%    SMemo %id%02>

	Msg%id%01 <You won the mission. You should go see %name1% at \SCENE NPCScene %1% about the reward.>
	Msg%id%02 <You lost the mission. You should go report to %name1% at \SCENE NPCScene %1% .>


	%% SubPlot1 is the combat encounter itself
	%% SubPlot2 is the encounter revealation
	%% SubPlot3 is the winning condition
	%% SubPlot4 is the loss condition
	%% SubPlot5 is the unwinnable condition
	SubPlot1 <*:CS_MechaEncounter&Raiders 2 3>
	SubPlot2 <*:CS_RevealEncounter_Raiders 2 3>
	SubPlot3 <*CS_CAWinMission 1>
	SubPlot4 <*CS_CALoseMission 1>
	SubPlot5 <*CS_MootMission 1>

	sub
		Persona 1
		greeting <if= PlotStatus %plotid1% 0 else .%id%_GoRemind if# PlotStatus %plotid% %id% else .%id%_GoOfferMission Goto %pop%>
		.%id%_GoOfferMission <ifChatNPCUnknown else .%id%_GoKnownGreeting ifChatNPCAlly else .%id%_GoUnknownGreeting Goto .%id%_GoKnownGreeting>
		*.%id%_GoRemind <*GenericMissionReminder>
		*.%id%_GoKnownGreeting <*IHaveAJobForYou .%id%_GoBriefing>
		*.%id%_GoUnknownGreeting <*AreYouHereAboutJob&Mecha .%id%_GoBriefing>
		*.%id%_GoBriefing <*CS_BasicFightingMission .%id%_GoAccept .%id%_GoDeny>
		*.%id%_GoAccept <*GoodLuckPlusHint .%id%_GoR1Exit %plotid2%>
		.%id%_GoR1Exit <SetPlotStatus %plotid1% %id1%  SetPlotStatus %plotid2% %id2%>
		*.%id%_GoDeny <*RejectMission .%id%_GoR2Exit>
		.%id%_GoR2Exit <LoseComp 0 .%id%_changes>
		.%id%_changes <+T-- +F-->
	end
	inv
		stc CORE-ACTIVATABLE
		name <%name1%'s Mission>
	end


%%  ********************************
%%  ***   +P--  Peaceful  Life   ***
%%  ********************************



%%  *****************************************
%%  ***   +Pme	PC meets an enemy pilot   ***
%%  *****************************************


%%  *****************************************
%%  ***   +Pun  Unknown  Enemy  Attacks   ***
%%  *****************************************


%%  ***********************************************************
%%  ***   +Psh	PC is shanghaied into working for faction   ***
%%  ***********************************************************


%%  *************************************
%%  ***   +Pla  Learn  of  Artifact   ***
%%  *************************************


%%  ****************************************
%%  ***   +Pew  Enemy  Weapon  Program   ***
%%  ****************************************





