[scenario]
	id=08_The_Princess_of_Wesnoth
	#textdomain wesnoth-httt
	name= _ "The Princess of Wesnoth"
	map_data="{campaigns/Heir_To_The_Throne/maps/Princess_of_Wesnoth}"
	{SCENARIO_MUSIC "gameplay02.ogg"}
	{TURNS 31 28 25}

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

	next_scenario=09_The_Valley_of_Death

	[event]
	name=prestart
		[objectives]
		side=1
			[objective]
				description= _ "Force Li'sar's surrender (reduce her hitpoints to 0 or lower)"
				condition=win
			[/objective]
			[objective]
				description= _ "Death of Konrad"
				condition=lose
			[/objective]
			[objective]
				description= _ "Death of Delfador"
				condition=lose
			[/objective]
			[objective]
				description= _ "Death of Kalenz"
				condition=lose
			[/objective]
			[objective]
				description= _ "Turns run out"
				condition=lose
			[/objective]
		[/objectives]
	[/event]

	[story]
		[part]
		story= _ "...but one of the orcs survived long enough to send the news to the queen..."
		background=story/story6.png
		[/part]
		[part]
		story= _ "...and she sent her most able commander."
		background=story/story7.png
		[/part]
	[/story]

	{BIGMAP_PRINCESS_OF_WESNOTH}

	[label]
	x,y=12,16
	text=_"Elmar's Crossing"
	[/label]

	[label]
	x,y=13,17
	text=_"Elbridge"
	[/label]

	[side]
	type=Commander
	description=Konrad
	user_description= _ "Konrad"
	unrenamable=yes
	side=1
	canrecruit=1
	controller=human
	enemy=2

#ifdef HARD
	gold=100
#else
	gold=300
#endif
	[/side]

	[side]
	type=Princess
	description=Li'sar
	user_description= _ "Li'sar"
	unrenamable=yes
	side=2
	canrecruit=1
	facing=reverse

	{GOLD 140 190 280}
	{INCOME 4 8 12}

#ifdef EASY
	recruit=Cavalryman,Spearman,Swordsman,Mage,Ogre,Bowman
#endif
#ifdef NORMAL
	recruit=Cavalryman,Swordsman,Spearman,Mage,Ogre,Bowman
#endif
#ifdef HARD
	recruit=Cavalryman,Swordsman,Red Mage,Ogre,Lieutenant,Pikeman,Longbowman
#endif

		[ai]
		passive_leader=yes
		#she's a smart leader and thinks deeply
		{ATTACK_DEPTH 4 5 5}
#ifdef EASY
		recruitment_pattern=scout,mixed fighter,fighter,fighter
#endif
#ifdef NORMAL
		recruitment_pattern=scout,mixed fighter,fighter,fighter
#endif
#ifdef HARD
		recruitment_pattern=scout,mixed fighter,fighter,fighter,fighter,archer
#endif
		[target]
			description=Konrad
			value=9.0
		[/target]
		leader_value=6.0
		[/ai]
		enemy=1
	[/side]

	[event]
	name=prestart

		[set_variable]
		name=trap_sprung
		value=0
		[/set_variable]

		{PLACE_IMAGE misc/mine.png 4 41}

		[recall]
		description=Delfador
		[/recall]
		[recall]
		description=Kalenz
		[/recall]
		[role]
		type=Elvish Champion,Elvish Marshal,Elvish Captain,Elvish Hero,Knight,Elvish Outrider,Elvish Rider,Paladin,Mage,White Mage,Red Mage
		role=Advisor
		[/role]
		[recall]
		role=Advisor
		[/recall]
	[/event]

	[event]
	name=start
		[message]
			speaker=narrator
			image="wesnoth-icon.png"
			message= _ "On the road to Knalga, the party was opposed by the forces of Asheviere."
		[/message]
		[message]
			description=Li'sar
			message= _ "The Queen has sent me to stop you, you impostor!"
		[/message]
		[message]
			role=Advisor
			message= _ "That's the princess, Li'sar. The daughter of the Queen, and her successor!"
		[/message]
		[message]
			description=Konrad
			message= _ "I'm no impostor. It seems that your mother has lied to you."
		[/message]
		[message]
			description=Li'sar
			image="portraits/lisar.png"
			message= _ "This is treason! Your lies will perish with you!"
		[/message]
		[message]
			description=Delfador
			message= _ "There is no use in reasoning. She will understand only one thing. To arms!"
		[/message]
	[/event]

	[event]
	name=turn 5

		{UNIT (Lieutenant) (Jibb) ( _ "Jibb") 2 27 12}
		{UNIT (Swordsman) (Monry) ( _ "Monry") 2 27 12}
		{UNIT (Swordsman) (Gleran) ( _ "Gleran") 2 27 12}

		[message]
		description=Li'sar
		message= _ "This is taking too much time, I had best call some reinforcements!"
		[/message]
	[/event]
	[event]
	name=turn 10
		{UNIT (Lieutenant) (Rogerus) ( _ "Rogerus") 2 27 12}
		{UNIT (Swordsman) (Rurcyn) ( _ "Rurcyn") 2 27 12}
		{UNIT (Swordsman) (Blyr) ( _ "Blyr") 2 27 12}

		[message]
		description=Li'sar
		message= _ "Maybe I was not using enough forces..."
		[/message]
	[/event]
	[event]
	name=die
		[filter]
		description=Li'sar
		[/filter]
		[message]
		speaker=unit
		message= _ "I surrender! Don't hurt me, Impostor."
		[/message]
		[message]
		description=Konrad
		message= _ "I said before I'm not an impostor, but if you yield, I will spare your life."
		[/message]
		[message]
		speaker=unit
		message= _ "Let me go!"
		[/message]
		[message]
		description=Konrad
		message= _ "Think about the story of the old king. Ask somebody who knew of him."
		[/message]
		[message]
		speaker=unit
		message= _ "The old king? I have heard about that, but I know it is not true. My mother told me."
		[/message]
		[message]
		description=Delfador
		message= _ "Your mother has lied to you, child. Now I suggest you reconsider, and either join us, or flee an exile. There will be a great battle soon, and if you are on the wrong side of it, we may not have the opportunity to spare your life a second time."
		[/message]
		[message]
		speaker=unit
		image="portraits/lisar.png"
		message= _ "I am not a child, and I do not want to talk about it! You said you would spare me, so be on your way. The northern road should be safe for you."
		[/message]
		[message]
		description=Konrad
		message= _ "Good day then, Princess. Come, men, to the northern road!"
		[/message]
		[message]
		speaker=unit
		message= _ "(He he, little do they know just how many undead have wandered the northern road of late. Surely they are doomed!)"
		[/message]

		{CLEAR_VARIABLE trap_sprung}

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

#define SECOND_WAVE
#ifdef EASY
		[gold]
			side=2
			amount=90
		[/gold]
#endif

#ifdef NORMAL
		[gold]
			side=2
			amount=120
		[/gold]
#endif

#ifdef HARD
		[gold]
			side=2
			amount=150
		[/gold]
#endif
#enddef

	[event]
		name=moveto
		[filter]
			side=1
			x=20-29
			y=1-23
		[/filter]

		[if]

		[variable]
			name=trap_sprung
			numerical_equals=0
		[/variable]

		[then]
			[set_variable]
				name=trap_sprung
				value=1
			[/set_variable]
			{SECOND_WAVE}

			[message]
			description=Li'sar
			message= _ "Your forces draw near impostor! I'll not be defeated in my own back yard so easily... Come forth and attack my loyal duelist!"
			[/message]

			[sound]
			name=dagger-swish.wav
			[/sound]

			[move_unit_fake]
			type=Duelist
			x=4,4,5,6,6
			y=41,42,42,41,40
			[/move_unit_fake]

			{UNIT (Duelist) (Ronry) ( _ "Ronry") 2 6 40}

			[scroll_to_unit]
			x=6
			y=40
			[/scroll_to_unit]
#ifdef NORMAL
			{UNIT (Fencer) (Ligwyn) ( _ "Ligwyn") 2 6 41}
#endif
#ifdef HARD
			{UNIT (Fencer) (Ligwyn) ( _ "Ligwyn") 2 6 41}
			{UNIT (Fencer) (Owaryn) ( _ "Owaryn") 2 5 42}
#endif

			[message]
			description=Ronry
			message= _ "I'll seize their keep my Lady!"
			[/message]
		[/then]
		[/if]
	[/event]

	[event]
		name=moveto
		[filter]
			side=1
			x=4
			y=41
		[/filter]

		[if]

		[variable]
			name=trap_sprung
			numerical_equals=0
		[/variable]

		[then]
			[set_variable]
				name=trap_sprung
				value=1
			[/set_variable]
			{SECOND_WAVE}

			[message]
			speaker=unit
			message= _ "It sounds like there is something in the mine shaft."
			[/message]

			[sound]
			name=dagger-swish.wav
			[/sound]

			{UNIT (Duelist) (Ronry) ( _ "Ronry") 2 4 41}

			[scroll_to_unit]
			x=4
			y=41
			[/scroll_to_unit]

			[message]
			description=Li'sar
			image="portraits/lisar.png"
			message= _ "You've discovered my ploy! It doesn't matter, I'll still rout you!"
			[/message]

#ifdef NORMAL
			{UNIT (Fencer) (Ligwyn) ( _ "Ligwyn") 2 4 41}
#endif
#ifdef HARD
			{UNIT (Fencer) (Ligwyn) ( _ "Ligwyn") 2 4 41}
			{UNIT (Fencer) (Owaryn) ( _ "Owaryn") 2 4 41}
#endif

			[message]
			description=Ronry
			message= _ "The trap is foiled but I'll still flush this rabble from their keep!"
			[/message]
		[/then]

		[/if]
	[/event]

	{campaigns/Heir_To_The_Throne/utils/deaths.cfg}
[/scenario]
