[scenario]
	id=6b_The_Long_March
	#textdomain wesnoth-tsg

	name= _ "The Long March"
	next_scenario=7b_Pebbles_In_The_Flood
	[music]
		name=wesnoth-1.ogg
		ms_before=500
	[/music]
	[music]
		name=wesnoth-5.ogg
		ms_before=500
		append=yes
	[/music]


	{SG_MAP 6b_The_Long_March}
	{@campaigns/The_South_Guard/utils/sg_deaths.cfg}

	{DUSK}
	{FIRST_WATCH}
	{SECOND_WATCH}
	{DAWN}
	{MORNING}
	{AFTERNOON}

	victory_when_enemies_defeated=no
	turns=24


# The South Guard

[side]
	side=1
	type=Horseman Commander
	description=Deoran
	user_description= _ "Deoran"
	unrenamable=yes

	team_name=South_Guard
	controller=human
	{CUSTOM_SG_FLAG}


	fog=no
	shroud=yes

	{GOLD 125 100 80}
	{INCOME 6 4 2}

	canrecruit=1
	recruit=Peasant, Bowman, Spearman, Cavalryman, Thug, Footpad, Poacher
[/side]

#Urza Afalas

[side]
	side=2

	team_name=South_Guard
	no_leader=yes

	controller=ai
[/side]

# The Undead Hordes (Part II)

[side]
	side=3
	no_leader=yes

	team_name=the_undead_hordes
	controller=ai

	{GOLD 10 20 30}
	{INCOME 1 2 3}

	canrecruit=1
	[ai]
		recruitment_pattern=scout
		aggression=-0.25
	[/ai]
	#ifdef EASY
		recruit=Vampire Bat
	#endif

	#ifdef NORMAL
		recruit=Vampire Bat
	#endif

	#ifdef HARD
		recruit=Vampire Bat, Blood Bat
	#endif
[/side]

#prestart
	[event]
		name=prestart

		{PUT_IMG (items/gohere.png) 16 3}

		{SG_GUARD (Naga Warrior) (Fssth) (_"Fssth") 3 9 14}

		[recall]
			description=Sir Gerrick
		[/recall]
		[recall]
			description=Minister Hylas
		[/recall]
		[recall]
			description=Jarek
		[/recall]
		[recall]
			description=Urza Afalas
		[/recall]

		{SG_CHANGE_TERRAIN 28 46 g}
	[/event]

#start
	[event]
		name=start

		[store_unit]
			variable=afalas_store
			[filter]
				description=Urza Afalas
			[/filter]
			kill=yes
		[/store_unit]
		{VARIABLE afalas_store.side 2}
		[unstore_unit]
			variable=afalas_store
		[/unstore_unit]

		[message]
			speaker=narrator
			message= _ "Deoran and Urza Afalas led their men quickly from the ruins of Mal M'brin's fortress..."
		[/message]

		[message]
			speaker=Deoran
			message= _ "Will this forest ever end?  How can we know what path to take?!"
		[/message]
		[message]
			speaker=Urza Afalas
			message= _ "You have to follow me!  There are many false paths in these woods.  Some are dead ends, others are even worse!"
		[/message]
		[message]
			speaker=Sir Gerrick
			message= _ "Can we trust him?  His people are murderers and thieves!"
		[/message]
		[message]
			speaker=Minister Hylas
			message= _ "Do we have any choice?  Our food is running out, and it will be winter soon..."
		[/message]

		{MOVE_EXISTING_UNIT (description=Urza Afalas) 20 47}
		[message]
			speaker=Urza Afalas
			message= _ "This way!  The only ford is a bit west of here, and the path to the north will lead you into trouble!"
		[/message]
		{PUT_IMG (items/gohere.png) 21 48}

		[message]
			speaker=Sir Gerrick
			message= _ "I think we should head north.  The road leads north, and the ford is north.  Why does he want us to head west?"
		[/message]


		[objectives]
			side=1
			[objective]
				description= _ "Make your way to the north edge of the woods"
				condition=win
			[/objective]
			[objective]
				description= _ "Death of Deoran"
				condition=lose
			[/objective]
			[objective]
				description= _ "Death of Sir Gerrick"
				condition=lose
			[/objective]
			[objective]
				description= _ "Death of Urza Afalas"
				condition=lose
			[/objective]
			[objective]
				description= _ "Time runs out"
				condition=lose
			[/objective]
		[/objectives]

	[/event]

[event]
	name=die
	[filter]
		description=Urza Afalas
	[/filter]
	[message]
		speaker=unit
		image=portraits/urza-afalas.png
		message= _ "Now I pay for my crimes. But how many others will also suffer for them?"
	[/message]
	[endlevel]
		result=defeat
	[/endlevel]
[/event]

# Urza's first leg/

	[event]
		name=moveto
		[filter]
			x,y=21,48
			description=Deoran
		[/filter]

		{MOVE_EXISTING_UNIT (description=Urza Afalas) 13 45}
		[message]
			speaker=Urza Afalas
			message= _ "We have to go even further west.  There are elves living to the north, and I don't think they'll receive us too kindly!"
		[/message]
		[message]
			speaker=Jarek
			message= _ "Maybe the elves will have food we can buy - we should head north to meet them!"
		[/message]
		[removeitem]
			x,y=21,48
		[/removeitem]
		{PUT_IMG (items/gohere.png) 14 45}
	[/event]

# Urza Afalas moves north - choice two.

	[event]
		name=moveto
		[filter]
			x,y=14,45
			description=Deoran
		[/filter]

		{MOVE_EXISTING_UNIT (description=Urza Afalas) 8 41}
		[message]
			speaker=Urza Afalas
			message= _ "Come on!  Hurry!"
		[/message]

		[removeitem]
			x,y=14,45
		[/removeitem]
		{PUT_IMG (items/gohere.png) 9 42}

		[message]
			speaker=Minister Hylas
			message= _ "If there are elves to the north we must head north!  We can't follow this bandit to who knows where...  The elves have been our friends!"
		[/message]

	[/event]

# Urza Afalas moves north - choice two.

	[event]
		name=moveto
		[filter]
			x,y=9,42
			description=Deoran
		[/filter]

		{MOVE_EXISTING_UNIT (description=Urza Afalas) 3 39}
		[message]
			speaker=Urza Afalas
			message= _ "Keep moving!"
		[/message]

		[removeitem]
			x,y=9,42
		[/removeitem]
		{PUT_IMG (items/gohere.png) 3 40}
	[/event]

# Urza Afalas moves north - choice two.

	[event]
		name=moveto
		[filter]
			x,y=3,40
			description=Deoran
		[/filter]

		{MOVE_EXISTING_UNIT (description=Urza Afalas) 3 34}
		[message]
			speaker=Urza Afalas
			message= _ "We're almost there!"
		[/message]

		[removeitem]
			x,y=3,40
		[/removeitem]
		{PUT_IMG (items/gohere.png) 3 35}
	[/event]

	[event]
		name=moveto
		[filter]
			x,y=3,35
			description=Deoran
		[/filter]

		{MOVE_EXISTING_UNIT (description=Urza Afalas) 5 29}
		[message]
			speaker=Urza Afalas
			message= _ "Just a little further!"
		[/message]

		[removeitem]
			x,y=3,35
		[/removeitem]
		{PUT_IMG (items/gohere.png) 5 30}
	[/event]

	[event]
		name=moveto
		[filter]
			x,y=5,30
			description=Deoran
		[/filter]

		{MOVE_EXISTING_UNIT (description=Urza Afalas) 9 25}
		[message]
			speaker=Urza Afalas
			message= _ "Hurry!  There are bandits in these woods!"
		[/message]
		[message]
			speaker=Deoran
			message= _ "Why should that worry us?!  Aren't you their leader?"
		[/message]
		[message]
			speaker=Urza Afalas
			message= _ "We're bandits, after all.  Not all of them are loyal to me."
		[/message]

		[removeitem]
			x,y=5,30
		[/removeitem]
		{PUT_IMG (items/gohere.png) 9 26}
	[/event]

	[event]
		name=moveto
		[filter]
			x,y=9,26
			description=Deoran
		[/filter]

		{MOVE_EXISTING_UNIT (description=Urza Afalas) 10 18}
		[message]
			speaker=Urza Afalas
			message= _ "The river is just ahead!"
		[/message]

		[removeitem]
			x,y=9,26
		[/removeitem]
		{PUT_IMG (items/gohere.png) 10 19}
	[/event]

	[event]
		name=moveto
		[filter]
			x,y=10,19
			description=Deoran
		[/filter]

		[message]
			speaker=Urza Afalas
			message= _ "From here you can see the banks of the river!  Across it we will find the sun again, and an end to these cursed trees!"
		[/message]

		[store_unit]
			variable=afalas_store
			[filter]
				description=Urza Afalas
			[/filter]
			kill=yes
		[/store_unit]
		{VARIABLE afalas_store.side 1}
		[unstore_unit]
			variable=afalas_store
		[/unstore_unit]

		[removeitem]
			x,y=10,19
		[/removeitem]
	[/event]

# Elvish Ambush

	[event]
		name=moveto
		[filter]
			side=1
			x,y=12-15,31-33
		[/filter]

		{SG_GUARD (Elvish Fighter) (Urien) (_"Urien") 3 12 34}
		{SG_GUARD (Elvish Archer) (Jesa) (_"Jesa") 3 15 31}
		{SG_GUARD (Elvish Archer) (Plinth) (_"Plinth") 3 15 34}

		[message]
			speaker=Plinth
			message= _ "We cannot allow you bandits and criminals to pass through our lands!"
		[/message]
		[message]
			speaker=Urza Afalas
			message= _ "But we have slain the undead - we wish only to return to our homes!"
		[/message]
		[message]
			speaker=Plinth
			message= _ "Nevertheless we will have vengeance for Mebrin!!"
		[/message]
	[/event]


# Deoran exits the forest.

	[event]
		name=moveto
		[filter]
			description=Deoran
			x,y=16,3
		[/filter]
		[message]
			speaker=Deoran
			message= _ "Thank heaven we have escaped that awful forest!"
		[/message]
		[message]
			speaker=Sir Gerrick
			message= _ "Indeed, Afalas, you've earned my trust today."
		[/message]
		[message]
			speaker=Urza Afalas
			message= _ "I can only hope for mercy when I return to Westin."
		[/message]

		[message]
			speaker=narrator
			message= _ "But there was a dark cloud looming behind Deoran and his Men..."
		[/message]

		[endlevel]
			bonus=yes
			result=victory
		[/endlevel]
	[/event]

[/scenario]
