[test]
	name="Test scenario"
map_data="
Mm          , Mm          , Mm          , Mm^Xm       , Mm^Xm       , Mm^Xm       , Gg          , Ww^Vm       , Gg          , Dd^Vda      , Gg          , Aa^Vea      , Gg          , Aa^Vha      , Gg          , Hh^Vhh      , Gg          , Mm^Vhh      , Gg          , Uu^Vu       , Gg          , Wo          , Wo          , Ch          , Wo          , Wo          , Wo          , Gg          , Wo          , Wo          , Wo          , Md          , Wo          , Wo          , Wo          , Rd          , Wo          
Mm          , Mm          , Mm          , Mm          , Mm^Xm       , Gg          , Gg          , Gg          , Uu^Vud      , Gg          , Dd^Vdt      , Gg          , Gg^Ve       , Gg          , Gg^Vh       , Gg          , Ha^Vhha     , Gg          , Gs^Vht      , Wo          , Wo          , Cud         , Ch          , Wo          , Wo          , Ds          , Gg          , Wo          , Wo          , Hd          , Md          , Wo          , Wo          , Re          , Rd          , Wo          , Wo          
Mm          , Gg          , Gg          , Gg          , Gg          , Gg          , Ch          , Ch          , Ch          , Ch          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Ss^Vhs      , Gg          , Cud         , Wo          , Wo          , Dd          , Ds          , Wo          , Wo          , Ha          , Hd          , Wo          , Wo          , Ql          , Re          , Wo          , Wo          , Uu          , Uu          
Mm          , Gg          , Gg          , Gg          , Gg          , Gg          , Ch          , 1 Kh        , Ch          , Ww          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gs^Fp       , Gs^Fp       , Gs^Fp       , Gs^Fp       , Dd          , Wo          , Wo          , Gs          , Ha          , Wo          , Wo          , Mm          , Ql          , Wo          , Wo          , Uh          , Uh          , Wo          , Wo          
Mm          , Gg          , Gg          , Gg          , Gg          , Gg          , Ch          , Ch          , Ch          , Gg          , Ww          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gs^Fp       , Gs^Fp       , Gs^Fp       , Gs^Fp       , Wo          , Gs          , Gs          , Gg^Vh       , Ww          , Ww          , Mm          , Ww          , Wo          , Rr          , Rr          , Wo          , Wo          , Gg          , Gg          
Mm          , Gg          , Gg          , Gg          , Gg          , Gg          , Ch          , Ch          , Ch          , Gg          , Gg          , Gg          , Gg          , Rr          , Gg          , Rr          , Rr          , Rr          , Gs^Fp       , Gs^Fp       , Gs^Fp       , Gs^Fp       , Gs^Fp       , Gg^Vh       , Rr          , Gg          , Ww          , Ww          , Hh          , Hh          , Hh          , Wo          , Wo          , Wo          , Gg          , Wo          , Gg          
Mm          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg^Ve       , Gg          , Gg^Ve       , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Rr          , Gg          , Rr          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Ww          , Ww          , Ww          , Ww          , Gg          , Wo          , Mm^Xm       , Wo          , Gg          , Wo          , Ha          
Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gs          , Gg          , Gg          , Rr          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Wo          , Mm^Xm       , Wo          , Gg          , Wo          , Ha          
Gg          , Gs^Fp       , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gs          , Gg          , Gs          , Gg          , Gs          , Gg          , Gg          , Re          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Wo          , Aa          , Wo          , Gg          , Wo          , Hh          
Gg          , Gg          , Gg          , Gs^Ft       , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gs          , Gs          , Gs          , Gg          , Re          , Gg          , Re          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Wo          , Aa          , Wo          , Md          , Wo          , Hh          
Gg          , Dd^Do       , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gs          , Gg          , Gg          , Rd          , Gg          , Gg          , Re          , Re          , Re          , Gg          , Gg          , Ch          , Ch          , Ch          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Wo          , Ai          , Wo          , Md          , Wo          , Ss^Bw|      
Gg          , Gg          , Gg          , Gg^Fet      , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Rd          , Gg          , Rd          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Ch          , Ch          , Ch          , Gg          , Gg          , Gg          , Ww          , Gg          , Wo          , Gg          , Wo          , Ai          , Wo          , Mm          , Wo          , Ss          
Xu          , Xu          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Rd          , Gg          , Rd          , Rd          , Rd          , Gg          , Re          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Wo^Bw\      , Wo^Bw/      , Wo^Bw|      , Ww          , Gg          , Wo          , Dd          , Wo          , Mm          , Wo          , Ss          
Xu          , Xu          , Ce          , Ce          , Ke          , Ce          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Ce          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Ss^Bw/      , Ww          , Ss^Bw|      , Ss^Bw\      , Gg          , Wo          , Dd          , Wo          , Qxu         , Wo          , Rr          
Xu          , Uu^Uf       , Xu          , Ce          , Ce          , Xu          , Gg          , Uh          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Ke          , Ce          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Ss^Bw\      , Wo          , Ds          , Wo          , Qxu         , Wo          , Rr          
Xu          , Uu^Uf       , Xu          , Xu          , Xu          , Xu          , Xu          , Uu          , Gg          , Uh          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Ss          , Gg          , Gg          , 2 Kh        , Gg          , Gg          , Wo          , Ds          , Wo          , Rd          , Wo          , Uh          
Xu          , Qxu         , Qxu         , Cud         , Xu          , Uu          , Uu^Ii       , Uu^Vu       , Gg          , Xu          , Gg          , Gg          , Gg          , Gg^Ve       , Gg          , Ch          , Gg          , Gg          , Chr         , Chr         , Gg          , Chw         , Ww          , Gg          , Chs         , Chs         , Gg          , Cud         , Gg          , Gg          , Gg          , Wo          , Gs          , Wo          , Rd          , Wo          , Uh          
Xu          , Xu          , Qxu         , Ql          , Cud         , Uh          , Uu^Vu       , Uu^Uf       , Xu          , Ql          , Gg^Ve       , Xu          , Gg          , Gg          , Gg          , Kh          , Ch          , Gg          , Khr         , Gg          , Gg          , Khw         , Chw         , Gg          , Khs         , Gg          , Gg          , Kud         , Cud         , Ww^Bw/      , Ww^Bw/      , Wo          , Gs          , Wo          , Re          , Wo          , Uu          
Xu          , Qxu         , Qxu         , Ql          , Ql          , Ql          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Wo          , Gg          , Wo          , Re          , Wo          , Uu          
"

[event]
name=moveto
	[filter]
	x=11
	y=6
	side=1
	[not]
	description=Baldras
	[/not]
	[/filter]

	[message]
	speaker=narrator
	message= "You can come if you wish, but the leader is only interested in speaking to Baldras."
	[/message]
[/event]

	turns=36
	id=test

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

	{ITM_BOOK1 2 2}
	{ITM_BOOK2 3 2}
	{ITM_BOOK3 4 2}
	{ITM_BOOK4 5 2}
	{ITM_FLOWER1 2 3}
	{ITM_FLOWER2 3 3}
	{ITM_FLOWER3 4 3}
	{ITM_FLOWER4 5 3}
	{ITM_ROCK1 2 4}
	{ITM_ROCK2 3 4}
	{ITM_ROCK3 4 4}
	{ITM_ROCK4 5 4}
	{ITM_DRAGONSTATUE 2 5}
	{ITM_ORNATE1 3 5}
	{ITM_ORNATE2 4 5}
	{ITM_BARREL 5 5}
	{ITM_MONOLITH1 2 6}
	{ITM_MONOLITH2 3 6}
	{ITM_MONOLITH3 4 6}
	{ITM_MONOLITH4 5 6}
	{ITM_WELL 2 7}
	{ITM_LEANTO 3 7}
	{ITM_BALL_GREEN 4 7}
	{ITM_BALL_BLUE 5 7}
	{ITM_BOX 2 8}
	{ITM_WISHINGWELL 10 5}

	{OBJ_RING_REGENERATION 10 4 OBJ1}
	{OBJ_RING_SLOW 11 4 OBJ2}
	{OBJ_POTION_HEALING 12 4 OBJ3}
	{OBJ_POTION_POISON 13 4 OBJ4}
	{OBJ_POTION_HOLY 14 4 OBJ5}
	{OBJ_POTION_STRONG 15 4 OBJ6}
	{OBJ_POTION_DECAY 11 5 OBJ7}
	{OBJ_TRIDENT_STORM 12 5 OBJ8}
	#{OBJ_SWORD_FIRE 13 5 OBJ9}
	#{OBJ_SCEPTER_FIRE 14 5 OBJ10}

	{ACT_TELEPORT 10 3 27 15}

	[side]
	type="Mage of Light"
	side=1
	canrecruit=1
	controller=human
	hitpoints=80
	recruit="Ghost,Troll Whelp,Assassin,Elvish Hero,Elvish Fighter,Elvish Archer,Horseman,Mage,Elvish Shaman,Red Mage,Spearman,Swordsman,Duelist,Fencer,Elvish Captain,Elvish Ranger,Elvish Shyde,Thief,Rogue,White Mage,Mage of Light,Elvish Sharpshooter,Silver Mage"
	gold=2000
	enemy=2
	shroud=yes
		[unit]
			x,y=4,8
			type="Elvish Avenger"
			generate_description=yes
			hitpoints=4
			[status]
			stone=on
			[/status]
		[/unit]
		[unit]
			x,y=12,8
			type="Thief"
			generate_description=yes
		[/unit]

	[/side]

	[side]
	type=Orcish Warlord
	description="Urug-Telfar"
	side=2
	controller=ai
	canrecruit=1
	recruit="Orcish Grunt,Troll Whelp,Wolf Rider,Orcish Archer,Orcish Assassin,Saurian Skirmisher,Naga Fighter"
	gold=40
	income=10
	enemy=1
		[unit]
			x,y=12,13
			type="Orcish Archer"
			generate_description=yes
		[/unit]
		[unit]
			x,y=10,7
			type="Orcish Archer"
			generate_description=yes
		[/unit]

	[/side]

	[item]
	x,y=8,8
	image="items/orcish-flag.png"
	[/item]
	[label]
	x,y=8,8
	text="Northerners unleashed!"
	[/label]

	[event]
	name=moveto
	first_time_only=no
		[filter]
		side=1
		x=8
		y=8
		[/filter]
		[terrain]
		x=28,30,29
		y=15,15,17
		letter=Ch
		[/terrain]

		{VARIABLE_OP xx1 random 10..20}
		{VARIABLE_OP yy1 random 10..17}

		[unit]
			side=2
			x,y="$xx1","$yy1"
			type="Orcish Warlord"
			description="Bozo"
			generate_description=yes
		[/unit]

		[message]
			speaker="Bozo"
			message="Mwahahahahah! I appeared at $xx1, $yy1!"
		[/message]
	[/event]

	[item]
	x,y=4,4
	image="items/orcish-flag.png"
	[/item]
	[label]
	x,y=4,4
	text="Open, Sesame!"
	[/label]

	[event]
	name=moveto
	first_time_only=no
		[filter]
		side=1
		x=4
		y=4
		[/filter]
		[terrain]
		x=1,2
		y=2,2
		letter=Re
		[/terrain]
	[/event]

	[item]
	x,y=8,5
	image="items/orcish-flag.png"
	[/item]
	[label]
	x,y=8,5
	text="Reveal the Way"
	[/label]

	[event]
	name=moveto
	first_time_only=no
		[filter]
		side=1
		x=8
		y=5
		[/filter]
		[remove_shroud]
			side=1
			x="0-38"
			y="0-20"
		[/remove_shroud]
	[/event]

	[item]
	x,y=12,6
	image="terrain/color-hex.png~RC(red>4)~RC(blue>5)"
	[/item]
	[label]
	x,y=12,6
	text="change coloring"
	[/label]

	[color_range] 
      id=blonde 
      rgb=255,255,0,255,255,128,0,0,0 
   [/color_range] 
   [color_palette] 
      thief=133,167,202,73,102,151,215,240,240,185,206,228,41,61,95,97,124,171 
   [/color_palette]    
   [event] 
      name=prerecruit 
      first_time_only=no 
      [filter] 
         type="Thief" 
      [/filter]    
      {RANDOM "RC(thief>1)","RC(thief>2)","RC(thief>3)","RC(thief>blonde)","RC(thief>mauve_troll)","donothing()"} 
      [object] 
         silent=yes 
         [effect] 
            apply_to=image_mod 
            replace=$random 
         [/effect] 
      [/object] 
   [/event] 
   
	[color_range]
		id=mauve_troll
		rgb=ED6F9B,C63567,380113
	[/color_range]
	[color_range]
		id=aqua_troll
		rgb=7AA09A,3B765F,002121
	[/color_range]
	[color_range]
		id=green_troll 
		rgb=869280,466546,001715
	[/color_range]
	[color_range]
		id=grey_troll 
		rgb=7E808B,3E5451,00101A
	[/color_range]
	
	[color_palette] 
		troll_skin=A8A8A8,747F73,616153,374336,172830,9A9A9A,999999,596F60,596E5F,4E4F3F,4E5040,4D4F3F,1E3325,1F3325,001B22,001A21
	[/color_palette]    
	[event] 
		name=prerecruit 
		first_time_only=no 
      [filter] 
         type="Troll Whelp" 
      [/filter] 
#define GIVE_TROLLSKIN   
      {RANDOM "RC(troll_skin>mauve_troll)","RC(troll_skin>aqua_troll)","RC(troll_skin>aqua_troll)","RC(troll_skin>green_troll)","RC(troll_skin>grey_troll)","donothing()"} 
      [object] 
         silent=yes 
         [effect] 
            apply_to=image_mod 
            replace=$random 
         [/effect] 
      [/object]
#enddef
   {GIVE_TROLLSKIN}
   [/event]    
   

	[event]
	name=moveto
	first_time_only=no
		[filter]
		side=1
		x=12
		y=6
		type="Thief"
		[/filter]
		[object]
			id=bleach
			name= "Potion of bleach"
			image=items/potion-red.png
			duration=level
			description= "Oooh tingly!!!"
			[effect]
				apply_to=image_mod
				add="RC(thief>blonde)"

				[color_palette]
					thief=133,167,202,73,102,151,215,240,240,185,206,228,41,61,95,97,124,171
				[/color_palette]	
			[/effect]
		[/object]
	[/event]

	[event]
		name=moveto
		first_time_only=no
		[filter]
			side=1
			x=12
			y=6
			[not]
				type="Thief"
			[/not]
		[/filter]
		[message]
           		speaker=narrator
           		image=units/elves-wood/captain.png~RC(magenta>3)
           		message="Send me a thief to spy on the blondes"
	     [/message]
	[/event]

	[item]
	x,y=8,7
	image="items/chest-plain-closed.png"
	[/item]
	[label]
	x,y=8,7
	text="BOOM!"
	[/label]

	[event]
	name="moveto"
	first_time_only=no
		[filter]
			x,y=8,7
		[/filter]
		[terrain]
			x="7,9"
			y="7,7"
			letter="Gg"
		[/terrain]
	[/event]

	[item]
	x,y=9,3
	image="items/gohere.png"
	[/item]
	[label]
	x,y=9,3
	text="Win"
	[/label]

	[event]
	name="moveto"
	first_time_only=no
		[filter]
			x,y=9,3
		[/filter]
		[endlevel]
			result="victory"
			bonus=yes
		[/endlevel]
	[/event]

	[event]
        name=prestart

        [unit]
            side=1
            x,y="recall","recall"
            type=Lich
        [/unit]

        [unit]
            side=1
            x,y="recall","recall"
            type=Arch Mage
        [/unit]

        [unit]
            side=1
            x,y="recall","recall"
            type=Ancient Wose
        [/unit]
    [/event]

[terrain_graphics]
	x,y=13,13
	map="
, *
*,  *
, 1
*,  *
, *"

	[tile]
	pos=1
	type=*
	[/tile]
	[image]
	name="forest"
	position=vertical
	base=90,144
	[/image]
[/terrain_graphics]

	[label]
	x,y=15,15
	text="This is not a forest"
	[/label]


	[label]
	x,y = 25,6
	text = "Let it snow"
	[/label]

	[event]
#when moving the the specified coordinates the 
#area will be transformed to a snow landscape
#but the water area should remain as is
		name="moveto"
		first_time_only=yes
		[filter]
			x,y=25,6
		[/filter]

		[terrain_mask]
			x,y=20,1
			mask="
_s, _s, _s, _s, Aa, Aa, _s, _s, _s, _s 
_s, _s, _s, Aa, Aa, Aa, Aa, _s, _s, _s 
_s, _s, Aa, Aa, Aa, Aa, Aa, Aa, _s, _s 
_s, Aa, Aa, Aa, Aa, Aa, Aa, Aa, Aa, _s 
Aa, Aa, Aa, Aa, Aa, Aa, Aa, Aa, Aa, Aa 
Aa, Aa, Aa, Aa, Aa, Aa, Aa, Aa, Aa, Aa 
_s, Aa, Aa, Aa, Aa, Aa, Aa, Aa, Aa, _s 
_s, _s, Aa, Aa, Aa, Aa, Aa, Aa, _s, _s 
_s, _s, _s, Aa, Aa, Aa, Aa, _s, _s, _s 
_s, _s, _s, _s, Aa, Aa, _s, _s, _s, _s 
"
			[rule]
				old=Gg^Vh
				new=Aa
				terrain=Aa^Vha
			[/rule]
			[rule]
				old=Gs^Fp
				new=Aa
				terrain=Aa^Fpa
			[/rule]
			[rule]
				old=Hh
				new=Aa
				terrain=Hh
			[/rule]
			[rule]
				old=Gg, Re
				new=Aa
				#don't specify terrain and it just uses the new terrain
			[/rule]
#			#default: Will match everything, since 'old' and 'new' aren't
#			#specified. Set 'use_old=yes' to signal no change.
			[rule]
				use_old=yes
			[/rule]
		[/terrain_mask]
	[/event]
	[event]
	name=start
		[set_menu_item]
			id=test1
			description="Summon Troll"
			[show_if]
				[not]
					[have_unit]
						x,y=$x1,$y1
					[/have_unit]
				[/not]
			[/show_if]
			[filter_location]
			[/filter_location]
			[command]
				{UNIT (Troll) (MagicTroll) ( "Magic Troll") $side_number $x1 $y1}
				{GIVE_TROLLSKIN}
#undef GIVE_TROLLSKIN
				[sound]
					name=magic-holy-miss-3.ogg
				[/sound]				
			[/command]
		[/set_menu_item]
		[set_menu_item]
			id=test2
			image="buttons/group_all.png"
			description="Dismiss Troll"
			[show_if]
				[have_unit]
					x,y=$x1,$y1
					type=Troll
					side=$side_number
				[/have_unit]
			[/show_if]
			[command]
				[kill]
					x,y=$x1,$y1
					animate=yes
				[/kill]
			[/command]
		[/set_menu_item]
	[/event]

	[label]
	x,y=10,10
	text="Keep out!!!"
	[/label]

	[event]
	name=moveto
	first_time_only=no
		[filter]
			x,y=10, 10
		[/filter]
		[deprecated_message]
			message="Moveing to this location is no longer supported... bye bye"
		[/deprecated_message]
		[kill]
			x,y=10,10
			animate=yes
		[/kill]
	[/event]

[/test]

