%%
%% *CS_Duel Content
%%
%%
%% The PC is about to duel somebody as part of the core story.
%%
%% The parent plot sets the plot status to this layer's ID when ready.
%% This component should move the opponent from its current location to the
%% contest location at update, and then move the opponent back to its
%% original location at the end of the battle.
%%
%% Param1: The Challenger
%% Param2: The Challenger's home scene, for the purpose of this component
%% Param3: The outdoor scene where the duel will take place
%%
%% NEEDED SCRIPTS: To deal with the ending, the parent plot must define two
%% scripts:
%% 	.%id%_%plotid%_GoWin
%% 	.%id%_%plotid%_GoLose
%% These scripts should set story memos.
%% %id% is the ID of the duel layer; so, if it was generated as subplot 1,
%% the calling plot would use %id1%.

Content
	name <Asteroid Duel>
	desc <The PC and the NPC will fight on an asteroid.>
	requires <*CS_Duel 3:SPACE>
	Size 5

	% E1 is the challenger
	% E2 is the challenger's home scene
	% E3 is the outdoor scene where the duel will take place
	% E4 is the duel encounter
	Element4 <Prefab>
	Place4 <%e3%>

	% P%id%01 = Initialization Counter
	update <if= P%id%01 0 MoveNPC %1% %4% SetNPCTeam %1% 2 NPCLevel %1% StoryDL P= %id%01 1>

	sub
		Persona 1
		greeting <if= PlotStatus %plotid% %id% else %pop%  ifChatNPCInPlay else .%id%_GoNotInPlay Goto .%id%_GoChallenge>
		*.%id%_GoChallenge <*ArenaChallenge .%id%_GoThemeInfo>
		*.%id%_GoThemeInfo <*THEME_EXPO&Enemy NA>
		*.%id%_GoNotInPlay <*WaitingForDuel %3%>

		MetaScene 4 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		% L4 = Identity of enemy NPC
		MapWidth 30
		MapHeight 30
		AsteroidMap
		RockyTiles

		% Suffocation effect...
		Vacuum
		SpaceBackdrop

		special <ARENA SOLO>

		Start <if= L2 0 L= 2 1   Alert 1 ForceChat %1%>
		nu1 <if= T1 0  Return   if= L1 0 L= 1 1   MoveNPC %1% %2%  History 4  Print 2 LoseRenown  Trigger0 .%id%_%plotid%_GoLose>
		nu2 <if= T2 0           if= L1 0 L= 1 2   MoveNPC %1% %2%  History 5  Print 2 AddRenown 1   XPV 100   Trigger0 .%id%_%plotid%_GoWin>

		Msg1 <%name1% found a large asteroid to fight on>
		Msg2 <%name1% returns to %name2%.>
		Msg4 <You were defeated by %name1% in a duel.>
		Msg5 <You defeated %name1% in a duel.>

		sub
			team 1
			SetEnemy 2
			ParaX 5
			ParaY 5

			team 2
			SetEnemy 1
			ParaX 25
			ParaY 25
		end

	end
	inv
		STC ENCOUNTER-DUEL
		name <%name1%'s Mecha>
		update <if= PlotStatus %plotid% %id% else GoHide ShowEncounter SetStat STAT_MetaVisibility 0  Goto GoSetOrders>
	end

Content
	name <Battle Royale>
	desc <The PC, the NPC, and all their henchmen will fight. Booyah!>
	requires <*CS_Duel -1:PDASS ~1:THIEF ~1:EVIL_ -1:GOOD_ ~1:CRIHN ~+Gfa -!Ne ~!Hi ~!Ex>
	Size 8

	% E1 is the challenger
	% E2 is the challenger's home scene
	% E3 is the outdoor scene where the duel will take place
	% E4 is the duel encounter
	Element4 <Prefab>
	Place4 <%e3%>

	% P%id%01 = Initialization Counter
	update <if= PlotStatus %plotid% %id% else %pop% if= P%id%01 0 MoveNPC %1% %4% SetNPCTeam %1% 2 NPCLevel %1% StoryDL P= %id%01 1>

	sub
		Persona 1
		rumor%id% <%name1% plays by Martian rules.>
		greeting <if= PlotStatus %plotid% %id% else %pop%  ifChatNPCInPlay else .%id%_GoNotInPlay Goto .%id%_GoChallenge>
		*.%id%_GoNotInPlay <*WaitingForDuel %3%>
		.%id%_GoChallenge <EndChat Say %id%01 AddChat %id%01 AddChat %id%02>

		result%id%01 <EndChat Say %id%02 AddChat %id%03>
		result%id%02 <EndChat Say %id%03 AddChat %id%03>
		*result%id%03 <*THEME_EXPO&Enemy NA>

		Msg%id%01 <This duel will be me and all of my lancemates against you and all of your lancemates. Whoever has the last mecha standing wins the match.>
		Msg%id%01_1 <For this duel, we'll be using Martian rules. It's going to be me and my team against you and your team. Whichever side has the last lancemate standing wins.>
		Msg%id%01_2 <This is going to be a battle royale match. You get to bring all of your lancemates, and I get to bring all of my lancemates.>
		Msg%id%02 <Well, you should have thought of that before you agreed to this duel! Let's get this match underway.>
		Msg%id%02_1 <It's a bit too late to be whining about that now! You should have thought of that before coming here.>
		Msg%id%03 <That's the spirit! Let's get this match underway.>
		Msg%id%03_1 <Now that we're all agreed, let's get this match underway.>
		Msg%id%03_2 <Okay, now that the rules have been settled we can start the match.>
		Prompt%id%01 <But I don't have any lancemates!>
		CPrompt%id%01 <if= T-3 0 Accept>
		Prompt%id%02 <That sounds fair.>
		Prompt%id%02_1 <Sounds good.>
		Prompt%id%02_2 <All right.>
		Prompt%id%03 <[Continue]>

		MetaScene 4 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		% L4 = Identity of enemy NPC
		MapWidth 30
		MapHeight 30

		special <ARENA>

		Start <if= L2 0 L= 2 1   ForceChat %1%>
		nu1 <if= T1 0  Return   if= L1 0 L= 1 1   MoveNPC %1% %2%  History 4  Print 2 LoseRenown  Trigger0 .%id%_%plotid%_GoLose>
		nu2 <if= T2 0           if= L1 0 L= 1 2   MoveNPC %1% %2%  History 5  Print 2 AddRenown 1   XPV 100  Salvage   Trigger0 .%id%_%plotid%_GoWin>

		Msg2 <%name1% returns to %name2%.>
		Msg4 <You were defeated by %name1% and \PPR %1% lancemates in a duel.>
		Msg5 <You defeated %name1% and \PPR %1% lancemates in a duel.>

		sub
			team 1
			SetEnemy 2
			ParaX 5
			ParaY 5

			team 2
			SetEnemy 1
			Deploy <SetSelfFaction NPCFac %1%   WMecha 2 StoryDL 70>
			ParaX 25
			ParaY 25
		end

	end
	inv
		STC ENCOUNTER-DUEL
		name <%name1%'s Mecha>
		update <if= PlotStatus %plotid% %id% else GoHide ShowEncounter SetStat STAT_MetaVisibility 0  Goto GoSetOrders>
	end


Content
	name <Regular Duel>
	desc <The PC and the NPC will fight. Nothing special happens.>
	requires <*CS_Duel>
	Size 5

	% E1 is the challenger
	% E2 is the challenger's home scene
	% E3 is the outdoor scene where the duel will take place
	% E4 is the duel encounter
	Element4 <Prefab>
	Place4 <%e3%>

	% P%id%01 = Initialization Counter
	update <if= PlotStatus %plotid% %id% else %pop% if= P%id%01 0 MoveNPC %1% %4% SetNPCTeam %1% 2 NPCLevel %1% StoryDL P= %id%01 1>

	sub
		Persona 1
		greeting <if= PlotStatus %plotid% %id% else %pop%  ifChatNPCInPlay else .%id%_GoNotInPlay Goto .%id%_GoChallenge>
		*.%id%_GoChallenge <*ArenaChallenge .%id%_GoThemeInfo>
		*.%id%_GoThemeInfo <*THEME_EXPO&Enemy NA>
		*.%id%_GoNotInPlay <*WaitingForDuel %3%>

		MetaScene 4 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		% L4 = Identity of enemy NPC
		MapWidth 30
		MapHeight 30

		special <ARENA SOLO>

		Start <if= L2 0 L= 2 1   ForceChat %1%>
		nu1 <if= T1 0  Return   if= L1 0 L= 1 1   MoveNPC %1% %2%  History 4  Print 2 LoseRenown  Trigger0 .%id%_%plotid%_GoLose>
		nu2 <if= T2 0           if= L1 0 L= 1 2   MoveNPC %1% %2%  History 5  Print 2 AddRenown 1   XPV 100   Trigger0 .%id%_%plotid%_GoWin>

		Msg2 <%name1% returns to %name2%.>
		Msg4 <You were defeated by %name1% in a duel.>
		Msg5 <You defeated %name1% in a duel.>

		sub
			team 1
			SetEnemy 2
			ParaX 5
			ParaY 5

			team 2
			SetEnemy 1
			ParaX 25
			ParaY 25
		end

	end
	inv
		STC ENCOUNTER-DUEL
		name <%name1%'s Mecha>
		update <if= PlotStatus %plotid% %id% else GoHide ShowEncounter SetStat STAT_MetaVisibility 0  Goto GoSetOrders>
	end

%%
%% *:CS_TournamentMatch Content
%%
%%  There's apparently a tournament going on. The PC will be able to challenge a NPC
%%  to a duel, which will be handled by the above subplot type.
%%
%% NEEDED SCRIPTS: To deal with the ending, the parent plot must define two
%% scripts:
%% 	.%id%_%plotid%_GoWin
%% 	.%id%_%plotid%_GoLose
%%
%% PARAM1: The NPC to be challenged
%% PARAM2: The home scene for this NPC

Content
	name <Basic Tournament Match>
	desc <You're going to challenge some guy.>
	requires <*:CS_TournamentMatch>

	% E1 is the NPC to be challenged
	% E2 is the home scene for the NPC
	% E3 is a location for the duel.
	Element3 <Scene Environs !Near -7>

	% As long as we're still at the first phase, the NPC's death will end the plot.
	start <if= PlotStatus %plotid% %id% ifNPCDead %1% Goto .%id1%_%plotid%_GoLose>

	% Resolution Scripts
	.%id1%_%plotid%_GoWin  <WinSubPlot %plotid%   Trigger0 .%id%_%plotid%_GoWin>
	.%id1%_%plotid%_GoLose <LoseSubPlot %plotid%  Trigger0 .%id%_%plotid%_GoLose>

	% SubPlot1 is the duel itself
	SubPlot1 <*CS_Duel&NoDerailment 1 2 3>

	sub
		Persona 1
		greeting <if= PlotStatus %plotid% %id% else %pop% Goto GoFirstTime>
		*GoFirstTime <*PCChallengeNPC GoMakeChallenge GoWussOut>
		GoMakeChallenge <History %id%01 PMemo %plotid% %id%01 SetPlotStatus %plotid1% %id1% Goto GoAcceptChallenge>
		*GoAcceptChallenge <*IAcceptYourChallenge %3%>
		*GoWussOut <*GodImBored>
		Msg%id%01 <You challenged %name1% to a duel in \EXACT_SCENE %3% .>
	end

%%
%%  *CS_MajorDuel
%%
%%  The following duels derail the plot; they've been quarantined here until
%%  I decide how to incorporate them into the new paradigm.
%%

Content
	name <Psycho Duelist>
	desc <Your duel is cut short by the intervention of an apparent psychopath.>
	requires <*CS_MajorDuel (+P--|+Pme) E:-- ~+Gre>

	% E1 is the challenger
	% E2 is the challenger's home scene
	% E3 is the outdoor scene where the duel will take place
	% E4 is the dueling scene
	% E5 is the opposing character
	% E6 is a hospital, to use if the PC wins
	Element4 <Prefab>
	Place4 <3>
	Element5 <Prefab>
	Element6 <Scene Hospital !Near -7>

	% P%id%01 = Initialization Counter
	% P%id%02 = Initialization Counter

	update <if= PlotStatus %plotid% %id% else %pop%  if=  P%id%01 0  P= %id%01 1  FreezeNPC %1% MoveNPC %5% %4% SetNPCTeam %5% 2 P= %id%02 StoryDL P+ %id%02 10 NPCLevel %5% P%id%02>

	% SubPlot1 = If you managed to rescue E1...
	SubPlot1 <*CS_ThanksForRescue&FromCSEnemy 1>

	sub
		MetaScene 4 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		% L3 = E1 powerup var
		MapWidth 30
		MapHeight 30

		special <SOLO ARENA>

		Start <if= L2 0 L= 2 1   StoryNote 1  Alert 10  ForceChat %5%    &SetEnemyNPC %5%   SetXXRAttitude %5% XXR_A_IsSenior  AlterContext .alter>
		.alter <+Pun>
		nu1 <if= T1 0  Return   if= L1 0 L= 1 1   DeleteNPC %1%    LoseComp 0 .loss>
		.loss <+T-- +F-->
		nu2 <if= T2 0           if= L1 0 L= 1 2   ifYesNo 4 5 6 else GoLeaveE1ToDie MoveNPC %1% %6%  Print 3 SMemo 7 History 8   AddRenown 1   XPV 100   SetPlotStatus %plotid% %id1%>
		% If E1 is left to die, there's a chance he'll survive and become the PC's enemy.
		GoLeaveE1ToDie <SMemo 0 History 9 WinComp 0 .win   XPV 100  AddHeroic -2  if= d2 1 else GoDeleteE1 PCEnemy %1% L= 3 StoryDL L+ 3 d40 NPCLevel %1% L3>
		GoDeleteE1 <DeleteNPC %1%>
		.win <+T-- +F-->

		% E5 has script immunity for this encounter...
		end <FreezeNPC %5%>

		Msg1 <Your duel with %name1% was interrupted by %name5%.>
		Msg3 <You call for help to take %name1% to %name6%.>
		Msg4 <With %name5% gone, you can deal with %name1%; \PPR %1% mecha is severely damaged and \SPR %1% may be injured or dead.>
		Msg5 <Call for help>
		Msg6 <Leave \OPR %1% there>
		Msg7 <You rescued %name1% from %name5%; \SPR %1% should be resting at %name6% now.>
		Msg8 <You rescued %name1% from %name5%.>
		Msg9 <After defeating %name5%, you left %name1% to die.>
		Msg10 <You arrive for the duel, but %name1% is nowhere to be seen. Instead you are confronted by %name5%.>

		sub
			team 1
			SetEnemy 2
			ParaX 5
			ParaY 5

			team 2
			SetEnemy 1
			ParaX 25
			ParaY 25
		end

		Persona 5
		special <UNLISTED NOESCAPE>
		greeting <EndChat Say 1 AddChat 1>
		result1 <EndChat Say 2 AddChat 2 AddChat 3 AddChat 4>
		result2 <ifConversation HardSkillTar StoryDL else GoR2Fail EndChat Say 4 Print 9 MoveNPC %1% %6%  Exit %6%  SMemo 5  History 6   AddRenown 1  AddHeroic 1  AddReact -d20  SetPlotStatus %plotid% %id1%>
		GoR2Fail <EndChat Say 3 AddChat 5>
		result3 <EndChat Say 7 AddChat 5>
		result4 <EndChat Say 8 AddChat 5>
		*result5 <*THEME_EXPO&Enemy NA>
		Msg1 <Finally, the second pilot has arrived. I was hoping you'd show up in time for me to see both of you at once.>
		Msg2 <That would be \PPR %1% wreckage you see over there. I'm afraid \SPR %1% didn't provide much of a challenge, but maybe you'll be harder to kill.>
		Msg3 <Why should I let my plaything go when you haven't even been scratched yet?>
		Msg4 <Isn't that touching... I take it from the sound of your voice that you're not likely to be much of a compeditor. Go, then, and know that you have been spared death.>
		Msg5 <You rescued %name1% from %name5%; \SPR %1% should be resting at %name6% now.>
		Msg6 <You rescued %name1% from %name5%.>
		Msg7 <My plans will be clear to the whole world soon enough, but for right now I am merely looking at some light entertainment.>
		Msg8 <You have spirit... There's a chance you'll last longer than %name1%, though I doubt that very much.>
		Msg9 <You bring %name1% to %name6% for emergency treatment.>
		Prompt1 <What happened to %name1%?>
		Prompt1_1 <Where is %name1%?>
		Prompt2 <Please, let me take %name1% to hospital.>
		Prompt3 <Why are you doing this?>
		Prompt4 <That's it, you're going down.>
		Prompt4_1 <Enough talking. Let's fight.>
		Prompt5 <[Continue]>
	end
	inv
		STC ENCOUNTER-DUEL
		name <%name1%'s Mecha>
		update <if= PlotStatus %plotid% %id% else GoHide ShowEncounter SetStat STAT_MetaVisibility 0  Goto GoSetOrders>

		NPC Mecha Pilot
		chardesc Villainous Renowned
	end

Content
	name <Against The Law>
	Size 5
	desc <Dueling's illegal in L5, don't you know? But you can cut a deal...>
	requires <*CS_MajorDuel (+P--|+Pme) F:-- (L:MAQUI|L:FCOMS|L:RISHI) -L:Enemy (C:MILIT|C:ADVEN|C:POLIC|P:PDASS) -P:CRIME>
	% E1 is the challenger
	% E2 is the challenger's home scene
	% E3 is the outdoor scene where the duel will take place
	% E4 is L5Law
	% E5 is a crime faction
	% E6 is the duel scene itself
	% E7 is the police officer
	Element4 <Faction L5Law>
	Element5 <Faction Crime !Enemy 4>
	Element6 <Prefab>
	Place6 <3>
	element7 <Character HasMecha !Comrade 4 !Near -2 NeverFail>
	NeverFail7 <Police Officer>

	% P%id%01 = Initialization Counter
	% P%id%02 = E7's original home

	update <if= PlotStatus %plotid% %id% else %pop%  if=  P%id%01 0  P= %id%01 1  MoveNPC %1% %6%  SetNPCTeam %1% 3  NPCLevel %1% StoryDL   P= %id%02 NPCScene %7% FreezeNPC %7%>

	% SubPlot1 = The Induction
	subplot1 <*ForcedInduction 7 4>

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

		special <ARENA SOLO>

		Start <if= L2 0 L= 2 1   Alert 1  Monologue %1% 2 ForceChat %7%>
		nu1 <if= T1 0  Return   if= L1 0 L= 1 1   LoseComp 0 .next>
		nu2 <if= T2 0           if= L1 0 L= 1 2   AddRenown 1  XPV 100   SALVAGE  WinComp 0 .next>
		.next <+T-- +F-->

		end <ifNPCOK %1% MoveNPC %1% %2%>

		Msg1 <As you prepare to duel %name1%, the two of you are approached by L5Law.>
		Msg2 <I hope this isn't about all my unpaid parking tickets...>
		Msg2_1 <You stall the cops, I have to eat the contents of my glove box...>
		Msg2_2 <I know I haven't done anything wrong... that means they must be after you.>

		sub
			team 1
			SetEnemy 2
			ParaX 5
			ParaY 10

			team 2
			SetEnemy 1 3
			SetFaction 9
			Deploy <WMecha 2 StoryDL 250>
			ParaX 25
			ParaY 25

			team 3
			SetEnemy 2
			ParaX 10
			ParaY 5
		end

		Persona 1
		greeting <if= PlotStatus %plotid% %id% else %pop% Goto GoBusy   EndChat Say %id%01>
		Msg%id%01 <Not a good time to be talking right now...>

		Persona 7
		% V1 = Have chatted counter
		special <UNLISTED NOESCAPE>
		greeting <if= V1 0 else GoBeenBefore  MoveNPC %7% P%id%02   V= 1 1  EndChat Say 1  AddChat 1 AddChat 9 AddChat 3>
		GoBeenBefore <EndChat SayAnything>

		result1 <EndChat AddEasygoing -d10  Say 2 AddChat 4 AddChat 5>
		result2 <EndChat Say 3 AddChat 6 AddChat 7>
		result3 <EndChat AddReact d15 Say 4 AddChat 8>
		result4 <EndChat Say 5 StoryNote 6 AddLawful -10 AlterContext .attack &SetEnemyFac %5%>
		.attack <+Pun>
		result5 <Goto result2>
		result6 <EndChat Say 7 StoryNote 6 AddLawful d6 SetPlotStatus %plotid% %id1%>
		result7 <Goto result4>
		result8 <Goto result2>
		result9 <EndChat Say 8 AddChat 2>

		Msg1 <You two do know that unlicensed dueling is prohibited in the colonies, don't you? Power down your weapons and come quietly; you're under arrest.>
		Msg2 <Don't be a fool. Even if you escape from us now, resisting arrest is going to be on your record forever. Cooperate and things will go much better.>
		Msg3 <L5Law is in need of your talents. There have been problems with %name5% lately; we could use a good mecha pilot to help fight them. Aid us in this, and this duel will be stricken from your record.>
		Msg4 <You're observant... that's a good trait to have. It's true that I have an ulterior motive for being here today.>
		Msg5 <I think you're making a big mistake... as %name5% increases in power it's going to be bad news for all of us.>
		Msg6 <You were busted by L5Law for illegal dueling.>
		Msg7 <You're making a smart move. I promise that you won't regret it.>
		Msg8 <Actually, that may be possible. With a bit of cooperation this could go very easily for you.>

		Prompt1 <You'll never take me alive, copper!>
		Prompt2 <What do you want?>
		Prompt3 <No-one ever enforces that law. What's going on?>
		CPrompt3 <ifG PCKnowledge 13 Accept>
		Prompt4 <Forget it, I'm fighting my way out!>
		Prompt5 <Alright. Tell me what you want.>
		Prompt6 <OK, I'll help you.>
		Prompt7 <Sorry, I'd rather have my freedom.>
		Prompt8 <So, what do you want?>
		Prompt9 <Wait, we can work out a deal...>

	end
	inv
		STC ENCOUNTER-DUEL
		name <%name1%'s Mecha>
		update <if= PlotStatus %plotid% %id% else GoHide ShowEncounter SetStat STAT_MetaVisibility 0  Goto GoSetOrders>
	end

Content
	name <A Duel Interrupted>
	Size 8
	desc <When you go to fight, you find some other mecha there.>
	requires <*CS_MajorDuel (+P--|+Pme) ~F:-- ~T:Ally ~T:Friend -L:Enemy ~+Gpe>

	% E1 is the challenger
	% E2 is the challenger's home scene
	% E3 is the outdoor scene where the duel will take place
	% E4 is the faction whose mecha are present
	% E5 is the faction of the current city
	% E6 is the duel scene itself
	element4 <Faction  !Enemy -7 !Xclude 1>
	% The faction of the root scene must not be an enemy of the character
	% you're dueling...
	element5 <Faction !Comrade -7 !Okay 1>
	Element6 <Prefab>
	Place6 <%e3%>

	% P%id%01 = Initialization Counter
	% P%id%02 = Duel target skill level calculator

	update <if= PlotStatus %plotid% %id% else %pop%  if=  P%id%01 0  P= %id%01 1  MoveNPC %1% %6%  SetNPCTeam %1% 3  V= %id%02 StoryDL  V+ %id%02 d5  NPCLevel %1% V%id%02 Goto %pop%>

	% SubPlot1 is the victory bit
	SubPlot1 <*CS_ThanksForAssist 1>

	sub
		MetaScene 6 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		% L4 = Identity of enemy NPC
		MapWidth 30
		MapHeight 30

		special <ARENA SOLO>

		Start <if= L2 0 L= 2 1   ForceChat %1%   AlterContext .change L= 4 %1%>
		nu1 <if= T1 0  Return   if= L1 0 L= 1 1   StoryNote 1   LoseRenown Trigger0 .%id%_%plotid%_GoLose>
		nu2 <if= T2 0           if= L1 0 L= 1 2   StoryNote 1   AddRenown 1  XPV 100   SALVAGE  ifTeamNotHostile 3 else GoFoughtNPC   SetPlotStatus %plotid1% %id1% MoveAndPacifyNPC %1% %2% Alert 2 SMemo 3>
		GoFoughtNPC <WinComp 0 .Next>
		.next <+T-- +F-->
		.change <+Pun>

		end <ifNPCOK %1% MoveNPC %1% %2%>

		Msg1 <Your duel with %name1% was interrupted by %name4%.>
		Msg2 <With %name4% defeated, %name1% returns to %name2%.>
		Msg3 <You should return to %name2% to speak with %name1%.>

		sub
			team 1
			SetEnemy 2
			ParaX 5
			ParaY 10

			team 2
			SetEnemy 1 3
			Deploy <SetSelfFaction %4%   WMecha 2 StoryDL 200>
			ParaX 15
			ParaY 25

			team 3
			SetEnemy 2
			ParaX 25
			ParaY 10
		end

		Persona 1
		% V%id%01 = Have spoken already
		greeting <if= PlotStatus %plotid% %id% else %pop% if= V%id%01 1 else .%id%_GoFirstTime EndChat Say %id%01>
		.%id%_GoFirstTime <ifChatNPCInPlay else .%id%_GoWaiting EndChat Say %id%02 AddChat %id%01 AddChat %id%02 AddChat %id%03 V= %id%01 1>
		*.%id%_GoWaiting <*WaitingForDuel %3%>
		result%id%01 <EndChat Say %id%03 AddHeroic 1        PCFriend %1% &SetAllyFac %5% &SetEnemyFac %4% PCFEnemy %4%>
		result%id%02 <EndChat Say %id%04 AddEasygoing -10   AddHeroic -1  PCEnemy %1%  TeamAttack 3 if= &EnemyFac 0 &SetEnemyFac %4% PCFEnemy %4%>
		result%id%03 <EndChat Say %id%05 AddRenown -1 AddReact -d20 if= &EnemyFac 0 &SetEnemyFac %4% PCFEnemy %4%>
		Msg%id%01 <Keep your mind on the game.>
		Msg%id%02 <It looks like we're not alone... those mecha are from %name4%. They can't possibly be up to any good. How about we fight them together?>
		Msg%id%02_1 <As much as I'd like to fight you, I'm afraid that we just got something bigger to worry about... Those mecha are from %name4%. Obviously they're here on some kind of covert mission. We should stop them before they do any damage.>
		CMsg%id%02_1 <ifNPCSociable Accept>
		Msg%id%02_2 <Look at that... a raiding party from %name4%. Let's defeat them together.>
		CMsg%id%02_2 <ifNPCShy Accept>
		Msg%id%02_3 <Sorry to interrupt our duel, but there's a group of mecha from %name4% right here. Most likey they're planning something destructive. Shall we defeat them together?>
		CMsg%id%02_3 <ifNPCEasygoing Accept>
		Msg%id%02_4 <Our fight will have to wait, there's something more important to take care of first... Look, it's a scout team from %name4%. This could be bad. If we team up we should be able to defeat them easily.>
		CMsg%id%02_4 <ifNPCPassionate Accept>
		Msg%id%02_5 <I was hoping our duel would be interesting, but I just found something a whole lot more fun. My sensors picked up a raiding party from %name4%. If we join forces, they won't stand a chance against us.>
		CMsg%id%02_5 <ifNPCCheerful Accept>
		Msg%id%02_6 <I've got some bad news... Look over there, those mecha were sent by %name4%. Is this the start of an invasion? Let's put our duel aside and defeat them before they have a chance to kill anyone.>
		CMsg%id%02_6 <ifNPCMelancholy Accept>
		Msg%id%03 <You're an honorable pilot, \PC . Let's do this.>
		Msg%id%03_1 <It'll be a pleasure to fight by your side. Let's go.>
		Msg%id%04 <Your hatred means so much that you'd side with the enemies of \NARRATIVE 7 ? Then let's see who can kill you first, %name4% or me...>
		Msg%id%04_1 <How spiteful are you? These mecha are here to destroy \NARRATIVE 7 , and still you can't think of anything but our fued. If it's a fight you want then it's a fight you're going to get!>
		Msg%id%05 <You're just going to run? You coward! Do the lives of your fellow citizens mean nothing to you?>
		Msg%id%05_1 <You're going to leave me to face them all by myself!? Coward! Traitor!>
		Prompt%id%01 <I'll help you, for \NARRATIVE 7 's sake.>
		Prompt%id%01_1 <It's up to us to protect \NARRATIVE 7 .>
		Prompt%id%02 <No way, you aren't getting off that easy.>
		CPrompt%id%02 <ifNPCArchEnemy E2 Accept>
		Prompt%id%02_1 <Forget it. I hate you more than %name4%.>
		Prompt%id%03 <You do it yourself. I'm out of here.>
		Prompt%id%03_1 <You can fight them, I'm getting out of here.>
	end
	inv
		STC ENCOUNTER-DUEL
		name <%name1%'s Mecha>
		update <if= PlotStatus %plotid% %id% else GoHide ShowEncounter SetStat STAT_MetaVisibility 0  Goto GoSetOrders>
	end


