plot 0
	name <PLOT: Ancestral Home>

	% E1 is the scene for the current episode.
	% E2 is the character who will give the PC a mission.
	% E3 is the scene to be used in the next episode.
	% E4 is the NPC who the PC must battle
	Element1 <Grab 3>
	Element2 <Prefab>
	Element3 <Scene Town Target !Far 1>
	Element4 <Prefab>

	% V1 = Conversation counter
	% V2 = Combat Counter


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

	% If Persona E2 dies, load a new plot.
	% Upon entering combat, force a conversation with the supposed enemy.
	start <ifPersona E2 else GoDelete if= V2 1 if= V1 0 V= 1 1 ifNPCInPlay E4 ForceChat E4>
	GoDelete <S= 101 1 AdvancePlot 0>

	% 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>
	nu2 <if= T2 0 if= V2 1  V= 2 3  Reputation 6  1  XPV 100>

sub
	Persona 2
	rumor <!2 has been researching the families that lived in this area many years ago.>

	%  V1 = Job offer counter, V1=1 is job offered, V1=-1 if job denied
	%  V2 = Message Randomizer
	%  V3 = Threat value of enemy mecha
	%  V4 = Reward offered to PC for the mission
	%  V5 = Recharge time if mission fails

	greeting <NewChat if= P2 3 else GoCheckLoss  Say 1  History 12 AdvancePlot 1>
	GoCheckLoss <if= P2 2 else GoCheckMission ifPersona E4 else GoE4Died Say 2 P= 2 0>
	GoE4Died <Say 3 History 12 AdvancePlot 1>
	GoCheckMission <if= V1 1 else GoFirstTime ifG ComTime V5 else GoMustWait Say 4 AddChat 1 AddChat 2 AddChat 3>
	GoMustWait <Say 13>

	% Unlike most combat missions, the PC is guaranteed to be offered
	% this one, since it's personal.
	% Set V1, V3, V4 here.
	GoFirstTime <V= 1 1 V= 3 Threat S103 200  V= 4 Reward V3 150 Memo 11 Say 6 AddChat 4 AddChat 5>


	% Combat being entered
	result1 <EndChat Say 5 SavePos P= 2 1 V= 5 ComTime V+ 5 86400 Dynamic 2 V3 .nu1 .nu2 if= d2 1 DynaNPC E4 2>
	.nu1 <if= T1 0 Return>
	.nu2 <if= T2 0 Return>
	% Combat being delayed
	result2 <NewChat Say 7>
	% How many points do the enemy have?
	result3 <NewChat Say 8 AddChat 1 AddChat 2>

	% Result 4 - may add Reputation command or whatnot
	result4 <NewChat Say 9 AddChat 1 AddChat 2 AddChat 3>

	% Result 5 - may add Reputation command or whatnot
	result5 <NewChat Say 10 AddChat 1 AddChat 2 AddChat 3>

	% 1 : Player has won the mission
	%    Should mention that next episode will happen in \ELEMENT 3
	Msg1 <You have reclaimed your ancestral home. I'll take a look around the site and see what I can find. Come see me tomorrow; I'll probably have some useful info by then.>

	% 2 : Player lost mission
	Msg2 <Those ravagers are every bit as tough as they look... Well, they're not going anywhere, and neither am I. You can try again in the morning, if you like.>

	% 3 : Player has lost mission, but main enemy died, so it counts
	%     as a success for story but PC won't get paid
	Msg3 <With their chieftan dead, the rest of the ravagers should just drift away from the site. When it's safe I'll take a look around and see what I can find. Come see me tomorrow; I'll probably have some useful info by then.>

	% 4 : Player has accepted mission, has returned from repair
	Msg4 <Your ancestral home is currently occupied by a ravager tribe. I'd like to explore it, but they won't let me in.>

	% 5 : Combat is starting
	Msg5 <Good luck out there.>

	% 6 : NPC explains what the PC should do in this mission, and why
	Msg6 <You're \PC , aren't you? My name is \ELEMENT 2 . I've heard of you... I've been researching your family history. The home of your ancestors is quite near to this town.>

	% 7 : PC needs some time to get ready
	Msg7 <I suppose not.>

	% 8 : How many points? Use "\VAL V3 " for that
	Msg8 <Their tribe has around \VAL V3 points worth of mecha. The site is very well defended...>

	% 9 : Response to Prompt4
	Msg9 <Not very easily, no. The site is currently occupied by a ravager gang. I've tried to get permission to examine the place but they're quite hostile towards outsiders.>

	% 10 : Response to Prompt5
	Msg10 <During the age of superpowers, your ancestors were quite influential. If I could examine the ruins I could learn more, but unfortunately the site is currently occupied by a ravager gang.>

	% 11 : Memo
	Msg11 <\ELEMENT 2 in \SCENE EScene 2 is investigating your ancestral home.>
	Msg12 <You reclaimed your ancestral home.>
	Msg13 <If you want to try again, come back tomorrow. We shouldn't attempt another attack until then.>

	% 1 - 3 :  Standard combat entry options:
	%         Start Mission, Delay Mission, Mission Details
	Prompt1 <I'll go get rid of them for you.>
	Prompt2 <I guess there's nothing that can be done...>
	Prompt3 <How many mecha do they have?>

	% 4 - 5 :  PC can have different reactions to Msg6 above
	Prompt4 <Interesting. Can I go there?>
	Prompt5 <Why are you studying my family?>


	Persona 4
	% This is the NPC that the PC has to fight. I don't really know
	% what to write here, so a very simple thing that you should replace.
	greeting <EndChat if= V1 0 else GoBeenBefore V= 1 1 Say 1 AddChat 1 AddChat 2 AddChat 3>
	GoBeenBefore <Say 3>

	result1 <EndCHat ifG PCRep 6 ds103 else GoR1NoGood Say 4 XPV 500 Retreat 2 PCAlly E4 MoveChar E4 E1 History 8 AdvancePlot 2>
	GoR1NoGood <Say 2>
	result2 <EndChat Say 5 AddChat 4 ifG PC$ Threat s103 50 AddChat 5>
	result3 <EndCHat Say 6>
	result4 <EndChat Say 7>
	result5 <EndChat Say 8 Cash+ - Threat S103 50 Retreat 2 MoveChar E4 E1>

	Msg1 <This is the land of my tribe. We will destroy any who come here without permission. State your purpose here, stranger.>
	Msg2 <Your land? Were you born here, have you lived here, would you fight to protect this patch of dirt!? We will defeat you!!!>
	Msg3 <I told you last time, you are not welcome here. We shall destroy you!>
	Msg4 <Your land? It can't be... \PC ! I have heard of your adventures... You and I are of the same blood! This is your home as well, cousin. We will not oppose you.>
	Msg5 <Negotiate? You want access to our ruins? Before you, \NARRATIVE 2 came and stole much. If you want to come here you must pay us $ \VAL Threat S103 50 . That is the only way we can trust you.>
	Msg6 <You will pay for your arrogance!!!>
	Msg7 <So you intend to come here and steal, without paying us for what you take? You will leave this place now!!!>
	Msg8 <You reclaimed your ancestral home, and met a distant relative.>

	Prompt1 <This is my land, and I will take it!>
	Prompt2 <I am here to negotiate.>
	Prompt3 <If you think you can destroy me, just try.>
	Prompt4 <No way, I'm not giving you that much.>
	Prompt5 <Here's the money. [Give Cash]>

	Plot 1
		% The PC has reclaimed the ancestral home, so now the NPC
		% will explain what was found there.
		start <ifPersona E2 else GoDelete if= V1 0 V= 1 1 Memo 1>
		GoDelete <S= 101 1 AdvancePlot 0>
		Msg1 <\ELEMENT 2 in \SCENE EScene 2 has some information about your family.>
	sub
		Persona 2
		greeting <NewChat ifG PCRep 6 s103 else GoExcuse Say 2 AddChat 1 AddChat 2>
		GoExcuse <Say 1>

		% Do everything here that has to be done. If some of the ExtraRandom
		% parameters need to be changed, do that here as well.
		GoEndMission <S= 101 1 S+ 102 1 N= 3 E3 AdvancePlot 0>

		result1 <NewChat V= 2 100 V+ 2 d5 Say V2 V+ 2 50 History V2 XRMystery NAV_XRMResolved Goto GoEndMission>
		result2 <NewChat Say 3>

		Msg1 <I'm still investigating the ruins. You should go do something useful while you're waiting... It would make no sense for you to just wait around.>
		Msg2 <My research at your ancestral home has finally turned up some interesting results... Would you like to hear about it?>
		Msg3 <I see. Well, be sure to come back sometime when you're not busy, and I'll tell you then.>

		% 101 - 105 :  Family histories
		Msg101 <Ever hear of "Idealist"? This was a genetic engineering project during the Age of Superpowers, seeking to create a better human being. Your ancestors were "Idealists", you perhaps contain some of their modified genes.>
		Msg102 <Long ago, your family was a powerful ninja clan... but they were almost entirely wiped out by a rival clan. It's possible that the rival clan still exists, and they may not even have forgotten of this centuries-old conflict.>
		Msg103 <Your ancestors came from a noble house of the Age of Superpowers. Many of them were high placed officers in the army. It's possible that your family heirlooms hold much information about this period.>
		Msg104 <You come from a noble line. During the Age of Superpowers your ancestors ruled this area. The site I investigated was originally a factory to produce "Cyclops" biosoldiers. They must have been very powerful.>
		Msg105 <In PreZero times, your ancestors were laborers. The site used to be a factory for "Cyclops" biosoldiers. One peasant stole something from the factory and the nobles burnt down the entire village, scattering your family across the globe.>

		% 151 - 155 :  Corresponding entries for player history
		Msg151 <Discovered that ancestors were genetically enhanced "Idealists".>
		Msg152 <Discovered that ancestors were ninjas whose enemies may still exist today.>
		Msg153 <Discovered that ancestors were a noble house from the Age of Superpowers.>
		Msg154 <Discovered that ancestors were a noble house from the Age of Superpowers.>
		Msg155 <Discovered that an ancestor stole something of great value.>

		Prompt1 <Tell me what you've found.>
		Prompt2 <I'll listen some other time.>

	end

	Plot 2
		% The PC has reclaimed the ancestral home, and has found
		% a new ally/distant relative in the tribal chieftan.
		start <ifPersona E2 else GoDelete if= V1 0 V= 1 1 Memo 1>
		GoDelete <S= 101 1 AdvancePlot 0>
		Msg1 <\ELEMENT 2 in \SCENE EScene 2 has some information about your family.>
	sub
		Persona 2
		greeting <NewChat ifG PCRep 6 s103 else GoExcuse Say 2 AddChat 1 AddChat 2>
		GoExcuse <Say 1>
		% Do everything here that has to be done. If some of the ExtraRandom
		% parameters need to be changed, do that here as well.
		GoEndMission <S= 101 1 S+ 102 1 N= 3 E3 AdvancePlot 0>
		result1 <NewChat V= 2 100 V+ 2 d5 Say V2 V+ 2 50 History V2 XRMystery NAV_XRMResolved AddChat 3 Goto GoEndMission>
		result2 <NewChat Say 3>
		result3 <NewChat Say 4>
		Msg1 <I'm still investigating the ruins. You should go do something useful while you're waiting... It would make no sense for you to just wait around.>
		Msg2 <My research at your ancestral home has finally turned up some interesting results... Would you like to hear about it?>
		Msg3 <I see. Well, be sure to come back sometime when you're not busy, and I'll tell you then.>
		Msg4 <I'll probably head to \ELEMENT 3 next, since that's where all the evidence seems to be pointed.>
		% 101 - 105 :  Family histories
		Msg101 <Ever hear of "Idealist"? This was a genetic engineering project during the Age of Superpowers, seeking to create a better human being. Your ancestors were "Idealists", you perhaps contain some of their modified genes.>
		Msg102 <Long ago, your family was a powerful ninja clan... but they were almost entirely wiped out by a rival clan. It's possible that the rival clan still exists, and they may not even have forgotten of this centuries-old conflict.>
		Msg103 <Your ancestors came from a noble house of the Age of Superpowers. Many of them were high placed officers in the army. It's possible that your family heirlooms hold much information about this period.>
		Msg104 <You come from a noble line. During the Age of Superpowers your ancestors ruled this area. The site I investigated was originally a factory to produce "Cyclops" biosoldiers. They must have been very powerful.>
		Msg105 <In PreZero times, your ancestors were laborers. The site used to be a factory for "Cyclops" biosoldiers. One peasant stole something from the factory and the nobles burnt down the entire village, scattering your family across the globe.>
		% 151 - 155 :  Corresponding entries for player history
		Msg151 <Discovered that ancestors were genetically enhanced "Idealists".>
		Msg152 <Discovered that ancestors were ninjas whose enemies may still exist today.>
		Msg153 <Discovered that ancestors were a noble house from the Age of Superpowers.>
		Msg154 <Discovered that ancestors were a noble house from the Age of Superpowers.>
		Msg155 <Discovered that an ancestor stole something of great value.>
		Prompt1 <Tell me what you've found.>
		Prompt2 <I'll listen some other time.>
		Prompt3 <Fascinating.>

		Persona 4
		greeting <NewChat Say 1>
		Msg1 <I look forward to fighting at your side someday, cousin!>

	end

end
inv
	NPC Professor
	job <Archaeologist>
	Place <1 Ally Pass>

	NPC Mecha Pilot
	teamdata <SD Ally>
	EquipChar 10000
	Mecha <Kojedo.txt>

end
