Plot 0
	name <PLOT: Hired Hunter>

	% E1 is the scene for the current episode.
	% E2 is the character who will tell the PC where to go.
	% E3 is the scene to be used in the next episode.
	Element1 <Grab 3>
	Element2 <Character Bounty Hunter Heroic>
	Element3 <Scene Town Target !Far 1>
	Element4 <Prefab>
	Element5 <Grab 2>

	% V1 = Combat Can Start
	% V2 = Combat Indicator
	% V3 = Initialization Counter
	% V4 = First conversation with enemy

	rumor <!5 hired a bounty hunter to kill you.>

	% On a cleanup request just delete this plot.
	cleanup <AdvancePlot 0>

	% The first start, initialize everything.
	start <ifG P2 1 else GoStart0 ForceChat E4>
	GoStart0 <if= V3 0 else GoStart2 V= 3 1 MoveChar E2 E1 ifPersona N1 else GoN1Dead DeleteChar E4 E= 4 N1>
	GoN1Dead <N= 1 E4>

	% If the combat start counter has been set, and the PC enters the world map,
	% better start combat. At this point in time the NPC who starts the mission
	% becomes irrelevant.
	GoStart2 <if= V2 1 else GoCheckUseful if= V3 1 ForceChat E4 V= 3 2>

	GoCheckUseful <ifPersona E4 else GoDelete if= V1 1 else GoCheckPersona if= SceneID 1 Goto GoStartCombat>

	% If Persona E2 dies, load a new plot.
	GoCheckPersona <ifPersona E2 else GoDelete if= SceneID E1 P= 1 1>
	GoDelete <S= 101 1 AdvancePlot 0>

	GoStartCombat <Print 101 SavePos P= 1 2 P= 2 1 Dynamic 2 Threat S103 140 .nu1 .nu2 DynaNPC E4 2>
	.nu1 <if= T1 0 Return>
	.nu2 <if= T2 0 Salvage>

	% Combat check. If combat has been entered, V2=1.
	% Combat ends in victory if the number of active masters on
	% team two drops to zero, or ends in defeat is the number of
	% active masters on team one drops to zero. After combat, V2=3
	% if the player was victorious or V2=2 is the player lost.
	nu1 <if= T1 0 if= V2 1  V= 2 2  Reputation 6 -7 ForceChat E4>
	nu2 <if= T2 0 if= V2 1  V= 2 3  Reputation 6  1  XPV 50 ForceChat E4>


	Msg101 <You are attacked by mecha bearing \ELEMENT 5 insignia!>

sub
	Persona 2
	rumor <!2 heard something you might need to know.>
	greeting <NewChat ifG P3 0 else GoNoStart Say 1 P= 1 1>
	GoNoStart <SayAnything>
	Msg1 <You should know that \ELEMENT 5 hired a bounty hunter to kill you. Goes by the name of \ELEMENT 4 ; was in town a while back asking questions. Be careful, there may be an ambush waiting when you leave town...>


	Persona 4
	greeting <EndChat ifPersona E4 else GoE4Dead if= P2 3 else GoCheckLoss Say 1 History 5 XREnemy NAV_XRECharacter Goto GoEndVictory>
	GoE4Dead <Say 3 History 4 Goto GoEndVictory>
	GoCheckLoss <if= P2 2 else GoStillFighting Say 2 History 5 XREnemy NAV_XRECharacter S= 101 1 N= 3 E3 AdvancePlot 0>
	GoStillFighting <Say 6>

	GoEndVictory <S= 101 1 S+ 102 1 N= 3 E3 AdvancePlot 0 Return>

	Msg1 <So you've got some piloting skills... Killing you will be a challenge! We will meet again, shortly...>
	Msg2 <That was too easy. Next time, I'll really destroy you!>
	Msg3 <Heh, you're a better pilot than you looked... \ELEMENT 5 is gonna have a real fight on their hands taking you out... I have failed...>
	Msg4 <You killed \ELEMENT 4 , the bounty hunter sent by \ELEMENT 5 .>
	Msg5 <You fought \ELEMENT 4 , a bounty hunter sent by \ELEMENT 5 .>
	Msg6 <Hello \PC . I am \ELEMENT 4 ; \ELEMENT 5 hired me to kill you. Well, that's enough for introductions... now we must fight!!!>

end
inv
	NPC Bounty Hunter
	EquipChar 45000
	CharDesc Villainous

end
