# Level 6.2: Hunting Dwarves

[scenario]
#textdomain wesnoth-utbs

id="6_2_HuntingDwarves"
name= _ "In the Domain of the Dwarves"
label= _ "In the Domain of the Dwarves"

map_data="{campaigns/Under_the_Burning_Suns/maps/6_2DwarfMission3.map}"

[music]
name=knolls.ogg
[/music]

next_scenario=7_2_TrollInterlude

#don't display snapshot of map in saved games
snapshot="no"

#max turns in scenario varies depending on difficulty
#ifdef EASY
turns="62"
#endif
#ifdef MEDIUM
turns="58"
#endif
#ifdef HARD
turns="56"
#endif

victory_when_enemies_defeated=no

{UNDERGROUND}

#Side=1 elf player
[side]
	side=1
	description=Kaleh
	type=Desert Fighter
	canrecruit=1
	{INCOME 5 3 1}
	controller=human
	shroud=yes
	fog=no
	team_name=troll
[/side]

#Side=2 dwarf 1 (guarding advance base)
[side]
	side=2
	colour=7
	no_leader=yes
	gold=0
	income=0
	controller=ai
	shroud=no
	fog=no
	#so that the lake bats won't go after dwarves
	team_name=monster

	[ai]
		# AI will attack a weak unit with a max of 3,4,5 units
		# depending on the difficulty (default=5)
		{ATTACK_DEPTH 3 4 5}

		aggression=0.9
		caution=0.1

		#defend advance outpost, don't retreat
		[avoid]
		x,y=19-26,30-32
		[/avoid]

		[avoid]
		x,y=16-18,33-35
		[/avoid]
	[/ai]
[/side]

#Side=3 troll 3 (troll allies)
[side]
	side=3
	no_leader=yes
	gold=0
	income=0
	controller=ai
	shroud=no
	fog=no
	team_name=troll
[/side]

#Side=4 empty side
[side]
	side=4
	no_leader=yes
	gold=0
	income=0
	controller=ai
	shroud=no
	fog=no
[/side]

#Side=5 empty side
[side]
	side=5
	no_leader=yes
	gold=0
	income=0
	controller=ai
	shroud=no
	fog=no
[/side]

#Side=6 dwarf 2 (main base guards)
[side]
	side=6
	no_leader=yes
	gold=0
	income=0
	controller=ai
	shroud=no
	fog=no
	#so that lake bats won't go after dwarves
	team_name=monster

	#ifdef EASY
	recruit=Dwarvish Fighter, Dwarvish Steelclad, Dwarvish Thunderer, Dwarvish Berserker, Dwarvish Thunderguard, Dwarvish Guardsman, Dwarvish Pathfinder,
	#endif

	#ifdef MEDIUM
	recruit=Dwarvish Fighter, Dwarvish Steelclad, Dwarvish Thunderer, Dwarvish Berserker, Dwarvish Thunderguard, Dwarvish Guardsman, Dwarvish Pathfinder, Dwarvish Explorer

	#endif

	#ifdef HARD
	recruit=Dwarvish Fighter, Dwarvish Steelclad, Dwarvish Thunderer, Dwarvish Berserker, Dwarvish Thunderguard, Dwarvish Guardsman, Dwarvish Dragonguard, Dwarvish Sentinel, Dwarvish Pathfinder, Dwarvish Explorer

	#endif

	[ai]
		#ifdef EASY
		recruitment_pattern=scout,fighter,archer,fighter
		#endif

		#ifdef MEDIUM
		recruitment_pattern=scout,fighter,archer,fighter
		#endif

		#ifdef HARD
		recruitment_pattern=scout,fighter,archer,fighter
		#endif

		# AI will attack a weak unit with a max of 3,4,5 units
		# depending on the difficulty (default=5)
		{ATTACK_DEPTH 3 4 5}

		aggression=0.6

		# makes the dwarves group defensively
		grouping=defensive

	[/ai]
[/side]

#Side=7 empty side
[side]
	side=7
	no_leader=yes
	gold=0
	income=0
	controller=ai
	shroud=no
	fog=no
[/side]

#Side=8 vampire bats (white)
[side]
	side=8
	no_leader=yes
	gold=0
	income=0
	controller=ai
	shroud=no
	fog=no
	team_name=monster

	#ifdef EASY
	recruit=Vampire Bat, Blood Bat
	#endif

	#ifdef MEDIUM
	recruit=Vampire Bat, Blood Bat, Dread Bat
	#endif

	#ifdef HARD
	recruit=Vampire Bat, Blood Bat, Dread Bat
	#endif

	[ai]
		aggression=0.8
		caution=0.1

		village_value=0

		# AI will attack a weak unit with a max of 3,4,5 units
		# depending on the difficulty (default=5)
		{ATTACK_DEPTH 3 4 5}

		recruitment_pattern=fighter,fighter,fighter,fighter
		recruitment_ignore_bad_combat=yes

		#bats can't go down SW tunnel
		[avoid]
		x,y=24-42, 23-50
		[/avoid]

		#bats cant go west and attack dwarves
		[avoid]
		x,y=33-35,13-15
		[/avoid]

		passive_leader=yes
	[/ai]
[/side]

#Side=9 Secrets & Tentacles (brown)
[side]
	side=9
	no_leader=yes
	gold=0
	income=0
	controller=ai
	shroud=yes
	fog=no
	team_name=monster

	[ai]
		# AI will attack a weak unit with a max of 4,5,6 units
		# depending on the difficulty (default=5)
		{ATTACK_DEPTH 3 4 5}

		aggression=0.90
		caution=0.10
	[/ai]

	[target]
	description=Kaleh
	value=20
	[/target]

[/side]

[story]
	[part]
	story= _ "Chapter 6: The troll Zurg led us through a maze of twisting passages speaking scarcely a word. Finally after what seemed like hours of marching he stopped. He motioned us to be very quiet and we crept forward; all I could hear was the soft patter of feet and my heavy breathing. Even that little noise seemed to echo off the cramped walls of our rough-hewn passage. I was suddenly aware of the sheer mass of of rock and earth above us and for a moment I despaired of ever seeing the sun again. Then I grabbed my sword with fresh determination and vowed to see this mission through."
	[/part]
[/story]


# Prestart functions:
# set starting scenario objectives
# increase cost of recruiting units
# place item images on map
# recall main heroes
# initialize starting variables
# remove keep
# create elf units
# create AI=guardian starting units

[event]
name=prestart

# Test Units

#{UNIT_ (Troll) (Test) ( _ "Test") 1 19 37}
#{UNIT_ (Troll) (Test) ( _ "Test") 1 21 25}

# tentacle secret event test
# {UNIT_ (Desert Prowler) (Test) ( _ "Test") 1 20 13}
# {UNIT_ (Troll) (Test) ( _ "Test") 1 20 14}

#set starting scenario objectives

[objectives]
	summary= _ "Starting Objectives:"
	[objective]
		description= _ "Kill Dwarf Chieftain"
		condition=win
	[/objective]

	[objective]
		description= _ "Death of Kaleh, Nym or Zhul"
		condition=lose
	[/objective]
[/objectives]

	#increase the cost of all units by 1
	[if]

		[variable]
		name=scen3
		numerical_equals=2
		[/variable]

		[then]

		#go from 3 to 4

		[disallow_recruit]
			type=Desert Fighter, Desert Archer, Desert Hunter, Desert Shaman, Desert Scout
			side=1
		[/disallow_recruit]

		[disallow_recruit]
			type=Desert Fighter2, Desert Archer2, Desert Hunter2, Desert Shaman2, Desert Scout2
			side=1
		[/disallow_recruit]

		[disallow_recruit]
			type=Desert Fighter3, Desert Archer3, Desert Hunter3, Desert Shaman3, Desert Scout3
			side=1
		[/disallow_recruit]

		[allow_recruit]
			type=Desert Fighter4, Desert Archer4, Desert Hunter4, Desert Shaman4, Desert Scout4
			side=1
		[/allow_recruit]

		[/then]

		[else]

		[if]
			[variable]
			name=scen3
			numerical_equals=1
			[/variable]

			[then]

			#go from 2 to 3

			[disallow_recruit]
				type=Desert Fighter, Desert Archer, Desert Hunter, Desert Shaman, Desert Scout
				side=1
			[/disallow_recruit]

			[disallow_recruit]
				type=Desert Fighter2, Desert Archer2, Desert Hunter2, Desert Shaman2, Desert Scout2
				side=1
			[/disallow_recruit]

			[allow_recruit]
				type=Desert Fighter3, Desert Archer3, Desert Hunter3, Desert Shaman3, Desert Scout3
				side=1
			[/allow_recruit]

			[/then]
		[/if]

		[if]
			[variable]
			name=scen3
			numerical_equals=3
			[/variable]

			[then]

			#go from 4 to 5

			[disallow_recruit]
				type=Desert Fighter, Desert Archer, Desert Hunter, Desert Shaman, Desert Scout
				side=1
			[/disallow_recruit]

			[disallow_recruit]
				type=Desert Fighter2, Desert Archer2, Desert Hunter2, Desert Shaman2, Desert Scout2
				side=1
			[/disallow_recruit]

			[disallow_recruit]
				type=Desert Fighter3, Desert Archer3, Desert Hunter3, Desert Shaman3, Desert Scout3
				side=1
			[/disallow_recruit]

			[disallow_recruit]
				type=Desert Fighter4, Desert Archer4, Desert Hunter4, Desert Shaman4, Desert Scout4
				side=1
			[/disallow_recruit]

			[allow_recruit]
				type=Desert Fighter5, Desert Archer5, Desert Hunter5, Desert Shaman5, Desert Scout5
				side=1
			[/allow_recruit]

			[/then]
		[/if]

		[/else]
	[/if]

	#secret tomb furnishings
	{PLACE_IMAGE items/rune-violet2.png 61 21}
	{PLACE_IMAGE items/coffin2.png 65 24}
	{PLACE_IMAGE items/coffin2.png 19 97}

	#recall heroes
	[recall]
	description=Nym
	[/recall]
	[recall]
	description=Zhul
	[/recall]
	[recall]
	description=Elyssa
	[/recall]

	#initialize starting variables

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

	[set_variable]
	name=first_tunnel
	value=1
	[/set_variable]

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

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

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

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

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

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

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

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

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

	# Pre-set units

	# Event 2.1
	# Dwarvish sergeant guardian

	[unit]
	type=Dwarvish Steelclad
	description=Dwarf Sergeant
	user_description= _ "Dwarf Sergeant"
	x=11
	y=36
	side=2
	ai_special=guardian
	[modifications]
		{TRAIT_RESILIENT}
		{TRAIT_STRONG}
	[/modifications]
	[/unit]

	# Event 2.2
	# Vengeful Dwarf

	[unit]
	type=Dwarvish Fighter
	description=Vengeful Dwarf
	user_description= _ "Vengeful Dwarf"
	x=7
	y=29
	side=2
	ai_special=guardian
	[modifications]
		{TRAIT_RESILIENT}
		{TRAIT_QUICK}
	[/modifications]
	[/unit]

	#Troll ally shaman, doesn't move
	[unit]
	type=Troll Shaman
	description=Zurg
	user_description= _ "Zurg"
	x=33
	y=30
	side=3
	ai_special=guardian
	[modifications]
		{TRAIT_STRONG}
		{TRAIT_RESILIENT}
	[/modifications]
	[/unit]

	# Event 3: Tunnel cave-ins

	[unit]
	type=Dwarvish Stalwart
	description=Dwarf Scout
	user_description= _ "Dwarf Scout"
	x=22
	y=30
	side=6
	ai_special=guardian
	[modifications]
		{TRAIT_STRONG}
		{TRAIT_RESILIENT}
	[/modifications]
	[/unit]

	[unit]
	type=Dwarvish Stalwart
	description=Dwarf Scout
	user_description= _ "Dwarf Scout"
	x=17
	y=31
	side=6
	ai_special=guardian
	[modifications]
		{TRAIT_STRONG}
		{TRAIT_RESILIENT}
	[/modifications]
	[/unit]


[/event]

# starting events

[event]
name=start

# starting dialogue

[message]
description=Zurg
message= _ "This amazing tunnel, it leads very close to dwarves' main lair. You can hear their tiny footsteps just on other side of wall. All that separates us from the dwarves is a thin wall of stone. When you move a unit adjacent to the final wall, on your order Zurg will destroy it with fire magic. Dwarf chieftain is only lightly guarded, he send best warriors to hunt trolls. Heh, we give you easy task. You know dwarf chieftain when you see him, he shorter and uglier than most."
[/message]

[message]
description=Zhul
message= _ "Did you dig these tunnels all by yourselves?"
[/message]

[message]
description=Zurg
message= _ "No, most are tiny dwarf tunnels. We like natural tunnels, big and tall enough for mighty trolls. When the world was young, Griknagh cut many tunnels and caverns into the rock far below us. We traveled deep deep down, following the trickle of ancient streams, far deeper than the puny dwarves. But now we come back up, great leader say there bad things now deep below. Bad for trolls. We come back up to reclaim ancient lands. But we find them filled with many many little stinky dwarves. All the beautiful stones are gone, greedy dwarves take them all. So we fight to reclaim our lands. But Zurg talk too much. We have job to do. Find dwarven leader and kill him and we will reward you well."
[/message]

[message]
description=Kaleh
message= _ "It shall be done."
[/message]

[/event]

# Event 1: Blow up wall, encounter advance dwarf guards

# when player moves next wall trigger variable
[event]
name=moveto

[filter]
x,y=28,32
side=1
[/filter]

[message]
description=Zurg
message= _ "Once you done moving into position, Zurg will destroy wall."
[/message]

[set_variable]
name=destroy_wall
value=1
[/set_variable]
[/event]

# at start of player's next turn, blow charges and destroy wall

[event]
name=new turn
first_time_only=no

[if]
	[variable]
	name=destroy_wall
	numerical_equals=1
	[/variable]

	[then]

	[set_variable]
	name=destroy_wall
	value=2
	[/set_variable]

	# Place dwarf guards

	# EASY: 1 dwarf steelclad, 2 thunderer, 3 scouts
	# MEDIUM: 1 dwarf steelclad, 2 thunderguard, 3 scouts
	# HARD: 1 dwarf steelclad, 2 thunderguard, 3 pathfinders

	# 1 Dwarf Sergeant
	{UNIT_ (Dwarvish Fighter) (Dwarf Sergeant) ( _ "Dwarf Sergeant") 2 22 33}

	# 2 Dwarf shooters
	#ifdef EASY
	{UNIT_ (Dwarvish Thunderer) (Dwarf Guard) ( _ "Dwarf Guard") 2 21 34}
	{UNIT_ (Dwarvish Thunderer) (Dwarf Guard) ( _ "Dwarf Guard") 2 23 34}
	#else
	{UNIT_ (Dwarvish Thunderguard) (Dwarf Guard) ( _ "Dwarf Guard") 2 21 34}
	{UNIT_ (Dwarvish Thunderguard) (Dwarf Guard) ( _ "Dwarf Guard") 2 23 34}
	#endif

	# 3 dwarf scouts occupy base and villages

	#ifdef HARD
	{UNIT_ (Dwarvish Pathfinder) (Dwarf Guard) ( _ "Dwarf Guard") 2 22 34}
	{UNIT_ (Dwarvish Pathfinder) (Dwarf Guard) ( _ "Dwarf Guard") 2 20 34}
	{UNIT_ (Dwarvish Pathfinder) (Dwarf Guard) ( _ "Dwarf Guard") 2 24 34}
	#else
	{UNIT_ (Dwarvish Scout) (Dwarf Guard) ( _ "Dwarf Guard") 2 22 34}
	{UNIT_ (Dwarvish Scout) (Dwarf Guard) ( _ "Dwarf Guard") 2 20 34}
	{UNIT_ (Dwarvish Scout) (Dwarf Guard) ( _ "Dwarf Guard") 2 24 34}
	#endif

	# Have Zurg cast spell to destroy wall

	[message]
		description=Zurg
		message= _ "Fist and fire, crumble stone!"
	[/message]

	# Have screen flash red

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

	[redraw]
	[/redraw]

	[delay]
	time=100
	[/delay]

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

	[redraw]
	[/redraw]

	# Have wall shake, then be replaced by dirt, then add rubble

	[scroll]
	x=20
	[/scroll]
	[scroll]
	x=-20
	[/scroll]
	[scroll]
	x=-20
	[/scroll]
	[scroll]
	x=-20
	[/scroll]

	[terrain]
	x,y=27,33
	letter=Re
	[/terrain]

	{PLACE_IMAGE scenery/rubble.png 27 33}

	# Reveal dwarven cavern
	[remove_shroud]
	x=19-30
	y=32-39
	side=1
	[/remove_shroud]

	# Have Zurg say goodbye

	[message]
		description=Zurg
		message= _ "My work here is done. Zurg must report back to Great Leader. Many things to do and dwarves to kill before rest. Zurg return later to see how little elves are doing. Fight well!"
	[/message]

	# Have Zurg leave
	[kill]
	description=Zurg
	animate=no
	fire_event=no
	[/kill]

	[move_unit_fake]
	type=Troll Shaman
	x=33,34,35,36,37,38,39
	y=30,30,30,29,30,30,31
	[/move_unit_fake]

	[terrain]
	x,y=45,36
	letter=Xu
	[/terrain]

	{PLACE_IMAGE scenery/rubble.png 44 35}

	# Have dwarf guards talk

	[message]
	description=Dwarf Guard
	message= _ "Intruders! Sound the alarm!"
	[/message]

	[/then]
[/if]

[/event]

# Event 2: If player tries to go back up escape passage
# This event is disabled becuase player can go back up escape passage
# before he triggers Event 1 and ally leaves. Thus you could trap
# a unit behind the cave-in. Since this event is just for flavor,
# I'm disabling it.

#[event]
#name=moveto

#[filter]
#	x,y=42-45,33-36
#	side=1
#[/filter]

#[message]
#speaker=unit
#message= _ "Zurg must have collapsed the tunnel. Perhaps he didn't want to give #the dwarves an easy access route if they defeated us. So much for an escape #route, I guess we'll just have to be sure not to fail."
#[/message]

#[/event]

# Event 2.1 2.2: Dwarf Sergeant and his Conscripts

# deleted text from alternate version
# I tried to make different versions depending on if the unit is an elf
# or a troll. But I gave up that idea. This is the deleted dialogue:

#[message]
#x,y=9,36
#message= _ "No, it's an elf!"
#[/message]

#[message]
#description=Dwarf Sergeant
#message= _ "What!?!.....Right...First task boys, kill the intruder!"
#[/message]

# moveto version, when dwarf sees enemy (sighted version disabled)

[event]
name=moveto

[filter]
	x,y=9-16,35-38
	side=1
[/filter]

#[filter]
#	description=Dwarf Sergeant
#[/filter]

#[filter_second]
#	side=1
#[/filter_second]

[remove_shroud]
	side=1
	x=8-14
	y=33-38
[/remove_shroud]

# if Hard, add a third Dwarf Conscript

{UNIT_T (Dwarvish Thunderer) (Dwarf Conscript) ( _ "Dwarf Conscript") 2 9 36}
{UNIT_T (Dwarvish Scout) (Dwarf Conscript) ( _ "Dwarf Conscript") 2 10 34}

#ifdef HARD
{UNIT_T (Dwarvish Fighter) (Dwarf Conscript) ( _ "Dwarf Conscript") 2 9 35}
#endif

[message]
description=Dwarf Sergeant
message= _ "Do you know what the first task of any dwarven warrior is, runt?"
[/message]

[message]
x,y=10,34
message= _ "Sir?"
[/message]

[message]
description=Dwarf Sergeant
message= _ "Constant vigilance, boys; the enemy could be anywhere!"
[/message]

[message]
x,y=9,36
message= _ "But Sir..."
[/message]

[message]
description=Dwarf Sergeant
message= _ "Did I give you permissions to speak? Did I?"
[/message]

[message]
description=Dwarf Sergeant
message= _ "I was killing trolls when you were in swaddling clothes. I wrote the book on killing trolls. And you're not going anywhere until I'm done with you."
[/message]

[message]
x,y=10,34
message= _ "But Sir, behind you..."
[/message]

[message]
description=Dwarf Sergeant
message= _ "Oh let me guess, a big nasty troll, right? And when I turn around you flee like the cowards you are. Do you think I'm stupid enough to fall for that one?"
[/message]

[message]
x,y=9,36
message= _ "I'm too young to die, save me!"
[/message]

[message]
description=Dwarf Sergeant
message= _ "Oh grow a backbone...Huh? Hey, for once the runt was telling the truth. Come on boys, kill the intruder!"
[/message]

[/event]

# funny death message from one of the conscripts
[event]
name=die

[filter]
type=Dwarvish Thunderer
description=Dwarf Conscript
[/filter]

[if]
	[have_unit]
	description=Dwarf Sergeant
	[/have_unit]

	[then]

	[message]
	speaker=unit
	message= _ "I love you, Sarge..."
	[/message]

	[/then]
[/if]

[/event]

# Event 2.2: Wounded Troll

# When player sees Vengeful Dwarf and troll prisoner (sighted version disabled)

[event]
name=moveto

[filter]
	x,y=6-8,28-34
	side=1
[/filter]

[remove_shroud]
	side=1
	x=5-9
	y=27-34
[/remove_shroud]

[unit]
	type=Troll
	description=Grog
	user_description= _ "Grog"
	profile=portraits/grog.png
	x=7
	y=28
	side=3
	hitpoints=25
	[modifications]
		{TRAIT_STRONG}
		{TRAIT_RESILIENT}
	[/modifications]
[/unit]

[message]
description=Vengeful Dwarf
message= _ "Ha, you're trapped. I've got you right where I want you, and this time no one is gonna save you."
[/message]

[message]
speaker=second_unit
message= _ "How did a troll get stuck all the way back here?"
[/message]

[/event]

# When Vengeful Dwarf dies
[event]
name=die

[filter]
description=Vengeful Dwarf
[/filter]

[kill]
description=Vengeful Dwarf
animate=no
[/kill]

[message]
description=Grog
message= _ "Thank you. Grog got lost and there were so many smelly dwarves. If you hadn't come Grog would have been killed. Grog owes you his life."
[/message]

[store_unit]
[filter]
	description=Grog
[/filter]

variable=trollstats
[/store_unit]

[set_variable]
name=trollstats.side
value=1
[/set_variable]

[set_variable]
name=trollstats.moves
value=5
[/set_variable]

[unstore_unit]
variable=trollstats
[/unstore_unit]

{CLEAR_VARIABLE trollstats}

[/event]

# Event 3: Tunnel cave-ins

# Eastern tunnel
[event]
name=moveto

[filter]
	x,y=22-24,30-32
	side=1
[/filter]

[if]
	[variable]
	name=first_tunnel
	numerical_equals=1
	[/variable]

	[then]

	[delay]
	time=200
	[/delay]

	[message]
	description="Dwarf Scout"
	message= _ "Here they come! Blow the charges!"
	[/message]

	[kill]
	description="Dwarf Scout"
	animate=no
	[/kill]

	[move_unit_fake]
	type=Dwarvish Stalwart
	x=22,21,20,20,20,19,18,18
	y=30,30,29,28,27,27,26,25
	[/move_unit_fake]

	[scroll]
	x=20
	[/scroll]
	[scroll]
	x=-20
	[/scroll]
	[scroll]
	x=20
	[/scroll]
	[scroll]
	x=-20
	[/scroll]

	[terrain]
	x,y=22,30
	letter=Xu
	[/terrain]

	{PLACE_IMAGE scenery/rubble.png 21 30}
	{PLACE_IMAGE scenery/rubble.png 23 30}

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

	[/then]

	[else]

	[message]
	description="Dwarf Scout"
	message= _ "They're coming this way too! Blow the charges!"
	[/message]

	[redraw]
	[/redraw]

	[delay]
	time=1000
	[/delay]

	[message]
	description="Dwarf Scout"
	message= _ "What!?! Nothing happened! Who in Moradin's name rigged the darn charges anyway? I'm going to have to hold them off by myself. "
	[/message]

	[/else]
[/if]

[/event]

# Western tunnel

[event]
name=moveto

[filter]
	x,y=15-16,31-34
	side=1
[/filter]

[filter_second]
	x,y=17,31
[/filter_second]

[if]
	[variable]
	name=first_tunnel
	numerical_equals=1
	[/variable]

	[then]

	[delay]
	time=200
	[/delay]

	[message]
	description=Dwarf Scout
	message= _ "Here they come! Blow the charges!"
	[/message]

	[kill]
	description=Dwarf Scout
	animate=no
	[/kill]

	[move_unit_fake]
	type=Dwarvish Stalwart
	x=17,18,18,18,18,18,18,18,17,17
	y=31,30,29,28,27,26,25,24,24,23
	[/move_unit_fake]

	[scroll]
	x=20
	[/scroll]
	[scroll]
	x=-20
	[/scroll]
	[scroll]
	x=20
	[/scroll]
	[scroll]
	x=-20
	[/scroll]

	[terrain]
	x,y=16,31
	letter=Xu
	[/terrain]

	{PLACE_IMAGE scenery/rubble.png 15 32}
	{PLACE_IMAGE scenery/rubble.png 17 31}

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

	[/then]

	[else]

	[message]
	description="Dwarf Scout"
	message= _ "They're coming this way too! Blow the charges!"
	[/message]

	[redraw]
	[/redraw]

	[delay]
	time=1000
	[/delay]

	[message]
	description="Dwarf Scout"
	message= _ "What!?! Nothing happened! Who in Moradin's name rigged the darn charges anyway? I'm going to have to hold them off by myself. "
	[/message]

	[/else]
[/if]

[/event]


# Event 4: Bridge/Chasm Fight

# Dwarf guards challenge elves to stand and fight, Jorgi doesn't want
# to have to resort to trickery

[event]
name=moveto

[filter]
x=17-21
y=24-31
side=1
[/filter]

[remove_shroud]
x=16-23
y=23-32
side=1
[/remove_shroud]

{UNIT_T (Dwarvish Sentinel) (Jorgi) ( _ "Jorgi") 6 19 25}

#ifdef HARD
{UNIT_T (Dwarvish Steelclad) (Dwarf Guard) ( _ "Dwarf Guard") 6 18 26}
{UNIT_T (Dwarvish Steelclad) (Dwarf Guard) ( _ "Dwarf Guard") 6 19 27}
{UNIT_T (Dwarvish Steelclad) (Dwarf Guard) ( _ "Dwarf Guard") 6 20 26}
#else
{UNIT_T (Dwarvish Fighter) (Dwarf Guard) ( _ "Dwarf Guard") 6 18 26}
{UNIT_T (Dwarvish Fighter) (Dwarf Guard) ( _ "Dwarf Guard") 6 19 27}
{UNIT_T (Dwarvish Fighter) (Dwarf Guard) ( _ "Dwarf Guard") 6 20 26}
#endif

{UNIT_T (Dwarvish Pathfinder) (Dwarf Guard) ( _ "Dwarf Guard") 6 18 25}
{UNIT_T (Dwarvish Pathfinder) (Dwarf Guard) ( _ "Dwarf Guard") 6 20 25}

#ifdef EASY
{UNIT_T (Dwarvish Thunderguard) (Dwarf Guard) ( _ "Dwarf Guard") 6 19 26}
#else
{UNIT_T (Dwarvish Dragonguard) (Dwarf Guard) ( _ "Dwarf Guard") 6 19 26}
#endif

[message]
description=Jorgi
message= _ "It was a mistake to depend on trickery, we will defeat you fighting face to face. A true dwarf always looks his opponent in the eye when he kills him!"
[/message]

[message]
description=Jorgi
message= _ "So I challenge you, man to man. If you are not cowards, step out onto these bridges and meet your fate!"
[/message]

[/event]

# defines macro to explode backup charges to destroy tunnel leading
# directly to main dwarf base

#define BACKUP_CHARGES

	[scroll]
	x=20
	[/scroll]
	[scroll]
	x=-20
	[/scroll]
	[scroll]
	x=20
	[/scroll]
	[scroll]
	x=-20
	[/scroll]

	[terrain]
	x=12,12
	y=19,20
	letter=Xu
	[/terrain]

	{PLACE_IMAGE scenery/rubble.png 11 19}
	{PLACE_IMAGE scenery/rubble.png 13 21}

#enddef


# When Jorgi dies, blow charges to destroy tunnel leading to dwarf base

[event]
name=die

[filter]
description=Jorgi
[/filter]

[if]
	[variable]
	name=bridge_blown
	numerical_equals=0
	[/variable]

	[then]

	[set_variable]
	name=bridge_blown
	value=1
	[/set_variable]

	[message]
	description=Jorgi
	message= _ "I couldn't do it. Blow the backup charges! If we can't stop them then maybe the black lake will."
	[/message]

	{BACKUP_CHARGES}

	[/then]
[/if]

[/event]

# if player crosses bridge before killing Jorgi, then blow charges
# to destroy tunnel leading to dwarf base

[event]
name=moveto

[filter]
x=12-21
y=19-26
side=1
[/filter]

[if]

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

	[then]

	[set_variable]
	name=bridge_blown
	value=1
	[/set_variable]

	[if]
		[have_unit]
		description=Jorgi
		[/have_unit]

		[then]

		[message]
		description=Jorgi
		message= _ "They've crossed the chasm! Blow the backup charges! If we can't stop them then maybe the black lake will."
		[/message]

		[/then]

		[else]

		[message]
		description=Dwarf High Guard
		message= _ "They've crossed the chasm! Blow the backup charges! If we can't stop them then maybe the black lake will."
		[/message]

		[/else]

	[/if]

	{BACKUP_CHARGES}

	[/then]

[/if]

[/event]




# Before you have tripped the bats event, keep them from gaining any gold
# Before you have gotten close to dwarf lair, keep them from gaining any gold

[event]
name=new turn
first_time_only=no

[if]
	[variable]
	name=tripped_bats
	numerical_equals=0
	[/variable]

	[then]

	[modify_side]
		side=8
		income=0
		gold=0
	[/modify_side]

	[/then]
[/if]

[if]
	[variable]
	name=entered_dwarf_lair
	numerical_equals=0
	[/variable]

	[then]

	[modify_side]
		side=6
		income=0
		gold=0
	[/modify_side]

	[/then]
[/if]

[/event]


# Event 5: Vampire Bats

[event]
name=moveto

[filter]
x=25-34
y=10-22
side=1
[/filter]

[message]
speaker=unit
message= _ "It's a huge underground lake. The water looks dark and deep and is cold to the touch. There also seems to be some glowing moss on the walls which illuminates the cavern, making it easier to see."
[/message]

[/event]

#activate bats and create dwarvish hermit unit

[event]
name=moveto

[filter]
x=26-28
y=15-20
side=1
[/filter]

[set_variable]
name=tripped_bats
value=1
[/set_variable]

[unit]
	description=Extra Hairy Bat
	user_description= _ "Extra Hairy Bat"
	type=Dread Bat
	x=42
	y=9
	side=8
	canrecruit=1
	upkeep=free
	[modifications]
		{TRAIT_STRONG}
		{TRAIT_RESILIENT}
	[/modifications]
[/unit]

#on easy, don't allow side to recruit dread bats, but create one at start

#ifdef EASY
[unit]
type=Dread Bat
side=8
x=41
y=10
moves=0
[/unit]
#endif

[modify_side]
	side=8

	#ifdef EASY
	income=8
	gold=90
	#endif
	#ifdef MEDIUM
	income=10
	gold=110
	#endif
	#ifdef HARD
	income=12
	gold=130
	#endif
[/modify_side]

[unit]
type=Dwarvish Stalwart
description=Dwarf Hermit
user_description= _ "Dwarf Hermit"
x=21
y=6
side=6
ai_special=guardian
[modifications]
	{TRAIT_STRONG}
	{TRAIT_QUICK}
[/modifications]
[/unit]

[capture_village]
x,y=22,5
side=6
[/capture_village]

[/event]

# when player sees bats

[event]
name=sighted

[filter]
	type=Vampire Bat,Blood Bat,Dread Bat
[/filter]

[filter_second]
	side=1
[/filter_second]

[message]
speaker=second_unit
message= _ "Incoming! Ug, it's big, hairy, and nasty. I hate bats, I really hate bats."
[/message]

[/event]

[event]
name=die

[filter]
description=Big Hairy Bat
[/filter]

[message]
speaker=unit
message= _ "Grrraaawwwkkk!"
[/message]

[message]
speaker=second_unit
message= _ "Good riddance."
[/message]

[/event]

# allow units around lake to look out over deep water
# artificially increase sight for units walking around lake

[event]
name=moveto
first_time_only=no

[filter]
x=19-41
y=3-22
side=1
[/filter]

[set_variable]
name=x_left
value=$x1
[/set_variable]

[set_variable]
name=x_left
add=-4
[/set_variable]

[set_variable]
name=x_right
value=$x1
[/set_variable]

[set_variable]
name=x_right
add=4
[/set_variable]

[set_variable]
name=y_up
value=$y1
[/set_variable]

[set_variable]
name=y_up
add=-3
[/set_variable]

[set_variable]
name=y_down
value=$y1
[/set_variable]

[set_variable]
name=y_down
add=3
[/set_variable]

[set_variable]
	name=lake_x
	format=$x_left-$x_right
[/set_variable]

[set_variable]
	name=lake_y
	format=$y_up-$y_down
[/set_variable]

[remove_shroud]
x=$lake_x
y=$lake_y
side=1
[/remove_shroud]

[/event]

# Event 6: Tentacles attack

# (2-3 level 1 tentacles appear every turn that player
# is in 27-30,13-16) Give warning when player reaches edge of ledge

# tentacles appear at start of player's turn

[event]
name=moveto

[filter]
x=27
y=17
side=1
[/filter]

[message]
speaker=unit
message= _ "The ledge just drops off here. The water might be shallow enough to wade across, but I think I vaguely see something moving underneath the surface. Maybe it's just fish, but I don't like the look of it."
[/message]

[/event]

#define FIND_WATER_LOCATION

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

[while]

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

	[do]

		{RANDOM 28..31}

		[set_variable]
		name=tempx
		value=$random
		[/set_variable]

		{RANDOM 13..17}

		[set_variable]
		name=tempy
		value=$random
		[/set_variable]

		[store_locations]
		x=$tempx
		y=$tempy
		terrain=Ww, Wo
		variable=locs
		[/store_locations]

		[set_variable]
		name=temp
		value=$locs.length
		[/set_variable]

		{CLEAR_VARIABLE locs}

		[if]

		[variable]
		name=temp
		greater_than=0
		[/variable]

		[then]

			[set_variable]
			name=location_match
			value=1
			[/set_variable]

		[/then]
	[/if]

	[/do]

[/while]

#enddef

#define CREATE_TENTACLES

{FIND_WATER_LOCATION}

[unit]
type=Tentacle of the Deep
description=Giant Tentacle
side=9
x=$tempx
y=$tempy
[modifications]
	{TRAIT_STRONG}
	{TRAIT_QUICK}
[/modifications]
[/unit]

{FIND_WATER_LOCATION}

[unit]
type=Tentacle of the Deep
description=Giant Tentacle
side=9
x=$tempx
y=$tempy
[modifications]
	{TRAIT_STRONG}
	{TRAIT_QUICK}
[/modifications]
[/unit]

#ifdef EASY
#else

{FIND_WATER_LOCATION}

[unit]
type=Tentacle of the Deep
description=Giant Tentacle
side=9
x=$tempx
y=$tempy
[modifications]
	{TRAIT_STRONG}
	{TRAIT_QUICK}
[/modifications]
[/unit]

#endif

#enddef

# create a bunch of tentacles every time a side 1 unit is in area
# do this 3 times, then stop

[event]
name=new turn
first_time_only=no

[store_locations]
	x=27-30
	y=13-17
	[filter]
	side=1
	[/filter]
	variable=lake_list
[/store_locations]

[set_variable]
	name=temp
	value=$lake_list.length
[/set_variable]

{CLEAR_VARIABLE lake_list}


[if]
	[variable]
	name=temp
	greater_than=0
	[/variable]

	[then]

	[if]
		[variable]
		name=tentacle_count
		less_than=3
		[/variable]

		[then]

		{CREATE_TENTACLES}

		#choose what message to say
		[if]

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

			[then]

			[message]
			x,y=24-30,12-20
			side=1
			message= _ "What are those?!?"
			[/message]

			[/then]

			[else]

			[message]
			x,y=24-30,12-20
			side=1
			message= _ "Here come more of them!"
			[/message]

			[/else]
		[/if]

		[/then]
	[/if]

	#either way, whenever a unit is in the area, increase the counter
	[if]
		[variable]
		name=tentacle_count
		less_than=3
		[/variable]

		[then]

		[set_variable]
		name=tentacle_count
		add=1
		[/set_variable]

		[/then]
	[/if]

	[/then]
[/if]

[/event]

#tentacle death counter

[event]
name=die
first_time_only=no

[filter]
type=Giant Tentacle
[/filter]

[set_variable]
	name=tentacle_deaths
	add=1
[/set_variable]

[if]
	#ifdef EASY
	[variable]
	name=tentacle_deaths
	numerical_equals=6
	[/variable]
	#else
	[variable]
	name=tentacle_deaths
	numerical_equals=9
	[/variable]
	#endif

	[then]

	[message]
	x,y=21-30,12-19
	side=1
	message= _ "The movement under the water has stopped. I think we killed the last of them. Whatever 'them' was."
	[/message]

	[modify_side]
	side=8
	income=2
	[/modify_side]

	[/then]
[/if]

[/event]


# Event 7: Trigger Dwarf Lord's side
# (also create hermit and capture village)

[event]
name=moveto

[filter]
x=13-22
y=11-17
side=1
[/filter]

[set_variable]
	name=entered_dwarf_lair
	value=1
[/set_variable]

#create dwarf chieftain
[unit]
	type=Dwarvish Lord
	description=Dwarf Chieftain
	user_description= _ "Dwarf Chieftain"
	canrecruit=1
	upkeep=full
	x=6
	y=16
	side=6
	[modifications]
		{TRAIT_STRONG}
		{TRAIT_RESILIENT}
	[/modifications]
[/unit]

[modify_side]
	side=6

	#ifdef EASY
	income=2
	gold=120
	#endif
	#ifdef MEDIUM
	income=4
	gold=140
	#endif
	#ifdef HARD
	income=6
	gold=160
	#endif
[/modify_side]

#create dwarven defenders:

#on EASY difficulty, don't create Dwarvish Pathfinder

{UNIT_T (Dwarvish Fighter) (Dwarf High Guard) ( _ "Dwarf High Guard") 6 11 10}
#ifdef EASY
#else
{UNIT_T (Dwarvish Pathfinder) (Dwarf High Guard) ( _ "Dwarf High Guard") 6 5 13}
#endif
{UNIT_T (Dwarvish Thunderguard) (Dwarf High Guard) ( _ "Dwarf High Guard") 6 7 15}
{UNIT_T (Dwarvish Guardsman) (Dwarf High Guard) ( _ "Dwarf High Guard") 6 7 19}


#capture dwarf chieftan's villages

[capture_village]
x,y=6,11
side=6
[/capture_village]
[capture_village]
x,y=8,14
side=6
[/capture_village]
[capture_village]
x,y=9,19
side=6
[/capture_village]
[capture_village]
x,y=14,16
side=6
[/capture_village]
[capture_village]
x,y=11,10
side=6
[/capture_village]

[/event]

# Event 8: Dwarf Lord sighted event and death event

[event]
name=sighted

[filter]
	description=Dwarf Chieftain
[/filter]

[filter_second]
	side=1
[/filter_second]

[message]
description=Dwarf Chieftain
message= _ "So you've come at last. Let it end, here and now!"
[/message]

[/event]

[event]
name=die

[filter]
	description=Dwarf Chieftain
[/filter]

[message]
description=Dwarf Chieftain
message= _ "Paugh! Even in death I curse you! You will never escape these tunnels alive!"
[/message]

[message]
speaker=second_unit
message= _ "And so, at last, it ends."
[/message]

[message]
side=6
message= _ "The chieftain has fallen! Flee for your lives!"
[/message]

[kill]
side=6
animate=no
[/kill]

[terrain]
x=4,4,4,5,5,6
y=23,22,21,21,20,19
letter=Uu
[/terrain]

[move_unit_fake]
type=Troll Whelp
x=4,4,4,4,5,5,6
y=24,23,22,21,21,20,19
[/move_unit_fake]

{UNIT_ (Troll Shaman) (Zurg) ( _ "Zurg") 2 6 19}

[remove_shroud]
	x=5-7
	y=18-20
	side=1
[/remove_shroud]

[delay]
time=200
[/delay]

[message]
description=Zurg
message= _ "Little elves fight good. Zurg impressed. With dwarf chieftain dead, cowardly dwarves flee before us. Our struggle not over, still much more fighting, but elf and troll have won this battle. We thank you. Great Leader has allowed you to come speak with him. Great honor, never has one of your kind been allowed in his presence. But he wishes to talk with you and reward you. Please come with me."
[/message]

[message]
description=Nym
message= _ "With their knowledge of all these secret tunnels, you'd think they could have led us straight here instead of making us go through those 'light defenses'. It would have saved us a lot of unnecessary fighting in actually getting to the dwarf chieftain."
[/message]

[message]
description=Zhul
message= _ "Perhaps they wanted to further test our prowess in battle. And besides, every dwarf we kill is one they don't have to. Still, I think we caused a bigger distraction then they were expecting."
[/message]

[message]
description=Kaleh
message= _ "Shhhh, you two. Yes, of course, we would be honored to come and meet the Great Leader. But first, we left many of our people back up near the entrance to the great cave where you first met us and I fear that even now those caves aren't safe. Can you help us escort my people to safety?"
[/message]

[message]
description=Zurg
message= _ "Hmmmm, yes, yes we can help. We have a few big caves you little people can stay in, and I get some big trolls to help escort you there. The Great Leader wouldn't want any unpleasant surprises. Show me where your people are hiding and we will help you move them to our caves."
[/message]

[message]
description=Kaleh
message= _ "I thank you. Come on people, no celebrating yet, we still have work left to do!"
[/message]

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

[/event]

# DWARF EASTER EGG EVENTS

# Event 19: Hermit Intro and Death events (sighted intro version disabled)

# Hermit lives alone on island in the lake, guarding his amulet

[event]
#name=sighted

name=moveto

[filter]
x,y=18-24,3-8
side=1
[/filter]

[message]
description=Dwarf Hermit
message= _ "They've come for my precious. It's mine, yes it is. They shan't have it, no they shan't. We shall kill them all, yes, yes we will."
[/message]

[/event]

[event]
name=die

[filter]
	description=Dwarf Hermit
[/filter]

[message]
description=Dwarf Hermit
message= _ "Curse them! We hates them!"
[/message]

[message]
speaker=second_unit
message= _ "What's this? His clothes were in rags, and yet he had this ancient jeweled amulet hanging around his neck. It contains a huge amethyst that seems to glow faintly with a strange purple light. I wonder where he got such a trinket?"
[/message]

[set_variable]
name=dwarf_amulet
value=1
[/set_variable]

[/event]

# Event 19.5 baby tentacles attack any unit that tries to walk around
# the edge of cave (except for flying shyde/star)
# 2 if easy difficulty, 3 if challenging or hard difficulty

[event]
name=moveto

[filter]
	[not]
	type=Desert Shyde, Desert Star
	[/not]
x=17-21
y=8-11
side=1
[/filter]

#ifdef HARD
[unit]
type=Tentacle of the Deep
description=Smaller Tentacle
side=9
x,y=18,10
[modifications]
	{TRAIT_INTELLIGENT}
	{TRAIT_QUICK}
[/modifications]
[/unit]
#endif

[unit]
type=Tentacle of the Deep
description=Smaller Tentacle
side=9
x,y=19,9
[modifications]
	{TRAIT_INTELLIGENT}
	{TRAIT_QUICK}
[/modifications]
[/unit]

[unit]
type=Tentacle of the Deep
description=Smaller Tentacle
side=9
x,y=20,10
[modifications]
	{TRAIT_INTELLIGENT}
	{TRAIT_QUICK}
[/modifications]
[/unit]

[message]
description=Small Tentacle
message= _ "Splash! Splash!"
[/message]

[message]
speaker=unit
message= _ "More tentacles?!? What, did that thing have a baby?"
[/message]

[/event]

# Event 20: Moveto rune statue, open door events

[event]
name=moveto
first_time_only=no

[filter]
x,y=45,21
side=1
[/filter]

# if dwarf_amulet = 1 open door desc set dwarf_door to 2

[if]
	[variable]
	name=dwarf_amulet
	numerical_equals=1
	[/variable]

	[then]

	[message]
	speaker=unit
	message= _ "Hey wait a minute, that amulet glows the same color as this rune. Maybe if I put the amulet on and step into the rune..."
	[/message]

	[colour_adjust]
	red,green,blue=246,0,243
	[/colour_adjust]

	[scroll]
	x=20
	[/scroll]
	[scroll]
	x=-20
	[/scroll]
	[scroll]
	x=20
	[/scroll]
	[scroll]
	x=-20
	[/scroll]

	[terrain]
	x,y=46,21
	letter=Uu
	[/terrain]

	{PLACE_IMAGE scenery/rubble.png 46 21}

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

	[removeitem]
	x,y=45,21
	[/removeitem]

	[message]
	speaker=unit
	message= _ "Woah. That was pretty impressive. The amulet stopped glowing and the rune is gone, but what have they revealed? "
	[/message]

	[set_variable]
	name=dwarf_amulet
	value=2
	[/set_variable]

	[set_variable]
	name=dwarf_door
	value=2
	[/set_variable]

	[/then]
[/if]

# if dwarf_door = 1 repeat description

[if]
	[variable]
	name=dwarf_door
	numerical_equals=1
	[/variable]

	[then]

	[message]
	speaker=unit
	message= _ "The rune is still there, glowing mysteriously. I still have no idea why it was put here, but it's obviously powerful and magical, a combination of things which I am hesitant to mess with."
	[/message]

	[/then]
[/if]

# if dwarf_door = 0 print initial rune description set dwarf_door to 1

[if]
	[variable]
	name=dwarf_door
	numerical_equals=0
	[/variable]

	[then]

	[message]
	speaker=unit
	message= _ "What in Eloh's name is this? Someone has carved a glowing purple rune in the floor at the end of this passage. It must be magical. And this passage ends suddenly in a smooth stone wall. This can't be a coincidence. But the wall seems quite solid. I wonder who carved that rune and why?"
	[/message]

	[set_variable]
	name=dwarf_door
	value=1
	[/set_variable]

	[/then]
[/if]

[/event]

# Event 21: Ransack Dwarven Tomb

# if unit is a desert shyde, star, ranger or avenger
# then use alternate events so they don't lose their melee attack
# special abilities when they gain first strike

[event]
name=moveto
first_time_only=no

[filter]
x=49
y=24
side=1
[/filter]

[if]

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

	[then]

	[message]
	speaker=unit

	message= _ "Based on the runes covering the walls this must be the tomb of some ancient dwarf. The tomb seems empty except for this ornate stone coffin. The skeleton inside the coffin has long since vanished into dust. All that's left are a few ceremonial trinkets and this shining golden belt. Inscribed on this inside are the words: 'May you have the toughness to stay standing long after your enemies fall'  Grave robbing is never a good thing to do, but this belt looks magical and its former owner certainly won't miss it."
	[option]

		message= _ "I fear no ghosts, I'll take it."
		[command]
			[set_variable]
			name=took_belt
			value=1
			[/set_variable]
		[/command]
		[command]
			[message]
			speaker=unit
			message= _ "The belt fits perfectly! Somehow I feel stronger and tougher. This is too easy, there seem to have been no traps set upon the coffin. Today's my lucky day."
			[/message]
		[/command]

		[command]

			[object]

			[filter]
			x=49
			y=24
			side=1
			[/filter]

			id=DwarvenBelt
			name= _ "Dwarven Belt"
			description= _ "The maximum hit points of the unit who wears this belt will increase by 12."

			[effect]
			apply_to=hitpoints
			increase_total=12
			[/effect]

			[/object]

		[/command]

		[command]
		{UNIT_ (Ghost) (Angry Ghost) ( _ "Angry Ghost") 9 47 22}

		[message]
		description=Angry Ghost
		message= _ "You who disturb my rest, come and join me in death!"
		[/message]

		[message]
		speaker=unit
		message= _ "Then again, maybe I spoke too soon."
		[/message]

		[/command]
	[/option]

	[option]
	message= _ "On second thought, it's better to leave the dead in peace."

	[/option]

	[/message]

	[/then]
[/if]

[/event]

#at victory, clear variables:
[event]
name=victory
{CLEAR_VARIABLE destroy_wall}

{CLEAR_VARIABLE i}
{CLEAR_VARIABLE first_tunnel}
{CLEAR_VARIABLE bridge_blown}
{CLEAR_VARIABLE temp}
{CLEAR_VARIABLE tempx}
{CLEAR_VARIABLE tempy}
{CLEAR_VARIABLE tentacle_count}
{CLEAR_VARIABLE tentacle_deaths}
{CLEAR_VARIABLE tripped_bats}
{CLEAR_VARIABLE x_left}
{CLEAR_VARIABLE x_right}
{CLEAR_VARIABLE y_up}
{CLEAR_VARIABLE y_down}
{CLEAR_VARIABLE dwarf_door}
{CLEAR_VARIABLE dwarf_amulet}
{CLEAR_VARIABLE took_belt}

{CLEAR_VARIABLE entered_dwarf_lair}
[/event]

[event]
name=time over

[message]
description=Kaleh
message= _ "Oh no, we took too long and enemy reinforcements have arrived. We'll surely be overwhelmed now!"
[/message]

[/event]

#if troll prisoner Grog dies in battle, record it

[event]
name=die

[filter]
description=Grog
[/filter]

[set_variable]
name=grog_died
value=1
[/set_variable]

[/event]

{@campaigns/Under_the_Burning_Suns/utils/deaths.cfg}

{@campaigns/Under_the_Burning_Suns/utils/global-events.cfg}
[/scenario]
