[scenario]
id=14_Plunging_into_the_Darkness
#textdomain wesnoth-httt
name= _ "Plunging into the Darkness"
map_data="{campaigns/Heir_To_The_Throne/maps/14_Plunging_Into_the_Darkness.map}"
[music]
name="battle.ogg"
[/music]
victory_when_enemies_defeated=no
{TURNS 19 16 13}

{UNDERGROUND}

next_scenario=15_The_Lost_General

{BIGMAP_PLUNGING_INTO_THE_DARKNESS}

[event]
name=prestart
	[objectives]
	side=1
		[objective]
			description= _ "Find the dwarves"
			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]

[side]
type=Commander
description=Konrad
user_description= _ "Konrad"
unrenamable=yes
side=1
canrecruit=1
controller=human
shroud=yes
team_name=good
[/side]

[side]
side=2
no_leader=yes
	[ai]
	{ATTACK_DEPTH 4 5 5}
	aggression=1.0
	[/ai]

	[unit]
	type=Blood Bat
	x=17
	y=36
	side=2
	ai_special=guardian
	[modifications]
		{TRAIT_UNDEAD}
	[/modifications]
	[/unit]
	[unit]
	type=Blood Bat
	x=21
	y=31
	side=2
	ai_special=guardian
	[modifications]
		{TRAIT_UNDEAD}
	[/modifications]
	[/unit]
	[unit]
	type=Blood Bat
	x=15
	y=32
	side=2
	ai_special=guardian
	[modifications]
		{TRAIT_UNDEAD}
	[/modifications]
	[/unit]
	[unit]
	type=Blood Bat
	x=15
	y=25
	side=2
	ai_special=guardian
	[modifications]
		{TRAIT_UNDEAD}
	[/modifications]
	[/unit]

	{UNIT (Giant Spider) (Hywyn) ( _ "Hywyn") 2 16 40}
[/side]

[side]
description=Relgorn
user_description= _ "Relgorn"
type=Dwarvish Lord
side=3
canrecruit=1
recruit=Dwarvish Fighter
gold=0
team_name=good

	[unit]
	generate_description=yes
	type=Dwarvish Thunderer
	x=15
	y=22
	side=3
	ai_special=guardian
	[modifications]
		{TRAIT_LOYAL}
	[/modifications]
	[/unit]
	[unit]
	generate_description=yes
	type=Dwarvish Fighter
	x=10
	y=22
	side=3
	ai_special=guardian
	[modifications]
		{TRAIT_LOYAL}
	[/modifications]
	[/unit]
	[unit]
	generate_description=yes
	type=Dwarvish Thunderer
	x=13
	y=20
	side=3
	ai_special=guardian
	[modifications]
		{TRAIT_LOYAL}
	[/modifications]
	[/unit]
	[unit]
	generate_description=yes
	type=Dwarvish Fighter
	x=11
	y=20
	side=3
	ai_special=guardian
	[modifications]
		{TRAIT_LOYAL}
	[/modifications]
	[/unit]
	[unit]
	generate_description=yes
	type=Dwarvish Thunderer
	x=13
	y=19
	side=3
	ai_special=guardian
	[modifications]
		{TRAIT_LOYAL}
	[/modifications]
	[/unit]
	[unit]
	generate_description=yes
	type=Dwarvish Fighter
	x=11
	y=19
	side=3
	ai_special=guardian
	[modifications]
		{TRAIT_LOYAL}
	[/modifications]
	[/unit]
	[unit]
	generate_description=yes
	type=Dwarvish Thunderer
	x=8
	y=20
	side=3
	ai_special=guardian
	[modifications]
		{TRAIT_LOYAL}
	[/modifications]
	[/unit]
	[unit]
	generate_description=yes
	type=Dwarvish Fighter
	x=17
	y=19
	side=3
	ai_special=guardian
	[modifications]
		{TRAIT_LOYAL}
	[/modifications]
	[/unit]
	[unit]
	generate_description=yes
	type=Dwarvish Thunderer
	x=15
	y=16
	side=3
	ai_special=guardian
	[modifications]
		{TRAIT_LOYAL}
	[/modifications]
	[/unit]
	[unit]
	generate_description=yes
	type=Dwarvish Fighter
	x=9
	y=16
	side=3
	ai_special=guardian
	[modifications]
		{TRAIT_LOYAL}
	[/modifications]
	[/unit]
[/side]

[event]
name=prestart
	[recall]
	description=Delfador
	show=no
	[/recall]
	[recall]
	description=Kalenz
	show=no
	[/recall]
	[teleport]
		[filter]
		description=Konrad
		[/filter]
	x,y=31,41
	[/teleport]
	[teleport]
		[filter]
		description=Delfador
		[/filter]
	x,y=31,41
	[/teleport]
	[teleport]
		[filter]
		description=Kalenz
		[/filter]
	x,y=31,41
	[/teleport]
	[place_shroud]
	x,y=1-20,21-41
	[/place_shroud]

	{PLACE_IMAGE items/bones.png 28 41}
	{PLACE_IMAGE items/bones.png 29 39}
	{PLACE_IMAGE items/bones.png 18 36}

[/event]


[event]
name=start
	[message]
	description=Konrad
	message= _ "It's so dark in here I can hardly see!"
	[/message]
	[message]
	description=Delfador
	message= _ "It is dark indeed. We shall have to light torches and tread slowly and carefully. It may be there are still dwarves down here who can aid us!"
	[/message]
	[message]
	description=Kalenz
	message= _ "Indeed. We elves do not fare well in these dark pits."
	[/message]
[/event]

[event]
name=moveto
	[filter]
	side=1
	y=10-22
	x=1-100
	[/filter]

	[message]
	description=Relgorn
	message= _ "Who are these that approach? Surface-dwellers! On your guard, men!"
	[/message]

	[teleport]
		[filter]
		description=Konrad
		[/filter]
	x,y=12,21
	[/teleport]
	[teleport]
		[filter]
		description=Delfador
		[/filter]
	x,y=12,24
	[/teleport]
	[teleport]
		[filter]
		description=Kalenz
		[/filter]
	x,y=15,24
	[/teleport]

	[redraw]
	[/redraw]
	[delay]
	time=1000
	[/delay]

	[message]
	description=Delfador
	message= _ "We come in peace, friends. We come in peace!"
	[/message]

	[message]
	description=Relgorn
	message= _ "Oh, do you? I see that you are accompanied by elves. Can we dwarves not live in peace without the treacherous elves coming to bother us?"
	[/message]

	[message]
	description=Kalenz
	message= _ "Why such harsh words, dwarf? Elves have never done you any harm."
	[/message]

	[message]
	description=Relgorn
	message= _ "'Never done us any harm?' Why, I was there myself, when the elves refused to honor our alliance. Many dwarves were slaughtered, and you cowardly elves did nothing to help!"
	[/message]

	[message]
	description=Kalenz
	message= _ "You go too far! I am Kalenz, a mighty elvish lord! How dare such as you, sniveling in his tunnel, call me a coward?"
	[/message]

	[message]
	description=Delfador
	message= _ "Peace, friends! Peace! The evil orcs roam the lands above us, we must not fight among ourselves."
	[/message]

	[message]
	description=Relgorn
	message= _ "Very well! Explain your presence here then, human. Who are you? Why have you risked life and limb to come to Knalga, home of the dwarves?"
	[/message]

	[message]
	description=Konrad
	message= _ "Well, we... we..."
	[/message]

	[message]
	description=Delfador
	message= _ "We have come so that an heir may claim his inheritance, that a king may claim his throne. We seek the Scepter of Fire."
	[/message]

	[message]
	description=Relgorn
	message= _ "The Scepter of Fire? Are you out of your minds? Surely you speak in jest!"
	[/message]

	[message]
	description=Delfador
	message= _ "We jest not, friend. We seek the Scepter of Fire. We seek the help of the dwarves in finding it. But know that we will find it, whether you help us or not."
	[/message]

	[message]
	description=Relgorn
	message= _ "You speak foolishness. No one even knows if the Scepter of Fire still exists. And who is this heir, this king that you speak of?"
	[/message]

	[message]
	description=Konrad
	message= _ "I am, sir."
	[/message]

	[message]
	description=Relgorn
	message= _ "You? Ha ha! This boy that stands before me is the king of Wesnoth? Ha ha! I haven't had such a laugh in a long time. And who are you, old man?"
	[/message]

	[message]
	description=Delfador
	message= _ "I am Delfador, Delfador the Great, Arch Mage to King Garard, and Protector of his heir."
	[/message]

	[message]
	description=Relgorn
	message= _ "You... you are Delfador? I saw Delfador when I was but a young dwarf, and I will tell you, old man, you are not Delfador. Men! Take these liars out of my sight. Delfador perished many years ago."
	[/message]

	#the flash of Delfador's lightning bolt
	[scroll_to_unit]
	description=Delfador
	[/scroll_to_unit]

	[sound]
	name=lightning.ogg
	[/sound]

	[colour_adjust]
	red=100
	green=100
	blue=100
	[/colour_adjust]

	[delay]
	time=10
	[/delay]

	[colour_adjust]
	red=0
	green=0
	blue=0
	[/colour_adjust]

	[message]
	description=Delfador
	message= _ "I am Delfador the Great! Tremble before my wrath!"
	[/message]

	[message]
	description=Relgorn
	message= _ "You... you really are Delfador! But we had news that you were dead, years ago!"
	[/message]

	[message]
	description=Delfador
	message= _ "They thought I was dead. They hoped I was dead. Yet still I live."
	[/message]

	[message]
	description=Relgorn
	message= _ "And you really think that you can find the Scepter of Fire?"
	[/message]

	[message]
	description=Delfador
	message= _ "Yes, I do. If you help us, friend, all the treasures of Knalga that we find are yours. We want only the Scepter. It will be dangerous. Make no mistake about that: dwarves will be killed, perhaps many dwarves. But surely it is better than hiding from the orcs like worms."
	[/message]

	[message]
	description=Relgorn
	message= _ "You are right, friend. I will put my best men at your disposal. We know not where the Scepter is though. Legend says it is hidden in the eastern tunnels."
	[/message]

	[message]
	description=Delfador
	message= _ "Then to the eastern tunnels we shall go!"
	[/message]

#
# Your gryphons are big now!
#
	[if]
	[variable]
	name=get_gryphons
	numerical_equals=1
	[/variable]
	[then]

		[sound]
		name=claws.ogg
		[/sound]
		[delay]
			time=500
		[/delay]
		[sound]
		name=gryphon-shriek-2.ogg
		[/sound]
		[delay]
			time=200
		[/delay]
		[sound]
		name=skeleton-hit.wav
		[/sound]
		[delay]
			time=200
		[/delay]
		[sound]
		name=human-female-hit-3.ogg
		[/sound]

# A gryphon runs up with an elf behind him

		[move_unit_fake]
		type=Gryphon
		x=15,14,14,13,13
		y=26,25,24,24,23
		[/move_unit_fake]

		[unit]
		type=Gryphon
		side=1
		x,y=13,23
		[/unit]

		[redraw]
		[/redraw]
		[delay]
		time=500
		[/delay]

		[move_unit_fake]
		type=Elvish Shaman
		x=15,14,14,14,14
		y=26,25,24,23,22
		[/move_unit_fake]

		[unit]
		type=Elvish Shaman
		description=Gryphon Tender
		user_description= _ "Gryphon Tender"
		side=1
		x,y=14,22
		[/unit]

		[redraw]
		[/redraw]
		[delay]
		time=500
		[/delay]

		[message]
		description=Gryphon Tender
		message= _ "I am sorry, Prince Konrad. The young gryphons are breaking their ropes. They are simply getting too large and too restless to restrain anymore!"
		[/message]

# Gryphon runs around some more

		# This kills the gryphon unit so it can travel some more
		[kill]
		x,y=13,23
		[/kill]

		[move_unit_fake]
		type=Gryphon
		x=13,12,11,10,10,10,10,11,12,13,14,15,15
		y=23,22,22,21,20,19,18,18,17,18,17,18,19
		[/move_unit_fake]

		[unit]
		type=Gryphon
		side=1
		x,y=15,19
		[/unit]

		[redraw]
		[/redraw]
		[sound]
		name=gryphon-hit-3.ogg
		[/sound]
		[delay]
		time=1000
		[/delay]

		[message]
		description=Relgorn
		message= _ "What's this? Gryphons in my castle? Remove the beasts!"
		[/message]
		[message]
		description=Konrad
		message= _ "Beasts? We were planning to use them as mounts."
		[/message]
		[message]
		description=Relgorn
		message= _ "Ha ha! Gryphons as mounts! Is there no end to your folly?"
		[/message]
		[message]
		description=Konrad
		message= _ "(looks miffed)"
		[/message]
		[message]
		description=Relgorn
		message= _ "Well, if you must go on with this mad scheme, I shall supply you with my own troops as riders! A frail human - or worse, an elf - would never be able to handle their violent instincts!"
		[/message]
		[message]
		description=Kalenz
		message= _ "(looks miffed)"
		[/message]
		[message]
		description=Delfador
		message= _ "Temper your anger. Relgorn's manner may be rough, but surely there is nothing wrong with his suggestion?"
		[/message]
		[message]
		description=Konrad
		message= _ "Well, I suppose..."
		[/message]

# A dwarf hops on a gryphon and rides it

		# This gets rid of the dwarvish rider
		[kill]
		x,y=17,19
		[/kill]

		[move_unit_fake]
		type=Dwarvish Fighter
		x=17,16,15
		y=19,18,19
		[/move_unit_fake]

		# This gets ride of the gryphon
		[kill]
		x,y=15,19
		[/kill]

		[unit]
		type=Gryphon Rider
		description=Mounted Dwarf
		user_description= _ "Mounted Dwarf"
		side=1
		x,y=15,19
		[/unit]

		[redraw]
		[/redraw]
		[delay]
		time=2000
		[/delay]

		[message]
		description=Mounted Dwarf
		message= _ "Woah there... No need to be surly, now. Ok, easy... now GO!"
		[/message]

		[sound]
		name=gryphon-hit-2.ogg
		[/sound]

		# This gets rid of the gryphon rider
		[kill]
		x,y=15,19
		[/kill]

		[move_unit_fake]
		type=Gryphon Rider
		x=15,15,14,13,12,11,10,10,10,10,11,12,13,13,14,14,15
		y=19,18,17,18,17,18,18,19,20,21,22,22,23,24,24,25,26
		[/move_unit_fake]

		[allow_recruit]
		type=Gryphon Rider
		[/allow_recruit]

		[message]
		speaker=narrator
		image="wesnoth-icon.png"
		message= _ "You can now recruit fearsome Gryphon Riders!"
		[/message]


		[message]
		description=Relgorn
		message= _ "Though they stink, gryphons are magnificent animals. They may not be able to navigate our twisted caverns very well, but if you ever see the surface again, they will dominate the skies. Best of luck, Allies-of-Knalga."
		[/message]

		# This gets rid of the gryphon tender unit
		[kill]
		x,y=14,22
		[/kill]

	[/then]
	[/if]

	[endlevel]
	result=continue
	[/endlevel]
[/event]

#a secret passage
[event]
name=moveto
	[filter]
	x=17
	y=36
	side=1
	[/filter]
	[message]
	speaker=unit
	message= _ "Hmm... there seems to be a secret passage behind these rocks!"
	[/message]
	[terrain]
	x=16
	y=36
	letter=Uu
	[/terrain]

[/event]

#a chest of treasure behind the secret passage
{PLACE_IMAGE items/chest.png 9 39}

[event]
name=moveto
	[filter]
	x=9
	y=39
	side=1
	[/filter]
	[sound]
		name=gold.ogg
	[/sound]
	[message]
	speaker=unit
	message= _ "There is a great fortune in this chest of treasure! I can count two hundred pieces of gold!"
	[/message]
	[gold]
	side=1
	amount=200
	[/gold]
	[removeitem]
	[/removeitem]
[/event]

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