[scenario]
#textdomain wesnoth-sof
name= _ "Outriding the Outriders"
id=7_Outriding_the_Outriders
turns=12
map_data="{@campaigns/Sceptre_of_Fire/maps/7_Outriding_the_Outriders.map}"
next_scenario=8_The_Dragon
victory_when_enemies_defeated=no
village_gold=0

	{DEFAULT_MUSIC_PLAYLIST}

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

	[side]
	type=Dragoon
	description=Rugnur
	side=1
	canrecruit=1
	controller=human
	recruit=
	shroud=yes
	fog=yes
	income=-2
	[/side]

	[side]
	no_leader=yes
	side=2
		[ai]
			[target]
			description=Alanin
			value=1
			[/target]
			[target]
			type=Peasant,Spearman
			value=0.1
			[/target]
			[avoid]
			x=11,17,18,16,14,22
			y=5,12,20,33,28,14
			[/avoid]
		village_value=0
		aggression=1.0
		caution=0
		grouping=no
		[/ai]
	[/side]

	[story]
		[part]
		story= _ "Rugnur had fled to the caves, but Alanin could not do that. He went south - back to the Wesnoth border."
		[/part]
		[part]
		story= _ "The elves followed both of them. First I will tell of their persuit of Alanin, before we descent into the caves to learn Rugnur's fate."
		[/part]
		[part]
		background=maps/wesnoth.png
		show_title=yes
		{DOT 322 157}
		{DOT 322 170}
		{DOT 327 185}
		{CROSS 325 199}
		[/part]
	[/story]

	[event]
	name=prestart
		[objectives]
		side=1
			[objective]
			description= _ "Reach the Wesnothian outpost in the south"
			condition=win
			[/objective]
			[objective]
			description= _ "Death of Alanin"
			condition=lose
			[/objective]
			[objective]
			description= _ "Time runs out"
			condition=lose
			[/objective]
		[/objectives]
		[terrain]
		x,y=17,4
		letter=Gg
		[/terrain]
		[unit]
		x,y=1,1
		type=Galleon
		side=2
		[/unit]
	[/event]

	[event]
	name=start
		[message]
		description=Alanin
		message= _ "Well, the elves are behind me for now, but they will send riders to catch me, and elvish riders are faster than me."
		[/message]
		[message]
		description=Alanin
		message= _ "My only hope is to convince the peasants to stop the elves from passing through their land, so I can get ahead of them."
		[/message]
	[/event]

	[event]
	name=side turn
		[unit]
		type=Elvish Outrider
		description=Asaeri
		user_description= _ "Lord Asaeri"
		x,y=18,1
		side=2
			[modifications]
			{TRAIT_STRONG}
			{TRAIT_DEXTROUS}
			[/modifications]
		[/unit]
		[unit]
		type=Elvish Outrider
		description=?Gaelir
		user_description= _ "Gaelir"
		x,y=18,1
		side=2
			[modifications]
			{TRAIT_QUICK}
			{TRAIT_DEXTROUS}
			[/modifications]
		[/unit]
		[unit]
		type=Elvish Outrider
		description=Salira
		user_description= _ "Salira"
		x,y=18,1
		side=2
			[modifications]
			{TRAIT_STRONG}
			{TRAIT_QUICK}
			[/modifications]
		[/unit]
		[unit]
		type=Elvish Outrider
		description=Losnin
		user_description= _ "Losnin"
		x,y=18,1
		side=2
			[modifications]
			{TRAIT_STRONG}
			{TRAIT_RESILIENT}
			[/modifications]
		[/unit]
		[unit]
		type=Elvish Outrider
		description=Ealin
		user_description= _ "Ealin"
		x,y=18,1
		side=2
			[modifications]
			{TRAIT_QUICK}
			{TRAIT_RESILIENT}
			[/modifications]
		[/unit]
		[kill]
		type=Galleon
		[/kill]
		[scroll_to]
		x,y=18,1
		[/scroll_to]
		[message]
		description=Asaeri
		message= _ "You cannot outride us, horseman of Wesnoth! Whatever message you are carrying, it will not be delivered!"
		[/message]
		[message]
		description=Alanin
		message= _ "We shall see about that!"
		[/message]
	[/event]

	[event]
	name=turn 2
		[unit]
		type=Elvish Outrider
		description=Raesil
		user_description= _ "Raesil"
		x,y=18,1
		side=2
			[modifications]
			{TRAIT_QUICK}
			{TRAIT_RESILIENT}
			[/modifications]
		[/unit]
	[/event]

	[event]
	name=capture
		[filter]
		description=Alanin
		[/filter]
		[message]
		description=Alanin
		message= _ "The villagers here are loyal to Wesnoth. They should be willing to help me escape these elves!"
		[/message]
		{RANDOM_TRAIT_UNIT (
		type=Spearman
		description=Rolin
		user_description= _ "Rolin"
		x,y=$x1,$y1
		side=1)}
		[message]
		description=Rolin
		message= _ "We will certainly help any warrior of Wesnoth who needs our help!"
		[/message]
	[/event]

	[event]
	name=capture
	first_time_only=no
		[filter]
		description=Alanin
		[/filter]
		{RANDOM_TRAIT_UNIT (
		type=Spearman
		generate_description=yes
		x,y=$x1,$y1
		side=1)}
	[/event]

	[event]
	name=moveto
		[filter]
		description=Alanin
		x=10,9-11
		y=62,63-64
		[/filter]
		{RANDOM_TRAIT_UNIT (
		type=Lieutenant
		description=Hadlin
		user_description= _ "Hadlin"
		x,y=10,63
		side=1)}
		[message]
		description=Hadlin
		message= _ "Who goes there?"
		[/message]
		[message]
		description=Alanin
		message= _ "I'm a dragoon, with Haldric II's personal bodyguard. I was sent on a mission in the northlands, and now elvish horsemen are chasing me. I barely evaded them."
		[/message]
		[message]
		description=Hadlin
		message= _ "I see. Well, come on in. I doubt they would be able to capture this fort, even if they did want to start a war, which I doubt."
		[/message]
		[store_unit]
			[filter]
			description=Alanin
			[/filter]
		variable=alanin
		kill=yes
		[/store_unit]
		[kill]
		side=1
		[/kill]
		{FOREACH dwarves i}
			[unstore_unit]
			variable=dwarves[$i]
			[/unstore_unit]
		{NEXT i}
		[clear_variable]
		variable=dwarves
		[/clear_variable]
		[endlevel]
		result=victory
		bonus=no
		[/endlevel]
	[/event]
[/scenario]
