[scenario]
	id=Return_of_the_Fleet
	#textdomain wesnoth-trow
	name= _ "Return of the Fleet"
	map_data="{campaigns/The_Rise_Of_Wesnoth/maps/Return_of_the_Fleet}"
	{TURNS 45 42 39}

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

	next_scenario=The_Plan
	bonus=yes

	[music]
	name="gameplay02.ogg"
	[/music]

	{campaigns/The_Rise_Of_Wesnoth/utils/trow-deaths.cfg}

	[story]
		[part]
			background=story/the_great_continent.png
			show_title=yes
			{DOT 283 220}
			{DOT 270 215}
			{DOT 255 210}
			{DOT 245 215}
			{CROSS 236 218}
		[/part]
	[/story]

	[side]
		description=Prince Haldric
		user_description= _ "Prince Haldric"
		side=1
		type=Noble Commander
		unrenamable=yes
		canrecruit=1
		controller=human
		team_name=Haldric
		shroud=yes
	[/side]

	[side]
		type=Draug
		description=General Heravan
		user_description= _ "General Heravan"
		side=2
		canrecruit=1
		{GOLD 130 170 210}
		team_name=orcs
#ifdef EASY
		recruit=Skeleton,Skeleton Archer, Vampire Bat
#endif

#ifdef NORMAL
		recruit=Revenant,Deathblade,Bone Shooter,Skeleton,Skeleton Archer, Vampire Bat
#endif

#ifdef HARD
		recruit=Revenant,Deathblade,Bone Shooter,Skeleton,Skeleton Archer, Vampire Bat, Chocobone
#endif

		[ai]
			{NO_SCOUTS}
			recruitment_ignore_bad_movement=yes
			passive_leader=yes
			recruitment_pattern=scout,fighter,archer
			aggression=0.4
			{ATTACK_DEPTH 5 5 6}
		[/ai]
		[ai]
			time_of_day=dusk,first_watch,second_watch
			aggression=0.7
		[/ai]
		{INCOME 2 4 8}
	[/side]

	[side]
		type=Orcish Warlord
		description=Tan-Halg
		user_description= _ "Tan-Halg"
		side=3
		canrecruit=1
#ifdef EASY
		recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Troll Whelp, Goblin Spearman
#endif

#ifdef NORMAL
		recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Orcish Slayer, Orcish Warrior, Troll Whelp, Troll, Troll Rocklobber, Goblin Spearman
#endif

#ifdef HARD
		recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Slayer, Troll Whelp, Troll, Troll Warrior, Troll Rocklobber, Goblin Spearman, Goblin Impaler
#endif
		{GOLD 170 210 250}
		team_name=orcs
		[ai]
			#{NO_SCOUTS}
			recruitment_ignore_bad_movement=yes
			recruitment_pattern=scout,fighter,fighter,archer
			{ATTACK_DEPTH 5 5 6}
		[/ai]
		[ai]
			time_of_day=dusk,first_watch,second_watch
			aggression=0.75
			caution=0.0
			grouping=no
		[/ai]
		{INCOME 2 4 8}
	[/side]

	[side]
		type=Orcish Warlord
		description=Tan-Rinak
		user_description= _ "Tan-Rinak"
		side=4
		canrecruit=1
#ifdef EASY
		recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Troll Whelp, Goblin Spearman
#endif

#ifdef NORMAL
		recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Orcish Slayer, Orcish Warrior, Troll Whelp, Troll, Troll Rocklobber, Goblin Spearman
#endif

#ifdef HARD
		recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Slayer, Troll Whelp, Troll, Troll Warrior, Troll Rocklobber, Goblin Spearman, Goblin Impaler
#endif
		{GOLD 170 210 250}
		team_name=orcs
		[ai]
			#{NO_SCOUTS}
			recruitment_ignore_bad_movement=yes
			recruitment_pattern=scout,fighter,fighter,archer
			{ATTACK_DEPTH 5 5 6}
		[/ai]
		[ai]
			time_of_day=dusk,first_watch,second_watch
			aggression=0.75
			caution=0.0
			grouping=no
		[/ai]
		{INCOME 2 4 8}
	[/side]

	[event]
	name=prestart

		{STARTING_VILLAGES 2 10}
		{STARTING_VILLAGES 3 10}
		{STARTING_VILLAGES 4 10}

		{PLACE_IMAGE (units/transport/pirate-galleon.png) 10 27}
		{PLACE_IMAGE (units/transport/pirate-galleon.png) 7 30}
		{PLACE_IMAGE (units/transport/pirate-galleon.png) 6 33}
		{PLACE_IMAGE (units/transport/pirate-galleon.png) 5 36}

		{PLACE_IMAGE (items/fire.png) 8 8}
		{PLACE_IMAGE (items/fire.png) 10 2}
		{PLACE_IMAGE (items/fire.png) 17 8}
		{PLACE_IMAGE (items/fire.png) 39 6}
		{PLACE_IMAGE (items/fire.png) 29 8}
		{PLACE_IMAGE (items/fire.png) 26 11}

		{PLACE_IMAGE (items/slab.png) 18 15}

		{PLACE_IMAGE (items/signpost.png) 10 34}

		[recall]
			description=Burin the Lost
		[/recall]
		[recall]
			description=Sir Ruddry
		[/recall]
		[recall]
			description=Sir Ladoc
		[/recall]
		[recall]
			description=Minister Edmond
		[/recall]
		[recall]
			description=Lt. Aethyr
		[/recall]

		[remove_shroud]
			side=1
			x=1-40
			y=1-40
		[/remove_shroud]

		[objectives]
		side=1
			[objective]
				description= _ "Defeat all enemy leaders"
				condition=win
			[/objective]
			[objective]
				description= _ "Death of Prince Haldric"
				condition=lose
			[/objective]
			[objective]
				description= _ "Death of Lady Jessica"
				condition=lose
			[/objective]
			[objective]
				description= _ "Death of Lt. Aethyr"
				condition=lose
			[/objective]
			[objective]
				description= _ "Turns run out"
				condition=lose
			[/objective]
		[/objectives]
	[/event]

	[event]
		name=start
		[message]
			speaker=narrator
			message= _ "Haldric reaches the site where the fleet is due to return. Several ships have already docked. The orcs are on the frontier."
		[/message]
		[message]
			description=Lt. Aethyr
			message= _ "Sir, some ships have landed... They look like they've been damaged by the voyage. Hmm, it seems that most of the ships are staying at sea."
		[/message]
		[message]
			description=Prince Haldric
			message= _ "They've undoubtedly spotted the smoke from the orcish fires. We have to defeat these monsters before everybody starves at sea, or before Jevyan launches an attack with his fleet."
		[/message]
		[message]
			description=Lt. Aethyr
			message= _ "Yes Sir! The rest of the refugees have fled south, to our initial landing site. If we fail here they'll get slaughtered."
		[/message]
		[message]
			description=Burin the Lost
			message= _ "Well, that settles it. Enough talking, time to fight!"
		[/message]
		[message]
			description=Lt. Aethyr
			message= _ "For the glory of the men of The Green Isle!"
		[/message]
		[message]
			description=Prince Haldric
			message= _ "No, for the Glory of all of the people of the west-north! Charge!"
		[/message]
		[message]
			description=Tan-Rinak
			message= _ "Bah! Human- we will stomp you under our heels!"
		[/message]
		[message]
			description=General Heravan
			message= _ "...And raise your dead to serve forever!"
		[/message]
	[/event]

	[event]
	name=attack
		[filter_second]
			team=Haldric
		[/filter_second]

		[move_unit_fake]
			type=Blood Bat
			x=29,28,28
			y=1,1,2
		[/move_unit_fake]

		{UNDEAD_INTEL (Blood Bat) (Familiar) ( _ "Familiar") "portraits/familiar.png" 2 28 2}

		[move_unit_fake]
			type=Ancient Lich
			x=25,25,25
			y=1,2,2
		[/move_unit_fake]

		{UNDEAD_INTEL (Ancient Lich) (Lich-Lord Jevyan) ( _ "Lich-Lord Jevyan") "portraits/jevyan.png" 2 25 2}

		[message]
			description=Lich-Lord Jevyan
			message= _ "Give up, boy! You can't defeat me- Hmm, what's this? You've learned to conceal the power of the Ruby of Fire. It makes little difference, your undead corpse will lay it at my feet."
		[/message]
		[message]
			description=Prince Haldric
			message= _ "We'll see about that. The Fool Prince of Southbay was wrong to start this war, but you're the real monster! You sacrificed your own people to preserve your immortal un-life."
		[/message]
		[message]
			description=Lich-Lord Jevyan
			message= _ "Enough of this. A curse of darkness upon you, young prince."
		[/message]

		[kill]
			description=Lich-Lord Jevyan
		[/kill]

		[move_unit_fake]
			type=Ancient Lich
			x=25,25,25
			y=2,2,1
		[/move_unit_fake]

		{UNDEAD_UNIT (Chocobone) 2 26 4}
		{UNDEAD_UNIT (Chocobone) 2 27 4}
		{UNDEAD_UNIT (Chocobone) 2 25 4}
#ifdef NORMAL
		{UNDEAD_UNIT (Chocobone) 2 28 3}
		{UNDEAD_UNIT (Chocobone) 2 24 3}
#endif

#ifdef HARD
		{UNDEAD_UNIT (Chocobone) 2 28 3}
		{UNDEAD_UNIT (Chocobone) 2 24 3}
#endif

		[message]
			description=Familiar
			image="portraits/familiar.png"
			message= _ "Neep! Neep!"
		[/message]

		[kill]
			description=Familiar
		[/kill]

		[move_unit_fake]
			type=Blood Bat
			x=28,28,29
			y=2,1,1
		[/move_unit_fake]

		[place_shroud]
			side=1
			x=1-40
			y=1-40
		[/place_shroud]

		[remove_shroud]
			x=25-30
			y=34-38
		[/remove_shroud]

	[/event]

	[event]
		name=time over
		[message]
			description=Lt. Aethyr
			message= _ "I see masts on the horizon. Jevyan's fleet is here! It's all over."
		[/message]
	[/event]

	[event]
		name=moveto
		[filter]
			side=1
			x=10
			y=34
		[/filter]

		[redraw]
		[/redraw]

		[message]
			speaker=narrator
			message= _ "Please Disembark in an Orderly Fashion and Proceed South"
		[/message]
		[message]
			speaker=unit
			message= _ "Hmm, they left off the 'or the orcs will eat you' part."
		[/message]

		[allow_undo]
		[/allow_undo]
	[/event]

	[event]
		name=turn 7

		[set_variable]
			name=jessica_store.x
			value=14
		[/set_variable]
		[set_variable]
			name=jessica_store.y
			value=38
		[/set_variable]

		[move_unit_fake]
			type=$jessica_store.type
			x=16,15,14,14
			y=40,40,39,38
		[/move_unit_fake]

		[unstore_unit]
			variable=jessica_store
			find_vacant=yes
		[/unstore_unit]

		{CLEAR_VARIABLE jessica_store}

		[message]
			description=Lady Jessica
			message= _ "I'm back, things went well! Haldric, I sure hope you know what you're doing."
		[/message]
		[message]
			description=Prince Haldric
			message= _ "Umm, we'll talk about it later. I'm just a little busy at the moment. I'm glad you made it back in one piece."
		[/message]
		[message]
			description=Lady Jessica
			message= _ "Yes, it looks like you could use all of the help you can get."
		[/message]
	[/event]

[event]
		name=victory
		[message]
			description=Prince Haldric
			message= _ "We've defeated Jevyan's forces. The ships must disembark their passengers quickly-"
		[/message]
		[message]
			description=Lady Jessica
			message= _ "Haldric, what's going on? What's the plan?"
		[/message]
		[message]
			description=Prince Haldric
			message= _ "Well, we're going to confront Jevyan and destroy him."
		[/message]
		[message]
			description=Lady Jessica
			message= _ "That will be easier said than done. Even if we defeat him, the other Lich-Lords will follow. It's because of that ruby. If I were paranoid I'd say that our dear old 'tree-friend' might have known as much."
		[/message]
		[message]
			description=Prince Haldric
			message= _ "We should discuss this in private. Here, come with me."
		[/message]
	[/event]

	[event]
		name=moveto
		[filter]
			side=1
			x=1-25
			y=13-20
		[/filter]

		#No campaign is complete without a cuttlefish
		{UNIT (Cuttle Fish) (Cuttle Fish) ( _ "Cuttle Fish") 3 11 17}
#ifdef NORMAL
		{UNIT (Cuttle Fish) (Cuttle Fish) ( _ "Cuttle Fish") 3 11 18}
#endif

#ifdef HARD
		{UNIT (Cuttle Fish) (Cuttle Fish) ( _ "Cuttle Fish") 3 11 18}
		{UNIT (Cuttle Fish) (Cuttle Fish) ( _ "Cuttle Fish") 3 12 16}
#endif
		[message]
			description=Cuttle Fish
			message= _ "Slurp, click, click, click!"
		[/message]
		[message]
			description=Prince Haldric
			message= _ "I don't know what that is, but it doesn't sound friendly."
		[/message]
	[/event]

	[event]
		name=moveto
		[filter]
			side=1
			x=25-40
			y=13-18
		[/filter]
		{UNIT (Saurian Flanker) (Flixta) ( _ "Flixta") 4 34 15}
		{UNIT (Saurian Oracle) (Bzz'Kza) ( _ "Bzz'Kza") 4 34 16}
		{UNIT (Saurian Soothsayer) (Tirasch) ( _ "Tirasch") 4 33 16}
#ifdef NORMAL
		{UNIT (Saurian Skirmisher) (Kersezz) ( _ "Kersezz") 4 35 15}
		{UNIT (Saurian Skirmisher) (Tarex) ( _ "Tarex") 4 33 15}
#endif

#ifdef HARD
		{UNIT (Saurian Skirmisher) (Zzalkz) ( _ "Zzalkz") 4 35 15}
		{UNIT (Saurian Skirmisher) (Amprixta) ( _ "Amprixta") 4 34 16}
		{UNIT (Saurian Skirmisher) (Anexir) ( _ "Anexir") 4 33 15}
#endif
		[message]
			description=Flixta
			message= _ "You Again. You will sssuffer for your attack against my people! Shek'kahan, our Naga friendsss- You'll pay! We have new friends now."
		[/message]

		[allow_recruit]
			type=Saurian Skirmisher
			side=3,4
		[/allow_recruit]

#ifdef HARD
		[allow_recruit]
			type=Saurian Ambusher
			side=3,4
		[/allow_recruit]
#endif

	[/event]

	[event]
		name=die

		[filter]
			description=Lt. Aethyr
		[/filter]

		[message]
			description=Lt. Aethyr
			message= _ "Oh, to join my family again! Do not mourn my passing."
		[/message]

		[endlevel]
			result=defeat
		[/endlevel]
	[/event]

	[event]
		name=die
		[filter]
			description=Tan-Halg
		[/filter]

		[filter_second]
			side=1
		[/filter_second]

		[message]
			description=Tan-Halg
			message= _ "My people are like a rock slide, you can run, but we will crush you- Ahhck!"
		[/message]

		[gold]
			side=4
			amount=80
		[/gold]
	[/event]

	[event]
		name=die
		[filter]
			description=Tan-Rinak
		[/filter]

		[filter_second]
			side=1
		[/filter_second]

		[message]
			description=Tan-Rinak
			message= _ "I- I die?"
		[/message]

		[gold]
			side=3
			amount=80
		[/gold]
	[/event]
[/scenario]
