label="2p - Silverhead Crossing Turn 6_Condoriano"
version="1.6"
completion="victory"
campaign_type="multiplayer"
difficulty="NORMAL"
random_seed="1639591933"
random_calls="0"
next_underlying_unit_id="20"
end_text_duration="0"
[variables]
[/variables]
[replay]
	[command]
		[start]
		[/start]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="5"
			y="14"
		[/recruit]
		[random]
			value="28642"
		[/random]
		[random]
			value="20507"
		[/random]
		[random]
			value="14256"
		[/random]
		[random]
			value="12639"
		[/random]
		[random]
			value="6008"
		[/random]
		[random]
			value="32367"
		[/random]
		[random]
			value="1461"
		[/random]
		[random]
			value="25488"
		[/random]
		[random]
			value="13933"
		[/random]
		[random]
			value="25145"
		[/random]
		[random]
			value="29850"
		[/random]
		[random]
			value="13147"
		[/random]
		[random]
			value="12253"
			[results]
				checksum="Dem>c1k,fFB3IPKDDy,IIVsrrz9qrFsKPmsAOVOPtQsRHOMGLquuPuNAtBx6AEqpsGOKxE8KFoBPRQNzSIM0NsInAEUrD<pd7wU07l,LsmkMRAyTOtHFLqpFUIIzsxsc"
			[/results]
		[/random]
	[/command]
	[command]
		undo="no"
		[speak]
			id="KnightKunibert"
			message="hf :-)"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="4"
			y="13"
		[/recruit]
		[random]
			value="31701"
		[/random]
		[random]
			value="7197"
		[/random]
		[random]
			value="13657"
		[/random]
		[random]
			value="32668"
		[/random]
		[random]
			value="4703"
		[/random]
		[random]
			value="11039"
		[/random]
		[random]
			value="15545"
		[/random]
		[random]
			value="18313"
		[/random]
		[random]
			value="11948"
		[/random]
		[random]
			value="20281"
		[/random]
		[random]
			value="26019"
		[/random]
		[random]
			value="3176"
		[/random]
		[random]
			value="9085"
		[/random]
		[random]
			value="8127"
		[/random]
		[random]
			value="31593"
			[results]
				checksum="LhGI37qHcsJn9Niqer4moRo6wD4zsHoKP1Hy+wP.,jg1d-5cL>71745hhbgk5n1,oc<nn6f23854.p4418om4H8bFWB0pjc+cZng<m8e6X68+vn>t55bKrqZdmOCaJmI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Muhahahaha has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="5"
			x="5"
			y="12"
		[/recruit]
		[random]
			value="14380"
		[/random]
		[random]
			value="8439"
		[/random]
		[random]
			value="28333"
		[/random]
		[random]
			value="7033"
		[/random]
		[random]
			value="2232"
		[/random]
		[random]
			value="1471"
		[/random]
		[random]
			value="8529"
		[/random]
		[random]
			value="13274"
		[/random]
		[random]
			value="13553"
		[/random]
		[random]
			value="3653"
		[/random]
		[random]
			value="6252"
		[/random]
		[random]
			value="29636"
		[/random]
		[random]
			value="32710"
		[/random]
		[random]
			value="8015"
		[/random]
		[random]
			value="23804"
			[results]
				checksum="wmNPCQ,<jCB,xNaeN9c8kBjp>f.33i3,bi2g6odf4d42johapi+j5>4.,j0+4d89dk>9,2l9E.fc-I>-,WJ2j2m>8oQ0birbp4<4OkUyc1nTJvFiKQ-515ck5XIh5Kjg"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="TKVN has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="3"
			x="5"
			y="13"
		[/recruit]
		[random]
			value="22041"
		[/random]
		[random]
			value="22989"
		[/random]
		[random]
			value="27146"
		[/random]
		[random]
			value="24253"
		[/random]
		[random]
			value="27155"
		[/random]
		[random]
			value="16049"
		[/random]
		[random]
			value="1064"
		[/random]
		[random]
			value="13378"
		[/random]
		[random]
			value="802"
		[/random]
		[random]
			value="5861"
		[/random]
		[random]
			value="16545"
		[/random]
		[random]
			value="8656"
		[/random]
		[random]
			value="31438"
			[results]
				checksum="wIq0h4Aje6ZNhfnNl+7b,Ha4jCJxd>Z4D>emIBh6hCW2BmtJ8j1v.9xmODNURxriEsBIuurvENcQBQBPqyPrRxP5tBQME,Ezpfu49w6JQVkN94JBwVAIsdMAIZHHpExA"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="4"
			y="12"
		[/recruit]
		[random]
			value="4955"
		[/random]
		[random]
			value="8682"
		[/random]
		[random]
			value="4681"
		[/random]
		[random]
			value="25466"
		[/random]
		[random]
			value="26026"
		[/random]
		[random]
			value="10181"
		[/random]
		[random]
			value="18850"
		[/random]
		[random]
			value="9453"
		[/random]
		[random]
			value="9239"
		[/random]
		[random]
			value="14436"
		[/random]
		[random]
			value="14158"
		[/random]
		[random]
			value="29582"
		[/random]
		[random]
			value="3715"
			[results]
				checksum="fEAwEAF+1Gub.aUZJ5kiOGDqZxM8i-LoLYEs-E3jSJv0zT>8cpf6b>5Im2-i0051mfOa-a-d4,d8b>dr3-aeWym.7BZSugG6.eC5RE539gmeoJZ4jM-lYWmgBNCho0u4"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="6"
			y="14"
		[/recruit]
		[random]
			value="2142"
		[/random]
		[random]
			value="12615"
		[/random]
		[random]
			value="25262"
		[/random]
		[random]
			value="22984"
		[/random]
		[random]
			value="25468"
		[/random]
		[random]
			value="1675"
		[/random]
		[random]
			value="30027"
		[/random]
		[random]
			value="6130"
		[/random]
		[random]
			value="16186"
		[/random]
		[random]
			value="18395"
		[/random]
		[random]
			value="28159"
		[/random]
		[random]
			value="18731"
		[/random]
		[random]
			value="26060"
			[results]
				checksum="Dem>c1k,fFB3IPKDDy,IIVsrrz9qrFsKPmsAOVOPtQsRHOMGLquuPuNAtBx6AEqpsGOKxE8KFoBPRQNzSIM0NsInAEUrD<pd7wU07l,LsmkMRAyTOtHFLqpFUIIzsxsc"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Shai-tan has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Condoriano"
			message="same to you :)"
			side="1"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="7"
			x="22"
			y="17"
		[/recruit]
		[random]
			value="2062275930"
		[/random]
		[random]
			value="348767793"
		[/random]
		[random]
			value="1163471490"
		[/random]
		[random]
			value="27193179"
		[/random]
		[random]
			value="1402474613"
		[/random]
		[random]
			value="1297656437"
		[/random]
		[random]
			value="1227394952"
		[/random]
		[random]
			value="141277825"
		[/random]
		[random]
			value="870246663"
		[/random]
		[random]
			value="772685059"
		[/random]
		[random]
			value="325372715"
		[/random]
		[random]
			value="78770870"
		[/random]
		[random]
			value="1765081403"
		[/random]
		[random]
			value="1575889"
		[/random]
		[random]
			value="319254376"
			[results]
				checksum="86Wmq3.,tb9Th9Xh+8Om3eb898egWbi26k39>2dlaZge0f-9iPif8c7h8k-+v7e7e8fh1b<i8Sem73jI-oaGeRO,h0ybO20xxhh6<5-i30KE4<Yfd6-cbeMq5.ql>pFA"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="4"
			x="23"
			y="17"
		[/recruit]
		[random]
			value="1744382498"
		[/random]
		[random]
			value="1308176196"
		[/random]
		[random]
			value="48725049"
		[/random]
		[random]
			value="999373463"
		[/random]
		[random]
			value="458348985"
		[/random]
		[random]
			value="1276120001"
		[/random]
		[random]
			value="1140651289"
		[/random]
		[random]
			value="1328595649"
		[/random]
		[random]
			value="2048805060"
		[/random]
		[random]
			value="1466024004"
		[/random]
		[random]
			value="1407366519"
		[/random]
		[random]
			value="1666402815"
		[/random]
		[random]
			value="1467599893"
		[/random]
		[random]
			value="1726620896"
		[/random]
		[random]
			value="1569929092"
			[results]
				checksum="FTxBwyUzhyBkwVHKQOq5AMPytSNtRJzMRsDuHBtnQvBFyQAVsL8qJTmQQNRqrWuTuTxCUFIDPxfDLuyOdqNHp2JuaZMrXGikJwc0bkdie+c.P93obZj,mcol3b,IXl32"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="7"
			x="23"
			y="16"
		[/recruit]
		[random]
			value="865101406"
		[/random]
		[random]
			value="975397374"
		[/random]
		[random]
			value="1639055952"
		[/random]
		[random]
			value="913826455"
		[/random]
		[random]
			value="1974770838"
		[/random]
		[random]
			value="2097404938"
		[/random]
		[random]
			value="42462809"
		[/random]
		[random]
			value="967938479"
		[/random]
		[random]
			value="1278516939"
		[/random]
		[random]
			value="2091267869"
		[/random]
		[random]
			value="286478835"
		[/random]
		[random]
			value="538399810"
		[/random]
		[random]
			value="1610187037"
		[/random]
		[random]
			value="1754078728"
		[/random]
		[random]
			value="117537058"
			[results]
				checksum="96Wmq3.,tb9Th9Xh+8Om3eb898egWbi26k39>2dlaZge0f-9iPif8c7h8k-+v7e7e8fh19<i8Sem73jI-oaGeRO,h>ybO20xxhh6<5-i30KE4<Yfd6-cbeOq5.ql>pFA"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="22,21,20,19,18"
			y="14,14,13,13,12"
		[/move]
	[/command]
	[command]
		[recruit]
			value="5"
			x="18"
			y="11"
		[/recruit]
		[random]
			value="2005338489"
		[/random]
		[random]
			value="2022993588"
		[/random]
		[random]
			value="1379163095"
		[/random]
		[random]
			value="419167608"
		[/random]
		[random]
			value="1378312170"
		[/random]
		[random]
			value="1088157451"
		[/random]
		[random]
			value="211495251"
		[/random]
		[random]
			value="1064510508"
		[/random]
		[random]
			value="1662253213"
		[/random]
		[random]
			value="979220268"
		[/random]
		[random]
			value="242281151"
		[/random]
		[random]
			value="1002691782"
		[/random]
		[random]
			value="1574232476"
		[/random]
		[random]
			value="1517456731"
		[/random]
		[random]
			value="385593161"
			[results]
				checksum="8ax-d6b6wp8sjgga3aP72g3e+iBm.jefmffY-+6<ip3<5-4egW6m2lahna90i9fl5a1hh7oj8-<F-8mkj.91>I6ygXo9WjoolcACZdd9b,<-lvi-OF>N69sv8joLJwIp"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="4"
			x="17"
			y="13"
		[/recruit]
		[random]
			value="1187385225"
		[/random]
		[random]
			value="1318489144"
		[/random]
		[random]
			value="959005220"
		[/random]
		[random]
			value="418213747"
		[/random]
		[random]
			value="259162947"
		[/random]
		[random]
			value="1170500471"
		[/random]
		[random]
			value="1482724256"
		[/random]
		[random]
			value="1921416160"
		[/random]
		[random]
			value="2237091"
		[/random]
		[random]
			value="1725005407"
		[/random]
		[random]
			value="776624295"
		[/random]
		[random]
			value="1576469567"
		[/random]
		[random]
			value="1094978490"
		[/random]
		[random]
			value="1162217456"
		[/random]
		[random]
			value="418685434"
			[results]
				checksum="uyqOVzDO<ExdHrVAAKrGB6qDQPwqLuEDUSNIMADRBGxxpOFSryqC1rOBpDQNRqrWuTuTxCUFIDPxfDLuyOdqNHp2JuaZMrXGikJwc0bkdie+c.P93obZj,mcol3b,IXl"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Xardas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Artie has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="1"
			x="16"
			y="13"
		[/recruit]
		[random]
			value="752492124"
		[/random]
		[random]
			value="1243654131"
		[/random]
		[random]
			value="1904508826"
		[/random]
		[random]
			value="459893390"
		[/random]
		[random]
			value="1841657461"
		[/random]
		[random]
			value="1182628744"
		[/random]
		[random]
			value="302893344"
		[/random]
		[random]
			value="378712345"
		[/random]
		[random]
			value="1578291137"
		[/random]
		[random]
			value="1376470476"
		[/random]
		[random]
			value="164519887"
		[/random]
		[random]
			value="1362697793"
		[/random]
		[random]
			value="256817937"
		[/random]
		[random]
			value="2073576305"
		[/random]
		[random]
			value="1646179532"
			[results]
				checksum="MlpsyKA8tq1G+rohkH2DZ9>b7j1h.rkiw1-Fek9X9FajMic5Q3Y959Xncn>g+J0<5+3mY8je7a461,hkIw7d1pgHD0ytJwg>n6zuefoWmmRC,xvlCaM1htCesyckpNss"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="18,17"
			y="12,12"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7"
			y="12,11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7,7,8,9,10,11"
			y="11,10,9,8,8,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Valenwood has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="4,4,4,4,5,5"
			y="12,11,10,9,9,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="4,5,6,7,8,9,10"
			y="11,12,11,11,10,10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Shana has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Polar_BearXL has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,8,9,10"
			y="13,13,14,14,15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,8,9"
			y="14,13,14,14,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,11"
			y="15,15,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,6,6,6,6,6,5"
			y="14,15,16,17,18,19,20,21"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="4,5,5,5,5,5,6"
			y="13,14,15,16,17,18,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="chase has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="franck has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,21,21,20,19,18"
			y="17,18,19,19,20,20"
		[/move]
	[/command]
	[command]
		[move]
			x="23,23,23,23,24"
			y="17,18,19,20,20"
		[/move]
	[/command]
	[command]
		[move]
			x="23,22,21,20,19"
			y="16,16,17,16,17"
		[/move]
	[/command]
	[command]
		[move]
			x="17,18,18,18,18,18,19"
			y="13,12,11,10,9,8,8"
		[/move]
	[/command]
	[command]
		[move]
			x="18,19,20,21,21,22,22,23"
			y="11,11,10,10,9,8,7,7"
		[/move]
	[/command]
	[command]
		[move]
			x="17,18"
			y="12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ThatOneGuy has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Oink has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,7,8,9,10"
			y="18,19,19,20,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,8,8,9"
			y="21,21,22,22,23,24"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,10,9,8,7,6"
			y="10,11,12,13,13,14,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Sakartoune2 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="DenLaden has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="The_Beast has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,9,8,7,6,5"
			y="15,15,14,14,14,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11"
			y="16,17,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12"
			y="18,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,13,13"
			y="18,19,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Tonix has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Masqurin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,10,10,9"
			y="7,6,5,4,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="hoodlum_havoc has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,8,9"
			y="8,8,8,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Calandryl has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="23,23,22,22,21"
			y="7,6,5,4,4"
		[/move]
	[/command]
	[command]
		[move]
			x="19,18,17,16"
			y="8,7,8,7"
		[/move]
	[/command]
	[command]
		[move]
			x="16,15"
			y="7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Xaroy has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="19,18,17,16,15"
			y="17,17,18,17,18"
		[/move]
	[/command]
	[command]
		[move]
			x="18,17,16"
			y="20,21,21"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Semmi has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="16,17"
			y="21,21"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Jazz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="24,23,22,22,21,20,19"
			y="20,21,21,22,23,23,24"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="17"
			y="13"
		[/recruit]
		[random]
			value="691615927"
		[/random]
		[random]
			value="1713799660"
		[/random]
		[random]
			value="1463035047"
		[/random]
		[random]
			value="2093821858"
		[/random]
		[random]
			value="1076662069"
		[/random]
		[random]
			value="2018022699"
		[/random]
		[random]
			value="1974342543"
		[/random]
		[random]
			value="844358614"
		[/random]
		[random]
			value="242574644"
		[/random]
		[random]
			value="423327070"
		[/random]
		[random]
			value="1524731805"
		[/random]
		[random]
			value="1052111367"
		[/random]
		[random]
			value="1702872740"
		[/random]
		[random]
			value="599607965"
		[/random]
		[random]
			value="669931177"
			[results]
				checksum="uyqNVzDO<ExdHrVAAKrGB6qDQPwqLuEDUSNIMADRBGxxpOFSryqC1rOBpDQNRqrWuTuTxCUEQDPxfDLuyOdqNHp2JuaZJrXGikJwc0bkdie+c.P93obZj,mcpd3b,IXl"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="TheMaster has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="18,17,16,15"
			y="11,12,12,13"
		[/move]
	[/command]
	[command]
		[move]
			x="15,14"
			y="13,13"
		[/move]
	[/command]
	[command]
		[move]
			x="16,15,14,13,12"
			y="13,14,14,15,15"
		[/move]
	[/command]
	[command]
		[move]
			x="12,11"
			y="15,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="nigel has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Il-lo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="gloin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="5"
			y="13"
		[/recruit]
		[random]
			value="1785"
		[/random]
		[random]
			value="9709"
		[/random]
		[random]
			value="16951"
		[/random]
		[random]
			value="22037"
		[/random]
		[random]
			value="9148"
		[/random]
		[random]
			value="5298"
		[/random]
		[random]
			value="4864"
		[/random]
		[random]
			value="18360"
		[/random]
		[random]
			value="28953"
		[/random]
		[random]
			value="23312"
		[/random]
		[random]
			value="29901"
		[/random]
		[random]
			value="17116"
		[/random]
		[random]
			value="24649"
		[/random]
		[random]
			value="9447"
		[/random]
		[random]
			value="9550"
			[results]
				checksum="LhGI28qHcsJn9Niqer4ntRo6wD4zsHoKP1Hy+wP.,jg1d-5cL>71745hhbgk5n1,oc<nn6f23854.o1418om4H8bFWB0pjc+cZng<m8e6X68+vn>t55bKrqZdmOCaJmI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="plk3 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="FireZin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7"
			y="14,14,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,8"
			y="15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,9,8,8,9,9,10"
			y="20,20,19,18,18,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="0"
			[source]
				x="10"
				y="16"
			[/source]
			[destination]
				x="11"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="19370"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="9834"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="8438"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="lindsay40k has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,9,10"
			y="14,15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="15"
			[/source]
			[destination]
				x="11"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="8776"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12395"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11261"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3141"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19161"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1831"
			[results]
				chance="40"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,7,8,9,10,11,12"
			y="14,14,14,15,14,14,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Jon_Snow has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ghoul has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,11"
			y="7,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,11,12"
			y="4,3,3,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,11,10,9"
			y="3,4,4,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,13,13,13,13,12"
			y="20,19,18,17,16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="12"
				y="15"
			[/source]
			[destination]
				x="11"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="23473"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="9665"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18269"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="20016"
			[results]
				chance="50"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1394"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11163"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,9,10,10,10"
			y="24,23,22,21,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="19,18,17"
			y="24,24,24"
		[/move]
	[/command]
	[command]
		[move]
			x="17,16"
			y="24,23"
		[/move]
	[/command]
	[command]
		[move]
			x="16,15,14"
			y="23,24,23"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="bernd has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Schatzger has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="17,16,15,14,13,12"
			y="21,20,21,21,21,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Alderin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="17,16,15,14,13,12"
			y="13,13,14,13,13,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="12"
				y="13"
			[/source]
			[destination]
				x="12"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="1667567555"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1831164314"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="15,14,13,12,11,10"
			y="8,8,9,9,10,10"
		[/move]
	[/command]
	[command]
		[move]
			x="21,21,21,20,19,19,18,18,17"
			y="4,5,6,6,7,8,8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="bernd has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="14,15,16,17,18"
			y="13,13,13,13,12"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="16"
			y="13"
		[/recruit]
		[random]
			value="1095241746"
		[/random]
		[random]
			value="987139670"
		[/random]
		[random]
			value="1919675291"
		[/random]
		[random]
			value="857214317"
		[/random]
		[random]
			value="1746965377"
		[/random]
		[random]
			value="956124745"
		[/random]
		[random]
			value="611513771"
		[/random]
		[random]
			value="65122985"
		[/random]
		[random]
			value="1655962095"
		[/random]
		[random]
			value="1054999880"
		[/random]
		[random]
			value="2091041992"
		[/random]
		[random]
			value="854625491"
		[/random]
		[random]
			value="1976071829"
		[/random]
		[random]
			value="696990668"
		[/random]
		[random]
			value="1170092471"
			[results]
				checksum="FTxBwyUzhyBkwVHKQOq5AMPytSNtRJzMRsDuHBtnQvBFyQAVsL8qJTmQQNRqrWuTuTxCUFLDPxfDLuyOdqNHp2JuaZMrXGikJwc0bkdib+c.P93obZj,mcoe3b,IXl32"
			[/results]
		[/random]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="0"
			[source]
				x="11"
				y="16"
			[/source]
			[destination]
				x="10"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="1151511994"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1702577429"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1241493907"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="spalu has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="qwert has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Spree has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="0"
			[source]
				x="10"
				y="16"
			[/source]
			[destination]
				x="11"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="8923"
			[results]
				chance="70"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18217"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="19557"
			[results]
				chance="70"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="bernd has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Hoschi has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10"
			y="15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,8,9,10"
			y="13,13,14,14,15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="0"
			[source]
				x="10"
				y="15"
			[/source]
			[destination]
				x="11"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="27400"
			[results]
				chance="70"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13288"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27582"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Nath has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="12"
				y="15"
			[/source]
			[destination]
				x="11"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="20128"
			[results]
				chance="50"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14435"
			[results]
				chance="50"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23663"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="9099"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="29360"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="23225"
			[results]
				chance="50"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,11"
			y="14,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="11"
				y="15"
			[/source]
			[destination]
				x="11"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="23828"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="12259"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18428"
			[results]
				chance="50"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,11,10,9,8,7,6"
			y="14,15,15,15,14,14,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="5"
			y="14"
		[/recruit]
		[random]
			value="28015"
		[/random]
		[random]
			value="11235"
		[/random]
		[random]
			value="30379"
		[/random]
		[random]
			value="3737"
		[/random]
		[random]
			value="32235"
		[/random]
		[random]
			value="27351"
		[/random]
		[random]
			value="4831"
		[/random]
		[random]
			value="12304"
		[/random]
		[random]
			value="13200"
		[/random]
		[random]
			value="1801"
		[/random]
		[random]
			value="25887"
		[/random]
		[random]
			value="10758"
		[/random]
		[random]
			value="17351"
		[/random]
		[random]
			value="27476"
		[/random]
		[random]
			value="19375"
			[results]
				checksum="LhGI28qHcsJn9Niqer4mpRo6wD4zsHnKP1Hy+wP.,jg1d-5cL>71745hhbgk5n1,oc<nn6f23854.p5418om4H8bFWB0pjc+cZng<m8e6X68+vn>t55bKrqZdmOCaJmI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,11,12,13,14,15,16"
			y="4,3,3,3,3,2,3,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,14"
			y="7,6,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="TreeBearded has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,17"
			y="2,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="trogdor has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="0x0Tnik has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="bernd has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="12,12,12,11,10,9"
			y="20,21,22,23,23,24"
		[/move]
	[/command]
	[command]
		[move]
			x="15,14,13,13,13"
			y="18,18,19,20,21"
		[/move]
	[/command]
	[command]
		[move]
			x="14,13,12,11,10,9,8,7"
			y="23,24,23,23,22,23,22,22"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Frognosis has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="17,16,15,14,13,12,11,10,10"
			y="10,10,11,11,12,12,13,13,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="0"
			[source]
				x="10"
				y="14"
			[/source]
			[destination]
				x="10"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="5124190"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="737977174"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="12,11,10,9,8,8,9"
			y="13,13,13,14,14,15,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="0"
			[source]
				x="9"
				y="16"
			[/source]
			[destination]
				x="10"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="634099771"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1788610953"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="10,10,10,11,12,12"
			y="10,11,12,13,13,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="12"
				y="14"
			[/source]
			[destination]
				x="12"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="92066145"
			[results]
				chance="50"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="509788907"
			[results]
				chance="30"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1504719620"
			[results]
				chance="50"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1741208044"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="406454715"
			[results]
				chance="30"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="16,15,14,13"
			y="13,14,14,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="artase has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="13"
				y="15"
			[/source]
			[destination]
				x="12"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="333489883"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="119451579"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2001980150"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1700121929"
			[results]
				chance="40"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1029338954"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="4"
			x="16"
			y="13"
		[/recruit]
		[random]
			value="985035714"
		[/random]
		[random]
			value="1479971074"
		[/random]
		[random]
			value="444406624"
		[/random]
		[random]
			value="809595975"
		[/random]
		[random]
			value="1666956979"
		[/random]
		[random]
			value="9710142"
		[/random]
		[random]
			value="753607815"
		[/random]
		[random]
			value="240739213"
		[/random]
		[random]
			value="1556567414"
		[/random]
		[random]
			value="624009495"
		[/random]
		[random]
			value="1270078167"
		[/random]
		[random]
			value="130297139"
		[/random]
		[random]
			value="304801164"
		[/random]
		[random]
			value="640254357"
		[/random]
		[random]
			value="59404492"
			[results]
				checksum="FIxBwyUzhyBkwVHKQOq5AMPytSNtRJzMRsDuHBtnQvBFyQAVsL8qJTmQQNRqrWuTuTxCUEQDPxfDLuyOdqNHp2JuaZJrXGikJwc0bkdie+c.P93obZj,mcpd3b,IXl32"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="4"
			x="17"
			y="13"
		[/recruit]
		[random]
			value="163342682"
		[/random]
		[random]
			value="1364484096"
		[/random]
		[random]
			value="1519843769"
		[/random]
		[random]
			value="475865245"
		[/random]
		[random]
			value="1333136247"
		[/random]
		[random]
			value="973884504"
		[/random]
		[random]
			value="1559207848"
		[/random]
		[random]
			value="767360120"
		[/random]
		[random]
			value="1625726636"
		[/random]
		[random]
			value="1980032438"
		[/random]
		[random]
			value="378466577"
		[/random]
		[random]
			value="182573872"
		[/random]
		[random]
			value="179927261"
		[/random]
		[random]
			value="536314414"
		[/random]
		[random]
			value="1494202789"
			[results]
				checksum="FIxBwyUzhyBkwVHKQOq5AMPytSNtRJzMRsDuHBtnQvBFyQAVsL8qJTmQQNRqrWuTuTxCUEQDPxfDLuyOdqNHp2JuaZJrXGikJwc0bkdie+c.P93obZj,mcpd3b,IXl32"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="18,17,16,15,14,13"
			y="12,13,13,14,14,14"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="qwert has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14,13,12,11,10"
			y="7,8,9,9,10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="master_hungary2 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18,19,20,21"
			y="2,2,3,3,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="TreeBearded has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="The_Beast has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Asketenbert has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="makavel has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,12,13,13,14,15"
			y="15,16,17,18,18,19"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,8,9"
			y="14,14,15,14,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="0"
			[source]
				x="9"
				y="15"
			[/source]
			[destination]
				x="10"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="26379"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3392"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="0"
			[source]
				x="10"
				y="15"
			[/source]
			[destination]
				x="10"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="22360"
			[results]
				chance="70"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="3474"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="bernd has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Draegeon has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="11"
				y="15"
			[/source]
			[destination]
				x="10"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="19743"
			[results]
				chance="50"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16061"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15579"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10867"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32500"
			[results]
				chance="50"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,7,8,9,10"
			y="14,14,13,13,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="13"
			[/source]
			[destination]
				x="10"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="27470"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8018"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="31659"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19637"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17230"
			[results]
				chance="50"
				damage="10"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Draegeon has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ilia has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,11,12"
			y="16,16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="0"
			[source]
				x="12"
				y="15"
			[/source]
			[destination]
				x="12"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="28508"
			[results]
				chance="70"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28451"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27995"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19302"
			[results]
				chance="60"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="toker has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="sand has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ant has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,9,8,8,9,10,11,11"
			y="20,20,19,18,18,17,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Carcharoth has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Kalcik has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="9,9,10,10,10"
			y="24,23,22,21,20"
		[/move]
	[/command]
	[command]
		[move]
			x="13,14,15,15"
			y="21,21,21,20"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="15"
				y="20"
			[/source]
			[destination]
				x="15"
				y="19"
			[/destination]
		[/attack]
		[random]
			value="1233522124"
			[results]
				chance="50"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1157548355"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="963639700"
			[results]
				chance="50"
				damage="3"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Xardas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="16,15,14,13,12,11,10"
			y="13,13,13,13,12,12,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="10"
				y="12"
			[/source]
			[destination]
				x="10"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="179535717"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1896131397"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Tonix has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="12,11"
			y="14,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="11"
				y="14"
			[/source]
			[destination]
				x="10"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="1218644306"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="542059431"
			[results]
				chance="50"
				damage="7"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[choose]
			value="0"
		[/choose]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="bernd has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Condoriano"
			message="lol"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Condoriano"
			message="good game I guess"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Condoriano"
			message="a bit fast :d"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="chojuro has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="KnightKunibert"
			message="what was that ?"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Morgoth has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="semler has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Condoriano"
			message="what?"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="DarkHeir has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Condoriano"
			message="that what?"
			side="1"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="KnightKunibert"
			message="why did you expose your leader?"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Condoriano"
			message="I was hoping not to die"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="plk2"
			message="KnightKunibert you should ask that :)"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Erlend has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="KnightKunibert"
			message="well, i am carsy i hpoe Condori not :-)"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Condoriano"
			message="well you did the same in the last game, so now we are even I guess :D"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Dordamage has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="plk2"
			message="funny :)"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="KnightKunibert"
			message="i do it always ... :-)"
			side="1"
		[/speak]
	[/command]
[/replay]
[snapshot]
	campaign_type="multiplayer"
	completion="running"
	current_tod="5"
#textdomain wesnoth-multiplayer
	description=_ "Players must traverse all manner of terrain in pursuit of victory on this multi-fronted duel map."
	difficulty="NORMAL"
	end_text_duration="0"
	experience_modifier="70"
	hash="cy9,5.FpN3rBcL.L4e+O18wLdEdI4Tz0IvgfbwAuK9N2059<42Xr0yhIQSuhssS,4T<A9.6ab>JpBPvMvrcHSQVHi2E+1XTwfH7D.FR+I29N,oCK6dipd3xe.OJ>Piko"
	id="multiplayer_Silverhead_Crossing"
	label="2p - Silverhead Crossing"
	map_data="border_size=1
usage=map

Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Ww          , Ww          , Wo          , Ww          , Ww          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          
Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Ww          , Wo          , Ww          , Ww          , Ww          , Ww          , Uh          , Xu          , Xu          , Ww          , Hh          , Wo          , Ww          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          
Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Ww          , Ww          , Ww          , Gs^Fp       , Ww          , Xu          , Xu          , Gs^Fp       , Uu^Uf       , Uh          , Gs^Fp       , Mm          , Gg^Fet      , Ww          , Ww          , Ww          , Ww          , Ww          , Wo          , Ww          , Wo          , Wo          
Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Ww          , Ww          , Hh          , Gg          , Gg          , Gg          , Gg          , Uh          , Gg          , Gg          , Gg          , Ggf         , Gg          , Gg          , Gg          , Gs^Fp       , Hh          , Mm          , Gs^Fms      , Ww          , Ww          , Wo          , Wo          
Wo          , Wo          , Wo          , Wo          , Ww          , Wo          , Ww          , Mm          , Gs^Fms      , Gg^Ve       , Gg          , Gg          , Wwf         , Wwf         , Wwf         , Wo          , Wwf         , Gg          , Gg          , Gg          , Rr          , Gg^Vc       , Gg          , Wwf         , Chw         , Hh          , Gs^Fp       , Ww          , Wo          
Wo          , Wo          , Wo          , Wo          , Ww          , Ww          , Gg          , Wwf         , Wwf         , Wwf         , Wwf         , Wwf         , Gg          , Gs^Fp       , Xu          , Wwf         , Xu          , Wwf         , Wwf         , Gg          , Wwf         , Wwf         , Wwf         , Chw         , Rr          , Rr          , Wwf         , Ww          , Wo          
Wo          , Wo          , Wo          , Ww          , Ww          , Gs^Fp       , Rd          , Chw         , Kh          , Ch          , Gg          , Gg          , Rd          , Rd^Uf       , Uh          , Xu          , Xu          , Rd^Uf       , Xu          , Wwf         , Wwf         , Gg          , Gg          , Hh          , Hh          , Wwf         , Ww          , Ww          , Xu          
Wo          , Wo          , Wo          , Wo          , Gg          , Ggf         , Hh          , Mm          , Wwf         , Chw         , Rd          , Uu^Vud      , Uu          , Ur          , Uu^Uf       , Ur          , Gs^Fp       , Xu          , Rd          , Gg          , Wwf         , Gg          , Gg          , Gg^Ve       , Gg^Fet      , Wwf         , Gs^Fp       , Ww          , Xu          
Wo          , Wo          , Ww          , Ww          , Ww          , Gg^Ve       , Wwf         , Gg^Fet      , Wwf         , Ggf         , Xu          , Uu          , Xu          , Uu^Uf       , Wwf         , Uh          , Xu          , Rd          , Gg          , Gg^Ve       , Kh          , Wwf         , Gg          , Gg          , Xu          , Wwf         , Wwf         , Xu          , Xu          
Wo          , Wo          , Ww          , Ww          , Gg          , Wwf         , Gg          , Wwf         , Xu          , Xu          , Gg          , Xu          , Gg          , Gg          , Ww          , Gg          , Gg          , Xu          , Gg          , Gg          , Ww          , Chw         , Ch          , Gg          , Xu          , Xu          , Uh          , Xu          , Xu          
Ww          , Ww          , Ww          , Gg          , Gg          , Gs^Fds      , Gg          , Rd          , Gg          , Gg          , Gg^Vc       , Gg          , Gs^Fms      , Ww          , Wo          , Ww          , Ww          , Gg          , Wwf         , Wwf         , Gg          , Ww          , Kh          , Gg          , Rd          , Gs^Fp       , Rd          , Xu          , Xu          
Ww          , Ww          , Gg          , Gg          , 1 Kh        , Gg          , Rd          , Rd          , Mm          , Gs^Fp       , Gg          , Gg          , Gg          , Ww          , Wo          , Wo          , Ww          , Wwf         , Kh          , Gs^Fms      , Ggf         , Gg          , Gg          , Gg          , Hh          , Rd          , Gg          , Xu          , Xu          
Ww          , Ww          , Ggf         , Gg          , Ch          , Ch          , Ggf         , Gg          , Gg          , Hh          , Gg          , Gs^Fp       , Ww          , Ww          , Ww          , Ww          , Wwf         , Ss^Vhs      , Kh          , Gg          , Hh          , Gs^Fds      , Gg          , Mm          , Gg          , Gg          , Ww          , Gg          , Gg          
Ww          , Gg          , Gg          , Rd          , Ch          , Ch          , Gg          , Gg          , Gg          , Gg          , Hh          , Ww          , Wwf         , Wwf         , Rr          , Rr          , Chw         , Chw         , Wwf         , Gg          , Gg          , Gg          , Wwf         , Gg          , Wwf         , Gs^Fp       , Ww          , Ww          , Ww          
Ww          , Wwf         , Wwf         , Wwf         , Wwf         , Ch          , Kh          , Wwf         , Wwf         , Gg          , Wwf         , Wwf         , Chw         , Wwf         , Rr          , Wwf         , Wwf         , Wwf         , Gs^Fp       , Wwf         , Wwf         , Wwf         , 2 Kud       , Wwf         , Gg          , Wwf         , Ww          , Wo          , Wo          
Gs^Fds      , Gs^Fms      , Hh          , Gg          , Gg          , Wwf         , Wwf         , Wwf         , Gg          , Wwf         , Kh          , Chw         , Wwf         , Rr          , Mm          , Wwf         , Ww          , Ww          , Gg          , Gg          , Hh          , Gg          , Gg          , Cud         , Cud         , Gg          , Gg          , Ww          , Xu          
Rd          , Rd          , Rd          , Gg          , Rd          , Gg          , Gs^Fp       , Mm          , Hh          , Gg          , Kh          , Ss^Vhs      , Ww          , Ww          , Wo          , Ww          , Ww          , Ww          , Gg          , Gg          , Gg          , Mm          , Gg          , Kud         , Cud         , Rd          , Gg          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Rd          , Rd          , Rd          , Rd          , Gg          , Gg          , Wwf         , Wwf         , Ww          , Ww          , Ww          , Ww          , Ww          , Gs^Fms      , Ggf         , Gg^Ve       , Gs^Fds      , Gg          , Cud         , Cud         , Gg          , Rd          , Xu          , Xu          , Xu          
Xu          , Xu          , Uu^Uf       , Uu^Uf       , Uh          , Gg          , Kud         , Gg          , Wwf         , Wwf         , Xu          , Ww          , Hh          , Gs^Fp       , Gs^Fp       , Hh          , Ww          , Gg          , Hh          , Hh          , Xu          , Rd          , Rd          , Gg          , Rd          , Rd          , Gg          , Uu^Uf       , Uu^Uf       
Xu          , Xu          , Cud         , Wwf         , Xu          , Xu          , Wwf         , Cud         , Kud         , Xu          , Xu          , Xu          , Xu          , Cud         , Xu          , Cud         , Xu          , Xu          , Xu          , Xu          , Gs^Fp       , Gg          , Rd          , Rd          , Gg          , Gg          , Gs^Fp       , Xu          , Xu          
Xu          , Xu          , Cud         , Wwf         , Wwf         , Ww          , Gg          , Cud         , Rd          , Rd          , Uu^Vu       , Ur          , Uu^Uf       , Wwf^Uf      , Xu          , Wwf^Uf      , Uu^Uf       , Ur          , Uu^Vu       , Rd          , Rd          , Gg          , Rd          , Gg          , Uu^Vud      , Uu^Uf       , Cud         , Xu          , Xu          
Wwf         , Wwf         , Wwf         , Wwf         , Gs^Fp       , Gg^Vc       , Rd          , Rd          , Xu          , Ur          , Ur          , Uh          , Uh          , Wwf         , Wwf         , Wwf         , Uh          , Uh          , Ur          , Ur          , Xu          , Rd          , Gg          , Gg          , Gg          , Ur          , Cud         , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Gg          , Ggf         , Mm          , Rd          , Rd          , Xu          , Rd          , Xu          , Wwf         , Wwf         , Ggf         , Wwf         , Wwf         , Xu          , Rd          , Xu          , Rd          , Rd          , Kud         , Gg          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Hh          , Gs^Fp       , Gg          , Gg          , Rd          , Gg          , Gg          , Wwf         , Mm          , Gs^Fp       , Hh          , Gg          , Wwf         , Gg          , Rd          , Gg          , Cud         , Cud         , Cud         , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Rd^Uf       , Gg          , Gs^Fms      , Gg^Ve       , Gg          , Wwf         , Gg          , Gg          , Gg          , Gs^Fms      , Gg          , Wwf         , Gg          , Gg^Ve       , Gs^Fds      , Rd          , Rd^Uf       , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ur          , Xu          , Xu          , Ggf         , Gg          , Wwf         , Gg          , Hh          , Gg          , Mm          , Hh          , Wwf         , Wwf         , Ggf         , Xu          , Xu          , Ur          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ur          , Xu          , Rr          , Xu          , Wwf         , Wwf         , Gs^Fp       , Gg          , Xu          , Gg          , Gg          , Gg          , Wwf         , Xu          , Xu          , Ur          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Rr          , Wwf         , Chw         , Wwf         , Rr          , Ur          , Xu          , Uu^Uf       , Xu          , Ur          , Gs^Fp       , Rr          , Wwf         , Wwf         , Chw         , Wwf         , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Wwf         , Xu          , Xu          , Rr          , Rr          , Wwf         , Uh          , Wwf         , Uu^Uf       , Wwf         , Rr          , Rr          , Rr          , Rr          , Wwf         , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Wo          , Wwf         , Ur          , Wwf         , Wo          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Uh          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
"
	mp_countdown="yes"
	mp_countdown_action_bonus="20"
	mp_countdown_init_time="270"
	mp_countdown_reservoir_time="270"
	mp_countdown_turn_bonus="200"
	mp_fog="yes"
	mp_shroud="no"
	mp_use_map_settings="yes"
	mp_village_gold="2"
	name=_ "2p - Silverhead Crossing"
	next_underlying_unit_id="20"
#textdomain wesnoth
	objectives=_ "Victory:
@Defeat enemy leader(s)"
	observer="yes"
	playing_team="1"
	random_calls="1"
	random_seed="1639591933"
	random_start_time="no"
	snapshot="yes"
	turn_at="6"
	turns="-1"
	unit_wml_ids="Dark Adept,Deathblade,Dwarvish Guardsman,Dwarvish Steelclad,Footpad,Ghost,Gryphon Rider,Outlaw,Skeleton,Skeleton Archer,Thief,Vampire Bat,era_events"
	version="1.6"
	[side]
		action_bonus_count="11"
		aggression="0.5"
		allow_player="yes"
		caution="0.25"
		colour="1"
		controller="network"
		countdown_time="270000"
		current_player="Condoriano"
		disallow_observers="no"
		fog="yes"
		global_recruitment_pattern="fighter,fighter,archer,fighter,scout,archer"
		gold="19"
		hidden="no"
		id="Condoriano1"
		income="0"
		leader_value="3"
		name="Condoriano"
		no_leader="yes"
		number_of_possible_recruits_to_force_recruit="3.1"
		objectives=_ "Victory:
@Defeat enemy leader(s)"
		objectives_changed="yes"
		recruit="Dark Adept,Ghost,Ghoul,Skeleton,Skeleton Archer,Vampire Bat,Walking Corpse"
		recruitment_pattern="fighter,fighter,archer,fighter,scout,archer"
		save_id="Condoriano1"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="1"
		start_gold="100"
		team_name="west"
#textdomain wesnoth-multiplayer
		user_team_name=_ "teamname^West"
		village_gold="2"
		village_value="1"
		villages_per_scout="8"
		[ai]
			recruitment_pattern="fighter,fighter,archer,fighter,scout,archer"
			villages_per_scout="8"
			[team_formula]
				rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
			[/team_formula]
		[/ai]
		[ai]
			villages_per_scout="8"
		[/ai]
		[unit]
			advances_to="Blood Bat"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="13"
			die_sound="bat-flapping.wav"
			ellipse="misc/ellipse-nozoc"
			experience="0"
			facing="se"
			flag_rgb="magenta"
			flies="true"
			flying="yes"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="20"
			id="Vampire Bat-5"
			image="units/undead/bat-se-3.png"
#textdomain wesnoth-units
			language_name=_ "Vampire Bat"
			level="0"
			max_attacks="1"
			max_experience="13"
			max_hitpoints="20"
			max_moves="8"
			movement="8"
			movement_type="smallfly"
			moves="8"
			race="bats"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Vampire Bat"
			undead_variation="bat"
			underlying_id="5"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="21"
			y="4"
			zoc="no"
			[attack_anim]
				direction="s,se,sw"
				offset="0.0~0.9:200,0.9~0.0:160"
				start_time="-200"
				[filter_attack]
					name="fangs"
				[/filter_attack]
				[frame]
					duration="30"
					image="units/undead/bat-se-3.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-se-2.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-se-1.png"
					sound="bat-flapping.wav"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-se-2.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-se-3.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="70"
						image="units/undead/bat-se-4.png"
						sound="bite-small.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="70"
						image="units/undead/bat-se-4.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="50"
					image="units/undead/bat-se-3.png"
				[/frame]
				[frame]
					duration="50"
					image="units/undead/bat-se-2.png"
				[/frame]
				[frame]
					duration="40"
					image="units/undead/bat-se-3.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="n,ne,nw"
				offset="0.0~0.9:200,0.9~0.0:160"
				start_time="-200"
				[filter_attack]
					name="fangs"
				[/filter_attack]
				[frame]
					duration="30"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-ne-2.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-ne-1.png"
					sound="bat-flapping.wav"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-ne-2.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="70"
						image="units/undead/bat-ne-4.png"
						sound="bite-small.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="70"
						image="units/undead/bat-ne-4.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="50"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[frame]
					duration="50"
					image="units/undead/bat-ne-2.png"
				[/frame]
				[frame]
					duration="40"
					image="units/undead/bat-ne-3.png"
				[/frame]
			[/attack_anim]
			[defend]
				direction="s,sw,se"
				start_time="-126"
				[if]
					hits="miss"
					offset="0.0~-0.15,-0.15~0.0"
				[/if]
				[frame]
					duration="1"
					image="units/undead/bat-se-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead/bat-se-4.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead/bat-se-4.png"
						sound="bat-hit-1.ogg,bat-hit-2.ogg,bat-hit-3.ogg,bat-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead/bat-se-4.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead/bat-se-3.png"
				[/frame]
			[/defend]
			[defend]
				direction="n,nw,ne"
				start_time="-126"
				[if]
					hits="miss"
					offset="0.0~-0.15,-0.15~0.0"
				[/if]
				[frame]
					duration="1"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead/bat-ne-4.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead/bat-ne-4.png"
						sound="bat-hit-1.ogg,bat-hit-2.ogg,bat-hit-3.ogg,bat-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead/bat-ne-4.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead/bat-ne-3.png"
				[/frame]
			[/defend]
			[standing_anim]
				direction="s,se,sw"
				layer="60"
				start_time="0"
				[frame]
					duration="50"
					image="units/undead/bat-se-3.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-se-2.png"
				[/frame]
				[frame]
					duration="80"
					image="units/undead/bat-se-1.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-se-2.png"
				[/frame]
				[frame]
					duration="50"
					image="units/undead/bat-se-3.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-se-4.png"
				[/frame]
				[frame]
					duration="80"
					image="units/undead/bat-se-5.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-se-4.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				direction="n,ne,nw"
				layer="60"
				start_time="0"
				[frame]
					duration="50"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-ne-2.png"
				[/frame]
				[frame]
					duration="80"
					image="units/undead/bat-ne-1.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-ne-2.png"
				[/frame]
				[frame]
					duration="50"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-ne-4.png"
				[/frame]
				[frame]
					duration="80"
					image="units/undead/bat-ne-5.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-ne-4.png"
				[/frame]
			[/standing_anim]
			[defense]
				castle="40"
				cave="40"
				deep_water="40"
				flat="40"
				forest="40"
				frozen="40"
				fungus="40"
				hills="40"
				impassable="40"
				mountains="40"
				reef="40"
				sand="40"
				shallow_water="40"
				swamp_water="40"
				unwalkable="40"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="1"
				flat="1"
				forest="1"
				frozen="1"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="1"
				sand="1"
				shallow_water="1"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="100"
				cold="70"
				fire="100"
				impact="120"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="4"
				description=_ "fangs"
				icon="attacks/fangs-animal.png"
				name="fangs"
				number="2"
				range="melee"
				type="blade"
				[specials]
					[drains]
#textdomain wesnoth
						description=_ "Drain:
This unit drains health from living units, healing itself for half the amount of damage it deals (rounded down)."
						id="drains"
						name=_ "drains"
					[/drains]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Revenant,Deathblade"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="15"
			die_sound="skeleton-die-1.ogg,skeleton-die-2.ogg"
			ellipse="misc/ellipse"
			experience="10"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="34"
			id="Skeleton-6"
			image="units/undead-skeletal/skeleton.png"
#textdomain wesnoth-units
			language_name=_ "Skeleton"
			level="1"
			max_attacks="1"
			max_experience="25"
			max_hitpoints="34"
			max_moves="5"
			movement="5"
			movement_type="undeadfoot"
			moves="5"
			race="undead"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Skeleton"
			underlying_id="6"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="11"
			y="15"
			zoc="yes"
			[attack_anim]
				offset="0.0~0.3,0.3~0.45,0.45~0.3,0.3~0.0"
				start_time="-250"
				[filter_attack]
					name="axe"
				[/filter_attack]
				[frame]
					duration="150"
					image="units/undead-skeletal/skeleton-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="100"
						image="units/undead-skeletal/skeleton-attack-2.png"
						sound="axe.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="100"
						image="units/undead-skeletal/skeleton-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-attack-3.png"
				[/frame]
				[frame]
					duration="90"
					image="units/undead-skeletal/skeleton-attack-4.png"
				[/frame]
				[frame]
					duration="80"
					image="units/undead-skeletal/skeleton-attack-5.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/undead-skeletal/skeleton-dying-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/skeleton-dying-2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/skeleton-dying-3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/skeleton-dying-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/skeleton-dying-5.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/undead-skeletal/skeleton-dying-6.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/undead-skeletal/skeleton-dying-7.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/undead-skeletal/skeleton-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead-skeletal/skeleton-defend-2.png"
						sound="skeleton-hit-1.ogg,skeleton-hit-2.ogg,skeleton-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead-skeletal/skeleton-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead-skeletal/skeleton-defend-1.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-2.png"
				[/frame]
			[/idle_anim]
			[recruit_anim]
				[frame]
					alpha="0~1:300"
					begin="-200"
					end="100"
					image="units/undead-skeletal/skeleton-dying-7.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/skeleton-dying-6.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/skeleton-dying-5.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/skeleton-dying-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/skeleton-dying-3.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/undead-skeletal/skeleton-dying-2.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/undead-skeletal/skeleton-dying-1.png"
				[/frame]
			[/recruit_anim]
			[defense]
				castle="40"
				cave="60"
				deep_water="90"
				flat="60"
				forest="50"
				frozen="70"
				fungus="40"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="70"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="3"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="150"
				blade="60"
				cold="40"
				fire="120"
				impact="120"
				pierce="40"
			[/resistance]
			[abilities]
				[hides]
					affect_self="yes"
#textdomain wesnoth
					description=_ "Submerge:
This unit can hide in deep water, and remain undetected by its enemies.

Enemy units cannot see this unit while it is in deep water, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
					description_inactive=_ "Submerge:
This unit can hide in deep water, and remain undetected by its enemies.

Enemy units cannot see this unit while it is in deep water, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
					female_name=_ "female^submerge"
					female_name_inactive=_ "female^submerge"
					id="submerge"
					name=_ "submerge"
					name_inactive=_ "submerge"
					[filter_self]
						[filter_location]
							terrain="Wo"
						[/filter_location]
					[/filter_self]
				[/hides]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
				not_living="yes"
			[/status]
			[attack]
				damage="7"
#textdomain wesnoth-units
				description=_ "axe"
				icon="attacks/axe-undead.png"
				name="axe"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[modifications]
				[trait]
					availability="musthave"
#textdomain wesnoth
					description=_ "Immune to drain, poison and plague"
					female_name=_ "female^undead"
					id="undead"
					male_name=_ "undead"
					name=_ "undead"
					[effect]
						add="not_living"
						apply_to="status"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Bone Shooter"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="skeleton-die-1.ogg,skeleton-die-2.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="sw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="31"
			id="Skeleton Archer-7"
			image="units/undead-skeletal/archer.png"
#textdomain wesnoth-units
			language_name=_ "Skeleton Archer"
			level="1"
			max_attacks="1"
			max_experience="25"
			max_hitpoints="31"
			max_moves="5"
			movement="5"
			movement_type="undeadfoot"
			moves="5"
			race="undead"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Skeleton Archer"
			underlying_id="7"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			x="10"
			y="10"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="bow"
				[/filter_attack]
				[missile_frame]
					begin="-150"
					end="0"
					image="projectiles/missile-n.png"
					image_diagonal="projectiles/missile-ne.png"
				[/missile_frame]
				[if]
					hits="yes"
					[frame]
						begin="-400"
						end="-250"
						image="units/undead-skeletal/archer-attack1.png"
						sound="bow.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-400"
						end="-250"
						image="units/undead-skeletal/archer-attack1.png"
						sound="bow-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-250"
					end="-100"
					image="units/undead-skeletal/archer-attack2.png"
				[/frame]
				[frame]
					begin="-100"
					end="0"
					image="units/undead-skeletal/archer.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="fist"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/undead-skeletal/archer.png"
				[/frame]
				[if]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/undead-skeletal/archer-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/undead-skeletal/archer-attack.png"
						sound="fist.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/archer.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/undead-skeletal/archer-die2-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/archer-die2-2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/archer-die2-3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/archer-die2-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/archer-die2-5.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/undead-skeletal/archer-die2-6.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/undead-skeletal/archer-die2-7.png"
				[/frame]
			[/death]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/undead-skeletal/archer-die-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/archer-die-2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/archer-die-3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/archer-die-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/archer-die-5.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/undead-skeletal/archer-die-6.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/undead-skeletal/archer-die-7.png"
				[/frame]
				[frame]
					begin="700"
					end="800"
					image="units/undead-skeletal/archer-die-8.png"
				[/frame]
				[frame]
					begin="800"
					end="900"
					image="units/undead-skeletal/archer-die-9.png"
				[/frame]
				[frame]
					begin="900"
					end="1000"
					image="units/undead-skeletal/archer-die-10.png"
				[/frame]
				[frame]
					begin="1000"
					end="1100"
					image="units/undead-skeletal/archer-die-11.png"
				[/frame]
				[frame]
					begin="1100"
					end="1200"
					image="units/undead-skeletal/archer-die-12.png"
				[/frame]
				[frame]
					begin="1200"
					end="1300"
					image="units/undead-skeletal/archer-die-13.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/undead-skeletal/archer.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/archer-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead-skeletal/archer-defend.png"
						sound="skeleton-hit-1.ogg,skeleton-hit-2.ogg,skeleton-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead-skeletal/archer-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead-skeletal/archer.png"
				[/frame]
			[/defend]
			[idle_anim]
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					begin="0"
					end="100"
					image="units/undead-skeletal/archer-idle-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/archer-idle-2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/archer-idle-3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/archer-idle-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/archer-idle-5.png"
				[/frame]
				[frame]
					begin="500"
					end="700"
					image="units/undead-skeletal/archer-idle-6.png"
				[/frame]
				[frame]
					begin="700"
					end="800"
					image="units/undead-skeletal/archer-idle-7.png"
				[/frame]
				[frame]
					begin="800"
					end="900"
					image="units/undead-skeletal/archer-idle-8.png"
				[/frame]
				[frame]
					begin="900"
					end="1000"
					image="units/undead-skeletal/archer-idle-9.png"
				[/frame]
				[frame]
					begin="1000"
					end="1100"
					image="units/undead-skeletal/archer-idle-10.png"
				[/frame]
				[frame]
					begin="1100"
					end="1200"
					image="units/undead-skeletal/archer-idle-11.png"
				[/frame]
				[frame]
					begin="1200"
					end="1400"
					image="units/undead-skeletal/archer-idle-12.png"
				[/frame]
				[frame]
					begin="1400"
					end="1500"
					image="units/undead-skeletal/archer-idle-13.png"
				[/frame]
				[frame]
					begin="1500"
					end="1600"
					image="units/undead-skeletal/archer-idle-14.png"
				[/frame]
			[/idle_anim]
			[recruit_anim]
				[frame]
					alpha="0~1:300"
					begin="-200"
					end="100"
					image="units/undead-skeletal/archer-die2-7.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/archer-die2-6.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/archer-die2-5.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/archer-die2-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/archer-die2-3.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/undead-skeletal/archer-die2-2.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/undead-skeletal/archer-die2-1.png"
				[/frame]
			[/recruit_anim]
			[defense]
				castle="40"
				cave="60"
				deep_water="90"
				flat="60"
				forest="50"
				frozen="70"
				fungus="40"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="70"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="3"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="150"
				blade="60"
				cold="40"
				fire="120"
				impact="120"
				pierce="40"
			[/resistance]
			[abilities]
				[hides]
					affect_self="yes"
#textdomain wesnoth
					description=_ "Submerge:
This unit can hide in deep water, and remain undetected by its enemies.

Enemy units cannot see this unit while it is in deep water, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
					description_inactive=_ "Submerge:
This unit can hide in deep water, and remain undetected by its enemies.

Enemy units cannot see this unit while it is in deep water, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
					female_name=_ "female^submerge"
					female_name_inactive=_ "female^submerge"
					id="submerge"
					name=_ "submerge"
					name_inactive=_ "submerge"
					[filter_self]
						[filter_location]
							terrain="Wo"
						[/filter_location]
					[/filter_self]
				[/hides]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
				not_living="yes"
			[/status]
			[attack]
				damage="3"
#textdomain wesnoth-units
				description=_ "fist"
				icon="attacks/fist-skeletal.png"
				name="fist"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="6"
				description=_ "bow"
				icon="attacks/bow-orcish.png"
				name="bow"
				number="3"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
				[trait]
					availability="musthave"
#textdomain wesnoth
					description=_ "Immune to drain, poison and plague"
					female_name=_ "female^undead"
					id="undead"
					male_name=_ "undead"
					name=_ "undead"
					[effect]
						add="not_living"
						apply_to="status"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Wraith,Shadow"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="20"
			die_sound="wail-long.wav"
			ellipse="misc/ellipse"
			experience="0"
			facing="n"
			flag_rgb="magenta"
			flies="true"
			flying="yes"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="18"
			id="Ghost-8"
			image="units/undead/ghost-s-2.png"
#textdomain wesnoth-units
			language_name=_ "Ghost"
			level="1"
			max_attacks="1"
			max_experience="21"
			max_hitpoints="18"
			max_moves="7"
			movement="7"
			movement_type="undeadspirit"
			moves="7"
			race="undead"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Ghost"
			underlying_id="8"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="11"
			y="16"
			zoc="yes"
			[attack_anim]
				start_time="-200"
				[filter_attack]
					name="wail"
				[/filter_attack]
				[if]
					direction="n,ne,nw"
					[missile_frame]
						begin="-300"
						end="-230"
						image="projectiles/wailprojectile-n-1.png"
						image_diagonal="projectiles/wailprojectile-ne-1.png"
					[/missile_frame]
					[missile_frame]
						begin="-230"
						end="-160"
						image="projectiles/wailprojectile-n-2.png"
						image_diagonal="projectiles/wailprojectile-ne-2.png"
					[/missile_frame]
					[missile_frame]
						begin="-160"
						end="0"
						image="projectiles/wailprojectile-n-3.png"
						image_diagonal="projectiles/wailprojectile-ne-3.png"
					[/missile_frame]
					[missile_frame]
						begin="0"
						end="40"
						image="projectiles/wailprojectile-n-4.png"
						image_diagonal="projectiles/wailprojectile-ne-4.png"
					[/missile_frame]
					[missile_frame]
						begin="40"
						end="80"
						image="projectiles/wailprojectile-n-5.png"
						image_diagonal="projectiles/wailprojectile-ne-5.png"
					[/missile_frame]
					[missile_frame]
						begin="80"
						end="120"
						image="projectiles/wailprojectile-n-6.png"
						image_diagonal="projectiles/wailprojectile-ne-6.png"
					[/missile_frame]
				[/if]
				[else]
					direction="s,se,sw"
					[missile_frame]
						begin="-300"
						end="-230"
						image="projectiles/wailprojectile-s-1.png"
						image_diagonal="projectiles/wailprojectile-se-1.png"
					[/missile_frame]
					[missile_frame]
						begin="-230"
						end="-160"
						image="projectiles/wailprojectile-s-2.png"
						image_diagonal="projectiles/wailprojectile-se-2.png"
					[/missile_frame]
					[missile_frame]
						begin="-160"
						end="0"
						image="projectiles/wailprojectile-s-3.png"
						image_diagonal="projectiles/wailprojectile-se-3.png"
					[/missile_frame]
					[missile_frame]
						begin="0"
						end="40"
						image="projectiles/wailprojectile-s-4.png"
						image_diagonal="projectiles/wailprojectile-se-4.png"
					[/missile_frame]
					[missile_frame]
						begin="40"
						end="80"
						image="projectiles/wailprojectile-s-5.png"
						image_diagonal="projectiles/wailprojectile-se-5.png"
					[/missile_frame]
					[missile_frame]
						begin="80"
						end="120"
						image="projectiles/wailprojectile-s-6.png"
						image_diagonal="projectiles/wailprojectile-se-6.png"
					[/missile_frame]
				[/else]
				[if]
					direction="s,se,sw"
					[frame]
						duration="25"
						image="units/undead/ghost-s-2.png"
					[/frame]
					[frame]
						duration="75"
						image="units/undead/ghost-s-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-s-attack-2.png"
						sound="wail-sml.wav"
					[/frame]
					[frame]
						duration="75"
						image="units/undead/ghost-s-attack-1.png"
					[/frame]
					[frame]
						duration="25"
						image="units/undead/ghost-s-2.png"
					[/frame]
				[/if]
				[else]
					direction="n,ne,nw"
					[frame]
						duration="25"
						image="units/undead/ghost-n-2.png"
					[/frame]
					[frame]
						duration="75"
						image="units/undead/ghost-n-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-n-attack-2.png"
						sound="wail-sml.wav"
					[/frame]
					[frame]
						duration="75"
						image="units/undead/ghost-n-attack-1.png"
					[/frame]
					[frame]
						duration="25"
						image="units/undead/ghost-n-2.png"
					[/frame]
				[/else]
			[/attack_anim]
			[attack_anim]
				alpha="0.8~0.0:425,0.0~0.8:225"
				direction="s,se,sw"
				offset="0.0~1.0:425,0.0:225"
				start_time="-500"
				[filter_attack]
					name="touch"
				[/filter_attack]
				[frame]
					duration="25"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="175"
					image="units/undead/ghost-s-attack-1.png"
				[/frame]
				[frame]
					duration="175"
					image="units/undead/ghost-s-attack-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead/ghost-s-attack-3.png"
					sound="wail-sml.wav"
				[/frame]
				[frame]
					duration="75"
					image="units/undead/ghost-s-attack-2.png"
				[/frame]
				[frame]
					duration="75"
					image="units/undead/ghost-s-attack-1.png"
				[/frame]
				[frame]
					duration="25"
					image="units/undead/ghost-s-2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				alpha="0.8~0.0:425,0.0~0.8:225"
				direction="n,ne,nw"
				offset="0.0~1.0:425,0.0:225"
				start_time="-500"
				[filter_attack]
					name="touch"
				[/filter_attack]
				[frame]
					duration="25"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="175"
					image="units/undead/ghost-n-attack-1.png"
				[/frame]
				[frame]
					duration="175"
					image="units/undead/ghost-n-attack-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead/ghost-n-attack-3.png"
					sound="wail-sml.wav"
				[/frame]
				[frame]
					duration="75"
					image="units/undead/ghost-n-attack-2.png"
				[/frame]
				[frame]
					duration="75"
					image="units/undead/ghost-n-attack-1.png"
				[/frame]
				[frame]
					duration="25"
					image="units/undead/ghost-n-2.png"
				[/frame]
			[/attack_anim]
			[defend]
				direction="s,se,sw"
				start_time="-126"
				[if]
					alpha="0.8~0.5:126,0.5~0.8:126"
					hits="hit,kill"
					offset="0.0~-0.05:126,-0.05~0.0:126"
					[frame]
						duration="1"
						image="units/undead/ghost-s-2.png"
					[/frame]
					[frame]
						duration="100"
						image="units/undead/ghost-s-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-s-attack-1.png"
						sound="wail-sml.wav"
					[/frame]
					[frame]
						duration="1"
						image="units/undead/ghost-s-2.png"
					[/frame]
				[/if]
				[else]
					alpha="0.8~0.25:126,0.25~0.8:126"
					hits="miss"
					offset="0.0~-0.1:126,-0.1~0.0:126"
					[frame]
						duration="1"
						image="units/undead/ghost-s-2.png"
					[/frame]
					[frame]
						duration="100"
						image="units/undead/ghost-s-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-s-attack-1.png"
					[/frame]
					[frame]
						duration="1"
						image="units/undead/ghost-s-2.png"
					[/frame]
				[/else]
			[/defend]
			[defend]
				direction="n,ne,nw"
				start_time="-126"
				[if]
					alpha="0.8~0.5:126,0.5~0.8:126"
					hits="hit,kill"
					offset="0.0~-0.05:126,-0.05~0.0:126"
					[frame]
						duration="1"
						image="units/undead/ghost-n-2.png"
					[/frame]
					[frame]
						duration="100"
						image="units/undead/ghost-n-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-n-attack-1.png"
						sound="wail-sml.wav"
					[/frame]
					[frame]
						duration="1"
						image="units/undead/ghost-n-2.png"
					[/frame]
				[/if]
				[else]
					alpha="0.8~0.25:126,0.25~0.8:126"
					hits="miss"
					offset="0.0~-0.1:126,-0.1~0.0:126"
					[frame]
						duration="1"
						image="units/undead/ghost-n-2.png"
					[/frame]
					[frame]
						duration="100"
						image="units/undead/ghost-n-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-n-attack-1.png"
					[/frame]
					[frame]
						duration="1"
						image="units/undead/ghost-n-2.png"
					[/frame]
				[/else]
			[/defend]
			[standing_anim]
				alpha="0.8~0.4:1400,0.4~0.6:600,0.6~0.4:600,0.4~0.8:1400"
				direction="s,se,sw"
				start_time="0"
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-3.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				alpha="0.8~0.4:1400,0.4~0.6:600,0.6~0.4:600,0.4~0.8:1400"
				direction="n,ne,nw"
				start_time="0"
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-3.png"
				[/frame]
			[/standing_anim]
			[defense]
				castle="50"
				cave="50"
				deep_water="50"
				flat="50"
				forest="50"
				frozen="50"
				fungus="50"
				hills="50"
				impassable="50"
				mountains="50"
				reef="50"
				sand="50"
				shallow_water="50"
				swamp_water="50"
				unwalkable="50"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="2"
				flat="1"
				forest="1"
				frozen="1"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="1"
				reef="2"
				sand="1"
				shallow_water="2"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="110"
				blade="50"
				cold="30"
				fire="90"
				impact="50"
				pierce="50"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
				not_living="yes"
			[/status]
			[attack]
				damage="4"
				description=_ "touch"
				icon="attacks/touch-undead.png"
				name="touch"
				number="3"
				range="melee"
				type="arcane"
				[specials]
					[drains]
#textdomain wesnoth
						description=_ "Drain:
This unit drains health from living units, healing itself for half the amount of damage it deals (rounded down)."
						id="drains"
						name=_ "drains"
					[/drains]
				[/specials]
			[/attack]
			[attack]
				damage="3"
#textdomain wesnoth-units
				description=_ "wail"
				name="wail"
				number="3"
				range="ranged"
				type="cold"
			[/attack]
			[modifications]
				[trait]
					availability="musthave"
#textdomain wesnoth
					description=_ "Immune to drain, poison and plague"
					female_name=_ "female^undead"
					id="undead"
					male_name=_ "undead"
					name=_ "undead"
					[effect]
						add="not_living"
						apply_to="status"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Dark Sorcerer"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="16"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="3"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="27"
			id="Dark Adept-16"
			ignore_race_traits="yes"
			image="units/undead-necromancers/adept+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Dark Adept"
			level="1"
			max_attacks="1"
			max_experience="27"
			max_hitpoints="27"
			max_moves="6"
			movement="5"
			movement_type="smallfoot"
			moves="6"
			name="Raeryangwen"
			profile="portraits/humans/dark-adept+female.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Dark Adept"
			underlying_id="16"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			x="10"
			y="15"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					range="ranged"
				[/filter_attack]
				[missile_frame]
					begin="-50"
					end="150"
					image="projectiles/darkmissile-n.png"
					image_diagonal="projectiles/darkmissile-ne.png"
				[/missile_frame]
				[frame]
					begin="-450"
					end="-420"
					image="units/undead-necromancers/adept+female.png"
				[/frame]
				[frame]
					begin="-420"
					end="-395"
					image="units/undead-necromancers/adept+female-magic-1.png"
				[/frame]
				[frame]
					begin="-395"
					end="-320"
					image="units/undead-necromancers/adept+female-magic-2.png"
				[/frame]
				[frame]
					begin="-320"
					end="-300"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-300"
					end="-250"
					halo="halo/undead/dark-magic-1.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-250"
					end="-200"
					halo="halo/undead/dark-magic-2.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-200"
					end="-150"
					halo="halo/undead/dark-magic-3.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-150"
					end="-100"
					halo="halo/undead/dark-magic-4.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-100"
					end="-50"
					halo="halo/undead/dark-magic-5.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[if]
					hits="no"
					[frame]
						begin="-50"
						end="0"
						halo="halo/undead/dark-magic-6.png"
						halo_x="0"
						halo_y="-12"
						image="units/undead-necromancers/adept+female-magic-3.png"
						sound="magic-dark-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-50"
						end="0"
						halo="halo/undead/dark-magic-6.png"
						halo_x="0"
						halo_y="-12"
						image="units/undead-necromancers/adept+female-magic-3.png"
						sound="magic-dark.ogg"
					[/frame]
				[/else]
				[frame]
					begin="0"
					end="50"
					image="units/undead-necromancers/adept+female-magic-2.png"
				[/frame]
				[frame]
					begin="50"
					end="90"
					image="units/undead-necromancers/adept+female-magic-1.png"
				[/frame]
				[frame]
					begin="90"
					end="100"
					image="units/undead-necromancers/adept+female.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/undead-necromancers/adept-die1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-necromancers/adept-die2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-necromancers/adept-die3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-necromancers/adept-die4.png"
				[/frame]
				[frame]
					begin="400"
					end="520"
					image="units/undead-necromancers/adept-die5.png"
				[/frame]
				[frame]
					begin="520"
					end="640"
					image="units/undead-necromancers/adept-die6.png"
				[/frame]
				[frame]
					begin="640"
					end="780"
					image="units/undead-necromancers/adept-die7.png"
				[/frame]
				[frame]
					begin="780"
					end="900"
					image="units/undead-necromancers/adept-die8.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/undead-necromancers/adept+female-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-necromancers/adept+female-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead-necromancers/adept+female-defend-2.png"
						sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead-necromancers/adept+female-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead-necromancers/adept+female-defend-1.png"
				[/frame]
			[/defend]
			[portrait]
				image="portraits/humans/transparent/dark-adept+female.png"
				mirror="true"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/dark-adept+female.png"
				mirror="false"
				side="right"
				size="400"
			[/portrait]
			[trait]
#textdomain wesnoth
				female_name=_ "female^quick"
				id="quick"
				male_name=_ "quick"
				[effect]
					apply_to="movement"
					increase="1"
				[/effect]
				[effect]
					apply_to="hitpoints"
					increase_total="-5%"
				[/effect]
			[/trait]
			[trait]
				female_name=_ "female^intelligent"
				id="intelligent"
				male_name=_ "intelligent"
				[effect]
					apply_to="max_experience"
					increase="-20%"
				[/effect]
			[/trait]
			[trait]
				female_name=_ "female^resilient"
				id="resilient"
				male_name=_ "resilient"
				[effect]
					apply_to="hitpoints"
					increase_total="4"
				[/effect]
				[effect]
					apply_to="hitpoints"
					increase_total="1"
					times="per level"
				[/effect]
			[/trait]
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="50"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="3"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="10"
#textdomain wesnoth-units
				description=_ "chill wave"
				icon="attacks/iceball.png"
				name="chill wave"
				number="2"
				range="ranged"
				type="cold"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[attack]
				damage="7"
#textdomain wesnoth-units
				description=_ "shadow wave"
				icon="attacks/dark-missile.png"
				name="shadow wave"
				number="2"
				range="ranged"
				type="arcane"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "female^quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "female^intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Dark Sorcerer"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="16"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="33"
			id="Dark Adept-18"
			ignore_race_traits="yes"
			image="units/undead-necromancers/adept+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Dark Adept"
			level="1"
			max_attacks="1"
			max_experience="27"
			max_hitpoints="33"
			max_moves="5"
			movement="5"
			movement_type="smallfoot"
			moves="5"
			name="Cinoic"
			profile="portraits/humans/dark-adept+female.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Dark Adept"
			underlying_id="18"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			x="9"
			y="15"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					range="ranged"
				[/filter_attack]
				[missile_frame]
					begin="-50"
					end="150"
					image="projectiles/darkmissile-n.png"
					image_diagonal="projectiles/darkmissile-ne.png"
				[/missile_frame]
				[frame]
					begin="-450"
					end="-420"
					image="units/undead-necromancers/adept+female.png"
				[/frame]
				[frame]
					begin="-420"
					end="-395"
					image="units/undead-necromancers/adept+female-magic-1.png"
				[/frame]
				[frame]
					begin="-395"
					end="-320"
					image="units/undead-necromancers/adept+female-magic-2.png"
				[/frame]
				[frame]
					begin="-320"
					end="-300"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-300"
					end="-250"
					halo="halo/undead/dark-magic-1.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-250"
					end="-200"
					halo="halo/undead/dark-magic-2.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-200"
					end="-150"
					halo="halo/undead/dark-magic-3.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-150"
					end="-100"
					halo="halo/undead/dark-magic-4.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-100"
					end="-50"
					halo="halo/undead/dark-magic-5.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[if]
					hits="no"
					[frame]
						begin="-50"
						end="0"
						halo="halo/undead/dark-magic-6.png"
						halo_x="0"
						halo_y="-12"
						image="units/undead-necromancers/adept+female-magic-3.png"
						sound="magic-dark-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-50"
						end="0"
						halo="halo/undead/dark-magic-6.png"
						halo_x="0"
						halo_y="-12"
						image="units/undead-necromancers/adept+female-magic-3.png"
						sound="magic-dark.ogg"
					[/frame]
				[/else]
				[frame]
					begin="0"
					end="50"
					image="units/undead-necromancers/adept+female-magic-2.png"
				[/frame]
				[frame]
					begin="50"
					end="90"
					image="units/undead-necromancers/adept+female-magic-1.png"
				[/frame]
				[frame]
					begin="90"
					end="100"
					image="units/undead-necromancers/adept+female.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/undead-necromancers/adept-die1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-necromancers/adept-die2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-necromancers/adept-die3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-necromancers/adept-die4.png"
				[/frame]
				[frame]
					begin="400"
					end="520"
					image="units/undead-necromancers/adept-die5.png"
				[/frame]
				[frame]
					begin="520"
					end="640"
					image="units/undead-necromancers/adept-die6.png"
				[/frame]
				[frame]
					begin="640"
					end="780"
					image="units/undead-necromancers/adept-die7.png"
				[/frame]
				[frame]
					begin="780"
					end="900"
					image="units/undead-necromancers/adept-die8.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/undead-necromancers/adept+female-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-necromancers/adept+female-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead-necromancers/adept+female-defend-2.png"
						sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead-necromancers/adept+female-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead-necromancers/adept+female-defend-1.png"
				[/frame]
			[/defend]
			[portrait]
				image="portraits/humans/transparent/dark-adept+female.png"
				mirror="true"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/dark-adept+female.png"
				mirror="false"
				side="right"
				size="400"
			[/portrait]
			[trait]
#textdomain wesnoth
				female_name=_ "female^quick"
				id="quick"
				male_name=_ "quick"
				[effect]
					apply_to="movement"
					increase="1"
				[/effect]
				[effect]
					apply_to="hitpoints"
					increase_total="-5%"
				[/effect]
			[/trait]
			[trait]
				female_name=_ "female^intelligent"
				id="intelligent"
				male_name=_ "intelligent"
				[effect]
					apply_to="max_experience"
					increase="-20%"
				[/effect]
			[/trait]
			[trait]
				female_name=_ "female^resilient"
				id="resilient"
				male_name=_ "resilient"
				[effect]
					apply_to="hitpoints"
					increase_total="4"
				[/effect]
				[effect]
					apply_to="hitpoints"
					increase_total="1"
					times="per level"
				[/effect]
			[/trait]
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="50"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="3"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="10"
#textdomain wesnoth-units
				description=_ "chill wave"
				icon="attacks/iceball.png"
				name="chill wave"
				number="2"
				range="ranged"
				type="cold"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[attack]
				damage="7"
#textdomain wesnoth-units
				description=_ "shadow wave"
				icon="attacks/dark-missile.png"
				name="shadow wave"
				number="2"
				range="ranged"
				type="arcane"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "female^resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "female^intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Blood Bat"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="13"
			die_sound="bat-flapping.wav"
			ellipse="misc/ellipse-nozoc"
			experience="0"
			facing="se"
			flag_rgb="magenta"
			flies="true"
			flying="yes"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="20"
			id="Vampire Bat-5"
			image="units/undead/bat-se-3.png"
#textdomain wesnoth-units
			language_name=_ "Vampire Bat"
			level="0"
			max_attacks="1"
			max_experience="13"
			max_hitpoints="20"
			max_moves="8"
			movement="8"
			movement_type="smallfly"
			moves="8"
			race="bats"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Vampire Bat"
			undead_variation="bat"
			underlying_id="5"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="no"
			[attack_anim]
				direction="s,se,sw"
				offset="0.0~0.9:200,0.9~0.0:160"
				start_time="-200"
				[filter_attack]
					name="fangs"
				[/filter_attack]
				[frame]
					duration="30"
					image="units/undead/bat-se-3.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-se-2.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-se-1.png"
					sound="bat-flapping.wav"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-se-2.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-se-3.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="70"
						image="units/undead/bat-se-4.png"
						sound="bite-small.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="70"
						image="units/undead/bat-se-4.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="50"
					image="units/undead/bat-se-3.png"
				[/frame]
				[frame]
					duration="50"
					image="units/undead/bat-se-2.png"
				[/frame]
				[frame]
					duration="40"
					image="units/undead/bat-se-3.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="n,ne,nw"
				offset="0.0~0.9:200,0.9~0.0:160"
				start_time="-200"
				[filter_attack]
					name="fangs"
				[/filter_attack]
				[frame]
					duration="30"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-ne-2.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-ne-1.png"
					sound="bat-flapping.wav"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-ne-2.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="70"
						image="units/undead/bat-ne-4.png"
						sound="bite-small.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="70"
						image="units/undead/bat-ne-4.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="50"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[frame]
					duration="50"
					image="units/undead/bat-ne-2.png"
				[/frame]
				[frame]
					duration="40"
					image="units/undead/bat-ne-3.png"
				[/frame]
			[/attack_anim]
			[defend]
				direction="s,sw,se"
				start_time="-126"
				[if]
					hits="miss"
					offset="0.0~-0.15,-0.15~0.0"
				[/if]
				[frame]
					duration="1"
					image="units/undead/bat-se-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead/bat-se-4.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead/bat-se-4.png"
						sound="bat-hit-1.ogg,bat-hit-2.ogg,bat-hit-3.ogg,bat-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead/bat-se-4.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead/bat-se-3.png"
				[/frame]
			[/defend]
			[defend]
				direction="n,nw,ne"
				start_time="-126"
				[if]
					hits="miss"
					offset="0.0~-0.15,-0.15~0.0"
				[/if]
				[frame]
					duration="1"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead/bat-ne-4.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead/bat-ne-4.png"
						sound="bat-hit-1.ogg,bat-hit-2.ogg,bat-hit-3.ogg,bat-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead/bat-ne-4.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead/bat-ne-3.png"
				[/frame]
			[/defend]
			[standing_anim]
				direction="s,se,sw"
				layer="60"
				start_time="0"
				[frame]
					duration="50"
					image="units/undead/bat-se-3.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-se-2.png"
				[/frame]
				[frame]
					duration="80"
					image="units/undead/bat-se-1.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-se-2.png"
				[/frame]
				[frame]
					duration="50"
					image="units/undead/bat-se-3.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-se-4.png"
				[/frame]
				[frame]
					duration="80"
					image="units/undead/bat-se-5.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-se-4.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				direction="n,ne,nw"
				layer="60"
				start_time="0"
				[frame]
					duration="50"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-ne-2.png"
				[/frame]
				[frame]
					duration="80"
					image="units/undead/bat-ne-1.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-ne-2.png"
				[/frame]
				[frame]
					duration="50"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-ne-4.png"
				[/frame]
				[frame]
					duration="80"
					image="units/undead/bat-ne-5.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-ne-4.png"
				[/frame]
			[/standing_anim]
			[defense]
				castle="40"
				cave="40"
				deep_water="40"
				flat="40"
				forest="40"
				frozen="40"
				fungus="40"
				hills="40"
				impassable="40"
				mountains="40"
				reef="40"
				sand="40"
				shallow_water="40"
				swamp_water="40"
				unwalkable="40"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="1"
				flat="1"
				forest="1"
				frozen="1"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="1"
				sand="1"
				shallow_water="1"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="100"
				cold="70"
				fire="100"
				impact="120"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="4"
				description=_ "fangs"
				icon="attacks/fangs-animal.png"
				name="fangs"
				number="2"
				range="melee"
				type="blade"
				[specials]
					[drains]
#textdomain wesnoth
						description=_ "Drain:
This unit drains health from living units, healing itself for half the amount of damage it deals (rounded down)."
						id="drains"
						name=_ "drains"
					[/drains]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Revenant,Deathblade"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="15"
			die_sound="skeleton-die-1.ogg,skeleton-die-2.ogg"
			ellipse="misc/ellipse"
			experience="10"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="34"
			id="Skeleton-6"
			image="units/undead-skeletal/skeleton.png"
#textdomain wesnoth-units
			language_name=_ "Skeleton"
			level="1"
			max_attacks="1"
			max_experience="25"
			max_hitpoints="34"
			max_moves="5"
			movement="5"
			movement_type="undeadfoot"
			moves="5"
			race="undead"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Skeleton"
			underlying_id="6"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				offset="0.0~0.3,0.3~0.45,0.45~0.3,0.3~0.0"
				start_time="-250"
				[filter_attack]
					name="axe"
				[/filter_attack]
				[frame]
					duration="150"
					image="units/undead-skeletal/skeleton-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="100"
						image="units/undead-skeletal/skeleton-attack-2.png"
						sound="axe.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="100"
						image="units/undead-skeletal/skeleton-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-attack-3.png"
				[/frame]
				[frame]
					duration="90"
					image="units/undead-skeletal/skeleton-attack-4.png"
				[/frame]
				[frame]
					duration="80"
					image="units/undead-skeletal/skeleton-attack-5.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/undead-skeletal/skeleton-dying-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/skeleton-dying-2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/skeleton-dying-3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/skeleton-dying-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/skeleton-dying-5.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/undead-skeletal/skeleton-dying-6.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/undead-skeletal/skeleton-dying-7.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/undead-skeletal/skeleton-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead-skeletal/skeleton-defend-2.png"
						sound="skeleton-hit-1.ogg,skeleton-hit-2.ogg,skeleton-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead-skeletal/skeleton-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead-skeletal/skeleton-defend-1.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-2.png"
				[/frame]
			[/idle_anim]
			[recruit_anim]
				[frame]
					alpha="0~1:300"
					begin="-200"
					end="100"
					image="units/undead-skeletal/skeleton-dying-7.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/skeleton-dying-6.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/skeleton-dying-5.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/skeleton-dying-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/skeleton-dying-3.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/undead-skeletal/skeleton-dying-2.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/undead-skeletal/skeleton-dying-1.png"
				[/frame]
			[/recruit_anim]
			[defense]
				castle="40"
				cave="60"
				deep_water="90"
				flat="60"
				forest="50"
				frozen="70"
				fungus="40"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="70"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="3"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="150"
				blade="60"
				cold="40"
				fire="120"
				impact="120"
				pierce="40"
			[/resistance]
			[abilities]
				[hides]
					affect_self="yes"
#textdomain wesnoth
					description=_ "Submerge:
This unit can hide in deep water, and remain undetected by its enemies.

Enemy units cannot see this unit while it is in deep water, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
					description_inactive=_ "Submerge:
This unit can hide in deep water, and remain undetected by its enemies.

Enemy units cannot see this unit while it is in deep water, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
					female_name=_ "female^submerge"
					female_name_inactive=_ "female^submerge"
					id="submerge"
					name=_ "submerge"
					name_inactive=_ "submerge"
					[filter_self]
						[filter_location]
							terrain="Wo"
						[/filter_location]
					[/filter_self]
				[/hides]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
				not_living="yes"
			[/status]
			[attack]
				damage="7"
#textdomain wesnoth-units
				description=_ "axe"
				icon="attacks/axe-undead.png"
				name="axe"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[modifications]
				[trait]
					availability="musthave"
#textdomain wesnoth
					description=_ "Immune to drain, poison and plague"
					female_name=_ "female^undead"
					id="undead"
					male_name=_ "undead"
					name=_ "undead"
					[effect]
						add="not_living"
						apply_to="status"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Bone Shooter"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="skeleton-die-1.ogg,skeleton-die-2.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="sw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="31"
			id="Skeleton Archer-7"
			image="units/undead-skeletal/archer.png"
#textdomain wesnoth-units
			language_name=_ "Skeleton Archer"
			level="1"
			max_attacks="1"
			max_experience="25"
			max_hitpoints="31"
			max_moves="5"
			movement="5"
			movement_type="undeadfoot"
			moves="5"
			race="undead"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Skeleton Archer"
			underlying_id="7"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="bow"
				[/filter_attack]
				[missile_frame]
					begin="-150"
					end="0"
					image="projectiles/missile-n.png"
					image_diagonal="projectiles/missile-ne.png"
				[/missile_frame]
				[if]
					hits="yes"
					[frame]
						begin="-400"
						end="-250"
						image="units/undead-skeletal/archer-attack1.png"
						sound="bow.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-400"
						end="-250"
						image="units/undead-skeletal/archer-attack1.png"
						sound="bow-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-250"
					end="-100"
					image="units/undead-skeletal/archer-attack2.png"
				[/frame]
				[frame]
					begin="-100"
					end="0"
					image="units/undead-skeletal/archer.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="fist"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/undead-skeletal/archer.png"
				[/frame]
				[if]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/undead-skeletal/archer-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/undead-skeletal/archer-attack.png"
						sound="fist.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/archer.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/undead-skeletal/archer-die2-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/archer-die2-2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/archer-die2-3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/archer-die2-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/archer-die2-5.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/undead-skeletal/archer-die2-6.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/undead-skeletal/archer-die2-7.png"
				[/frame]
			[/death]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/undead-skeletal/archer-die-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/archer-die-2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/archer-die-3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/archer-die-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/archer-die-5.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/undead-skeletal/archer-die-6.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/undead-skeletal/archer-die-7.png"
				[/frame]
				[frame]
					begin="700"
					end="800"
					image="units/undead-skeletal/archer-die-8.png"
				[/frame]
				[frame]
					begin="800"
					end="900"
					image="units/undead-skeletal/archer-die-9.png"
				[/frame]
				[frame]
					begin="900"
					end="1000"
					image="units/undead-skeletal/archer-die-10.png"
				[/frame]
				[frame]
					begin="1000"
					end="1100"
					image="units/undead-skeletal/archer-die-11.png"
				[/frame]
				[frame]
					begin="1100"
					end="1200"
					image="units/undead-skeletal/archer-die-12.png"
				[/frame]
				[frame]
					begin="1200"
					end="1300"
					image="units/undead-skeletal/archer-die-13.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/undead-skeletal/archer.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/archer-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead-skeletal/archer-defend.png"
						sound="skeleton-hit-1.ogg,skeleton-hit-2.ogg,skeleton-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead-skeletal/archer-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead-skeletal/archer.png"
				[/frame]
			[/defend]
			[idle_anim]
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					begin="0"
					end="100"
					image="units/undead-skeletal/archer-idle-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/archer-idle-2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/archer-idle-3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/archer-idle-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/archer-idle-5.png"
				[/frame]
				[frame]
					begin="500"
					end="700"
					image="units/undead-skeletal/archer-idle-6.png"
				[/frame]
				[frame]
					begin="700"
					end="800"
					image="units/undead-skeletal/archer-idle-7.png"
				[/frame]
				[frame]
					begin="800"
					end="900"
					image="units/undead-skeletal/archer-idle-8.png"
				[/frame]
				[frame]
					begin="900"
					end="1000"
					image="units/undead-skeletal/archer-idle-9.png"
				[/frame]
				[frame]
					begin="1000"
					end="1100"
					image="units/undead-skeletal/archer-idle-10.png"
				[/frame]
				[frame]
					begin="1100"
					end="1200"
					image="units/undead-skeletal/archer-idle-11.png"
				[/frame]
				[frame]
					begin="1200"
					end="1400"
					image="units/undead-skeletal/archer-idle-12.png"
				[/frame]
				[frame]
					begin="1400"
					end="1500"
					image="units/undead-skeletal/archer-idle-13.png"
				[/frame]
				[frame]
					begin="1500"
					end="1600"
					image="units/undead-skeletal/archer-idle-14.png"
				[/frame]
			[/idle_anim]
			[recruit_anim]
				[frame]
					alpha="0~1:300"
					begin="-200"
					end="100"
					image="units/undead-skeletal/archer-die2-7.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/archer-die2-6.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/archer-die2-5.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/archer-die2-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/archer-die2-3.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/undead-skeletal/archer-die2-2.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/undead-skeletal/archer-die2-1.png"
				[/frame]
			[/recruit_anim]
			[defense]
				castle="40"
				cave="60"
				deep_water="90"
				flat="60"
				forest="50"
				frozen="70"
				fungus="40"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="70"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="3"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="150"
				blade="60"
				cold="40"
				fire="120"
				impact="120"
				pierce="40"
			[/resistance]
			[abilities]
				[hides]
					affect_self="yes"
#textdomain wesnoth
					description=_ "Submerge:
This unit can hide in deep water, and remain undetected by its enemies.

Enemy units cannot see this unit while it is in deep water, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
					description_inactive=_ "Submerge:
This unit can hide in deep water, and remain undetected by its enemies.

Enemy units cannot see this unit while it is in deep water, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
					female_name=_ "female^submerge"
					female_name_inactive=_ "female^submerge"
					id="submerge"
					name=_ "submerge"
					name_inactive=_ "submerge"
					[filter_self]
						[filter_location]
							terrain="Wo"
						[/filter_location]
					[/filter_self]
				[/hides]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
				not_living="yes"
			[/status]
			[attack]
				damage="3"
#textdomain wesnoth-units
				description=_ "fist"
				icon="attacks/fist-skeletal.png"
				name="fist"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="6"
				description=_ "bow"
				icon="attacks/bow-orcish.png"
				name="bow"
				number="3"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
				[trait]
					availability="musthave"
#textdomain wesnoth
					description=_ "Immune to drain, poison and plague"
					female_name=_ "female^undead"
					id="undead"
					male_name=_ "undead"
					name=_ "undead"
					[effect]
						add="not_living"
						apply_to="status"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Wraith,Shadow"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="20"
			die_sound="wail-long.wav"
			ellipse="misc/ellipse"
			experience="0"
			facing="n"
			flag_rgb="magenta"
			flies="true"
			flying="yes"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="18"
			id="Ghost-8"
			image="units/undead/ghost-s-2.png"
#textdomain wesnoth-units
			language_name=_ "Ghost"
			level="1"
			max_attacks="1"
			max_experience="21"
			max_hitpoints="18"
			max_moves="7"
			movement="7"
			movement_type="undeadspirit"
			moves="7"
			race="undead"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Ghost"
			underlying_id="8"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				start_time="-200"
				[filter_attack]
					name="wail"
				[/filter_attack]
				[if]
					direction="n,ne,nw"
					[missile_frame]
						begin="-300"
						end="-230"
						image="projectiles/wailprojectile-n-1.png"
						image_diagonal="projectiles/wailprojectile-ne-1.png"
					[/missile_frame]
					[missile_frame]
						begin="-230"
						end="-160"
						image="projectiles/wailprojectile-n-2.png"
						image_diagonal="projectiles/wailprojectile-ne-2.png"
					[/missile_frame]
					[missile_frame]
						begin="-160"
						end="0"
						image="projectiles/wailprojectile-n-3.png"
						image_diagonal="projectiles/wailprojectile-ne-3.png"
					[/missile_frame]
					[missile_frame]
						begin="0"
						end="40"
						image="projectiles/wailprojectile-n-4.png"
						image_diagonal="projectiles/wailprojectile-ne-4.png"
					[/missile_frame]
					[missile_frame]
						begin="40"
						end="80"
						image="projectiles/wailprojectile-n-5.png"
						image_diagonal="projectiles/wailprojectile-ne-5.png"
					[/missile_frame]
					[missile_frame]
						begin="80"
						end="120"
						image="projectiles/wailprojectile-n-6.png"
						image_diagonal="projectiles/wailprojectile-ne-6.png"
					[/missile_frame]
				[/if]
				[else]
					direction="s,se,sw"
					[missile_frame]
						begin="-300"
						end="-230"
						image="projectiles/wailprojectile-s-1.png"
						image_diagonal="projectiles/wailprojectile-se-1.png"
					[/missile_frame]
					[missile_frame]
						begin="-230"
						end="-160"
						image="projectiles/wailprojectile-s-2.png"
						image_diagonal="projectiles/wailprojectile-se-2.png"
					[/missile_frame]
					[missile_frame]
						begin="-160"
						end="0"
						image="projectiles/wailprojectile-s-3.png"
						image_diagonal="projectiles/wailprojectile-se-3.png"
					[/missile_frame]
					[missile_frame]
						begin="0"
						end="40"
						image="projectiles/wailprojectile-s-4.png"
						image_diagonal="projectiles/wailprojectile-se-4.png"
					[/missile_frame]
					[missile_frame]
						begin="40"
						end="80"
						image="projectiles/wailprojectile-s-5.png"
						image_diagonal="projectiles/wailprojectile-se-5.png"
					[/missile_frame]
					[missile_frame]
						begin="80"
						end="120"
						image="projectiles/wailprojectile-s-6.png"
						image_diagonal="projectiles/wailprojectile-se-6.png"
					[/missile_frame]
				[/else]
				[if]
					direction="s,se,sw"
					[frame]
						duration="25"
						image="units/undead/ghost-s-2.png"
					[/frame]
					[frame]
						duration="75"
						image="units/undead/ghost-s-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-s-attack-2.png"
						sound="wail-sml.wav"
					[/frame]
					[frame]
						duration="75"
						image="units/undead/ghost-s-attack-1.png"
					[/frame]
					[frame]
						duration="25"
						image="units/undead/ghost-s-2.png"
					[/frame]
				[/if]
				[else]
					direction="n,ne,nw"
					[frame]
						duration="25"
						image="units/undead/ghost-n-2.png"
					[/frame]
					[frame]
						duration="75"
						image="units/undead/ghost-n-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-n-attack-2.png"
						sound="wail-sml.wav"
					[/frame]
					[frame]
						duration="75"
						image="units/undead/ghost-n-attack-1.png"
					[/frame]
					[frame]
						duration="25"
						image="units/undead/ghost-n-2.png"
					[/frame]
				[/else]
			[/attack_anim]
			[attack_anim]
				alpha="0.8~0.0:425,0.0~0.8:225"
				direction="s,se,sw"
				offset="0.0~1.0:425,0.0:225"
				start_time="-500"
				[filter_attack]
					name="touch"
				[/filter_attack]
				[frame]
					duration="25"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="175"
					image="units/undead/ghost-s-attack-1.png"
				[/frame]
				[frame]
					duration="175"
					image="units/undead/ghost-s-attack-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead/ghost-s-attack-3.png"
					sound="wail-sml.wav"
				[/frame]
				[frame]
					duration="75"
					image="units/undead/ghost-s-attack-2.png"
				[/frame]
				[frame]
					duration="75"
					image="units/undead/ghost-s-attack-1.png"
				[/frame]
				[frame]
					duration="25"
					image="units/undead/ghost-s-2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				alpha="0.8~0.0:425,0.0~0.8:225"
				direction="n,ne,nw"
				offset="0.0~1.0:425,0.0:225"
				start_time="-500"
				[filter_attack]
					name="touch"
				[/filter_attack]
				[frame]
					duration="25"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="175"
					image="units/undead/ghost-n-attack-1.png"
				[/frame]
				[frame]
					duration="175"
					image="units/undead/ghost-n-attack-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead/ghost-n-attack-3.png"
					sound="wail-sml.wav"
				[/frame]
				[frame]
					duration="75"
					image="units/undead/ghost-n-attack-2.png"
				[/frame]
				[frame]
					duration="75"
					image="units/undead/ghost-n-attack-1.png"
				[/frame]
				[frame]
					duration="25"
					image="units/undead/ghost-n-2.png"
				[/frame]
			[/attack_anim]
			[defend]
				direction="s,se,sw"
				start_time="-126"
				[if]
					alpha="0.8~0.5:126,0.5~0.8:126"
					hits="hit,kill"
					offset="0.0~-0.05:126,-0.05~0.0:126"
					[frame]
						duration="1"
						image="units/undead/ghost-s-2.png"
					[/frame]
					[frame]
						duration="100"
						image="units/undead/ghost-s-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-s-attack-1.png"
						sound="wail-sml.wav"
					[/frame]
					[frame]
						duration="1"
						image="units/undead/ghost-s-2.png"
					[/frame]
				[/if]
				[else]
					alpha="0.8~0.25:126,0.25~0.8:126"
					hits="miss"
					offset="0.0~-0.1:126,-0.1~0.0:126"
					[frame]
						duration="1"
						image="units/undead/ghost-s-2.png"
					[/frame]
					[frame]
						duration="100"
						image="units/undead/ghost-s-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-s-attack-1.png"
					[/frame]
					[frame]
						duration="1"
						image="units/undead/ghost-s-2.png"
					[/frame]
				[/else]
			[/defend]
			[defend]
				direction="n,ne,nw"
				start_time="-126"
				[if]
					alpha="0.8~0.5:126,0.5~0.8:126"
					hits="hit,kill"
					offset="0.0~-0.05:126,-0.05~0.0:126"
					[frame]
						duration="1"
						image="units/undead/ghost-n-2.png"
					[/frame]
					[frame]
						duration="100"
						image="units/undead/ghost-n-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-n-attack-1.png"
						sound="wail-sml.wav"
					[/frame]
					[frame]
						duration="1"
						image="units/undead/ghost-n-2.png"
					[/frame]
				[/if]
				[else]
					alpha="0.8~0.25:126,0.25~0.8:126"
					hits="miss"
					offset="0.0~-0.1:126,-0.1~0.0:126"
					[frame]
						duration="1"
						image="units/undead/ghost-n-2.png"
					[/frame]
					[frame]
						duration="100"
						image="units/undead/ghost-n-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-n-attack-1.png"
					[/frame]
					[frame]
						duration="1"
						image="units/undead/ghost-n-2.png"
					[/frame]
				[/else]
			[/defend]
			[standing_anim]
				alpha="0.8~0.4:1400,0.4~0.6:600,0.6~0.4:600,0.4~0.8:1400"
				direction="s,se,sw"
				start_time="0"
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-3.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				alpha="0.8~0.4:1400,0.4~0.6:600,0.6~0.4:600,0.4~0.8:1400"
				direction="n,ne,nw"
				start_time="0"
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-3.png"
				[/frame]
			[/standing_anim]
			[defense]
				castle="50"
				cave="50"
				deep_water="50"
				flat="50"
				forest="50"
				frozen="50"
				fungus="50"
				hills="50"
				impassable="50"
				mountains="50"
				reef="50"
				sand="50"
				shallow_water="50"
				swamp_water="50"
				unwalkable="50"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="2"
				flat="1"
				forest="1"
				frozen="1"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="1"
				reef="2"
				sand="1"
				shallow_water="2"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="110"
				blade="50"
				cold="30"
				fire="90"
				impact="50"
				pierce="50"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
				not_living="yes"
			[/status]
			[attack]
				damage="4"
				description=_ "touch"
				icon="attacks/touch-undead.png"
				name="touch"
				number="3"
				range="melee"
				type="arcane"
				[specials]
					[drains]
#textdomain wesnoth
						description=_ "Drain:
This unit drains health from living units, healing itself for half the amount of damage it deals (rounded down)."
						id="drains"
						name=_ "drains"
					[/drains]
				[/specials]
			[/attack]
			[attack]
				damage="3"
#textdomain wesnoth-units
				description=_ "wail"
				name="wail"
				number="3"
				range="ranged"
				type="cold"
			[/attack]
			[modifications]
				[trait]
					availability="musthave"
#textdomain wesnoth
					description=_ "Immune to drain, poison and plague"
					female_name=_ "female^undead"
					id="undead"
					male_name=_ "undead"
					name=_ "undead"
					[effect]
						add="not_living"
						apply_to="status"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Dark Sorcerer"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="16"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="3"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="27"
			id="Dark Adept-16"
			ignore_race_traits="yes"
			image="units/undead-necromancers/adept+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Dark Adept"
			level="1"
			max_attacks="1"
			max_experience="27"
			max_hitpoints="27"
			max_moves="6"
			movement="5"
			movement_type="smallfoot"
			moves="6"
			name="Raeryangwen"
			profile="portraits/humans/dark-adept+female.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Dark Adept"
			underlying_id="16"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					range="ranged"
				[/filter_attack]
				[missile_frame]
					begin="-50"
					end="150"
					image="projectiles/darkmissile-n.png"
					image_diagonal="projectiles/darkmissile-ne.png"
				[/missile_frame]
				[frame]
					begin="-450"
					end="-420"
					image="units/undead-necromancers/adept+female.png"
				[/frame]
				[frame]
					begin="-420"
					end="-395"
					image="units/undead-necromancers/adept+female-magic-1.png"
				[/frame]
				[frame]
					begin="-395"
					end="-320"
					image="units/undead-necromancers/adept+female-magic-2.png"
				[/frame]
				[frame]
					begin="-320"
					end="-300"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-300"
					end="-250"
					halo="halo/undead/dark-magic-1.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-250"
					end="-200"
					halo="halo/undead/dark-magic-2.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-200"
					end="-150"
					halo="halo/undead/dark-magic-3.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-150"
					end="-100"
					halo="halo/undead/dark-magic-4.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-100"
					end="-50"
					halo="halo/undead/dark-magic-5.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[if]
					hits="no"
					[frame]
						begin="-50"
						end="0"
						halo="halo/undead/dark-magic-6.png"
						halo_x="0"
						halo_y="-12"
						image="units/undead-necromancers/adept+female-magic-3.png"
						sound="magic-dark-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-50"
						end="0"
						halo="halo/undead/dark-magic-6.png"
						halo_x="0"
						halo_y="-12"
						image="units/undead-necromancers/adept+female-magic-3.png"
						sound="magic-dark.ogg"
					[/frame]
				[/else]
				[frame]
					begin="0"
					end="50"
					image="units/undead-necromancers/adept+female-magic-2.png"
				[/frame]
				[frame]
					begin="50"
					end="90"
					image="units/undead-necromancers/adept+female-magic-1.png"
				[/frame]
				[frame]
					begin="90"
					end="100"
					image="units/undead-necromancers/adept+female.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/undead-necromancers/adept-die1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-necromancers/adept-die2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-necromancers/adept-die3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-necromancers/adept-die4.png"
				[/frame]
				[frame]
					begin="400"
					end="520"
					image="units/undead-necromancers/adept-die5.png"
				[/frame]
				[frame]
					begin="520"
					end="640"
					image="units/undead-necromancers/adept-die6.png"
				[/frame]
				[frame]
					begin="640"
					end="780"
					image="units/undead-necromancers/adept-die7.png"
				[/frame]
				[frame]
					begin="780"
					end="900"
					image="units/undead-necromancers/adept-die8.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/undead-necromancers/adept+female-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-necromancers/adept+female-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead-necromancers/adept+female-defend-2.png"
						sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead-necromancers/adept+female-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead-necromancers/adept+female-defend-1.png"
				[/frame]
			[/defend]
			[portrait]
				image="portraits/humans/transparent/dark-adept+female.png"
				mirror="true"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/dark-adept+female.png"
				mirror="false"
				side="right"
				size="400"
			[/portrait]
			[trait]
#textdomain wesnoth
				female_name=_ "female^quick"
				id="quick"
				male_name=_ "quick"
				[effect]
					apply_to="movement"
					increase="1"
				[/effect]
				[effect]
					apply_to="hitpoints"
					increase_total="-5%"
				[/effect]
			[/trait]
			[trait]
				female_name=_ "female^intelligent"
				id="intelligent"
				male_name=_ "intelligent"
				[effect]
					apply_to="max_experience"
					increase="-20%"
				[/effect]
			[/trait]
			[trait]
				female_name=_ "female^resilient"
				id="resilient"
				male_name=_ "resilient"
				[effect]
					apply_to="hitpoints"
					increase_total="4"
				[/effect]
				[effect]
					apply_to="hitpoints"
					increase_total="1"
					times="per level"
				[/effect]
			[/trait]
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="50"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="3"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="10"
#textdomain wesnoth-units
				description=_ "chill wave"
				icon="attacks/iceball.png"
				name="chill wave"
				number="2"
				range="ranged"
				type="cold"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[attack]
				damage="7"
#textdomain wesnoth-units
				description=_ "shadow wave"
				icon="attacks/dark-missile.png"
				name="shadow wave"
				number="2"
				range="ranged"
				type="arcane"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "female^quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "female^intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Dark Sorcerer"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="16"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="33"
			id="Dark Adept-18"
			ignore_race_traits="yes"
			image="units/undead-necromancers/adept+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Dark Adept"
			level="1"
			max_attacks="1"
			max_experience="27"
			max_hitpoints="33"
			max_moves="5"
			movement="5"
			movement_type="smallfoot"
			moves="5"
			name="Cinoic"
			profile="portraits/humans/dark-adept+female.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Dark Adept"
			underlying_id="18"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					range="ranged"
				[/filter_attack]
				[missile_frame]
					begin="-50"
					end="150"
					image="projectiles/darkmissile-n.png"
					image_diagonal="projectiles/darkmissile-ne.png"
				[/missile_frame]
				[frame]
					begin="-450"
					end="-420"
					image="units/undead-necromancers/adept+female.png"
				[/frame]
				[frame]
					begin="-420"
					end="-395"
					image="units/undead-necromancers/adept+female-magic-1.png"
				[/frame]
				[frame]
					begin="-395"
					end="-320"
					image="units/undead-necromancers/adept+female-magic-2.png"
				[/frame]
				[frame]
					begin="-320"
					end="-300"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-300"
					end="-250"
					halo="halo/undead/dark-magic-1.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-250"
					end="-200"
					halo="halo/undead/dark-magic-2.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-200"
					end="-150"
					halo="halo/undead/dark-magic-3.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-150"
					end="-100"
					halo="halo/undead/dark-magic-4.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-100"
					end="-50"
					halo="halo/undead/dark-magic-5.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[if]
					hits="no"
					[frame]
						begin="-50"
						end="0"
						halo="halo/undead/dark-magic-6.png"
						halo_x="0"
						halo_y="-12"
						image="units/undead-necromancers/adept+female-magic-3.png"
						sound="magic-dark-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-50"
						end="0"
						halo="halo/undead/dark-magic-6.png"
						halo_x="0"
						halo_y="-12"
						image="units/undead-necromancers/adept+female-magic-3.png"
						sound="magic-dark.ogg"
					[/frame]
				[/else]
				[frame]
					begin="0"
					end="50"
					image="units/undead-necromancers/adept+female-magic-2.png"
				[/frame]
				[frame]
					begin="50"
					end="90"
					image="units/undead-necromancers/adept+female-magic-1.png"
				[/frame]
				[frame]
					begin="90"
					end="100"
					image="units/undead-necromancers/adept+female.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/undead-necromancers/adept-die1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-necromancers/adept-die2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-necromancers/adept-die3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-necromancers/adept-die4.png"
				[/frame]
				[frame]
					begin="400"
					end="520"
					image="units/undead-necromancers/adept-die5.png"
				[/frame]
				[frame]
					begin="520"
					end="640"
					image="units/undead-necromancers/adept-die6.png"
				[/frame]
				[frame]
					begin="640"
					end="780"
					image="units/undead-necromancers/adept-die7.png"
				[/frame]
				[frame]
					begin="780"
					end="900"
					image="units/undead-necromancers/adept-die8.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/undead-necromancers/adept+female-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-necromancers/adept+female-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead-necromancers/adept+female-defend-2.png"
						sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead-necromancers/adept+female-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead-necromancers/adept+female-defend-1.png"
				[/frame]
			[/defend]
			[portrait]
				image="portraits/humans/transparent/dark-adept+female.png"
				mirror="true"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/dark-adept+female.png"
				mirror="false"
				side="right"
				size="400"
			[/portrait]
			[trait]
#textdomain wesnoth
				female_name=_ "female^quick"
				id="quick"
				male_name=_ "quick"
				[effect]
					apply_to="movement"
					increase="1"
				[/effect]
				[effect]
					apply_to="hitpoints"
					increase_total="-5%"
				[/effect]
			[/trait]
			[trait]
				female_name=_ "female^intelligent"
				id="intelligent"
				male_name=_ "intelligent"
				[effect]
					apply_to="max_experience"
					increase="-20%"
				[/effect]
			[/trait]
			[trait]
				female_name=_ "female^resilient"
				id="resilient"
				male_name=_ "resilient"
				[effect]
					apply_to="hitpoints"
					increase_total="4"
				[/effect]
				[effect]
					apply_to="hitpoints"
					increase_total="1"
					times="per level"
				[/effect]
			[/trait]
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="50"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="3"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="10"
#textdomain wesnoth-units
				description=_ "chill wave"
				icon="attacks/iceball.png"
				name="chill wave"
				number="2"
				range="ranged"
				type="cold"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[attack]
				damage="7"
#textdomain wesnoth-units
				description=_ "shadow wave"
				icon="attacks/dark-missile.png"
				name="shadow wave"
				number="2"
				range="ranged"
				type="arcane"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "female^resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "female^intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
	[/side]
	[side]
		action_bonus_count="4"
		aggression="0.5"
		allow_player="yes"
		caution="0.25"
		colour="2"
		controller="human"
		countdown_time="184130"
		current_player="KnightKunibert"
		disallow_observers="no"
		fog="yes"
		global_recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
		gold="20"
		hidden="no"
		id="KnightKunibert2"
		income="0"
		leader_value="3"
		name="KnightKunibert"
		no_leader="yes"
		number_of_possible_recruits_to_force_recruit="3.1"
		objectives=_ "Victory:
@Defeat enemy leader(s)"
		objectives_changed="no"
		recruit="Dwarvish Fighter,Dwarvish Guardsman,Dwarvish Thunderer,Dwarvish Ulfserker,Footpad,Gryphon Rider,Poacher,Thief"
		recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
		save_id="KnightKunibert2"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="2"
		start_gold="100"
		team_name="east"
#textdomain wesnoth-multiplayer
		user_team_name=_ "teamname^East"
		village_gold="2"
		village_value="1"
		villages_per_scout="8"
		[ai]
			recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
			villages_per_scout="8"
			[team_formula]
				rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
			[/team_formula]
		[/ai]
		[ai]
			villages_per_scout="8"
		[/ai]
		[village]
			x="9"
			y="24"
		[/village]
		[village]
			x="10"
			y="20"
		[/village]
		[village]
			x="17"
			y="12"
		[/village]
		[village]
			x="18"
			y="20"
		[/village]
		[village]
			x="19"
			y="8"
		[/village]
		[village]
			x="19"
			y="17"
		[/village]
		[village]
			x="19"
			y="24"
		[/village]
		[village]
			x="23"
			y="7"
		[/village]
		[village]
			x="24"
			y="20"
		[/village]
		[unit]
			advances_to="Dwarvish Lord"
			alignment="neutral"
			allow_changes="yes"
			allow_player="yes"
			alpha="256"
			attacks_left="1"
			canrecruit="yes"
			colour="2"
			controller="human"
			cost="32"
			current_player="KnightKunibert"
			die_sound="dwarf-die-1.ogg,dwarf-die-2.ogg"
			experience="0"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			fog="yes"
			gender="male"
			gold="100"
			goto_x="-999"
			goto_y="-999"
			hitpoints="56"
			id="KnightKunibert2"
			image="units/dwarves/steelclad.png"
			income="0"
#textdomain wesnoth-units
			language_name=_ "Dwarvish Steelclad"
			leader="Dwarvish Steelclad,Dwarvish Thunderguard,Dwarvish Stalwart,Rogue,Trapper"
			level="2"
			max_attacks="1"
			max_experience="52"
			max_hitpoints="56"
			max_moves="5"
			movement="4"
			movement_type="dwarvishfoot"
			moves="5"
			mp_countdown="yes"
			mp_countdown_action_bonus="20"
			mp_countdown_init_time="270"
			mp_countdown_reservoir_time="270"
			mp_countdown_turn_bonus="200"
			name="KnightKunibert"
			profile="portraits/dwarves/fighter.png"
			race="dwarf"
			random_leader="Dwarvish Steelclad,Dwarvish Thunderguard,Rogue,Trapper"
			random_traits="no"
			recruit="Dwarvish Guardsman,Dwarvish Fighter,Dwarvish Ulfserker,Dwarvish Thunderer,Thief,Poacher,Footpad,Gryphon Rider"
			resting="yes"
			save_id="KnightKunibert2"
			share_maps="no"
			share_view="yes"
			shroud="no"
			side="2"
			team_name="east"
			terrain_liked="Hh, Ha, Mm"
			type="Dwarvish Steelclad"
			undead_variation="dwarf"
			underlying_id="2"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			user_team_name="wesnoth-multiplayerteamname^East"
			village_gold="2"
			x="13"
			y="14"
			zoc="yes"
			[portrait]
				image="portraits/dwarves/transparent/fighter.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/dwarves/transparent/fighter.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="50"
				deep_water="80"
				flat="70"
				forest="70"
				frozen="70"
				fungus="60"
				hills="40"
				impassable="50"
				mountains="30"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="99"
				flat="1"
				forest="1"
				frozen="2"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="1"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="90"
				blade="70"
				cold="90"
				fire="90"
				impact="70"
				pierce="70"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="11"
				description=_ "battle axe"
				icon="attacks/battleaxe.png"
				name="battle axe"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="14"
				description=_ "hammer"
				icon="attacks/hammer-dwarven.png"
				name="hammer"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="13"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="23"
			id="Thief-9"
			image="units/human-outlaws/thief.png"
#textdomain wesnoth-units
			language_name=_ "Thief"
			level="1"
			max_attacks="1"
			max_experience="15"
			max_hitpoints="23"
			max_moves="7"
			movement="6"
			movement_type="elusivefoot"
			moves="7"
			name="Ronry"
			profile="portraits/humans/thief.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Thief"
			underlying_id="9"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="10"
			y="20"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-outlaws/thief.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/attack_anim]
			[death]
				start_time="0"
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-7.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-2-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-3-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
					sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="4"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="3"
				range="melee"
				type="blade"
				[specials]
					[damage]
						active_on="offense"
						backstab="yes"
#textdomain wesnoth
						description=_ "Backstab:
When used offensively, this attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (turned to stone or otherwise paralyzed)."
						id="backstab"
						multiply="2"
						name=_ "backstab"
					[/damage]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="31"
			id="Footpad-10"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="31"
			max_moves="7"
			movement="7"
			movement_type="elusivefoot"
			moves="7"
			name="Cyr"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Footpad"
			underlying_id="10"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="7"
			y="22"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="6"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="13"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="8"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="25"
			id="Thief-11"
			image="units/human-outlaws/thief.png"
#textdomain wesnoth-units
			language_name=_ "Thief"
			level="1"
			max_attacks="1"
			max_experience="15"
			max_hitpoints="25"
			max_moves="6"
			movement="6"
			movement_type="elusivefoot"
			moves="6"
			name="Lec"
			profile="portraits/humans/thief.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Thief"
			underlying_id="11"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="15"
			y="20"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-outlaws/thief.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/attack_anim]
			[death]
				start_time="0"
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-7.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-2-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-3-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
					sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="3"
				range="melee"
				type="blade"
				[specials]
					[damage]
						active_on="offense"
						backstab="yes"
#textdomain wesnoth
						description=_ "Backstab:
When used offensively, this attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (turned to stone or otherwise paralyzed)."
						id="backstab"
						multiply="2"
						name=_ "backstab"
					[/damage]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Fugitive"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="28"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="5"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="43"
			id="Footpad-13"
			image="units/human-outlaws/outlaw+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Outlaw"
			level="2"
			max_attacks="1"
			max_experience="43"
			max_hitpoints="43"
			max_moves="7"
			movement="7"
			movement_type="elusivefoot"
			moves="7"
			name="Ysylla"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Outlaw"
			underlying_id="13"
			unrenamable="no"
			upkeep="full"
			usage="mixed fighter"
			x="11"
			y="14"
			zoc="yes"
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/outlaw+female-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/outlaw+female-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/outlaw+female-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="mace"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/outlaw+female-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="50"
						image="units/human-outlaws/outlaw+female-melee-2.png"
						sound="mace.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="50"
						image="units/human-outlaws/outlaw+female-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="50"
					end="150"
					image="units/human-outlaws/outlaw+female-melee-3.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/outlaw+female.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/outlaw+female-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/outlaw+female-defend.png"
						sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/outlaw+female-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/outlaw+female.png"
				[/frame]
			[/defend]
			[idle_anim]
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					begin="0"
					end="100"
					image="units/human-outlaws/outlaw-idle-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/outlaw-idle-7.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/outlaw-idle-5.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/human-outlaws/outlaw-idle-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/human-outlaws/outlaw-idle-3.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/human-outlaws/outlaw-idle-2.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/human-outlaws/outlaw-idle-1.png"
				[/frame]
				[frame]
					begin="700"
					end="800"
					image="units/human-outlaws/outlaw-idle-6.png"
				[/frame]
				[frame]
					begin="800"
					end="900"
					image="units/human-outlaws/outlaw-idle-5.png"
				[/frame]
				[frame]
					begin="900"
					end="1400"
					image="units/human-outlaws/outlaw-idle-4.png"
				[/frame]
				[frame]
					begin="1400"
					end="1500"
					image="units/human-outlaws/outlaw-idle-3.png"
				[/frame]
				[frame]
					begin="1500"
					end="1600"
					image="units/human-outlaws/outlaw-idle-2.png"
				[/frame]
				[frame]
					begin="1600"
					end="1700"
					image="units/human-outlaws/outlaw-idle-1.png"
				[/frame]
			[/idle_anim]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="9"
				description=_ "mace"
				name="mace"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="6"
				description=_ "sling"
				name="sling"
				number="3"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "female^strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "female^intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="3"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="29"
			id="Footpad-15"
			image="units/human-outlaws/footpad+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="29"
			max_moves="8"
			movement="7"
			movement_type="elusivefoot"
			moves="8"
			name="Cla"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Footpad"
			underlying_id="15"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="9"
			y="16"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad+female-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad+female-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad+female-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad+female.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad+female-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad+female-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad+female-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad+female-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad+female-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad+female.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad+female-defend.png"
						sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad+female-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad+female.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad+female-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad+female-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "female^quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "female^intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="sw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="36"
			id="Footpad-17"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="25"
			max_hitpoints="36"
			max_moves="7"
			movement="7"
			movement_type="elusivefoot"
			moves="7"
			name="Caryn"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Footpad"
			underlying_id="17"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="13"
			y="15"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="6"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="2"
			facing="s"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="29"
			id="Footpad-19"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="29"
			max_moves="8"
			movement="7"
			movement_type="elusivefoot"
			moves="8"
			name="Saregwyn"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Footpad"
			underlying_id="19"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="10"
			y="12"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="29"
			id="Footpad-20"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="29"
			max_moves="8"
			movement="7"
			movement_type="elusivefoot"
			moves="8"
			name="Gwurcyn"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Footpad"
			underlying_id="20"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="17"
			y="13"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Dwarvish Lord"
			alignment="neutral"
			allow_changes="yes"
			allow_player="yes"
			alpha="256"
			attacks_left="1"
			canrecruit="yes"
			colour="2"
			controller="human"
			cost="32"
			current_player="KnightKunibert"
			die_sound="dwarf-die-1.ogg,dwarf-die-2.ogg"
			experience="0"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			fog="yes"
			gender="male"
			gold="100"
			goto_x="-999"
			goto_y="-999"
			hitpoints="56"
			id="KnightKunibert2"
			image="units/dwarves/steelclad.png"
			income="0"
#textdomain wesnoth-units
			language_name=_ "Dwarvish Steelclad"
			leader="Dwarvish Steelclad,Dwarvish Thunderguard,Dwarvish Stalwart,Rogue,Trapper"
			level="2"
			max_attacks="1"
			max_experience="52"
			max_hitpoints="56"
			max_moves="5"
			movement="4"
			movement_type="dwarvishfoot"
			moves="5"
			mp_countdown="yes"
			mp_countdown_action_bonus="20"
			mp_countdown_init_time="270"
			mp_countdown_reservoir_time="270"
			mp_countdown_turn_bonus="200"
			name="KnightKunibert"
			profile="portraits/dwarves/fighter.png"
			race="dwarf"
			random_leader="Dwarvish Steelclad,Dwarvish Thunderguard,Rogue,Trapper"
			random_traits="no"
			recruit="Dwarvish Guardsman,Dwarvish Fighter,Dwarvish Ulfserker,Dwarvish Thunderer,Thief,Poacher,Footpad,Gryphon Rider"
			resting="yes"
			save_id="KnightKunibert2"
			share_maps="no"
			share_view="yes"
			shroud="no"
			side="2"
			team_name="east"
			terrain_liked="Hh, Ha, Mm"
			type="Dwarvish Steelclad"
			undead_variation="dwarf"
			underlying_id="2"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			user_team_name="wesnoth-multiplayerteamname^East"
			village_gold="2"
			zoc="yes"
			[portrait]
				image="portraits/dwarves/transparent/fighter.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/dwarves/transparent/fighter.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="50"
				deep_water="80"
				flat="70"
				forest="70"
				frozen="70"
				fungus="60"
				hills="40"
				impassable="50"
				mountains="30"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="99"
				flat="1"
				forest="1"
				frozen="2"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="1"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="90"
				blade="70"
				cold="90"
				fire="90"
				impact="70"
				pierce="70"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="11"
				description=_ "battle axe"
				icon="attacks/battleaxe.png"
				name="battle axe"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="14"
				description=_ "hammer"
				icon="attacks/hammer-dwarven.png"
				name="hammer"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="13"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="23"
			id="Thief-9"
			image="units/human-outlaws/thief.png"
#textdomain wesnoth-units
			language_name=_ "Thief"
			level="1"
			max_attacks="1"
			max_experience="15"
			max_hitpoints="23"
			max_moves="7"
			movement="6"
			movement_type="elusivefoot"
			moves="7"
			name="Ronry"
			profile="portraits/humans/thief.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Thief"
			underlying_id="9"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-outlaws/thief.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/attack_anim]
			[death]
				start_time="0"
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-7.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-2-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-3-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
					sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="4"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="3"
				range="melee"
				type="blade"
				[specials]
					[damage]
						active_on="offense"
						backstab="yes"
#textdomain wesnoth
						description=_ "Backstab:
When used offensively, this attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (turned to stone or otherwise paralyzed)."
						id="backstab"
						multiply="2"
						name=_ "backstab"
					[/damage]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="31"
			id="Footpad-10"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="31"
			max_moves="7"
			movement="7"
			movement_type="elusivefoot"
			moves="7"
			name="Cyr"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Footpad"
			underlying_id="10"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="6"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="13"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="8"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="25"
			id="Thief-11"
			image="units/human-outlaws/thief.png"
#textdomain wesnoth-units
			language_name=_ "Thief"
			level="1"
			max_attacks="1"
			max_experience="15"
			max_hitpoints="25"
			max_moves="6"
			movement="6"
			movement_type="elusivefoot"
			moves="6"
			name="Lec"
			profile="portraits/humans/thief.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Thief"
			underlying_id="11"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-outlaws/thief.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/attack_anim]
			[death]
				start_time="0"
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-7.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-2-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-3-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
					sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="3"
				range="melee"
				type="blade"
				[specials]
					[damage]
						active_on="offense"
						backstab="yes"
#textdomain wesnoth
						description=_ "Backstab:
When used offensively, this attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (turned to stone or otherwise paralyzed)."
						id="backstab"
						multiply="2"
						name=_ "backstab"
					[/damage]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Fugitive"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="28"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="5"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="43"
			id="Footpad-13"
			image="units/human-outlaws/outlaw+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Outlaw"
			level="2"
			max_attacks="1"
			max_experience="43"
			max_hitpoints="43"
			max_moves="7"
			movement="7"
			movement_type="elusivefoot"
			moves="7"
			name="Ysylla"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Outlaw"
			underlying_id="13"
			unrenamable="no"
			upkeep="full"
			usage="mixed fighter"
			zoc="yes"
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/outlaw+female-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/outlaw+female-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/outlaw+female-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="mace"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/outlaw+female-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="50"
						image="units/human-outlaws/outlaw+female-melee-2.png"
						sound="mace.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="50"
						image="units/human-outlaws/outlaw+female-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="50"
					end="150"
					image="units/human-outlaws/outlaw+female-melee-3.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/outlaw+female.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/outlaw+female-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/outlaw+female-defend.png"
						sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/outlaw+female-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/outlaw+female.png"
				[/frame]
			[/defend]
			[idle_anim]
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					begin="0"
					end="100"
					image="units/human-outlaws/outlaw-idle-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/outlaw-idle-7.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/outlaw-idle-5.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/human-outlaws/outlaw-idle-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/human-outlaws/outlaw-idle-3.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/human-outlaws/outlaw-idle-2.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/human-outlaws/outlaw-idle-1.png"
				[/frame]
				[frame]
					begin="700"
					end="800"
					image="units/human-outlaws/outlaw-idle-6.png"
				[/frame]
				[frame]
					begin="800"
					end="900"
					image="units/human-outlaws/outlaw-idle-5.png"
				[/frame]
				[frame]
					begin="900"
					end="1400"
					image="units/human-outlaws/outlaw-idle-4.png"
				[/frame]
				[frame]
					begin="1400"
					end="1500"
					image="units/human-outlaws/outlaw-idle-3.png"
				[/frame]
				[frame]
					begin="1500"
					end="1600"
					image="units/human-outlaws/outlaw-idle-2.png"
				[/frame]
				[frame]
					begin="1600"
					end="1700"
					image="units/human-outlaws/outlaw-idle-1.png"
				[/frame]
			[/idle_anim]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="9"
				description=_ "mace"
				name="mace"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="6"
				description=_ "sling"
				name="sling"
				number="3"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "female^strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "female^intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="3"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="29"
			id="Footpad-15"
			image="units/human-outlaws/footpad+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="29"
			max_moves="8"
			movement="7"
			movement_type="elusivefoot"
			moves="8"
			name="Cla"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Footpad"
			underlying_id="15"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad+female-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad+female-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad+female-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad+female.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad+female-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad+female-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad+female-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad+female-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad+female-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad+female.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad+female-defend.png"
						sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad+female-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad+female.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad+female-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad+female-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "female^quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "female^intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="sw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="36"
			id="Footpad-17"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="25"
			max_hitpoints="36"
			max_moves="7"
			movement="7"
			movement_type="elusivefoot"
			moves="7"
			name="Caryn"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Footpad"
			underlying_id="17"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="6"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="2"
			facing="s"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="29"
			id="Footpad-19"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="29"
			max_moves="8"
			movement="7"
			movement_type="elusivefoot"
			moves="8"
			name="Saregwyn"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Footpad"
			underlying_id="19"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="29"
			id="Footpad-20"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="29"
			max_moves="8"
			movement="7"
			movement_type="elusivefoot"
			moves="8"
			name="Gwurcyn"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Footpad"
			underlying_id="20"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
	[/side]
	[time]
		blue="0"
		green="-20"
		id="dawn"
		image="misc/schedule-dawn.png"
		lawful_bonus="0"
		name=_ "Dawn"
		red="-20"
	[/time]
	[time]
		blue="0"
		green="0"
		id="morning"
		image="misc/schedule-morning.png"
		lawful_bonus="25"
		name=_ "Morning"
		red="0"
	[/time]
	[time]
		blue="0"
		green="0"
		id="afternoon"
		image="misc/schedule-afternoon.png"
		lawful_bonus="25"
		name=_ "Afternoon"
		red="0"
	[/time]
	[time]
		blue="-20"
		green="-20"
		id="dusk"
		image="misc/schedule-dusk.png"
		lawful_bonus="0"
		name=_ "Dusk"
		red="0"
	[/time]
	[time]
		blue="-10"
		green="-40"
		id="first_watch"
		image="misc/schedule-firstwatch.png"
		lawful_bonus="-25"
		name=_ "First Watch"
		red="-40"
	[/time]
	[time]
		blue="-10"
		green="-40"
		id="second_watch"
		image="misc/schedule-secondwatch.png"
		lawful_bonus="-25"
		name=_ "Second Watch"
		red="-40"
	[/time]
	[variables]
		damage_inflicted="7"
		side_number="2"
		turn_number="6"
	[/variables]
	[player]
		can_recruit="Dark Adept,Ghost,Ghoul,Skeleton,Skeleton Archer,Vampire Bat,Walking Corpse"
		gold="-1"
		gold_add="no"
		name="Condoriano"
		save_id="Condoriano1"
		[unit]
			advances_to="Blood Bat"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="13"
			die_sound="bat-flapping.wav"
			ellipse="misc/ellipse-nozoc"
			experience="0"
			facing="se"
			flag_rgb="magenta"
			flies="true"
			flying="yes"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="20"
			id="Vampire Bat-5"
			image="units/undead/bat-se-3.png"
#textdomain wesnoth-units
			language_name=_ "Vampire Bat"
			level="0"
			max_attacks="1"
			max_experience="13"
			max_hitpoints="20"
			max_moves="8"
			movement="8"
			movement_type="smallfly"
			moves="8"
			race="bats"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Vampire Bat"
			undead_variation="bat"
			underlying_id="5"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="no"
			[attack_anim]
				direction="s,se,sw"
				offset="0.0~0.9:200,0.9~0.0:160"
				start_time="-200"
				[filter_attack]
					name="fangs"
				[/filter_attack]
				[frame]
					duration="30"
					image="units/undead/bat-se-3.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-se-2.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-se-1.png"
					sound="bat-flapping.wav"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-se-2.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-se-3.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="70"
						image="units/undead/bat-se-4.png"
						sound="bite-small.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="70"
						image="units/undead/bat-se-4.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="50"
					image="units/undead/bat-se-3.png"
				[/frame]
				[frame]
					duration="50"
					image="units/undead/bat-se-2.png"
				[/frame]
				[frame]
					duration="40"
					image="units/undead/bat-se-3.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="n,ne,nw"
				offset="0.0~0.9:200,0.9~0.0:160"
				start_time="-200"
				[filter_attack]
					name="fangs"
				[/filter_attack]
				[frame]
					duration="30"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-ne-2.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-ne-1.png"
					sound="bat-flapping.wav"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-ne-2.png"
				[/frame]
				[frame]
					duration="30"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="70"
						image="units/undead/bat-ne-4.png"
						sound="bite-small.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="70"
						image="units/undead/bat-ne-4.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="50"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[frame]
					duration="50"
					image="units/undead/bat-ne-2.png"
				[/frame]
				[frame]
					duration="40"
					image="units/undead/bat-ne-3.png"
				[/frame]
			[/attack_anim]
			[defend]
				direction="s,sw,se"
				start_time="-126"
				[if]
					hits="miss"
					offset="0.0~-0.15,-0.15~0.0"
				[/if]
				[frame]
					duration="1"
					image="units/undead/bat-se-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead/bat-se-4.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead/bat-se-4.png"
						sound="bat-hit-1.ogg,bat-hit-2.ogg,bat-hit-3.ogg,bat-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead/bat-se-4.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead/bat-se-3.png"
				[/frame]
			[/defend]
			[defend]
				direction="n,nw,ne"
				start_time="-126"
				[if]
					hits="miss"
					offset="0.0~-0.15,-0.15~0.0"
				[/if]
				[frame]
					duration="1"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead/bat-ne-4.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead/bat-ne-4.png"
						sound="bat-hit-1.ogg,bat-hit-2.ogg,bat-hit-3.ogg,bat-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead/bat-ne-4.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead/bat-ne-3.png"
				[/frame]
			[/defend]
			[standing_anim]
				direction="s,se,sw"
				layer="60"
				start_time="0"
				[frame]
					duration="50"
					image="units/undead/bat-se-3.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-se-2.png"
				[/frame]
				[frame]
					duration="80"
					image="units/undead/bat-se-1.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-se-2.png"
				[/frame]
				[frame]
					duration="50"
					image="units/undead/bat-se-3.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-se-4.png"
				[/frame]
				[frame]
					duration="80"
					image="units/undead/bat-se-5.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-se-4.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				direction="n,ne,nw"
				layer="60"
				start_time="0"
				[frame]
					duration="50"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-ne-2.png"
				[/frame]
				[frame]
					duration="80"
					image="units/undead/bat-ne-1.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-ne-2.png"
				[/frame]
				[frame]
					duration="50"
					image="units/undead/bat-ne-3.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-ne-4.png"
				[/frame]
				[frame]
					duration="80"
					image="units/undead/bat-ne-5.png"
				[/frame]
				[frame]
					duration="60"
					image="units/undead/bat-ne-4.png"
				[/frame]
			[/standing_anim]
			[defense]
				castle="40"
				cave="40"
				deep_water="40"
				flat="40"
				forest="40"
				frozen="40"
				fungus="40"
				hills="40"
				impassable="40"
				mountains="40"
				reef="40"
				sand="40"
				shallow_water="40"
				swamp_water="40"
				unwalkable="40"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="1"
				flat="1"
				forest="1"
				frozen="1"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="1"
				sand="1"
				shallow_water="1"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="100"
				cold="70"
				fire="100"
				impact="120"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="4"
				description=_ "fangs"
				icon="attacks/fangs-animal.png"
				name="fangs"
				number="2"
				range="melee"
				type="blade"
				[specials]
					[drains]
#textdomain wesnoth
						description=_ "Drain:
This unit drains health from living units, healing itself for half the amount of damage it deals (rounded down)."
						id="drains"
						name=_ "drains"
					[/drains]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Revenant,Deathblade"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="15"
			die_sound="skeleton-die-1.ogg,skeleton-die-2.ogg"
			ellipse="misc/ellipse"
			experience="10"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="34"
			id="Skeleton-6"
			image="units/undead-skeletal/skeleton.png"
#textdomain wesnoth-units
			language_name=_ "Skeleton"
			level="1"
			max_attacks="1"
			max_experience="25"
			max_hitpoints="34"
			max_moves="5"
			movement="5"
			movement_type="undeadfoot"
			moves="5"
			race="undead"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Skeleton"
			underlying_id="6"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				offset="0.0~0.3,0.3~0.45,0.45~0.3,0.3~0.0"
				start_time="-250"
				[filter_attack]
					name="axe"
				[/filter_attack]
				[frame]
					duration="150"
					image="units/undead-skeletal/skeleton-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="100"
						image="units/undead-skeletal/skeleton-attack-2.png"
						sound="axe.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="100"
						image="units/undead-skeletal/skeleton-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-attack-3.png"
				[/frame]
				[frame]
					duration="90"
					image="units/undead-skeletal/skeleton-attack-4.png"
				[/frame]
				[frame]
					duration="80"
					image="units/undead-skeletal/skeleton-attack-5.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/undead-skeletal/skeleton-dying-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/skeleton-dying-2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/skeleton-dying-3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/skeleton-dying-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/skeleton-dying-5.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/undead-skeletal/skeleton-dying-6.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/undead-skeletal/skeleton-dying-7.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/undead-skeletal/skeleton-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead-skeletal/skeleton-defend-2.png"
						sound="skeleton-hit-1.ogg,skeleton-hit-2.ogg,skeleton-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead-skeletal/skeleton-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead-skeletal/skeleton-defend-1.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/skeleton-idle-2.png"
				[/frame]
			[/idle_anim]
			[recruit_anim]
				[frame]
					alpha="0~1:300"
					begin="-200"
					end="100"
					image="units/undead-skeletal/skeleton-dying-7.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/skeleton-dying-6.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/skeleton-dying-5.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/skeleton-dying-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/skeleton-dying-3.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/undead-skeletal/skeleton-dying-2.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/undead-skeletal/skeleton-dying-1.png"
				[/frame]
			[/recruit_anim]
			[defense]
				castle="40"
				cave="60"
				deep_water="90"
				flat="60"
				forest="50"
				frozen="70"
				fungus="40"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="70"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="3"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="150"
				blade="60"
				cold="40"
				fire="120"
				impact="120"
				pierce="40"
			[/resistance]
			[abilities]
				[hides]
					affect_self="yes"
#textdomain wesnoth
					description=_ "Submerge:
This unit can hide in deep water, and remain undetected by its enemies.

Enemy units cannot see this unit while it is in deep water, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
					description_inactive=_ "Submerge:
This unit can hide in deep water, and remain undetected by its enemies.

Enemy units cannot see this unit while it is in deep water, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
					female_name=_ "female^submerge"
					female_name_inactive=_ "female^submerge"
					id="submerge"
					name=_ "submerge"
					name_inactive=_ "submerge"
					[filter_self]
						[filter_location]
							terrain="Wo"
						[/filter_location]
					[/filter_self]
				[/hides]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
				not_living="yes"
			[/status]
			[attack]
				damage="7"
#textdomain wesnoth-units
				description=_ "axe"
				icon="attacks/axe-undead.png"
				name="axe"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[modifications]
				[trait]
					availability="musthave"
#textdomain wesnoth
					description=_ "Immune to drain, poison and plague"
					female_name=_ "female^undead"
					id="undead"
					male_name=_ "undead"
					name=_ "undead"
					[effect]
						add="not_living"
						apply_to="status"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Bone Shooter"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="skeleton-die-1.ogg,skeleton-die-2.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="sw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="31"
			id="Skeleton Archer-7"
			image="units/undead-skeletal/archer.png"
#textdomain wesnoth-units
			language_name=_ "Skeleton Archer"
			level="1"
			max_attacks="1"
			max_experience="25"
			max_hitpoints="31"
			max_moves="5"
			movement="5"
			movement_type="undeadfoot"
			moves="5"
			race="undead"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Skeleton Archer"
			underlying_id="7"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="bow"
				[/filter_attack]
				[missile_frame]
					begin="-150"
					end="0"
					image="projectiles/missile-n.png"
					image_diagonal="projectiles/missile-ne.png"
				[/missile_frame]
				[if]
					hits="yes"
					[frame]
						begin="-400"
						end="-250"
						image="units/undead-skeletal/archer-attack1.png"
						sound="bow.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-400"
						end="-250"
						image="units/undead-skeletal/archer-attack1.png"
						sound="bow-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-250"
					end="-100"
					image="units/undead-skeletal/archer-attack2.png"
				[/frame]
				[frame]
					begin="-100"
					end="0"
					image="units/undead-skeletal/archer.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="fist"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/undead-skeletal/archer.png"
				[/frame]
				[if]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/undead-skeletal/archer-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/undead-skeletal/archer-attack.png"
						sound="fist.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/archer.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/undead-skeletal/archer-die2-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/archer-die2-2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/archer-die2-3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/archer-die2-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/archer-die2-5.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/undead-skeletal/archer-die2-6.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/undead-skeletal/archer-die2-7.png"
				[/frame]
			[/death]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/undead-skeletal/archer-die-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/archer-die-2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/archer-die-3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/archer-die-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/archer-die-5.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/undead-skeletal/archer-die-6.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/undead-skeletal/archer-die-7.png"
				[/frame]
				[frame]
					begin="700"
					end="800"
					image="units/undead-skeletal/archer-die-8.png"
				[/frame]
				[frame]
					begin="800"
					end="900"
					image="units/undead-skeletal/archer-die-9.png"
				[/frame]
				[frame]
					begin="900"
					end="1000"
					image="units/undead-skeletal/archer-die-10.png"
				[/frame]
				[frame]
					begin="1000"
					end="1100"
					image="units/undead-skeletal/archer-die-11.png"
				[/frame]
				[frame]
					begin="1100"
					end="1200"
					image="units/undead-skeletal/archer-die-12.png"
				[/frame]
				[frame]
					begin="1200"
					end="1300"
					image="units/undead-skeletal/archer-die-13.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/undead-skeletal/archer.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-skeletal/archer-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead-skeletal/archer-defend.png"
						sound="skeleton-hit-1.ogg,skeleton-hit-2.ogg,skeleton-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead-skeletal/archer-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead-skeletal/archer.png"
				[/frame]
			[/defend]
			[idle_anim]
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					begin="0"
					end="100"
					image="units/undead-skeletal/archer-idle-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/archer-idle-2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/archer-idle-3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/archer-idle-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/archer-idle-5.png"
				[/frame]
				[frame]
					begin="500"
					end="700"
					image="units/undead-skeletal/archer-idle-6.png"
				[/frame]
				[frame]
					begin="700"
					end="800"
					image="units/undead-skeletal/archer-idle-7.png"
				[/frame]
				[frame]
					begin="800"
					end="900"
					image="units/undead-skeletal/archer-idle-8.png"
				[/frame]
				[frame]
					begin="900"
					end="1000"
					image="units/undead-skeletal/archer-idle-9.png"
				[/frame]
				[frame]
					begin="1000"
					end="1100"
					image="units/undead-skeletal/archer-idle-10.png"
				[/frame]
				[frame]
					begin="1100"
					end="1200"
					image="units/undead-skeletal/archer-idle-11.png"
				[/frame]
				[frame]
					begin="1200"
					end="1400"
					image="units/undead-skeletal/archer-idle-12.png"
				[/frame]
				[frame]
					begin="1400"
					end="1500"
					image="units/undead-skeletal/archer-idle-13.png"
				[/frame]
				[frame]
					begin="1500"
					end="1600"
					image="units/undead-skeletal/archer-idle-14.png"
				[/frame]
			[/idle_anim]
			[recruit_anim]
				[frame]
					alpha="0~1:300"
					begin="-200"
					end="100"
					image="units/undead-skeletal/archer-die2-7.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-skeletal/archer-die2-6.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-skeletal/archer-die2-5.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-skeletal/archer-die2-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/undead-skeletal/archer-die2-3.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/undead-skeletal/archer-die2-2.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/undead-skeletal/archer-die2-1.png"
				[/frame]
			[/recruit_anim]
			[defense]
				castle="40"
				cave="60"
				deep_water="90"
				flat="60"
				forest="50"
				frozen="70"
				fungus="40"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="70"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="3"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="150"
				blade="60"
				cold="40"
				fire="120"
				impact="120"
				pierce="40"
			[/resistance]
			[abilities]
				[hides]
					affect_self="yes"
#textdomain wesnoth
					description=_ "Submerge:
This unit can hide in deep water, and remain undetected by its enemies.

Enemy units cannot see this unit while it is in deep water, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
					description_inactive=_ "Submerge:
This unit can hide in deep water, and remain undetected by its enemies.

Enemy units cannot see this unit while it is in deep water, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
					female_name=_ "female^submerge"
					female_name_inactive=_ "female^submerge"
					id="submerge"
					name=_ "submerge"
					name_inactive=_ "submerge"
					[filter_self]
						[filter_location]
							terrain="Wo"
						[/filter_location]
					[/filter_self]
				[/hides]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
				not_living="yes"
			[/status]
			[attack]
				damage="3"
#textdomain wesnoth-units
				description=_ "fist"
				icon="attacks/fist-skeletal.png"
				name="fist"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="6"
				description=_ "bow"
				icon="attacks/bow-orcish.png"
				name="bow"
				number="3"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
				[trait]
					availability="musthave"
#textdomain wesnoth
					description=_ "Immune to drain, poison and plague"
					female_name=_ "female^undead"
					id="undead"
					male_name=_ "undead"
					name=_ "undead"
					[effect]
						add="not_living"
						apply_to="status"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Wraith,Shadow"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="20"
			die_sound="wail-long.wav"
			ellipse="misc/ellipse"
			experience="0"
			facing="n"
			flag_rgb="magenta"
			flies="true"
			flying="yes"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="18"
			id="Ghost-8"
			image="units/undead/ghost-s-2.png"
#textdomain wesnoth-units
			language_name=_ "Ghost"
			level="1"
			max_attacks="1"
			max_experience="21"
			max_hitpoints="18"
			max_moves="7"
			movement="7"
			movement_type="undeadspirit"
			moves="7"
			race="undead"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Ghost"
			underlying_id="8"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				start_time="-200"
				[filter_attack]
					name="wail"
				[/filter_attack]
				[if]
					direction="n,ne,nw"
					[missile_frame]
						begin="-300"
						end="-230"
						image="projectiles/wailprojectile-n-1.png"
						image_diagonal="projectiles/wailprojectile-ne-1.png"
					[/missile_frame]
					[missile_frame]
						begin="-230"
						end="-160"
						image="projectiles/wailprojectile-n-2.png"
						image_diagonal="projectiles/wailprojectile-ne-2.png"
					[/missile_frame]
					[missile_frame]
						begin="-160"
						end="0"
						image="projectiles/wailprojectile-n-3.png"
						image_diagonal="projectiles/wailprojectile-ne-3.png"
					[/missile_frame]
					[missile_frame]
						begin="0"
						end="40"
						image="projectiles/wailprojectile-n-4.png"
						image_diagonal="projectiles/wailprojectile-ne-4.png"
					[/missile_frame]
					[missile_frame]
						begin="40"
						end="80"
						image="projectiles/wailprojectile-n-5.png"
						image_diagonal="projectiles/wailprojectile-ne-5.png"
					[/missile_frame]
					[missile_frame]
						begin="80"
						end="120"
						image="projectiles/wailprojectile-n-6.png"
						image_diagonal="projectiles/wailprojectile-ne-6.png"
					[/missile_frame]
				[/if]
				[else]
					direction="s,se,sw"
					[missile_frame]
						begin="-300"
						end="-230"
						image="projectiles/wailprojectile-s-1.png"
						image_diagonal="projectiles/wailprojectile-se-1.png"
					[/missile_frame]
					[missile_frame]
						begin="-230"
						end="-160"
						image="projectiles/wailprojectile-s-2.png"
						image_diagonal="projectiles/wailprojectile-se-2.png"
					[/missile_frame]
					[missile_frame]
						begin="-160"
						end="0"
						image="projectiles/wailprojectile-s-3.png"
						image_diagonal="projectiles/wailprojectile-se-3.png"
					[/missile_frame]
					[missile_frame]
						begin="0"
						end="40"
						image="projectiles/wailprojectile-s-4.png"
						image_diagonal="projectiles/wailprojectile-se-4.png"
					[/missile_frame]
					[missile_frame]
						begin="40"
						end="80"
						image="projectiles/wailprojectile-s-5.png"
						image_diagonal="projectiles/wailprojectile-se-5.png"
					[/missile_frame]
					[missile_frame]
						begin="80"
						end="120"
						image="projectiles/wailprojectile-s-6.png"
						image_diagonal="projectiles/wailprojectile-se-6.png"
					[/missile_frame]
				[/else]
				[if]
					direction="s,se,sw"
					[frame]
						duration="25"
						image="units/undead/ghost-s-2.png"
					[/frame]
					[frame]
						duration="75"
						image="units/undead/ghost-s-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-s-attack-2.png"
						sound="wail-sml.wav"
					[/frame]
					[frame]
						duration="75"
						image="units/undead/ghost-s-attack-1.png"
					[/frame]
					[frame]
						duration="25"
						image="units/undead/ghost-s-2.png"
					[/frame]
				[/if]
				[else]
					direction="n,ne,nw"
					[frame]
						duration="25"
						image="units/undead/ghost-n-2.png"
					[/frame]
					[frame]
						duration="75"
						image="units/undead/ghost-n-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-n-attack-2.png"
						sound="wail-sml.wav"
					[/frame]
					[frame]
						duration="75"
						image="units/undead/ghost-n-attack-1.png"
					[/frame]
					[frame]
						duration="25"
						image="units/undead/ghost-n-2.png"
					[/frame]
				[/else]
			[/attack_anim]
			[attack_anim]
				alpha="0.8~0.0:425,0.0~0.8:225"
				direction="s,se,sw"
				offset="0.0~1.0:425,0.0:225"
				start_time="-500"
				[filter_attack]
					name="touch"
				[/filter_attack]
				[frame]
					duration="25"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="175"
					image="units/undead/ghost-s-attack-1.png"
				[/frame]
				[frame]
					duration="175"
					image="units/undead/ghost-s-attack-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead/ghost-s-attack-3.png"
					sound="wail-sml.wav"
				[/frame]
				[frame]
					duration="75"
					image="units/undead/ghost-s-attack-2.png"
				[/frame]
				[frame]
					duration="75"
					image="units/undead/ghost-s-attack-1.png"
				[/frame]
				[frame]
					duration="25"
					image="units/undead/ghost-s-2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				alpha="0.8~0.0:425,0.0~0.8:225"
				direction="n,ne,nw"
				offset="0.0~1.0:425,0.0:225"
				start_time="-500"
				[filter_attack]
					name="touch"
				[/filter_attack]
				[frame]
					duration="25"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="175"
					image="units/undead/ghost-n-attack-1.png"
				[/frame]
				[frame]
					duration="175"
					image="units/undead/ghost-n-attack-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead/ghost-n-attack-3.png"
					sound="wail-sml.wav"
				[/frame]
				[frame]
					duration="75"
					image="units/undead/ghost-n-attack-2.png"
				[/frame]
				[frame]
					duration="75"
					image="units/undead/ghost-n-attack-1.png"
				[/frame]
				[frame]
					duration="25"
					image="units/undead/ghost-n-2.png"
				[/frame]
			[/attack_anim]
			[defend]
				direction="s,se,sw"
				start_time="-126"
				[if]
					alpha="0.8~0.5:126,0.5~0.8:126"
					hits="hit,kill"
					offset="0.0~-0.05:126,-0.05~0.0:126"
					[frame]
						duration="1"
						image="units/undead/ghost-s-2.png"
					[/frame]
					[frame]
						duration="100"
						image="units/undead/ghost-s-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-s-attack-1.png"
						sound="wail-sml.wav"
					[/frame]
					[frame]
						duration="1"
						image="units/undead/ghost-s-2.png"
					[/frame]
				[/if]
				[else]
					alpha="0.8~0.25:126,0.25~0.8:126"
					hits="miss"
					offset="0.0~-0.1:126,-0.1~0.0:126"
					[frame]
						duration="1"
						image="units/undead/ghost-s-2.png"
					[/frame]
					[frame]
						duration="100"
						image="units/undead/ghost-s-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-s-attack-1.png"
					[/frame]
					[frame]
						duration="1"
						image="units/undead/ghost-s-2.png"
					[/frame]
				[/else]
			[/defend]
			[defend]
				direction="n,ne,nw"
				start_time="-126"
				[if]
					alpha="0.8~0.5:126,0.5~0.8:126"
					hits="hit,kill"
					offset="0.0~-0.05:126,-0.05~0.0:126"
					[frame]
						duration="1"
						image="units/undead/ghost-n-2.png"
					[/frame]
					[frame]
						duration="100"
						image="units/undead/ghost-n-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-n-attack-1.png"
						sound="wail-sml.wav"
					[/frame]
					[frame]
						duration="1"
						image="units/undead/ghost-n-2.png"
					[/frame]
				[/if]
				[else]
					alpha="0.8~0.25:126,0.25~0.8:126"
					hits="miss"
					offset="0.0~-0.1:126,-0.1~0.0:126"
					[frame]
						duration="1"
						image="units/undead/ghost-n-2.png"
					[/frame]
					[frame]
						duration="100"
						image="units/undead/ghost-n-attack-1.png"
					[/frame]
					[frame]
						duration="150"
						image="units/undead/ghost-n-attack-1.png"
					[/frame]
					[frame]
						duration="1"
						image="units/undead/ghost-n-2.png"
					[/frame]
				[/else]
			[/defend]
			[standing_anim]
				alpha="0.8~0.4:1400,0.4~0.6:600,0.6~0.4:600,0.4~0.8:1400"
				direction="s,se,sw"
				start_time="0"
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-s-3.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				alpha="0.8~0.4:1400,0.4~0.6:600,0.6~0.4:600,0.4~0.8:1400"
				direction="n,ne,nw"
				start_time="0"
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-3.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-1.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-2.png"
				[/frame]
				[frame]
					duration="250"
					image="units/undead/ghost-n-3.png"
				[/frame]
			[/standing_anim]
			[defense]
				castle="50"
				cave="50"
				deep_water="50"
				flat="50"
				forest="50"
				frozen="50"
				fungus="50"
				hills="50"
				impassable="50"
				mountains="50"
				reef="50"
				sand="50"
				shallow_water="50"
				swamp_water="50"
				unwalkable="50"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="2"
				flat="1"
				forest="1"
				frozen="1"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="1"
				reef="2"
				sand="1"
				shallow_water="2"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="110"
				blade="50"
				cold="30"
				fire="90"
				impact="50"
				pierce="50"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
				not_living="yes"
			[/status]
			[attack]
				damage="4"
				description=_ "touch"
				icon="attacks/touch-undead.png"
				name="touch"
				number="3"
				range="melee"
				type="arcane"
				[specials]
					[drains]
#textdomain wesnoth
						description=_ "Drain:
This unit drains health from living units, healing itself for half the amount of damage it deals (rounded down)."
						id="drains"
						name=_ "drains"
					[/drains]
				[/specials]
			[/attack]
			[attack]
				damage="3"
#textdomain wesnoth-units
				description=_ "wail"
				name="wail"
				number="3"
				range="ranged"
				type="cold"
			[/attack]
			[modifications]
				[trait]
					availability="musthave"
#textdomain wesnoth
					description=_ "Immune to drain, poison and plague"
					female_name=_ "female^undead"
					id="undead"
					male_name=_ "undead"
					name=_ "undead"
					[effect]
						add="not_living"
						apply_to="status"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Dark Sorcerer"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="16"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="3"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="27"
			id="Dark Adept-16"
			ignore_race_traits="yes"
			image="units/undead-necromancers/adept+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Dark Adept"
			level="1"
			max_attacks="1"
			max_experience="27"
			max_hitpoints="27"
			max_moves="6"
			movement="5"
			movement_type="smallfoot"
			moves="6"
			name="Raeryangwen"
			profile="portraits/humans/dark-adept+female.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Dark Adept"
			underlying_id="16"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					range="ranged"
				[/filter_attack]
				[missile_frame]
					begin="-50"
					end="150"
					image="projectiles/darkmissile-n.png"
					image_diagonal="projectiles/darkmissile-ne.png"
				[/missile_frame]
				[frame]
					begin="-450"
					end="-420"
					image="units/undead-necromancers/adept+female.png"
				[/frame]
				[frame]
					begin="-420"
					end="-395"
					image="units/undead-necromancers/adept+female-magic-1.png"
				[/frame]
				[frame]
					begin="-395"
					end="-320"
					image="units/undead-necromancers/adept+female-magic-2.png"
				[/frame]
				[frame]
					begin="-320"
					end="-300"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-300"
					end="-250"
					halo="halo/undead/dark-magic-1.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-250"
					end="-200"
					halo="halo/undead/dark-magic-2.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-200"
					end="-150"
					halo="halo/undead/dark-magic-3.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-150"
					end="-100"
					halo="halo/undead/dark-magic-4.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-100"
					end="-50"
					halo="halo/undead/dark-magic-5.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[if]
					hits="no"
					[frame]
						begin="-50"
						end="0"
						halo="halo/undead/dark-magic-6.png"
						halo_x="0"
						halo_y="-12"
						image="units/undead-necromancers/adept+female-magic-3.png"
						sound="magic-dark-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-50"
						end="0"
						halo="halo/undead/dark-magic-6.png"
						halo_x="0"
						halo_y="-12"
						image="units/undead-necromancers/adept+female-magic-3.png"
						sound="magic-dark.ogg"
					[/frame]
				[/else]
				[frame]
					begin="0"
					end="50"
					image="units/undead-necromancers/adept+female-magic-2.png"
				[/frame]
				[frame]
					begin="50"
					end="90"
					image="units/undead-necromancers/adept+female-magic-1.png"
				[/frame]
				[frame]
					begin="90"
					end="100"
					image="units/undead-necromancers/adept+female.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/undead-necromancers/adept-die1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-necromancers/adept-die2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-necromancers/adept-die3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-necromancers/adept-die4.png"
				[/frame]
				[frame]
					begin="400"
					end="520"
					image="units/undead-necromancers/adept-die5.png"
				[/frame]
				[frame]
					begin="520"
					end="640"
					image="units/undead-necromancers/adept-die6.png"
				[/frame]
				[frame]
					begin="640"
					end="780"
					image="units/undead-necromancers/adept-die7.png"
				[/frame]
				[frame]
					begin="780"
					end="900"
					image="units/undead-necromancers/adept-die8.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/undead-necromancers/adept+female-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-necromancers/adept+female-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead-necromancers/adept+female-defend-2.png"
						sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead-necromancers/adept+female-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead-necromancers/adept+female-defend-1.png"
				[/frame]
			[/defend]
			[portrait]
				image="portraits/humans/transparent/dark-adept+female.png"
				mirror="true"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/dark-adept+female.png"
				mirror="false"
				side="right"
				size="400"
			[/portrait]
			[trait]
#textdomain wesnoth
				female_name=_ "female^quick"
				id="quick"
				male_name=_ "quick"
				[effect]
					apply_to="movement"
					increase="1"
				[/effect]
				[effect]
					apply_to="hitpoints"
					increase_total="-5%"
				[/effect]
			[/trait]
			[trait]
				female_name=_ "female^intelligent"
				id="intelligent"
				male_name=_ "intelligent"
				[effect]
					apply_to="max_experience"
					increase="-20%"
				[/effect]
			[/trait]
			[trait]
				female_name=_ "female^resilient"
				id="resilient"
				male_name=_ "resilient"
				[effect]
					apply_to="hitpoints"
					increase_total="4"
				[/effect]
				[effect]
					apply_to="hitpoints"
					increase_total="1"
					times="per level"
				[/effect]
			[/trait]
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="50"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="3"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="10"
#textdomain wesnoth-units
				description=_ "chill wave"
				icon="attacks/iceball.png"
				name="chill wave"
				number="2"
				range="ranged"
				type="cold"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[attack]
				damage="7"
#textdomain wesnoth-units
				description=_ "shadow wave"
				icon="attacks/dark-missile.png"
				name="shadow wave"
				number="2"
				range="ranged"
				type="arcane"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "female^quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "female^intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Dark Sorcerer"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="16"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="33"
			id="Dark Adept-18"
			ignore_race_traits="yes"
			image="units/undead-necromancers/adept+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Dark Adept"
			level="1"
			max_attacks="1"
			max_experience="27"
			max_hitpoints="33"
			max_moves="5"
			movement="5"
			movement_type="smallfoot"
			moves="5"
			name="Cinoic"
			profile="portraits/humans/dark-adept+female.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Dark Adept"
			underlying_id="18"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					range="ranged"
				[/filter_attack]
				[missile_frame]
					begin="-50"
					end="150"
					image="projectiles/darkmissile-n.png"
					image_diagonal="projectiles/darkmissile-ne.png"
				[/missile_frame]
				[frame]
					begin="-450"
					end="-420"
					image="units/undead-necromancers/adept+female.png"
				[/frame]
				[frame]
					begin="-420"
					end="-395"
					image="units/undead-necromancers/adept+female-magic-1.png"
				[/frame]
				[frame]
					begin="-395"
					end="-320"
					image="units/undead-necromancers/adept+female-magic-2.png"
				[/frame]
				[frame]
					begin="-320"
					end="-300"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-300"
					end="-250"
					halo="halo/undead/dark-magic-1.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-250"
					end="-200"
					halo="halo/undead/dark-magic-2.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-200"
					end="-150"
					halo="halo/undead/dark-magic-3.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-150"
					end="-100"
					halo="halo/undead/dark-magic-4.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[frame]
					begin="-100"
					end="-50"
					halo="halo/undead/dark-magic-5.png"
					halo_x="0"
					halo_y="-12"
					image="units/undead-necromancers/adept+female-magic-3.png"
				[/frame]
				[if]
					hits="no"
					[frame]
						begin="-50"
						end="0"
						halo="halo/undead/dark-magic-6.png"
						halo_x="0"
						halo_y="-12"
						image="units/undead-necromancers/adept+female-magic-3.png"
						sound="magic-dark-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-50"
						end="0"
						halo="halo/undead/dark-magic-6.png"
						halo_x="0"
						halo_y="-12"
						image="units/undead-necromancers/adept+female-magic-3.png"
						sound="magic-dark.ogg"
					[/frame]
				[/else]
				[frame]
					begin="0"
					end="50"
					image="units/undead-necromancers/adept+female-magic-2.png"
				[/frame]
				[frame]
					begin="50"
					end="90"
					image="units/undead-necromancers/adept+female-magic-1.png"
				[/frame]
				[frame]
					begin="90"
					end="100"
					image="units/undead-necromancers/adept+female.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/undead-necromancers/adept-die1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/undead-necromancers/adept-die2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/undead-necromancers/adept-die3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/undead-necromancers/adept-die4.png"
				[/frame]
				[frame]
					begin="400"
					end="520"
					image="units/undead-necromancers/adept-die5.png"
				[/frame]
				[frame]
					begin="520"
					end="640"
					image="units/undead-necromancers/adept-die6.png"
				[/frame]
				[frame]
					begin="640"
					end="780"
					image="units/undead-necromancers/adept-die7.png"
				[/frame]
				[frame]
					begin="780"
					end="900"
					image="units/undead-necromancers/adept-die8.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/undead-necromancers/adept+female-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/undead-necromancers/adept+female-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/undead-necromancers/adept+female-defend-2.png"
						sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/undead-necromancers/adept+female-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/undead-necromancers/adept+female-defend-1.png"
				[/frame]
			[/defend]
			[portrait]
				image="portraits/humans/transparent/dark-adept+female.png"
				mirror="true"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/dark-adept+female.png"
				mirror="false"
				side="right"
				size="400"
			[/portrait]
			[trait]
#textdomain wesnoth
				female_name=_ "female^quick"
				id="quick"
				male_name=_ "quick"
				[effect]
					apply_to="movement"
					increase="1"
				[/effect]
				[effect]
					apply_to="hitpoints"
					increase_total="-5%"
				[/effect]
			[/trait]
			[trait]
				female_name=_ "female^intelligent"
				id="intelligent"
				male_name=_ "intelligent"
				[effect]
					apply_to="max_experience"
					increase="-20%"
				[/effect]
			[/trait]
			[trait]
				female_name=_ "female^resilient"
				id="resilient"
				male_name=_ "resilient"
				[effect]
					apply_to="hitpoints"
					increase_total="4"
				[/effect]
				[effect]
					apply_to="hitpoints"
					increase_total="1"
					times="per level"
				[/effect]
			[/trait]
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="50"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="3"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="10"
#textdomain wesnoth-units
				description=_ "chill wave"
				icon="attacks/iceball.png"
				name="chill wave"
				number="2"
				range="ranged"
				type="cold"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[attack]
				damage="7"
#textdomain wesnoth-units
				description=_ "shadow wave"
				icon="attacks/dark-missile.png"
				name="shadow wave"
				number="2"
				range="ranged"
				type="arcane"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "female^resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "female^intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
	[/player]
	[player]
		can_recruit="Dwarvish Fighter,Dwarvish Guardsman,Dwarvish Thunderer,Dwarvish Ulfserker,Footpad,Gryphon Rider,Poacher,Thief"
		gold="-1"
		gold_add="no"
		name="KnightKunibert"
		save_id="KnightKunibert2"
		[unit]
			advances_to="Dwarvish Lord"
			alignment="neutral"
			allow_changes="yes"
			allow_player="yes"
			alpha="256"
			attacks_left="1"
			canrecruit="yes"
			colour="2"
			controller="human"
			cost="32"
			current_player="KnightKunibert"
			die_sound="dwarf-die-1.ogg,dwarf-die-2.ogg"
			experience="0"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			fog="yes"
			gender="male"
			gold="100"
			goto_x="-999"
			goto_y="-999"
			hitpoints="56"
			id="KnightKunibert2"
			image="units/dwarves/steelclad.png"
			income="0"
#textdomain wesnoth-units
			language_name=_ "Dwarvish Steelclad"
			leader="Dwarvish Steelclad,Dwarvish Thunderguard,Dwarvish Stalwart,Rogue,Trapper"
			level="2"
			max_attacks="1"
			max_experience="52"
			max_hitpoints="56"
			max_moves="5"
			movement="4"
			movement_type="dwarvishfoot"
			moves="5"
			mp_countdown="yes"
			mp_countdown_action_bonus="20"
			mp_countdown_init_time="270"
			mp_countdown_reservoir_time="270"
			mp_countdown_turn_bonus="200"
			name="KnightKunibert"
			profile="portraits/dwarves/fighter.png"
			race="dwarf"
			random_leader="Dwarvish Steelclad,Dwarvish Thunderguard,Rogue,Trapper"
			random_traits="no"
			recruit="Dwarvish Guardsman,Dwarvish Fighter,Dwarvish Ulfserker,Dwarvish Thunderer,Thief,Poacher,Footpad,Gryphon Rider"
			resting="yes"
			save_id="KnightKunibert2"
			share_maps="no"
			share_view="yes"
			shroud="no"
			side="2"
			team_name="east"
			terrain_liked="Hh, Ha, Mm"
			type="Dwarvish Steelclad"
			undead_variation="dwarf"
			underlying_id="2"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			user_team_name="wesnoth-multiplayerteamname^East"
			village_gold="2"
			zoc="yes"
			[portrait]
				image="portraits/dwarves/transparent/fighter.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/dwarves/transparent/fighter.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="50"
				deep_water="80"
				flat="70"
				forest="70"
				frozen="70"
				fungus="60"
				hills="40"
				impassable="50"
				mountains="30"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="99"
				flat="1"
				forest="1"
				frozen="2"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="1"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="90"
				blade="70"
				cold="90"
				fire="90"
				impact="70"
				pierce="70"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="11"
				description=_ "battle axe"
				icon="attacks/battleaxe.png"
				name="battle axe"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="14"
				description=_ "hammer"
				icon="attacks/hammer-dwarven.png"
				name="hammer"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="13"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="23"
			id="Thief-9"
			image="units/human-outlaws/thief.png"
#textdomain wesnoth-units
			language_name=_ "Thief"
			level="1"
			max_attacks="1"
			max_experience="15"
			max_hitpoints="23"
			max_moves="7"
			movement="6"
			movement_type="elusivefoot"
			moves="7"
			name="Ronry"
			profile="portraits/humans/thief.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Thief"
			underlying_id="9"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-outlaws/thief.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/attack_anim]
			[death]
				start_time="0"
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-7.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-2-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-3-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
					sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="4"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="3"
				range="melee"
				type="blade"
				[specials]
					[damage]
						active_on="offense"
						backstab="yes"
#textdomain wesnoth
						description=_ "Backstab:
When used offensively, this attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (turned to stone or otherwise paralyzed)."
						id="backstab"
						multiply="2"
						name=_ "backstab"
					[/damage]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="31"
			id="Footpad-10"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="31"
			max_moves="7"
			movement="7"
			movement_type="elusivefoot"
			moves="7"
			name="Cyr"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Footpad"
			underlying_id="10"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="6"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="13"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="8"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="25"
			id="Thief-11"
			image="units/human-outlaws/thief.png"
#textdomain wesnoth-units
			language_name=_ "Thief"
			level="1"
			max_attacks="1"
			max_experience="15"
			max_hitpoints="25"
			max_moves="6"
			movement="6"
			movement_type="elusivefoot"
			moves="6"
			name="Lec"
			profile="portraits/humans/thief.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Thief"
			underlying_id="11"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-outlaws/thief.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/attack_anim]
			[death]
				start_time="0"
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-7.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-2-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-3-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
					sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="3"
				range="melee"
				type="blade"
				[specials]
					[damage]
						active_on="offense"
						backstab="yes"
#textdomain wesnoth
						description=_ "Backstab:
When used offensively, this attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (turned to stone or otherwise paralyzed)."
						id="backstab"
						multiply="2"
						name=_ "backstab"
					[/damage]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Fugitive"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="28"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="5"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="43"
			id="Footpad-13"
			image="units/human-outlaws/outlaw+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Outlaw"
			level="2"
			max_attacks="1"
			max_experience="43"
			max_hitpoints="43"
			max_moves="7"
			movement="7"
			movement_type="elusivefoot"
			moves="7"
			name="Ysylla"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Outlaw"
			underlying_id="13"
			unrenamable="no"
			upkeep="full"
			usage="mixed fighter"
			zoc="yes"
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/outlaw+female-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/outlaw+female-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/outlaw+female-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="mace"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/outlaw+female-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="50"
						image="units/human-outlaws/outlaw+female-melee-2.png"
						sound="mace.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="50"
						image="units/human-outlaws/outlaw+female-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="50"
					end="150"
					image="units/human-outlaws/outlaw+female-melee-3.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/outlaw+female.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/outlaw+female-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/outlaw+female-defend.png"
						sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/outlaw+female-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/outlaw+female.png"
				[/frame]
			[/defend]
			[idle_anim]
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					begin="0"
					end="100"
					image="units/human-outlaws/outlaw-idle-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/outlaw-idle-7.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/outlaw-idle-5.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/human-outlaws/outlaw-idle-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/human-outlaws/outlaw-idle-3.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/human-outlaws/outlaw-idle-2.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/human-outlaws/outlaw-idle-1.png"
				[/frame]
				[frame]
					begin="700"
					end="800"
					image="units/human-outlaws/outlaw-idle-6.png"
				[/frame]
				[frame]
					begin="800"
					end="900"
					image="units/human-outlaws/outlaw-idle-5.png"
				[/frame]
				[frame]
					begin="900"
					end="1400"
					image="units/human-outlaws/outlaw-idle-4.png"
				[/frame]
				[frame]
					begin="1400"
					end="1500"
					image="units/human-outlaws/outlaw-idle-3.png"
				[/frame]
				[frame]
					begin="1500"
					end="1600"
					image="units/human-outlaws/outlaw-idle-2.png"
				[/frame]
				[frame]
					begin="1600"
					end="1700"
					image="units/human-outlaws/outlaw-idle-1.png"
				[/frame]
			[/idle_anim]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="9"
				description=_ "mace"
				name="mace"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="6"
				description=_ "sling"
				name="sling"
				number="3"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "female^strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "female^intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="3"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="29"
			id="Footpad-15"
			image="units/human-outlaws/footpad+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="29"
			max_moves="8"
			movement="7"
			movement_type="elusivefoot"
			moves="8"
			name="Cla"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Footpad"
			underlying_id="15"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad+female-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad+female-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad+female-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad+female.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad+female-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad+female-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad+female-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad+female-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad+female-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad+female.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad+female-defend.png"
						sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad+female-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad+female.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad+female-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad+female-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "female^quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "female^intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="sw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="36"
			id="Footpad-17"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="25"
			max_hitpoints="36"
			max_moves="7"
			movement="7"
			movement_type="elusivefoot"
			moves="7"
			name="Caryn"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Footpad"
			underlying_id="17"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="6"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="2"
			facing="s"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="29"
			id="Footpad-19"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="29"
			max_moves="8"
			movement="7"
			movement_type="elusivefoot"
			moves="8"
			name="Saregwyn"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Footpad"
			underlying_id="19"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="29"
			id="Footpad-20"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="29"
			max_moves="8"
			movement="7"
			movement_type="elusivefoot"
			moves="8"
			name="Gwurcyn"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Footpad"
			underlying_id="20"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
	[/player]
[/snapshot]
[replay_start]
	current_tod="0"
#textdomain wesnoth-multiplayer
	description=_ "Players must traverse all manner of terrain in pursuit of victory on this multi-fronted duel map."
	experience_modifier="70"
	hash="cy9,5.FpN3rBcL.L4e+O18wLdEdI4Tz0IvgfbwAuK9N2059<42Xr0yhIQSuhssS,4T<A9.6ab>JpBPvMvrcHSQVHi2E+1XTwfH7D.FR+I29N,oCK6dipd3xe.OJ>Piko"
	id="multiplayer_Silverhead_Crossing"
	map_data="border_size=1
usage=map

Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Ww          , Ww          , Wo          , Ww          , Ww          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          
Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Ww          , Wo          , Ww          , Ww          , Ww          , Ww          , Uh          , Xu          , Xu          , Ww          , Hh          , Wo          , Ww          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          
Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Ww          , Ww          , Ww          , Gs^Fp       , Ww          , Xu          , Xu          , Gs^Fp       , Uu^Uf       , Uh          , Gs^Fp       , Mm          , Gg^Fet      , Ww          , Ww          , Ww          , Ww          , Ww          , Wo          , Ww          , Wo          , Wo          
Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Ww          , Ww          , Hh          , Gg          , Gg          , Gg          , Gg          , Uh          , Gg          , Gg          , Gg          , Ggf         , Gg          , Gg          , Gg          , Gs^Fp       , Hh          , Mm          , Gs^Fms      , Ww          , Ww          , Wo          , Wo          
Wo          , Wo          , Wo          , Wo          , Ww          , Wo          , Ww          , Mm          , Gs^Fms      , Gg^Ve       , Gg          , Gg          , Wwf         , Wwf         , Wwf         , Wo          , Wwf         , Gg          , Gg          , Gg          , Rr          , Gg^Vc       , Gg          , Wwf         , Chw         , Hh          , Gs^Fp       , Ww          , Wo          
Wo          , Wo          , Wo          , Wo          , Ww          , Ww          , Gg          , Wwf         , Wwf         , Wwf         , Wwf         , Wwf         , Gg          , Gs^Fp       , Xu          , Wwf         , Xu          , Wwf         , Wwf         , Gg          , Wwf         , Wwf         , Wwf         , Chw         , Rr          , Rr          , Wwf         , Ww          , Wo          
Wo          , Wo          , Wo          , Ww          , Ww          , Gs^Fp       , Rd          , Chw         , Kh          , Ch          , Gg          , Gg          , Rd          , Rd^Uf       , Uh          , Xu          , Xu          , Rd^Uf       , Xu          , Wwf         , Wwf         , Gg          , Gg          , Hh          , Hh          , Wwf         , Ww          , Ww          , Xu          
Wo          , Wo          , Wo          , Wo          , Gg          , Ggf         , Hh          , Mm          , Wwf         , Chw         , Rd          , Uu^Vud      , Uu          , Ur          , Uu^Uf       , Ur          , Gs^Fp       , Xu          , Rd          , Gg          , Wwf         , Gg          , Gg          , Gg^Ve       , Gg^Fet      , Wwf         , Gs^Fp       , Ww          , Xu          
Wo          , Wo          , Ww          , Ww          , Ww          , Gg^Ve       , Wwf         , Gg^Fet      , Wwf         , Ggf         , Xu          , Uu          , Xu          , Uu^Uf       , Wwf         , Uh          , Xu          , Rd          , Gg          , Gg^Ve       , Kh          , Wwf         , Gg          , Gg          , Xu          , Wwf         , Wwf         , Xu          , Xu          
Wo          , Wo          , Ww          , Ww          , Gg          , Wwf         , Gg          , Wwf         , Xu          , Xu          , Gg          , Xu          , Gg          , Gg          , Ww          , Gg          , Gg          , Xu          , Gg          , Gg          , Ww          , Chw         , Ch          , Gg          , Xu          , Xu          , Uh          , Xu          , Xu          
Ww          , Ww          , Ww          , Gg          , Gg          , Gs^Fds      , Gg          , Rd          , Gg          , Gg          , Gg^Vc       , Gg          , Gs^Fms      , Ww          , Wo          , Ww          , Ww          , Gg          , Wwf         , Wwf         , Gg          , Ww          , Kh          , Gg          , Rd          , Gs^Fp       , Rd          , Xu          , Xu          
Ww          , Ww          , Gg          , Gg          , 1 Kh        , Gg          , Rd          , Rd          , Mm          , Gs^Fp       , Gg          , Gg          , Gg          , Ww          , Wo          , Wo          , Ww          , Wwf         , Kh          , Gs^Fms      , Ggf         , Gg          , Gg          , Gg          , Hh          , Rd          , Gg          , Xu          , Xu          
Ww          , Ww          , Ggf         , Gg          , Ch          , Ch          , Ggf         , Gg          , Gg          , Hh          , Gg          , Gs^Fp       , Ww          , Ww          , Ww          , Ww          , Wwf         , Ss^Vhs      , Kh          , Gg          , Hh          , Gs^Fds      , Gg          , Mm          , Gg          , Gg          , Ww          , Gg          , Gg          
Ww          , Gg          , Gg          , Rd          , Ch          , Ch          , Gg          , Gg          , Gg          , Gg          , Hh          , Ww          , Wwf         , Wwf         , Rr          , Rr          , Chw         , Chw         , Wwf         , Gg          , Gg          , Gg          , Wwf         , Gg          , Wwf         , Gs^Fp       , Ww          , Ww          , Ww          
Ww          , Wwf         , Wwf         , Wwf         , Wwf         , Ch          , Kh          , Wwf         , Wwf         , Gg          , Wwf         , Wwf         , Chw         , Wwf         , Rr          , Wwf         , Wwf         , Wwf         , Gs^Fp       , Wwf         , Wwf         , Wwf         , 2 Kud       , Wwf         , Gg          , Wwf         , Ww          , Wo          , Wo          
Gs^Fds      , Gs^Fms      , Hh          , Gg          , Gg          , Wwf         , Wwf         , Wwf         , Gg          , Wwf         , Kh          , Chw         , Wwf         , Rr          , Mm          , Wwf         , Ww          , Ww          , Gg          , Gg          , Hh          , Gg          , Gg          , Cud         , Cud         , Gg          , Gg          , Ww          , Xu          
Rd          , Rd          , Rd          , Gg          , Rd          , Gg          , Gs^Fp       , Mm          , Hh          , Gg          , Kh          , Ss^Vhs      , Ww          , Ww          , Wo          , Ww          , Ww          , Ww          , Gg          , Gg          , Gg          , Mm          , Gg          , Kud         , Cud         , Rd          , Gg          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Rd          , Rd          , Rd          , Rd          , Gg          , Gg          , Wwf         , Wwf         , Ww          , Ww          , Ww          , Ww          , Ww          , Gs^Fms      , Ggf         , Gg^Ve       , Gs^Fds      , Gg          , Cud         , Cud         , Gg          , Rd          , Xu          , Xu          , Xu          
Xu          , Xu          , Uu^Uf       , Uu^Uf       , Uh          , Gg          , Kud         , Gg          , Wwf         , Wwf         , Xu          , Ww          , Hh          , Gs^Fp       , Gs^Fp       , Hh          , Ww          , Gg          , Hh          , Hh          , Xu          , Rd          , Rd          , Gg          , Rd          , Rd          , Gg          , Uu^Uf       , Uu^Uf       
Xu          , Xu          , Cud         , Wwf         , Xu          , Xu          , Wwf         , Cud         , Kud         , Xu          , Xu          , Xu          , Xu          , Cud         , Xu          , Cud         , Xu          , Xu          , Xu          , Xu          , Gs^Fp       , Gg          , Rd          , Rd          , Gg          , Gg          , Gs^Fp       , Xu          , Xu          
Xu          , Xu          , Cud         , Wwf         , Wwf         , Ww          , Gg          , Cud         , Rd          , Rd          , Uu^Vu       , Ur          , Uu^Uf       , Wwf^Uf      , Xu          , Wwf^Uf      , Uu^Uf       , Ur          , Uu^Vu       , Rd          , Rd          , Gg          , Rd          , Gg          , Uu^Vud      , Uu^Uf       , Cud         , Xu          , Xu          
Wwf         , Wwf         , Wwf         , Wwf         , Gs^Fp       , Gg^Vc       , Rd          , Rd          , Xu          , Ur          , Ur          , Uh          , Uh          , Wwf         , Wwf         , Wwf         , Uh          , Uh          , Ur          , Ur          , Xu          , Rd          , Gg          , Gg          , Gg          , Ur          , Cud         , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Gg          , Ggf         , Mm          , Rd          , Rd          , Xu          , Rd          , Xu          , Wwf         , Wwf         , Ggf         , Wwf         , Wwf         , Xu          , Rd          , Xu          , Rd          , Rd          , Kud         , Gg          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Hh          , Gs^Fp       , Gg          , Gg          , Rd          , Gg          , Gg          , Wwf         , Mm          , Gs^Fp       , Hh          , Gg          , Wwf         , Gg          , Rd          , Gg          , Cud         , Cud         , Cud         , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Rd^Uf       , Gg          , Gs^Fms      , Gg^Ve       , Gg          , Wwf         , Gg          , Gg          , Gg          , Gs^Fms      , Gg          , Wwf         , Gg          , Gg^Ve       , Gs^Fds      , Rd          , Rd^Uf       , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ur          , Xu          , Xu          , Ggf         , Gg          , Wwf         , Gg          , Hh          , Gg          , Mm          , Hh          , Wwf         , Wwf         , Ggf         , Xu          , Xu          , Ur          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ur          , Xu          , Rr          , Xu          , Wwf         , Wwf         , Gs^Fp       , Gg          , Xu          , Gg          , Gg          , Gg          , Wwf         , Xu          , Xu          , Ur          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Rr          , Wwf         , Chw         , Wwf         , Rr          , Ur          , Xu          , Uu^Uf       , Xu          , Ur          , Gs^Fp       , Rr          , Wwf         , Wwf         , Chw         , Wwf         , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Wwf         , Xu          , Xu          , Rr          , Rr          , Wwf         , Uh          , Wwf         , Uu^Uf       , Wwf         , Rr          , Rr          , Rr          , Rr          , Wwf         , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Wo          , Wwf         , Ur          , Wwf         , Wo          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Uh          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
"
	mp_countdown="yes"
	mp_countdown_action_bonus="20"
	mp_countdown_init_time="270"
	mp_countdown_reservoir_time="270"
	mp_countdown_turn_bonus="200"
	mp_fog="yes"
	mp_shroud="no"
	mp_use_map_settings="yes"
	mp_village_gold="2"
	name=_ "2p - Silverhead Crossing"
	next_underlying_unit_id="0"
#textdomain wesnoth
	objectives=_ "Victory:
@Defeat enemy leader(s)"
	observer="yes"
	random_seed="1639591933"
	random_start_time="no"
	scenario="Ladder KnightKunibert"
	turns="-1"
	version="1.6"
	[time]
		green="-20"
		id="dawn"
		image="misc/schedule-dawn.png"
		name=_ "Dawn"
		red="-20"
		sound="ambient/morning.ogg"
	[/time]
	[time]
		id="morning"
		image="misc/schedule-morning.png"
		lawful_bonus="25"
		name=_ "Morning"
	[/time]
	[time]
		id="afternoon"
		image="misc/schedule-afternoon.png"
		lawful_bonus="25"
		name=_ "Afternoon"
	[/time]
	[time]
		blue="-20"
		green="-20"
		id="dusk"
		image="misc/schedule-dusk.png"
		name=_ "Dusk"
		sound="ambient/night.ogg"
	[/time]
	[time]
		blue="-10"
		green="-40"
		id="first_watch"
		image="misc/schedule-firstwatch.png"
		lawful_bonus="-25"
		name=_ "First Watch"
		red="-40"
	[/time]
	[time]
		blue="-10"
		green="-40"
		id="second_watch"
		image="misc/schedule-secondwatch.png"
		lawful_bonus="-25"
		name=_ "Second Watch"
		red="-40"
	[/time]
	[music]
		ms_before="12000"
		name="knolls.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="wanderer.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="battle.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="transience.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="the_king_is_dead.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="knalgan_theme.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="the_city_falls.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="nunc_dimittis.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="revelation.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="loyalists.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="breaking_the_chains.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="elvish-theme.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="legends_of_the_north.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="traveling_minstrels.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="underground.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="vengeful.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="frantic.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="the_dangerous_symphony.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="heroes_rite.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="suspense.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="the_deep_path.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="siege_of_laurelmor.ogg"
	[/music]
	[event]
		name="prestart"
		[music]
			ms_before="12000"
			name="knolls.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="wanderer.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="battle.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="transience.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="revelation.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="loyalists.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="the_king_is_dead.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="knalgan_theme.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="the_city_falls.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="nunc_dimittis.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="breaking_the_chains.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="elvish-theme.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="legends_of_the_north.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="traveling_minstrels.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="underground.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="vengeful.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="frantic.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="the_dangerous_symphony.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="heroes_rite.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="suspense.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="the_deep_path.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="siege_of_laurelmor.ogg"
		[/music]
	[/event]
	[era]
		id="era_default"
#textdomain wesnoth-multiplayer
		name=_ "Default"
		[multiplayer_side]
			flag_rgb="magenta"
			id="Random"
			image="units/random-dice.png"
			name=_ "Random"
			random_faction="yes"
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Loyalists"
			image="units/human-loyalists/lieutenant.png"
			leader="Lieutenant,Swordsman,Pikeman,Javelineer,Shock Trooper,Longbowman,White Mage,Red Mage"
			name=_ "Loyalists"
			random_leader="Lieutenant,Swordsman,Pikeman,Javelineer,Longbowman,Red Mage"
			recruit="Cavalryman,Horseman,Spearman,Fencer,Heavy Infantryman,Bowman,Mage,Merman Fighter"
			terrain_liked="Gg, Ww, Wo"
			type="Lieutenant"
			[ai]
				recruitment_pattern="fighter,fighter,fighter,archer,mixed fighter,scout"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Rebels"
			image="units/elves-wood/captain.png"
			leader="Elvish Captain,Elvish Hero,Elvish Ranger,Elvish Marksman,Elvish Druid,Elvish Sorceress,White Mage,Red Mage,Elder Wose"
			name=_ "Rebels"
			random_leader="Elvish Captain,Elvish Hero,Elvish Ranger,Elvish Marksman,Elvish Druid,Elvish Sorceress,Red Mage"
			recruit="Elvish Fighter,Elvish Archer,Mage,Elvish Shaman,Elvish Scout,Wose,Merman Hunter"
			terrain_liked="Ff, Fa, Ss, Ww"
			type="Elvish Captain"
			[ai]
				recruitment_pattern="fighter,fighter,archer,archer,mixed fighter,healer,scout"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Northerners"
			image="units/orcs/warrior.png"
			leader="Orcish Warrior,Troll,Troll Rocklobber,Orcish Crossbowman,Orcish Slayer"
			name=_ "Northerners"
			recruit="Orcish Grunt,Troll Whelp,Wolf Rider,Orcish Archer,Orcish Assassin,Naga Fighter,Goblin Spearman"
			terrain_liked="Hh, Ha, Mm, Ss"
			type="Orcish Warrior"
			[ai]
				recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Undead"
			image="units/undead-necromancers/dark-sorcerer.png"
			leader="Dark Sorcerer,Revenant,Deathblade,Bone Shooter,Necrophage"
			name=_ "Undead"
			random_leader="Dark Sorcerer,Revenant,Deathblade,Bone Shooter"
			recruit="Skeleton,Skeleton Archer,Walking Corpse,Ghost,Vampire Bat,Dark Adept,Ghoul"
			terrain_liked="Ss, Hh, Ha, Ww"
			type="Dark Sorcerer"
			[ai]
				recruitment_pattern="fighter,fighter,archer,fighter,scout,archer"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Knalgan Alliance"
			image="units/dwarves/steelclad.png"
			leader="Dwarvish Steelclad,Dwarvish Thunderguard,Dwarvish Stalwart,Rogue,Trapper"
			name=_ "Knalgan Alliance"
			random_leader="Dwarvish Steelclad,Dwarvish Thunderguard,Rogue,Trapper"
			recruit="Dwarvish Guardsman,Dwarvish Fighter,Dwarvish Ulfserker,Dwarvish Thunderer,Thief,Poacher,Footpad,Gryphon Rider"
			terrain_liked="Hh, Ha, Mm"
			type="Dwarvish Steelclad"
			[ai]
				recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Drakes"
			image="units/drakes/flare.png"
			leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior,Saurian Oracle,Saurian Soothsayer"
			name=_ "Drakes"
			random_leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior"
			recruit="Drake Burner,Drake Clasher,Drake Glider,Drake Fighter,Saurian Skirmisher,Saurian Augur"
			terrain_liked="Hh, Ha, Ds, Ss"
			type="Drake Flare"
			[ai]
				recruitment_pattern="fighter,fighter,archer,healer,scout,scout"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[event]
			name="prestart"
			[store_unit]
				kill="yes"
				variable="leaders_to_make_quick"
				[filter]
					canrecruit="yes"
					[filter_wml]
						max_moves="4"
					[/filter_wml]
				[/filter]
			[/store_unit]
			[set_variable]
				name="i"
				value="0"
			[/set_variable]
			[while]
				[variable]
					less_than="$leaders_to_make_quick.length"
					name="i"
				[/variable]
				[do]
					[set_variables]
						mode="merge"
						name="leaders_to_make_quick[$i].modifications"
						[literal]
							[trait]
#textdomain wesnoth
								female_name=_ "female^quick"
								id="quick"
								male_name=_ "quick"
								[effect]
									apply_to="movement"
									increase="1"
								[/effect]
								[effect]
									apply_to="hitpoints"
									increase_total="-5%"
								[/effect]
							[/trait]
						[/literal]
					[/set_variables]
					[clear_variable]
						name="leaders_to_make_quick[$i].max_moves,leaders_to_make_quick[$i].moves,leaders_to_make_quick[$i].max_hitpoints,leaders_to_make_quick[$i].hitpoints"
					[/clear_variable]
					[unstore_unit]
						variable="leaders_to_make_quick[$i]"
					[/unstore_unit]
					[set_variable]
						add="1"
						name="i"
					[/set_variable]
				[/do]
			[/while]
			[clear_variable]
				name="i"
			[/clear_variable]
			[clear_variable]
				name="leaders_to_make_quick"
			[/clear_variable]
		[/event]
	[/era]
	[side]
		allow_changes="yes"
		allow_player="yes"
		canrecruit="yes"
		colour="1"
		controller="network"
		current_player="Condoriano"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="Condoriano1"
		image="units/undead-necromancers/dark-sorcerer.png"
		income="0"
		leader="Dark Sorcerer,Revenant,Deathblade,Bone Shooter,Necrophage"
		mp_countdown="yes"
		mp_countdown_action_bonus="20"
		mp_countdown_init_time="270"
		mp_countdown_reservoir_time="270"
		mp_countdown_turn_bonus="200"
		name="Condoriano"
		random_leader="Dark Sorcerer,Revenant,Deathblade,Bone Shooter"
		recruit="Skeleton,Skeleton Archer,Walking Corpse,Ghost,Vampire Bat,Dark Adept,Ghoul"
		save_id="Condoriano1"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="1"
		team_name="west"
		terrain_liked="Ss, Hh, Ha, Ww"
		type="Deathblade"
		user_team_name="wesnoth-multiplayerteamname^West"
		village_gold="2"
		[ai]
			recruitment_pattern="fighter,fighter,archer,fighter,scout,archer"
			villages_per_scout="8"
			[team_formula]
				rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
			[/team_formula]
		[/ai]
		[ai]
			villages_per_scout="8"
		[/ai]
	[/side]
	[side]
		allow_changes="yes"
		allow_player="yes"
		canrecruit="yes"
		colour="2"
		controller="human"
		current_player="KnightKunibert"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="KnightKunibert2"
		image="units/dwarves/steelclad.png"
		income="0"
		leader="Dwarvish Steelclad,Dwarvish Thunderguard,Dwarvish Stalwart,Rogue,Trapper"
		mp_countdown="yes"
		mp_countdown_action_bonus="20"
		mp_countdown_init_time="270"
		mp_countdown_reservoir_time="270"
		mp_countdown_turn_bonus="200"
		name="KnightKunibert"
		random_leader="Dwarvish Steelclad,Dwarvish Thunderguard,Rogue,Trapper"
		recruit="Dwarvish Guardsman,Dwarvish Fighter,Dwarvish Ulfserker,Dwarvish Thunderer,Thief,Poacher,Footpad,Gryphon Rider"
		save_id="KnightKunibert2"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="2"
		team_name="east"
		terrain_liked="Hh, Ha, Mm"
		type="Dwarvish Steelclad"
		user_team_name="wesnoth-multiplayerteamname^East"
		village_gold="2"
		[ai]
			recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
			villages_per_scout="8"
			[team_formula]
				rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
			[/team_formula]
		[/ai]
		[ai]
			villages_per_scout="8"
		[/ai]
	[/side]
[/replay_start]
[statistics]
	mid_scenario="yes"
	[scenario]
		scenario="2p - Silverhead Crossing"
		[team]
			[recruits]
				Dark Adept="3"
				Ghost="2"
				Skeleton="1"
				Skeleton Archer="1"
				Vampire Bat="1"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
			[/advances]
			[deaths]
				Dark Adept="1"
				Deathblade="1"
				Ghost="1"
			[/deaths]
			[killed]
				Dwarvish Guardsman="1"
				Gryphon Rider="1"
			[/killed]
			[attacks]
				[sequence]
					s000="2"
					s001="1"
					s100="1"
					s101="1"
					s11="1"
					_num="50"
				[/sequence]
				[sequence]
					s00="1"
					s01="1"
					s10="3"
					s11="1"
					_num="70"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="6"
					_num="0"
				[/sequence]
				[sequence]
					s0="1"
					s101="1"
					_num="30"
				[/sequence]
				[sequence]
					s010="1"
					_num="40"
				[/sequence]
			[/defends]
			recruit_cost="130"
			recall_cost="0"
			damage_inflicted="112"
			damage_taken="91"
			expected_damage_inflicted="138667"
			expected_damage_taken="76749"
			turn_damage_inflicted="51"
			turn_damage_taken="48"
			turn_expected_damage_inflicted="70117"
			turn_expected_damage_taken="29188"
			save_id="Condoriano1"
		[/team]
		[team]
			[recruits]
				Dwarvish Guardsman="1"
				Footpad="6"
				Gryphon Rider="1"
				Thief="2"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
				Outlaw="1"
			[/advances]
			[deaths]
				Dwarvish Guardsman="1"
				Gryphon Rider="1"
			[/deaths]
			[killed]
				Dark Adept="1"
				Deathblade="1"
				Ghost="1"
			[/killed]
			[attacks]
				[sequence]
					s00="2"
					s01="1"
					s011="1"
					_num="40"
				[/sequence]
				[sequence]
					s00="1"
					s10="1"
					s11="3"
					_num="50"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="2"
					_num="0"
				[/sequence]
				[sequence]
					s0="2"
					s00="1"
					s001="1"
					s1="2"
					_num="40"
				[/sequence]
				[sequence]
					s010="1"
					s101="1"
					s11="1"
					_num="50"
				[/sequence]
				[sequence]
					s11="1"
					_num="60"
				[/sequence]
			[/defends]
			recruit_cost="153"
			recall_cost="0"
			damage_inflicted="91"
			damage_taken="112"
			expected_damage_inflicted="76749"
			expected_damage_taken="138667"
			turn_damage_inflicted="24"
			turn_damage_taken="0"
			turn_expected_damage_inflicted="15894"
			turn_expected_damage_taken="-2012"
			save_id="KnightKunibert2"
		[/team]
	[/scenario]
[/statistics]
