label="Atly_Onis"
version="1.6"
completion="running"
campaign_type="multiplayer"
difficulty="NORMAL"
random_seed="26859"
random_calls="0"
next_underlying_unit_id="32"
end_text_duration="0"
[variables]
[/variables]
[replay]
	[command]
		[start]
		[/start]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Angel has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="have fun"
			side="2"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="same to you"
			side="1"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="4"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="13716"
		[/random]
		[random]
			value="21628"
		[/random]
		[random]
			value="15248"
		[/random]
		[random]
			value="16028"
		[/random]
		[random]
			value="16782"
		[/random]
		[random]
			value="13732"
		[/random]
		[random]
			value="16142"
		[/random]
		[random]
			value="7296"
		[/random]
		[random]
			value="22284"
		[/random]
		[random]
			value="12015"
		[/random]
		[random]
			value="20507"
		[/random]
		[random]
			value="29642"
		[/random]
		[random]
			value="11800"
		[/random]
		[random]
			value="7759"
		[/random]
		[random]
			value="692"
			[results]
				checksum="FTxBwyUzhyBkwVHKQOq5AMPytSNtRJzMRsDuHBtnQvBFyQAVsL8qJTmQQNRqrWuTuTxCUFMDPxfDLuyOdqNHp2JuaZJrXGikJwc0bkdie+c.P93obZj,mcoh3b,IXl32"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="jagger has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="3"
			x="14"
			y="21"
		[/recruit]
		[random]
			value="31738"
		[/random]
		[random]
			value="26346"
		[/random]
		[random]
			value="14704"
		[/random]
		[random]
			value="13136"
		[/random]
		[random]
			value="12037"
		[/random]
		[random]
			value="1751"
		[/random]
		[random]
			value="18878"
		[/random]
		[random]
			value="24674"
		[/random]
		[random]
			value="795"
		[/random]
		[random]
			value="6388"
		[/random]
		[random]
			value="1931"
		[/random]
		[random]
			value="27858"
		[/random]
		[random]
			value="9610"
		[/random]
		[random]
			value="3751"
		[/random]
		[random]
			value="29364"
			[results]
				checksum="s6dvszkDcAP6z+iACEP7A2muIutTrV-zNi5IwMDsI88+-635<idd<26oh6m2>-p8-0W.oZ8>>6f27lXfla>9Z2A4b82p.au,,a+31>-PXX2S4+>Y,4g93GZ9to8iVxJ<"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="1"
			x="15"
			y="22"
		[/recruit]
		[random]
			value="31077"
		[/random]
		[random]
			value="17146"
		[/random]
		[random]
			value="17329"
		[/random]
		[random]
			value="26391"
		[/random]
		[random]
			value="4723"
		[/random]
		[random]
			value="32040"
		[/random]
		[random]
			value="11867"
		[/random]
		[random]
			value="24509"
		[/random]
		[random]
			value="29140"
		[/random]
		[random]
			value="10569"
		[/random]
		[random]
			value="22642"
		[/random]
		[random]
			value="11853"
		[/random]
		[random]
			value="5862"
		[/random]
		[random]
			value="8716"
		[/random]
		[random]
			value="26486"
			[results]
				checksum="MppsyKA8tq1G+rohkH2DZ9>b7j1h.rkiw1-Fek9X9FajMic5Q3Y959Xncn>g+J0<5+3mY8je7a461,hkEw7d1pgHD0ytJwg>n6zuefoWmmRC,xvlCaM1htCesyhkpNss"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="5"
			x="15"
			y="23"
		[/recruit]
		[random]
			value="12878"
		[/random]
		[random]
			value="30333"
		[/random]
		[random]
			value="15050"
		[/random]
		[random]
			value="18376"
		[/random]
		[random]
			value="11721"
		[/random]
		[random]
			value="17605"
		[/random]
		[random]
			value="5382"
		[/random]
		[random]
			value="21525"
		[/random]
		[random]
			value="31014"
		[/random]
		[random]
			value="20010"
		[/random]
		[random]
			value="427"
		[/random]
		[random]
			value="4590"
		[/random]
		[random]
			value="22915"
		[/random]
		[random]
			value="28573"
		[/random]
		[random]
			value="9455"
			[results]
				checksum="8ax-d6b6xp8sjgga3aP72g3e+iBm.jefmffY-+6<ip3<5-4egW6m2lahna90i9fl5a1hh7oj8-<F-+mkj.91>I6ygXo9WjoolcACZdd9b,<-lvi1OF>N69sv8joLJwSp"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="15,16,17,18,19"
			y="24,23,23,22,22"
		[/move]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="gawe has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="how many instances of Wesnoth can you have running?"
			side="1"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="also: do you do blindfolded parties?"
			side="1"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="this all reminds me of Capablanca or some other chess GrandMaster"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="4"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="pq1pro has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="haha, maybe I'll make that a suggestion"
			side="1"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="a new fork of Wesnoth"
			side="1"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="Blindnoth"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="xxx has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="7"
			x="17"
			y="5"
		[/recruit]
		[random]
			value="3934"
		[/random]
		[random]
			value="19269"
		[/random]
		[random]
			value="22007"
		[/random]
		[random]
			value="20831"
		[/random]
		[random]
			value="18588"
		[/random]
		[random]
			value="12983"
		[/random]
		[random]
			value="8292"
		[/random]
		[random]
			value="16656"
		[/random]
		[random]
			value="6377"
		[/random]
		[random]
			value="16117"
		[/random]
		[random]
			value="29302"
		[/random]
		[random]
			value="7093"
		[/random]
		[random]
			value="30375"
		[/random]
		[random]
			value="15342"
		[/random]
		[random]
			value="6961"
			[results]
				checksum=",Ad3Y5f-Gtmspp5jHbEoRiSrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNLpM8mwoFomIhFlq1.CLW<<ddNv5EsLNHBNzkOI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="yeah, and only playing by the interface sounds"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="two moanings means your spearman has hit twice"
			side="2"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="hehe"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Slug has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="5"
			x="15"
			y="4"
		[/recruit]
		[random]
			value="31384"
		[/random]
		[random]
			value="6088"
		[/random]
		[random]
			value="7492"
		[/random]
		[random]
			value="28376"
		[/random]
		[random]
			value="10350"
		[/random]
		[random]
			value="13161"
		[/random]
		[random]
			value="25392"
		[/random]
		[random]
			value="14820"
		[/random]
		[random]
			value="15138"
		[/random]
		[random]
			value="16649"
		[/random]
		[random]
			value="1379"
		[/random]
		[random]
			value="7508"
		[/random]
		[random]
			value="12529"
		[/random]
		[random]
			value="1147"
		[/random]
		[random]
			value="15536"
			[results]
				checksum="iDp,4nc1oNO1LLyKmJLIEhoF>vyBA6mszOAMDTywuzyODCrTtRLwFwmIsr1QENmxPFHFw.RFKFnqypNKAM8mwoFomIhFlq1.CL-<<ddBfkHDONNHvMSO1I9LGCHpACmL"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="zubran has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="16"
			y="4"
		[/recruit]
		[random]
			value="4142"
		[/random]
		[random]
			value="21259"
		[/random]
		[random]
			value="5972"
		[/random]
		[random]
			value="23884"
		[/random]
		[random]
			value="26271"
		[/random]
		[random]
			value="15839"
		[/random]
		[random]
			value="4000"
		[/random]
		[random]
			value="16460"
		[/random]
		[random]
			value="30507"
		[/random]
		[random]
			value="2004"
		[/random]
		[random]
			value="17975"
		[/random]
		[random]
			value="18792"
		[/random]
		[random]
			value="5755"
		[/random]
		[random]
			value="13889"
		[/random]
		[random]
			value="24868"
			[results]
				checksum="14,Wfc>cu2lH0olW9-5N-m<e6f60hfabkcij<4>i3h3e2.t0a1f<j870h0k565.Y0>ide9Mi80k.d8da021n<.26Z+40CN5c8b.-X,48E.7v3f3XdJFikGGOwGMoVOFH"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="2"
			x="15"
			y="3"
		[/recruit]
		[random]
			value="20696"
		[/random]
		[random]
			value="6652"
		[/random]
		[random]
			value="16474"
		[/random]
		[random]
			value="7892"
		[/random]
		[random]
			value="18903"
		[/random]
		[random]
			value="1002"
		[/random]
		[random]
			value="14601"
		[/random]
		[random]
			value="29078"
		[/random]
		[random]
			value="31331"
		[/random]
		[random]
			value="23051"
		[/random]
		[random]
			value="22677"
		[/random]
		[random]
			value="8544"
		[/random]
		[random]
			value="25335"
		[/random]
		[random]
			value="20159"
		[/random]
		[random]
			value="11376"
			[results]
				checksum="RVQsCRORlSP,DLsxDMMfFuzJRDJCyOyPpHMVsOIMzEOKRzPuHEfJqwNzzmyJIhVwVwSxvKmMAS8wEVRB+JCszfJzd4jC+rc<MF13amk4nil5K7b35>-yp,+.8,eyb6ac"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,14,13,12,11"
			y="2,2,3,3,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="15,16,17,18,19,20,21,22,23,24"
			y="23,22,22,21,21,20,20,19,20,19"
		[/move]
	[/command]
	[command]
		[move]
			x="13,12,12,12,11,10,9"
			y="21,20,19,18,18,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="15,15,15,15,15,16"
			y="22,21,20,19,18,17"
		[/move]
	[/command]
	[command]
		[move]
			x="14,13,12,11,10"
			y="21,21,20,21,20"
		[/move]
	[/command]
	[command]
		[move]
			x="19,18,17,16,15"
			y="22,22,23,23,24"
		[/move]
	[/command]
	[command]
		[recruit]
			value="6"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="16499"
		[/random]
		[random]
			value="1712"
		[/random]
		[random]
			value="17776"
		[/random]
		[random]
			value="13498"
		[/random]
		[random]
			value="1132"
		[/random]
		[random]
			value="7188"
		[/random]
		[random]
			value="25236"
		[/random]
		[random]
			value="16791"
		[/random]
		[random]
			value="15416"
		[/random]
		[random]
			value="14278"
		[/random]
		[random]
			value="11125"
		[/random]
		[random]
			value="25422"
		[/random]
		[random]
			value="28995"
		[/random]
		[random]
			value="7257"
		[/random]
		[random]
			value="31720"
			[results]
				checksum="GIrTMzMz9ES2DQOJBEKJhELDntFKRtrHUBCMyPNLLqFJRxvqM3FDTGMqHwEVMDODuIOJsNEtPcOusOKDwebPsxOruODoP.K+zDJqnpswGK0PpQ,qvAQ3huxn5mf5Lj19"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Vigil has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Milamber has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,15,15"
			y="24,23,22"
		[/move]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,14,15"
			y="4,3,3,2,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,14,13,12,11,10,9"
			y="3,3,4,4,5,5,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,18,19,20"
			y="4,4,5,5,6,5"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,17,16,15,14"
			y="5,6,7,7,8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,17,18,19,20,21,22,23,24"
			y="4,5,5,6,6,6,5,6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="7"
			x="17"
			y="5"
		[/recruit]
		[random]
			value="13068"
		[/random]
		[random]
			value="19807"
		[/random]
		[random]
			value="2202"
		[/random]
		[random]
			value="3456"
		[/random]
		[random]
			value="7039"
		[/random]
		[random]
			value="6690"
		[/random]
		[random]
			value="26694"
		[/random]
		[random]
			value="5084"
		[/random]
		[random]
			value="12932"
		[/random]
		[random]
			value="2049"
		[/random]
		[random]
			value="29217"
		[/random]
		[random]
			value="14122"
		[/random]
		[random]
			value="21568"
		[/random]
		[random]
			value="5408"
		[/random]
		[random]
			value="13322"
			[results]
				checksum=",Ad3Y5f-Gtmnrp5jHbEoRiVrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNQrM8mwoFomIhFlq1.CLB<<ddNv5EsLNHBNzhOI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="16"
			y="4"
		[/recruit]
		[random]
			value="11161"
		[/random]
		[random]
			value="32522"
		[/random]
		[random]
			value="24358"
		[/random]
		[random]
			value="3769"
		[/random]
		[random]
			value="12990"
		[/random]
		[random]
			value="1826"
		[/random]
		[random]
			value="32393"
		[/random]
		[random]
			value="22734"
		[/random]
		[random]
			value="28160"
		[/random]
		[random]
			value="21018"
		[/random]
		[random]
			value="19373"
		[/random]
		[random]
			value="31359"
		[/random]
		[random]
			value="13272"
		[/random]
		[random]
			value="11537"
		[/random]
		[random]
			value="11652"
			[results]
				checksum="pMyPwoKvbBq0MCQtxRPyPu1PqOvyvtVtPtsuCMyPNLLqFJRxvqM3FDTGMqHwEVMDODuIOJsNErPcOusOKDwebPsxOruODoP.K+zDJqnqswJL0PpQ,RvAQ30CF>hl1cth"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="I'm not very good on this map"
			side="2"
		[/speak]
	[/command]
	[command]
		[move]
			x="9,8,7,6,6,6"
			y="17,16,17,17,18,19"
		[/move]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="I haven't played it very often"
			side="2"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,13,13,14,14,15"
			y="21,20,19,18,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="16,15,14,13,12,11"
			y="17,17,16,17,16,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Isgrimnur has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="24,24,24,25"
			y="19,18,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="15,15,15"
			y="22,23,24"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="12100"
		[/random]
		[random]
			value="13895"
		[/random]
		[random]
			value="23289"
		[/random]
		[random]
			value="32230"
		[/random]
		[random]
			value="26502"
		[/random]
		[random]
			value="25373"
		[/random]
		[random]
			value="30691"
		[/random]
		[random]
			value="20515"
		[/random]
		[random]
			value="15385"
		[/random]
		[random]
			value="12485"
		[/random]
		[random]
			value="9478"
		[/random]
		[random]
			value="7589"
		[/random]
		[random]
			value="3863"
		[/random]
		[random]
			value="22147"
		[/random]
		[random]
			value="25580"
			[results]
				checksum="FTxBwyUzhyBkwVHKQOq5AMPytSNtRJzMRsDuHBtnQvBFyQAVsL8qJTmQQNRqrWuTuTxCUFMDPxfDLuyOdqNHp2JuaZJrXGikJwc0bkdie+c.P93obZj,mcoh3b,IXl32"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="10,9,8,7,6,6,6"
			y="20,20,19,19,18,17,16"
		[/move]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,8,7,6,6,6,5"
			y="6,6,6,6,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,17,17,17,17"
			y="5,6,7,8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,17,17,17,17,17,18"
			y="4,5,6,7,8,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,20,21,21,21"
			y="5,6,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Asyrian has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,24,24,24"
			y="6,7,8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="7"
			x="17"
			y="5"
		[/recruit]
		[random]
			value="24619"
		[/random]
		[random]
			value="5549"
		[/random]
		[random]
			value="1366"
		[/random]
		[random]
			value="18552"
		[/random]
		[random]
			value="16555"
		[/random]
		[random]
			value="27515"
		[/random]
		[random]
			value="26692"
		[/random]
		[random]
			value="5099"
		[/random]
		[random]
			value="7653"
		[/random]
		[random]
			value="16472"
		[/random]
		[random]
			value="8782"
		[/random]
		[random]
			value="16682"
		[/random]
		[random]
			value="29770"
		[/random]
		[random]
			value="20990"
		[/random]
		[random]
			value="8468"
			[results]
				checksum=",Ad3Y5f-Gtmnsp5jHbEoRiVrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNQsM8mwoFomIhFlq1.CLW<<ddNv5EsLNHBNzkOI"
			[/results]
		[/random]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="how lng have you been playing?"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14,14"
			y="8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14"
			y="10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="eastprince has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="6,6,6,6,6,6"
			y="19,18,17,16,15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="11,10,9"
			y="17,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="13,14,15,16,17,18,19,20"
			y="21,21,21,20,20,19,19,18"
		[/move]
	[/command]
	[command]
		[recruit]
			value="0"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="23085"
		[/random]
		[random]
			value="15012"
		[/random]
		[random]
			value="19866"
		[/random]
		[random]
			value="31191"
		[/random]
		[random]
			value="32561"
		[/random]
		[random]
			value="25760"
		[/random]
		[random]
			value="22734"
		[/random]
		[random]
			value="16389"
		[/random]
		[random]
			value="27535"
		[/random]
		[random]
			value="19"
		[/random]
		[random]
			value="3343"
		[/random]
		[random]
			value="5816"
		[/random]
		[random]
			value="30549"
		[/random]
		[random]
			value="28261"
		[/random]
		[random]
			value="18803"
			[results]
				checksum="F<huxQ8q-vqhtpPuqvoeBIvxzyqxRKaVOEMsRHPLsxrnKSQUuPzuQTzBNpzqtPasFJDFNwNCmGSzKQuCQQCMwz5BGNz0sHXttHryoCqiuuzfBrmxtBFMypdZF<grEJR6"
			[/results]
		[/random]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Mechyas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="for a long time already"
			side="2"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="ehe, long"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="I've seen version 1.2"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,17,17"
			y="10,11,12,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,16"
			y="13,12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,17,17,17,17"
			y="5,6,7,8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,18,18"
			y="9,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,24"
			y="10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,25"
			y="12,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="25,24,24,23"
			y="13,12,11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,20,19,18"
			y="9,9,10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,4,3"
			y="9,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="3,4,5"
			y="10,9,9"
		[/move]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="ok, so you're one of the greenies, then :-P"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="6,6"
			y="14,13"
		[/move]
	[/command]
	[command]
		[move]
			x="6,5"
			y="13,13"
		[/move]
	[/command]
	[command]
		[move]
			x="6,6,5,5,4"
			y="16,15,15,14,13"
		[/move]
	[/command]
	[command]
		[move]
			x="5,5,4"
			y="13,12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="but I haven't played seriously until about a year"
			side="2"
		[/speak]
	[/command]
	[command]
		[move]
			x="9,8,7,6,6,6"
			y="17,16,17,16,15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="15,16"
			y="17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="25,24,24,24,23,22,21,20"
			y="17,17,18,19,20,19,20,19"
		[/move]
	[/command]
	[command]
		[move]
			x="20,21,22,23,24,24,24,25"
			y="18,19,19,20,19,18,17,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="kubi696 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,13,12,11,11,11"
			y="21,20,19,19,18,17"
		[/move]
	[/command]
	[command]
		[recruit]
			value="2"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="22663"
		[/random]
		[random]
			value="1478"
		[/random]
		[random]
			value="32323"
		[/random]
		[random]
			value="980"
		[/random]
		[random]
			value="5882"
		[/random]
		[random]
			value="24363"
		[/random]
		[random]
			value="31261"
		[/random]
		[random]
			value="9574"
		[/random]
		[random]
			value="27423"
		[/random]
		[random]
			value="20324"
		[/random]
		[random]
			value="7605"
		[/random]
		[random]
			value="12052"
		[/random]
		[random]
			value="31987"
		[/random]
		[random]
			value="26767"
		[/random]
		[random]
			value="21632"
			[results]
				checksum="<0CL,0MA07qnKSwEonI1LxtPCvyvIJCEpbxFsqwtpJJCxrnKSQUuOzuQTzBNpzqtPasFJDFNwNCmGSzKQuCQNCMwz5BGNz0sHXttHryoCqiuuzfBrmxtBFTypdZF<gDD"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="jin007 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="20,20"
			y="19,18"
		[/move]
	[/command]
	[command]
		[move]
			x="20,20"
			y="18,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Angel has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Twix has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="15"
			y="4"
		[/recruit]
		[random]
			value="24176"
		[/random]
		[random]
			value="6869"
		[/random]
		[random]
			value="6643"
		[/random]
		[random]
			value="12899"
		[/random]
		[random]
			value="20393"
		[/random]
		[random]
			value="3144"
		[/random]
		[random]
			value="131"
		[/random]
		[random]
			value="12093"
		[/random]
		[random]
			value="9149"
		[/random]
		[random]
			value="7016"
		[/random]
		[random]
			value="28499"
		[/random]
		[random]
			value="21372"
		[/random]
		[random]
			value="5424"
		[/random]
		[random]
			value="7093"
		[/random]
		[random]
			value="8884"
			[results]
				checksum="14,Wfc>cu2lH0olW9-5N-m<e6f60hfabkcij<4>i3h3e2.t0a1f<j870h0k565.Y0>ide9Mi80k.d8da021n<.26Z+40CN5c8b.-X,48E.7v3f3XdJFikGGOwGMoVOFH"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,6,6,7,8,9"
			y="9,8,7,6,6,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,19,20,21,22"
			y="11,12,12,12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,18,19"
			y="10,11,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,19,20,21"
			y="10,11,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,15,14"
			y="11,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14,13"
			y="11,10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,14,13,12,11,10"
			y="2,2,3,3,4,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="pq1pro has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="I have been playing since 0.9, but I still stink at the game"
			side="1"
		[/speak]
	[/command]
	[command]
		[move]
			x="4,3,3"
			y="11,11,10"
		[/move]
	[/command]
	[command]
		[move]
			x="3,4"
			y="10,9"
		[/move]
	[/command]
	[command]
		[move]
			x="4,5"
			y="9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="oh, 0.9"
			side="2"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,13,14,15,15"
			y="21,20,19,19,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="and I thought I was an ancient"
			side="2"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,16,17,18,19,20,21"
			y="24,23,23,22,22,21,21"
		[/move]
	[/command]
	[command]
		[move]
			x="6,5,5,4,4,3"
			y="14,14,13,12,11,11"
		[/move]
	[/command]
	[command]
		[move]
			x="4,5"
			y="13,13"
		[/move]
	[/command]
	[command]
		[move]
			x="5,5"
			y="13,12"
		[/move]
	[/command]
	[command]
		[move]
			x="5,5"
			y="12,13"
		[/move]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="MiRaCle has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,14,13,12,11,10"
			y="4,4,5,5,5,5"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Twix has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Vardek has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,10"
			y="5,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,8"
			y="7,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,11,12,13,14,15"
			y="4,4,3,3,2,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="22,23,24,25"
			y="12,12,12,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="apachai has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="23,24,24,25,25,25"
			y="11,11,12,13,14,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,21"
			y="11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,22,23"
			y="12,12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,20"
			y="12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,15,16,17,18"
			y="10,11,11,11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,13,13"
			y="10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="25,25"
			y="13,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="15"
			y="4"
		[/recruit]
		[random]
			value="16786"
		[/random]
		[random]
			value="13038"
		[/random]
		[random]
			value="22022"
		[/random]
		[random]
			value="22182"
		[/random]
		[random]
			value="26812"
		[/random]
		[random]
			value="16777"
		[/random]
		[random]
			value="26918"
		[/random]
		[random]
			value="32430"
		[/random]
		[random]
			value="29099"
		[/random]
		[random]
			value="13287"
		[/random]
		[random]
			value="14798"
		[/random]
		[random]
			value="10168"
		[/random]
		[random]
			value="28360"
		[/random]
		[random]
			value="30747"
		[/random]
		[random]
			value="19919"
			[results]
				checksum="pMyPvoKvbBq0MCQtxRPyPu1PqOvyvtVtPtsuCMyPNLLqFJRxvqM3FDTGMqHwEVMDODuIOJsNEBPcOusOKDwebPsxOruODoP.K+zDJqnqswJG0PpQ,OvAQ30CF>nl1cth"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Kiriyama has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="5,6,7,7"
			y="9,8,9,10"
		[/move]
	[/command]
	[command]
		[move]
			x="3,3,4,5"
			y="11,10,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="zubran has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,15,16,17,18"
			y="18,19,19,20,19"
		[/move]
	[/command]
	[command]
		[move]
			x="21,20,19,18,17,16,15"
			y="21,21,22,22,23,23,24"
		[/move]
	[/command]
	[command]
		[recruit]
			value="2"
			x="15"
			y="23"
		[/recruit]
		[random]
			value="3958"
		[/random]
		[random]
			value="12604"
		[/random]
		[random]
			value="31654"
		[/random]
		[random]
			value="31394"
		[/random]
		[random]
			value="23216"
		[/random]
		[random]
			value="31859"
		[/random]
		[random]
			value="1687"
		[/random]
		[random]
			value="14929"
		[/random]
		[random]
			value="1884"
		[/random]
		[random]
			value="2947"
		[/random]
		[random]
			value="4456"
		[/random]
		[random]
			value="3100"
		[/random]
		[random]
			value="27786"
		[/random]
		[random]
			value="14479"
		[/random]
		[random]
			value="12227"
			[results]
				checksum="<0CL>,MA07qnKSwEonI1LxtPCvyvIJCEpbxFsqwtpJJCxrnKSQUuOzuQTzBNpzqtPasFJDFNwNCmGSzKQuCLJCMwz5BGNz0sHXttHryoCqiuuzfBrmxtBFNypdZF<gID"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="16,16,16,17,18,19"
			y="17,18,19,20,19,19"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lake has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,12,13,14,15,16"
			y="17,17,17,16,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="20,20,19,18,17"
			y="17,16,16,16,16"
		[/move]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,17,17,17"
			y="4,4,5,6,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,10,9,9,9"
			y="7,8,9,10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="pq1pro has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,9"
			y="12,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,12,11,10,10"
			y="12,12,13,13,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="23,24,25,25,24"
			y="12,12,13,14,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="25,24,23"
			y="15,15,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="23,23,24"
			y="16,17,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="17"
			[/source]
			[destination]
				x="25"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="22137"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31498"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22670"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1034"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30677"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="25,26,27,27,26"
			y="14,14,15,16,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="26"
				y="16"
			[/source]
			[destination]
				x="25"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="23891"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="16004"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="3816"
			[results]
				chance="30"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4070"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32345"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,17,16,15,14,13"
			y="11,12,12,13,13,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,15,15,16,17,17"
			y="2,3,4,4,5,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="sidzej has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,19,18,17,16"
			y="11,12,12,12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="16,15,14,13,12,11"
			y="17,17,16,17,16,17"
		[/move]
	[/command]
	[command]
		[move]
			x="17,16,15,14,13,12,11,10,9"
			y="16,16,17,17,17,17,17,16,17"
		[/move]
	[/command]
	[command]
		[move]
			x="15,16,17,18,19"
			y="23,22,22,21,21"
		[/move]
	[/command]
	[command]
		[move]
			x="19,20,21,22,23,24,24"
			y="19,18,19,19,20,19,18"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="24"
				y="18"
			[/source]
			[destination]
				x="24"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="31757"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="634"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4423"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32570"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="25"
				y="17"
			[/source]
			[destination]
				x="24"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="22734"
			[results]
				chance="60"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10925"
			[results]
				chance="60"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="1"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="17916"
		[/random]
		[random]
			value="25871"
		[/random]
		[random]
			value="7102"
		[/random]
		[random]
			value="8813"
		[/random]
		[random]
			value="6877"
		[/random]
		[random]
			value="9731"
		[/random]
		[random]
			value="6493"
		[/random]
		[random]
			value="27230"
		[/random]
		[random]
			value="31202"
		[/random]
		[random]
			value="30894"
		[/random]
		[random]
			value="5493"
		[/random]
		[random]
			value="20490"
		[/random]
		[random]
			value="6204"
		[/random]
		[random]
			value="6088"
		[/random]
		[random]
			value="4333"
			[results]
				checksum="MppsyKA8tq1G+rohkH2DZ9>b7j1h.rkiw1-Fek9X9FajMic5Q3Y959Xncn>g+J0<5+3mY8je7a461,hkEw7d1pgHD0ytJwg>n6zuefoWmmRC,xvlCaM1htCesyhkpNss"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="kavalji has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,16,17,18,19,20,21"
			y="24,23,23,22,22,21,21"
		[/move]
	[/command]
	[command]
		[move]
			x="18,17,16,16,16"
			y="19,20,19,18,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Cheat has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="pq1 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="King_Miroslav has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="7,7,6,5,4"
			y="10,9,8,8,7"
		[/move]
	[/command]
	[command]
		[move]
			x="5,5,6"
			y="9,8,7"
		[/move]
	[/command]
	[command]
		[move]
			x="5,5,4,3,3,4,5"
			y="13,12,11,11,10,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ares has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Angel has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="SomeRandom has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,9,10,10,11"
			y="6,6,5,4,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="26,26"
			y="16,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,25,26,27,27"
			y="14,15,14,15,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="26"
				y="17"
			[/source]
			[destination]
				x="25"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="20298"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22796"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1944"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2909"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29968"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="ehe"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Dark has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="the RNG gods smile at me again?"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,9,8,7"
			y="14,14,13,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="this sounds bad for me"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="hogar has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,14,14,14"
			y="13,12,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,17,18"
			y="11,11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,10,11,11,12,13,14"
			y="13,12,11,11,10,9,9,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,18,18,19"
			y="8,9,9,10,11"
		[/move]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="you do not play blindfolded, do you?"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,16,15,15,15"
			y="6,5,4,4,3,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="5"
			x="15"
			y="4"
		[/recruit]
		[random]
			value="12303"
		[/random]
		[random]
			value="20863"
		[/random]
		[random]
			value="25626"
		[/random]
		[random]
			value="30582"
		[/random]
		[random]
			value="3080"
		[/random]
		[random]
			value="4563"
		[/random]
		[random]
			value="26526"
		[/random]
		[random]
			value="23459"
		[/random]
		[random]
			value="24211"
		[/random]
		[random]
			value="15161"
		[/random]
		[random]
			value="11668"
		[/random]
		[random]
			value="21388"
		[/random]
		[random]
			value="26807"
		[/random]
		[random]
			value="22896"
		[/random]
		[random]
			value="26189"
			[results]
				checksum="-n8rN+-Dy+EeNPrPbGMNQXtz0Ipzwss1tysRRKOwxuoVBywHrwxEqutHtKzE>BNMxHQOHFw.RFKFnqypNLtM8mwoFomIhFlq1.CLW<<ddBfkHDONNHvHQO1I9LGCHpAC"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,23,23,24,25"
			y="17,17,16,15,15"
		[/move]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="I don't want no handicap!"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,6"
			y="14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="24,24,23,23,24"
			y="18,17,17,16,15"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="24"
				y="15"
			[/source]
			[destination]
				x="25"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="29293"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="23121"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2311"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13942"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Anni has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="19,20,21,22,23"
			y="21,20,20,19,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Machcik has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="stone has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="JK2K2G has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="5,5,6,6"
			y="9,8,7,6"
		[/move]
	[/command]
	[command]
		[move]
			x="6,6,7"
			y="7,6,6"
		[/move]
	[/command]
	[command]
		[move]
			x="4,4,5"
			y="7,8,9"
		[/move]
	[/command]
	[command]
		[move]
			x="9,9"
			y="17,16"
		[/move]
	[/command]
	[command]
		[move]
			x="9,9,10"
			y="16,15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="we should try a blindfolded game one time"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Qyf has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,10,10,9"
			y="14,15,16,17"
		[/move]
	[/command]
	[command]
		[move]
			x="13,13,14,14,14,14"
			y="21,20,19,18,17,16"
		[/move]
	[/command]
	[command]
		[move]
			x="21,22"
			y="21,20"
		[/move]
	[/command]
	[command]
		[move]
			x="9,8,7,6"
			y="17,16,17,16"
		[/move]
	[/command]
	[command]
		[move]
			x="11,11"
			y="17,16"
		[/move]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,15,14,14,14"
			y="4,5,5,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,5,5,5,6"
			y="13,13,12,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="27,27,26,25,24"
			y="16,15,14,14,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="24"
				y="14"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="17602"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2026"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30288"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13972"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6600"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13462"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17092"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="26,26"
			y="17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="25,25,25,24,24,23"
			y="15,14,13,12,11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,20,21,22"
			y="11,11,12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,19,20,20,21"
			y="11,11,10,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14,13,12,11"
			y="10,9,9,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="25"
				y="17"
			[/source]
			[destination]
				x="26"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="6064"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="9666"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2044"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="26478"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="23,24,24,25,26"
			y="20,19,18,18,17"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="26"
				y="17"
			[/source]
			[destination]
				x="26"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="10050"
			[results]
				chance="60"
				damage="18"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lisohlavek has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="24,23,23,23,24,24"
			y="15,16,17,18,18,19"
		[/move]
	[/command]
	[command]
		[move]
			x="22,21,20,19,18,17,16"
			y="20,21,21,22,22,23,23"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="papi has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="7,6,6,6"
			y="6,6,7,8"
		[/move]
	[/command]
	[command]
		[move]
			x="6,6,5"
			y="6,7,8"
		[/move]
	[/command]
	[command]
		[move]
			x="5,4"
			y="8,8"
		[/move]
	[/command]
	[command]
		[move]
			x="5,4"
			y="9,9"
		[/move]
	[/command]
	[command]
		[move]
			x="6,5"
			y="8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="MiRaCle has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="14,15,16"
			y="16,16,15"
		[/move]
	[/command]
	[command]
		[move]
			x="11,11,12"
			y="16,15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16,17"
			y="17,16,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="tany has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="6,6,6"
			y="16,15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="6,6,5"
			y="14,13,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Nath has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="16,16"
			y="15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="17,16"
			y="16,15"
		[/move]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="hogar has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,25,25,25,24"
			y="14,14,13,12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="23,24,24,24,24"
			y="11,10,9,8,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="22,23"
			y="12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,7,7,7,6,6"
			y="10,10,9,8,7,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,10,9,9,8"
			y="4,4,5,6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="7"
			x="17"
			y="5"
		[/recruit]
		[random]
			value="30276"
		[/random]
		[random]
			value="31775"
		[/random]
		[random]
			value="17738"
		[/random]
		[random]
			value="26182"
		[/random]
		[random]
			value="10184"
		[/random]
		[random]
			value="26638"
		[/random]
		[random]
			value="587"
		[/random]
		[random]
			value="9755"
		[/random]
		[random]
			value="6147"
		[/random]
		[random]
			value="19318"
		[/random]
		[random]
			value="29191"
		[/random]
		[random]
			value="26181"
		[/random]
		[random]
			value="4525"
		[/random]
		[random]
			value="30526"
		[/random]
		[random]
			value="20126"
			[results]
				checksum=",Ad3Y5f-Gtmnsp5jHbEoRiVrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNQsM8mwoFomIhFlq1.CLW<<ddNv5EsLNHBNzkOI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14,13,12,11"
			y="7,6,6,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,14,13,12,11"
			y="2,2,3,3,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="5,5,5,6,7,7,7,6"
			y="13,12,11,10,10,9,8,7"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="7"
			[/source]
			[destination]
				x="6"
				y="6"
			[/destination]
		[/attack]
		[random]
			value="11822"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="8683"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="4252"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32580"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="4306"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="4,4,4"
			y="9,8,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Merk has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="25,26"
			y="17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="oh has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="24,24,24,25"
			y="19,18,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="16,15"
			y="23,24"
		[/move]
	[/command]
	[command]
		[recruit]
			value="3"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="26375"
		[/random]
		[random]
			value="32528"
		[/random]
		[random]
			value="24793"
		[/random]
		[random]
			value="31297"
		[/random]
		[random]
			value="31857"
		[/random]
		[random]
			value="10906"
		[/random]
		[random]
			value="25120"
		[/random]
		[random]
			value="5370"
		[/random]
		[random]
			value="20950"
		[/random]
		[random]
			value="13812"
		[/random]
		[random]
			value="10420"
		[/random]
		[random]
			value="26006"
		[/random]
		[random]
			value="22585"
		[/random]
		[random]
			value="2662"
		[/random]
		[random]
			value="975"
			[results]
				checksum="s68vszkDcAP6A+iACEP7A2muIutTrV-zNi5IwMDsI88+-635<idd<26oh6m2>-p8-0W.oZ8>>6f27lXfl7>9Z2A4b82p.au,,a+31>-PXX2S4+>Y,4gk3GZ9to8lVxJ<"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="0"
			x="14"
			y="21"
		[/recruit]
		[random]
			value="32103"
		[/random]
		[random]
			value="3635"
		[/random]
		[random]
			value="31007"
		[/random]
		[random]
			value="10972"
		[/random]
		[random]
			value="7893"
		[/random]
		[random]
			value="17742"
		[/random]
		[random]
			value="12519"
		[/random]
		[random]
			value="24191"
		[/random]
		[random]
			value="7231"
		[/random]
		[random]
			value="2132"
		[/random]
		[random]
			value="10569"
		[/random]
		[random]
			value="22332"
		[/random]
		[random]
			value="6562"
		[/random]
		[random]
			value="12702"
		[/random]
		[random]
			value="16461"
			[results]
				checksum="F<juxQ8q-vqhtpPuqvoeBIvxzyqxRKaVOEMsRHPLsxrnKSQUuPzuQTzBNpzqtPasFJDFNwNCmGSzKQuCQKCMwz5BGNz0sHXttHryoCqiuuzfBrmxtBFSypdZF<grEJR6"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="15,15,15,15,15"
			y="24,23,22,21,20"
		[/move]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Balanceguardian has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Alesk has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="strike_ has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lake has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24"
			y="11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24"
			y="7,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,21,21,21,22"
			y="9,10,11,12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18,18,18,19,20"
			y="5,5,6,7,8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,10,10,9"
			y="9,8,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,10,9,8"
			y="7,6,6,5"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,14,15"
			y="4,3,3,2,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="noob has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="7"
			[/source]
			[destination]
				x="6"
				y="6"
			[/destination]
		[/attack]
		[random]
			value="30636"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7115"
			[results]
				chance="60"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10571"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18566"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2354"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="4,4,4,5"
			y="8,7,6,6"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="5"
				y="6"
			[/source]
			[destination]
				x="6"
				y="6"
			[/destination]
		[/attack]
		[random]
			value="4956"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14478"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7769"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17575"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="24765"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17475"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26223"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="496"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7158"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17235"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="26217"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28340"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21162"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21131"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24002"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23995"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28576"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="16452"
			[results]
				chance="60"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="maybe the rng will change sides"
			side="2"
		[/speak]
	[/command]
	[command]
		[move]
			x="5,5,6,6,7"
			y="9,8,7,6,6"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="6"
			[/source]
			[destination]
				x="8"
				y="5"
			[/destination]
		[/attack]
		[random]
			value="14363"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5400"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2406"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11792"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="4,4,5,6"
			y="7,6,6,5"
		[/move]
	[/command]
	[command]
		[move]
			x="13,13,12,11,11,11"
			y="21,20,19,19,18,17"
		[/move]
	[/command]
	[command]
		[move]
			x="14,14,14,14,14"
			y="21,20,19,18,17"
		[/move]
	[/command]
	[command]
		[move]
			x="14,14"
			y="17,16"
		[/move]
	[/command]
	[command]
		[move]
			x="15,15,15,15,15"
			y="20,21,22,23,24"
		[/move]
	[/command]
	[command]
		[recruit]
			value="7"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="8112"
		[/random]
		[random]
			value="23466"
		[/random]
		[random]
			value="17961"
		[/random]
		[random]
			value="11352"
		[/random]
		[random]
			value="17907"
		[/random]
		[random]
			value="7452"
		[/random]
		[random]
			value="21091"
		[/random]
		[random]
			value="20023"
		[/random]
		[random]
			value="25585"
		[/random]
		[random]
			value="12949"
		[/random]
		[random]
			value="21727"
		[/random]
		[random]
			value="19026"
		[/random]
		[random]
			value="53"
		[/random]
		[random]
			value="23110"
		[/random]
		[random]
			value="23959"
			[results]
				checksum="86Wmq3.,tb9Th9Xh+8Om3eb898egWbi26k39>2dlaZge0f-9iPif8c7h8k-+v7e7e8fh1b<i8Sem73jI-oaGeRO,h0ybO20xxhh6<5-i30KE4<Yfd6-cbeMq5.ql>pFA"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="nilkiimas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="26,27"
			y="16,16"
		[/move]
	[/command]
	[command]
		[move]
			x="27,27,26"
			y="16,15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="26,27,27,26"
			y="14,15,16,16"
		[/move]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="7"
			x="15"
			y="4"
		[/recruit]
		[random]
			value="15611"
		[/random]
		[random]
			value="10664"
		[/random]
		[random]
			value="18535"
		[/random]
		[random]
			value="1926"
		[/random]
		[random]
			value="23300"
		[/random]
		[random]
			value="17704"
		[/random]
		[random]
			value="21337"
		[/random]
		[random]
			value="5024"
		[/random]
		[random]
			value="24618"
		[/random]
		[random]
			value="10397"
		[/random]
		[random]
			value="641"
		[/random]
		[random]
			value="25291"
		[/random]
		[random]
			value="8443"
		[/random]
		[random]
			value="3693"
		[/random]
		[random]
			value="16004"
			[results]
				checksum=",Ad3Y5f-GtmsAp5jHbEoRiSrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNLAM8mwoFomIhFlq1.CLW<<ddNv5EsLNHBNzhOI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,9,10,11"
			y="5,5,4,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,9,8"
			y="7,6,5"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="22,23,24,25"
			y="12,12,12,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="23,24,25"
			y="12,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="25,26"
			y="12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,25"
			y="10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,24,23,22,21"
			y="6,7,8,9,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Nami has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,20,20,20"
			y="8,9,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14,14,13,12,11"
			y="8,7,6,6,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="5,4,4,4,5"
			y="6,6,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lord_MM has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="7,6"
			y="6,6"
		[/move]
	[/command]
	[command]
		[move]
			x="6,5,4,4"
			y="5,6,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Bob999 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="SomeRandom has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,12,13,14,15,16"
			y="17,17,18,18,19,19"
		[/move]
	[/command]
	[command]
		[move]
			x="13,13,13,12,12,11"
			y="21,20,19,18,17,17"
		[/move]
	[/command]
	[command]
		[recruit]
			value="2"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="30043"
		[/random]
		[random]
			value="12635"
		[/random]
		[random]
			value="17640"
		[/random]
		[random]
			value="9478"
		[/random]
		[random]
			value="8199"
		[/random]
		[random]
			value="23012"
		[/random]
		[random]
			value="29916"
		[/random]
		[random]
			value="11961"
		[/random]
		[random]
			value="29573"
		[/random]
		[random]
			value="21996"
		[/random]
		[random]
			value="17537"
		[/random]
		[random]
			value="32465"
		[/random]
		[random]
			value="10086"
		[/random]
		[random]
			value="10763"
		[/random]
		[random]
			value="25630"
			[results]
				checksum="<0CL,4MA07qnKSwEonI1LxtPCvyvIJCEpbxFsqwtpJJCxrnKSQUuOzuQTzBNpzqtPasFJDFNwNCmGSzKQuCQRCMwz5BGNz0sHXttHryoCqiuuzfBrmxtBFTypdZF<gID"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="15,16,17,18,19,20,21"
			y="24,23,23,22,22,21,21"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="GNUMARCO has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="16,16"
			y="14,13"
		[/move]
	[/command]
	[command]
		[move]
			x="12,12,13"
			y="14,13,13"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16"
			y="13,12"
		[/move]
	[/command]
	[command]
		[move]
			x="16,17,18"
			y="12,12,11"
		[/move]
	[/command]
	[command]
		[move]
			x="13,13,14"
			y="13,12,11"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16,16,16"
			y="15,14,13,12"
		[/move]
	[/command]
	[command]
		[move]
			x="14,15,16,16,17,18"
			y="16,16,15,14,14,13"
		[/move]
	[/command]
	[command]
		[move]
			x="25,25"
			y="17,18"
		[/move]
	[/command]
	[command]
		[move]
			x="26,25"
			y="16,17"
		[/move]
	[/command]
	[command]
		[move]
			x="26,26"
			y="17,18"
		[/move]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Arios has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Vardek has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="25,24,24,24"
			y="12,11,10,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="25,25,24,24"
			y="13,12,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="26,25,24,23"
			y="12,12,12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="23,23"
			y="12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,20,20,19"
			y="11,10,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,7,6,5,4"
			y="6,6,5,6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="natcabag has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="I used abit of a dirty trick to get the left village"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Vee has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,15,14,14,14,14"
			y="4,5,5,6,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,14,14,15,16"
			y="7,6,6,6,7,8,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,15,15,16,17,17"
			y="2,3,4,4,5,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,10,9,9,8"
			y="4,4,5,6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,7"
			y="5,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="6"
			[/source]
			[destination]
				x="6"
				y="6"
			[/destination]
		[/attack]
		[random]
			value="25173"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28502"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5674"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7080"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26391"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11351"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="you know, as long as it works.."
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="too bad I couldn't take the right one"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Angel has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="6,5"
			y="7,8"
		[/move]
	[/command]
	[command]
		[move]
			x="6,6"
			y="6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Animar has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="21,20,19,18,17,16,15"
			y="21,21,22,22,23,23,24"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16,16,16,16"
			y="19,18,17,16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Dark has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="CHN_binbin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="18,18,17,17,16"
			y="11,12,13,14,14"
		[/move]
	[/command]
	[command]
		[move]
			x="18,17,16,16,17"
			y="13,14,14,15,16"
		[/move]
	[/command]
	[command]
		[move]
			x="14,14,13,13,12"
			y="11,12,13,14,14"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16,16,15"
			y="12,13,14,15"
		[/move]
	[/command]
	[command]
		[move]
			x="11,12,13,14"
			y="17,16,16,16"
		[/move]
	[/command]
	[command]
		[move]
			x="14,15"
			y="16,16"
		[/move]
	[/command]
	[command]
		[move]
			x="13,13,13,13,13"
			y="21,20,19,18,17"
		[/move]
	[/command]
	[command]
		[move]
			x="25,26,27"
			y="17,16,16"
		[/move]
	[/command]
	[command]
		[move]
			x="27,27,26"
			y="16,15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Twix has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Funkshunator has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="philipp has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="26,27"
			y="14,15"
		[/move]
	[/command]
	[command]
		[move]
			x="26,25,24,23,23"
			y="18,18,17,17,16"
		[/move]
	[/command]
	[command]
		[move]
			x="25,24,23,23,24"
			y="18,17,17,16,15"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="4"
				y="7"
			[/source]
			[destination]
				x="4"
				y="6"
			[/destination]
		[/attack]
		[random]
			value="9981"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="16198"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="4,5"
			y="6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,6,5,4"
			y="6,5,6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="4"
				y="6"
			[/source]
			[destination]
				x="4"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="65"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="4593"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13301"
			[results]
				chance="30"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4576"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21523"
			[results]
				chance="30"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6"
			y="6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="6"
			[/source]
			[destination]
				x="6"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="22128"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25379"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21585"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2610"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2502"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="19664"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5678"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,7,6,5"
			y="6,6,5,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,16,15,15,15"
			y="6,5,4,4,3,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="2"
			x="17"
			y="5"
		[/recruit]
		[random]
			value="20233"
		[/random]
		[random]
			value="31037"
		[/random]
		[random]
			value="17166"
		[/random]
		[random]
			value="27520"
		[/random]
		[random]
			value="744"
		[/random]
		[random]
			value="25383"
		[/random]
		[random]
			value="1275"
		[/random]
		[random]
			value="30200"
		[/random]
		[random]
			value="1283"
		[/random]
		[random]
			value="16785"
		[/random]
		[random]
			value="24521"
		[/random]
		[random]
			value="5802"
		[/random]
		[random]
			value="21974"
		[/random]
		[random]
			value="25498"
		[/random]
		[random]
			value="13418"
			[results]
				checksum="RVQsCRORlSP,DLsxDMMfFuzJRDJCyOyPpHMVsOIMzEOKRzPuHEfJqwNzzmyJIhVwVwSxvKtMAS8wEVRB+JCszfJzd4kC+rc<MF13amk4yil5K7b35>-yp,+<8,eyb6ac"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lake has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,21,21,21,22"
			y="9,10,11,12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24"
			y="10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,25"
			y="11,12,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="23,24,25,26"
			y="11,11,12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,24,25"
			y="9,10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,20,20,21,21"
			y="9,9,10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,17,18,19,20,21"
			y="7,8,8,8,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="4,4,4"
			y="7,8,9"
		[/move]
	[/command]
	[command]
		[move]
			x="5,4"
			y="8,7"
		[/move]
	[/command]
	[command]
		[move]
			x="5,6,7,7,6"
			y="9,8,9,10,10"
		[/move]
	[/command]
	[command]
		[move]
			x="4,5"
			y="9,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="6"
				y="7"
			[/source]
			[destination]
				x="6"
				y="6"
			[/destination]
		[/attack]
		[random]
			value="16606"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Travis06 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="27,27,26,25"
			y="15,16,16,17"
		[/move]
	[/command]
	[command]
		[move]
			x="24,23,23,24,25"
			y="15,16,17,17,18"
		[/move]
	[/command]
	[command]
		[move]
			x="23,23,24"
			y="16,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16,16,16,16,17"
			y="15,16,17,18,19,20"
		[/move]
	[/command]
	[command]
		[recruit]
			value="2"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="1119"
		[/random]
		[random]
			value="1562"
		[/random]
		[random]
			value="12279"
		[/random]
		[random]
			value="7140"
		[/random]
		[random]
			value="30587"
		[/random]
		[random]
			value="13006"
		[/random]
		[random]
			value="20989"
		[/random]
		[random]
			value="3753"
		[/random]
		[random]
			value="8425"
		[/random]
		[random]
			value="3210"
		[/random]
		[random]
			value="12533"
		[/random]
		[random]
			value="25211"
		[/random]
		[random]
			value="13186"
		[/random]
		[random]
			value="2516"
		[/random]
		[random]
			value="31773"
			[results]
				checksum="<0CL,-MA07qnKSwFonI1LxtPCvyvIJCEpbxFsqwtpJJCxrnKSQUuOzuQTzBNpzqtPasFJDFNwNCmGSzKQuCQGCMwz5BGNz0sHXttHryoCqiuuzfBrmxtBFTypdZF<gID"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="15,16"
			y="16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="zerog has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,14,14,14"
			y="17,16,15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="12,12,13"
			y="14,13,13"
		[/move]
	[/command]
	[command]
		[move]
			x="16,15,14,13,12"
			y="15,15,14,14,13"
		[/move]
	[/command]
	[command]
		[move]
			x="17,18,19,20"
			y="16,15,15,15"
		[/move]
	[/command]
	[command]
		[move]
			x="15,15"
			y="15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="14,14"
			y="14,13"
		[/move]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Gorthaur has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,21,21,20"
			y="9,10,11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="leocrotta has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18,18,18,19,20,21"
			y="5,5,6,7,8,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,20,20"
			y="11,10,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,22,23,24"
			y="12,12,12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="22,23,24,25,25"
			y="12,12,12,13,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="25,26,27,27,27,26"
			y="13,13,14,15,16,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="26"
				y="16"
			[/source]
			[destination]
				x="25"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="5180"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="24097"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17251"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10308"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21854"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="26,26,25,25,24"
			y="12,13,14,15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="25,25,26,27,27"
			y="12,13,13,14,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="4,5,6"
			y="6,6,5"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,4"
			y="6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="4"
				y="6"
			[/source]
			[destination]
				x="4"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="28226"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2569"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17567"
			[results]
				chance="70"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,5,4,4,5"
			y="6,6,6,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="5"
				y="8"
			[/source]
			[destination]
				x="5"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="30439"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6844"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12782"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3465"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="879"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13196"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6"
			y="5,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="6"
			[/source]
			[destination]
				x="6"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="30900"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21223"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9202"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27514"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11085"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13443"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="6"
				y="7"
			[/source]
			[destination]
				x="5"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="31289"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="5"
				y="9"
			[/source]
			[destination]
				x="5"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="5883"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18667"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Angel has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="24,25,26"
			y="17,18,17"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="26"
				y="17"
			[/source]
			[destination]
				x="26"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="8282"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22263"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="17,18,19,20,21,22"
			y="20,19,20,19,20,19"
		[/move]
	[/command]
	[command]
		[move]
			x="15,15,15,14"
			y="14,13,12,11"
		[/move]
	[/command]
	[command]
		[move]
			x="13,13,14,14"
			y="13,12,11,10"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16,16"
			y="14,13,12"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16"
			y="12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="zxa has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="12,12,12,12"
			y="13,12,11,10"
		[/move]
	[/command]
	[command]
		[move]
			x="20,20,20,19,19,18"
			y="15,14,13,13,12,11"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16,16"
			y="11,10,9"
		[/move]
	[/command]
	[command]
		[move]
			x="14,14,14,15"
			y="13,12,11,11"
		[/move]
	[/command]
	[command]
		[move]
			x="13,13,13,13,13,13"
			y="21,20,19,18,17,16"
		[/move]
	[/command]
	[command]
		[move]
			x="15,16,17,18,19,20,21"
			y="24,23,23,22,22,21,21"
		[/move]
	[/command]
	[command]
		[move]
			x="25,24,24"
			y="17,17,18"
		[/move]
	[/command]
	[command]
		[move]
			x="25,25"
			y="18,17"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="25"
				y="17"
			[/source]
			[destination]
				x="26"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="11346"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="3510"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21300"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23176"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22691"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="24,25"
			y="18,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="I didn't see it was afternoon"
			side="2"
		[/speak]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="xenom has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="zerog has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,5"
			y="6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="4,4,4"
			y="6,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="4"
				y="8"
			[/source]
			[destination]
				x="5"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="1699"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="14971"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15914"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24227"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13848"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,7"
			y="8,8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="10"
			[/source]
			[destination]
				x="6"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="174"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22606"
			[results]
				chance="30"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4883"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21014"
			[results]
				chance="30"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15661"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7739"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17898"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32421"
			[results]
				chance="30"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5552"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5998"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25454"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17892"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6794"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5110"
			[results]
				chance="30"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="damn"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6"
			y="6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="6"
				y="6"
			[/source]
			[destination]
				x="6"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="5843"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11255"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="oh dear, what was ctk?"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="70"
			side="2"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="65-70?"
			side="1"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="ok"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="your 70% and mine aren't the same :)"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ncatt323 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="I mean, def"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Cyndane has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="noob has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="26,27,27,27,26"
			y="16,16,15,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="27,27,26,26"
			y="15,14,13,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="26,25"
			y="12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,25,25"
			y="15,14,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="25,25,24,23"
			y="14,13,12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,23,22"
			y="12,12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,20,19,18,17,17,16,15,14,13"
			y="9,8,8,7,7,6,5,5,5,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="5,6"
			y="9,8"
		[/move]
	[/command]
	[command]
		[move]
			x="6,7,7,6,5"
			y="10,10,9,8,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="5"
				y="9"
			[/source]
			[destination]
				x="4"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="14882"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21450"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="407"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="26951"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1889"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18298"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22584"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6624"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="20630"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="12750"
			[results]
				chance="60"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="6,5,4"
			y="8,8,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="well, that's what I call a fail"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="I surrender"
			side="2"
		[/speak]
	[/command]
	[command]
		[move]
			x="14,14,14"
			y="11,10,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="14"
				y="9"
			[/source]
			[destination]
				x="14"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="21485"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="492"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Blademaster1 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,15,15"
			y="11,10,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="15"
				y="9"
			[/source]
			[destination]
				x="14"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="10792"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11121"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="see? free points :)"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="firas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="16,16,15"
			y="9,8,8"
		[/move]
	[/command]
	[command]
		[move]
			x="12,13,13"
			y="10,10,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="13"
				y="9"
			[/source]
			[destination]
				x="14"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="22871"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31097"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7383"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22117"
			[results]
				chance="40"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29093"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="23677"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="15"
				y="8"
			[/source]
			[destination]
				x="14"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="2656"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11071"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26427"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="22172"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="20912"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11654"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="marek has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="14,15,16"
			y="10,10,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="zxa has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="18,18,19"
			y="11,10,10"
		[/move]
	[/command]
	[command]
		[move]
			x="13,13,13,13,13,14"
			y="16,15,14,13,12,11"
		[/move]
	[/command]
	[command]
		[move]
			x="19,19"
			y="10,11"
		[/move]
	[/command]
	[command]
		[move]
			x="19,18"
			y="11,11"
		[/move]
	[/command]
	[command]
		[move]
			x="21,20,19,18,17,16,15"
			y="21,21,22,22,23,23,24"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Arhanit has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="7"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="9251"
		[/random]
		[random]
			value="25421"
		[/random]
		[random]
			value="21951"
		[/random]
		[random]
			value="6598"
		[/random]
		[random]
			value="14860"
		[/random]
		[random]
			value="6366"
		[/random]
		[random]
			value="28523"
		[/random]
		[random]
			value="15589"
		[/random]
		[random]
			value="8835"
		[/random]
		[random]
			value="824"
		[/random]
		[random]
			value="31069"
		[/random]
		[random]
			value="10065"
		[/random]
		[random]
			value="8381"
		[/random]
		[random]
			value="19792"
		[/random]
		[random]
			value="21767"
			[results]
				checksum="c4ibeoBjPXdN9277b82>Vg,h+ld6d5,0c<W-1<71YYc5-d+8873Gj8ibkh8k-+v7e7e8fh0c<i8Sem73jI-oaGeRO,h>ybO20xxhh6<5,n30KE4<Yfd6-cbfLq5.ql>p"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="25,25,26"
			y="18,17,16"
		[/move]
	[/command]
	[command]
		[move]
			x="25,24,24,24,23,22,21"
			y="17,17,18,19,20,19,19"
		[/move]
	[/command]
	[command]
		[move]
			x="22,23,24,24,24,25"
			y="19,20,19,18,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="26,26,27,27,27"
			y="17,16,16,15,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="27"
				y="14"
			[/source]
			[destination]
				x="26"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="7240"
			[results]
				chance="60"
				damage="18"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6389"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="26,27,27,26"
			y="16,16,15,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="26"
				y="14"
			[/source]
			[destination]
				x="26"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="25909"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="22148"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1857"
			[results]
				chance="60"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Jiskah has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="hehe"
			side="1"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="thanks for the game"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Blademaster1 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="you too"
			side="2"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="want a revenge?"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="sure"
			side="2"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="on a more standard map?"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="you're really greedy for points"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="I'd say so"
			side="2"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="points is my light and my air"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="but I don't particularly hate this map"
			side="2"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="ok, I host another?"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="sure"
			side="2"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Gauteamus"
			message="Freelands?"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="atlyx"
			message="ok"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="atlyx has left the game."
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Gauteamus takes control of side 2."
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ombrelune has logged into the lobby"
		[/speak]
	[/command]
[/replay]
[snapshot]
	campaign_type="multiplayer"
	completion="running"
	current_tod="4"
#textdomain wesnoth-multiplayer
	description=_ "This most unusual of caves was once known as the Chamber of Laughing Devils, and was the inner citadel of the Kah Ruuk Oni. The Kah Ruuk were a wicked and cunning race of man-eating demons, who terrorized the people of the Eastern Lands for nearly four hundred years, before vanishing from Irdya without a trace. Since that time, many factions have vied for dominion over the Den of Onis, hoping to unlock the strange and mysterious magics of its creators."
	difficulty="NORMAL"
	end_text_duration="0"
	experience_modifier="70"
	hash="0UcdixDPqLm3+hh>V5qedNftTzpDzEnpcCt9okfubpKJFPc+N02noXfLREz,CUoR2IfA>Kgve5rc.2fi6bgul1BoAlggOrqRAY4K1w,Am7P<VLAwGeU,.pw-Ir84kuiX"
	id="multiplayer_Den_of_Onis"
	label="2S – Die Höhle von Onis"
	map_data="border_size=1
usage=map

Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ql          , Ql          , Ql          , 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          , Ql          , Ql          , Ql          , 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          , Ur          , 2 Kud       , Uu          , Ql          , Ql          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Uh          , Wwf^Uf      , Wwf         , Rd          , Rd          , Cud         , Ur          , Uu^Uf       , Rd          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ur          , Uu^Vu       , Ur          , Wwf         , Rd          , Cud         , Cud         , Ur          , Ur          , Hh          , Ss          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Rd          , Xu          , Wwf         , Rd          , Rd          , Ur          , Ur          , Wwf         , Wwf         , Rd          , Rd          , Cud         , Rp          , Gs^Fp       , Ss^Vhs      , Ss          , Rd          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Ur          , Ur          , Ur          , Rd          , Rd          , Wwf         , Rd          , Mm          , Ur          , Ur          , Ur^Fp       , Rd^Fp       , Uh          , Rd          , Rd          , Rp          , Wwf         , Rd          , Hh          , Rd          , Uu^Vu       , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Ql          , Uu^Uf       , Xu          , Ur          , Xu          , Xu          , Wwf         , Wwf         , Rd          , Ql          , Ql          , Ur          , Uu^Uf       , Wwf         , Rd          , Rd          , Hh          , Gs^Fp       , Rp          , Xu          , Rd          , Wwf         , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Rd          , Gs^Fp       , Rd          , Ur          , Xu          , Ww          , Ww          , Xu          , Xu          , Xu          , Uu^Vu       , Wwf         , Rd          , Rd          , Rd          , Rd          , Rd          , Rd          , Xu          , Xu          , Rp          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Ql          , Xu          , Rd          , Uu^Vu       , Xu          , Rd          , Xu          , Ww          , Wwf         , Uh          , Rd          , Rd          , Rd          , Rd^Fp       , Hh          , Rd          , Rp          , Mm          , Wwf         , Ss^Vhs      , Rd          , Rd          , Gs^Fp       , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Rp          , Xu          , Xu          , Uh          , Gs^Fp       , Xu          , Wwf         , Mm          , Wwf         , Gs^Fp       , Mm          , Hh          , Rd          , Rd          , Rd          , Rp          , Hh          , Wwf         , Rd          , Xu          , Xu          , Uh          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Wwf         , Wwf         , Gs^Fp       , Rd          , Rd          , Uu^Uf       , Xu          , Wwf         , Wwf         , Wwf         , Ww          , Ww          , Hh          , Rp          , Rd          , Rd          , Hh          , Gs^Fp       , Hh          , Wwf         , Xu          , Rp          , Rd          , Uu^Uf       , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Rp          , Wwf         , Rp          , Rp          , Rd          , Xu          , Ur          , Xu          , Wwf         , Rp          , Ww          , Rp          , Gs^Fp       , Rp          , Rp          , Rd          , Rd          , Rd          , Gs^Fp       , Rp          , Wwf         , Uh          , Gs^Fp       , Rd          , Rd          , Uh          , Xu          , Wo          , Xu          , Xu          
Xu          , Xu          , Wo          , Ww          , Uh          , Uh          , Rd          , Xu          , Uh          , Wwf         , Rp          , Rd          , Rd          , Rp          , Rd          , Rd          , Rp          , Rp          , Rp          , Rd          , Rp          , Wwf         , Xu          , Xu          , Xu          , Uh          , Rp          , Ww          , Wwf         , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Rd          , Rd          , Gs^Fp       , Xu          , Wwf         , Hh          , Gs^Fp       , Hh          , Rd          , Rd          , Rp          , Hh          , Gs^Fp       , Ww          , Ww          , Wwf         , Wwf         , Xu          , Rd          , Rd          , Rd          , Gs^Fp       , Rp          , Wwf         , Rp          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Uu^Uf       , Uh          , Rp          , Xu          , Wwf         , Wwf         , Gs^Fp       , Rp          , Rd          , Rd          , Rp          , Hh          , Ww          , Gs^Fp       , Wwf         , Mm          , Wwf         , Xu          , Uu^Uf       , Uh          , Rd          , Xu          , Wwf         , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Gs^Fp       , Xu          , Rd          , Rd          , Wwf         , Hh          , Rp          , Rd          , Hh          , Rd          , Rd          , Mm          , Rd          , Wwf         , Wwf         , Wwf         , Xu          , Gs^Fp       , Xu          , Xu          , Rd          , Rd          , Ql          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Rp          , Rp          , Xu          , Ss^Vhs      , Rd          , Mm          , Rd          , Rd          , Rd          , Rd^Fp       , Uu^Vu       , Rd          , Xu          , Uh          , Ww          , Ww          , Xu          , Rd          , Rd          , Uu^Vu       , Rd          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Wwf         , Xu          , Xu          , Rd          , Rd^Fp       , Rd          , Rd          , Rd          , Wwf         , Wwf         , Ur          , Xu          , Ql          , Xu          , Wwf         , Ww          , Xu          , Ur          , Ur          , Gs^Fp       , Uu^Uf       , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Uu^Vu       , Rd          , Hh          , Rp          , Wwf         , Hh          , Rd          , Rd          , Uh          , Uu^Uf       , Ur^Fp       , Ql          , Ur          , Rd          , Rd          , Wwf         , Rd          , Xu          , Ur          , Xu          , Ur          , Ql          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Rd          , Rd          , Rd          , Ss^Vhs      , Rp          , Rp          , Rd          , Rd          , Rd^Fp       , Wwf         , Ur          , Ur          , Mm          , Rd          , Wwf         , Wwf         , Rd          , Rd          , Ur          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ss          , Ss          , Gs^Fp       , Ur          , Cud         , Cud         , Rd          , Rd          , Wwf         , Ur          , Ur          , Ur          , Rd          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Hh          , Rd          , Ur          , Ur          , Cud         , Rd          , Wwf         , Wwf         , Uu^Vu       , Uh          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ql          , Uu^Uf       , Uu          , Cud         , Ur          , Rd          , Xu          , Wwf^Uf      , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ql          , Ql          , 1 Kud       , Ql          , 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          , Ql          , Ql          , Ql          , Ql          , Ql          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
"
	mp_countdown="no"
	mp_countdown_action_bonus="13"
	mp_countdown_init_time="270"
	mp_countdown_reservoir_time="330"
	mp_countdown_turn_bonus="60"
	mp_fog="yes"
	mp_shroud="no"
	mp_use_map_settings="yes"
	mp_village_gold="2"
	name=_ "2p - Den of Onis"
	next_underlying_unit_id="32"
#textdomain wesnoth
	objectives=_ "Victory:
@Defeat enemy leader(s)"
	observer="yes"
	playing_team="1"
	random_calls="0"
	random_seed="26859"
	random_start_time="no"
	snapshot="yes"
	turn_at="17"
	turns="-1"
	unit_wml_ids="Bowman,Cavalryman,Dwarvish Fighter,Dwarvish Guardsman,Dwarvish Thunderer,Dwarvish Ulfserker,Fencer,Footpad,Gryphon Rider,Longbowman,Mage,Poacher,Rogue,Spearman,Thief,era_events"
	version="1.6"
	[side]
		action_bonus_count="45"
		aggression="0.5"
		allow_player="yes"
		caution="0.25"
		colour="1"
		controller="human"
		countdown_time="0"
		current_player="Gauteamus"
		disallow_observers="no"
		fog="yes"
		global_recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
		gold="6"
		hidden="no"
		id="Gauteamus1"
		income="0"
		leader_value="3"
		name="Gauteamus"
		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="Gauteamus1"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="1"
		start_gold="100"
		team_name="south"
#textdomain wesnoth-multiplayer
		user_team_name=_ "teamname^South"
		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="5"
			y="9"
		[/village]
		[village]
			x="6"
			y="19"
		[/village]
		[village]
			x="9"
			y="17"
		[/village]
		[village]
			x="10"
			y="20"
		[/village]
		[village]
			x="16"
			y="17"
		[/village]
		[village]
			x="19"
			y="22"
		[/village]
		[village]
			x="25"
			y="17"
		[/village]
		[unit]
			advances_to="Assassin"
			alignment="chaotic"
			allow_changes="yes"
			allow_player="yes"
			alpha="256"
			attacks_left="1"
			canrecruit="yes"
			colour="1"
			controller="human"
			cost="24"
			current_player="Gauteamus"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			experience="0"
			facing="sw"
			flag_rgb="magenta"
			flying="no"
			fog="yes"
			gender="male"
			gold="100"
			goto_x="-999"
			goto_y="-999"
			hitpoints="40"
			id="Gauteamus1"
			image="units/human-outlaws/rogue.png"
			income="0"
#textdomain wesnoth-units
			language_name=_ "Rogue"
			leader="Dwarvish Steelclad,Dwarvish Thunderguard,Dwarvish Stalwart,Rogue,Trapper"
			level="2"
			max_attacks="1"
			max_experience="49"
			max_hitpoints="40"
			max_moves="6"
			movement="6"
			movement_type="elusivefoot"
			moves="0"
			mp_countdown="no"
			mp_countdown_action_bonus="13"
			mp_countdown_init_time="270"
			mp_countdown_reservoir_time="330"
			mp_countdown_turn_bonus="60"
			name="Gauteamus"
			profile="portraits/humans/thief.png"
			race="human"
			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="no"
			save_id="Gauteamus1"
			share_maps="no"
			share_view="yes"
			shroud="no"
			side="1"
			team_name="south"
			terrain_liked="Hh, Ha, Mm"
			type="Rogue"
			underlying_id="1"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			user_team_name="wesnoth-multiplayerteamname^South"
			village_gold="2"
			x="15"
			y="24"
			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]
			[abilities]
				[skirmisher]
					affect_self="yes"
#textdomain wesnoth
					description=_ "Skirmisher:
This unit is skilled in moving past enemies quickly, and ignores all enemy Zones of Control."
					female_name=_ "female^skirmisher"
					id="skirmisher"
					name=_ "skirmisher"
				[/skirmisher]
			[/abilities]
			[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]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="6"
#textdomain wesnoth-units
				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]
			[attack]
				damage="4"
#textdomain wesnoth-units
				description=_ "knife"
				icon="attacks/dagger-thrown-human.png"
				name="knife"
				number="3"
				range="ranged"
				type="blade"
			[/attack]
			[modifications]
			[/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="5"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="13"
			id="Footpad-3"
			image="units/human-outlaws/footpad.png"
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="35"
			max_moves="7"
			movement="7"
			movement_type="elusivefoot"
			moves="2"
			name="Oweollyn"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Footpad"
			underlying_id="3"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="4"
			y="7"
			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^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="Dwarvish Berserker"
			alignment="neutral"
			alpha="256"
			attacks_left="0"
			cost="19"
			die_sound="dwarf-die-1.ogg,dwarf-die-2.ogg"
			ellipse="misc/ellipse"
			experience="24"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="15"
			id="Dwarvish Ulfserker-4"
			image="units/dwarves/ulfserker.png"
#textdomain wesnoth-units
			language_name=_ "Dwarvish Ulfserker"
			level="1"
			max_attacks="1"
			max_experience="29"
			max_hitpoints="33"
			max_moves="6"
			movement="5"
			movement_type="dwarvishfoot"
			moves="0"
			name="Anaithaithdr"
			profile="portraits/dwarves/ulfserker.png"
			race="dwarf"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Dwarvish Ulfserker"
			undead_variation="dwarf"
			underlying_id="4"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="5"
			y="9"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="berserker frenzy"
				[/filter_attack]
				[if]
					offset="0.0~-0.15:20,-0.15~0.1:30,0.1~0.5:190,0.5~0.6:30,0.6~0.6:30,0.6~0.15:100,0.15~0.0:30"
					start_time="-240"
					swing="1"
					[filter_second_attack]
					[/filter_second_attack]
				[/if]
				[else]
					offset="0.0~0.0:3400,0.0~-0.15:20,-0.15~0.1:30,0.1~0.5:190,0.5~0.6:30,0.6~0.6:30,0.6~0.15:100,0.15~0.0:30"
					start_time="-3640"
					swing="1"
					[frame]
						duration="200"
						image="units/dwarves/ulfserker.png"
					[/frame]
					[frame]
						duration="400"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-2.png"
						sound="dwarf-laugh.wav"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-2.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-2.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-2.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-2.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-2.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-2.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
				[/else]
				[else]
					[frame]
						duration="1"
						image="units/dwarves/ulfserker.png"
					[/frame]
				[/else]
				[frame]
					duration="40"
					image="units/dwarves/ulfserker-attack-1.png"
				[/frame]
				[frame]
					duration="50"
					image="units/dwarves/ulfserker-attack-2.png"
				[/frame]
				[frame]
					duration="50"
					image="units/dwarves/ulfserker-attack-3.png"
				[/frame]
				[frame]
					duration="50"
					image="units/dwarves/ulfserker-attack-4.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="50"
						image="units/dwarves/ulfserker-attack-5.png"
						sound="axe.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="50"
						image="units/dwarves/ulfserker-attack-5.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="60"
					image="units/dwarves/ulfserker-attack-6.png"
				[/frame]
				[frame]
					duration="40"
					image="units/dwarves/ulfserker-attack-7.png"
				[/frame]
				[frame]
					duration="30"
					image="units/dwarves/ulfserker-attack-8.png"
				[/frame]
				[frame]
					duration="30"
					image="units/dwarves/ulfserker-attack-1.png"
				[/frame]
				[frame]
					duration="30"
					image="units/dwarves/ulfserker.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/dwarves/ulfserker-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/ulfserker-idle-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/dwarves/ulfserker-idle-2.png"
						sound="dwarf-hit-1.ogg,dwarf-hit-2.ogg,dwarf-hit-3.ogg,dwarf-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/dwarves/ulfserker-idle-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/dwarves/ulfserker-idle-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/dwarves/ulfserker-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/ulfserker-idle-2.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/ulfserker-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/ulfserker-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/ulfserker-idle-5.png"
				[/frame]
				[frame]
					duration="300"
					image="units/dwarves/ulfserker-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/ulfserker-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/ulfserker-idle-5.png"
				[/frame]
				[frame]
					duration="300"
					image="units/dwarves/ulfserker-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/ulfserker-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/ulfserker-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/ulfserker-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/dwarves/transparent/ulfserker.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/dwarves/transparent/ulfserker.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="60"
				cave="60"
				deep_water="80"
				flat="70"
				forest="70"
				frozen="70"
				fungus="60"
				hills="60"
				impassable="50"
				mountains="50"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="60"
			[/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="80"
				cold="90"
				fire="90"
				impact="80"
				pierce="80"
			[/resistance]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="5"
				description=_ "berserker frenzy"
				icon="attacks/frenzy.png"
				name="berserker frenzy"
				number="4"
				range="melee"
				type="blade"
				[specials]
					[berserk]
#textdomain wesnoth
						description=_ "Berserk:
Whether used offensively or defensively, this attack presses the engagement until one of the combatants is slain, or 30 rounds of attacks have occurred."
						id="berserk"
						name=_ "berserk"
						value="30"
					[/berserk]
				[/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^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]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Dwarvish Stalwart"
			alignment="neutral"
			alpha="256"
			attacks_left="1"
			cost="19"
			die_sound="dwarf-die-1.ogg,dwarf-die-2.ogg"
			ellipse="misc/ellipse"
			experience="7"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="17"
			id="Dwarvish Guardsman-5"
			image="units/dwarves/guard.png"
#textdomain wesnoth-units
			language_name=_ "Dwarvish Guardsman"
			level="1"
			max_attacks="1"
			max_experience="33"
			max_hitpoints="45"
			max_moves="5"
			movement="4"
			movement_type="dwarvishfoot"
			moves="5"
			name="Peldrsol"
			profile="portraits/dwarves/guard.png"
			race="dwarf"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Dwarvish Guardsman"
			undead_variation="dwarf"
			underlying_id="5"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="6"
			y="7"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="javelin"
				[/filter_attack]
				[missile_frame]
					begin="-150"
					end="0"
					image="projectiles/spear-n.png"
					image_diagonal="projectiles/spear-ne.png"
				[/missile_frame]
				[frame]
					begin="-250"
					end="-150"
					image="units/dwarves/guard-defend-1.png"
					sound="throw-1.wav,throw-2.wav,throw-3.wav,throw-4.wav"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-150"
						end="-50"
						image="units/dwarves/guard-attack.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-150"
						end="-50"
						image="units/dwarves/guard-attack.png"
					[/frame]
				[/else]
				[frame]
					begin="-50"
					end="0"
					image="units/dwarves/guard.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-150"
					image="units/dwarves/guard.png"
				[/frame]
				[frame]
					begin="-150"
					end="-100"
					image="units/dwarves/guard-defend-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="50"
						image="units/dwarves/guard-attack.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="50"
						image="units/dwarves/guard-attack.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="50"
					end="75"
					image="units/dwarves/guard-defend-2.png"
				[/frame]
				[frame]
					begin="75"
					end="150"
					image="units/dwarves/guard.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/dwarves/guard-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/guard-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/dwarves/guard-defend-2.png"
						sound="dwarf-hit-1.ogg,dwarf-hit-2.ogg,dwarf-hit-3.ogg,dwarf-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/dwarves/guard-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/dwarves/guard-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/dwarves/guard-idle-1.png"
				[/frame]
				[frame]
					duration="500"
					image="units/dwarves/guard-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/guard-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/guard-idle-4.png"
				[/frame]
				[frame]
					duration="400"
					image="units/dwarves/guard-idle-5.png"
				[/frame]
				[frame]
					duration="500"
					image="units/dwarves/guard-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/guard-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/dwarves/transparent/guard.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/dwarves/transparent/guard.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="50"
				impassable="50"
				mountains="40"
				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="80"
				cold="90"
				fire="90"
				impact="80"
				pierce="80"
			[/resistance]
			[abilities]
				[resistance]
					active_on="defense"
					affect_self="yes"
					apply_to="blade,pierce,impact,fire,cold,arcane"
#textdomain wesnoth
					description=_ "Steadfast:
This unit's resistances are doubled, up to a maximum of 50%, when defending. Vulnerabilities are not affected."
					female_name=_ "female^steadfast"
					id="steadfast"
					max_value="50"
					multiply="2"
					name=_ "steadfast"
					[filter_base_value]
						greater_than="0"
						less_than_equal_to="50"
					[/filter_base_value]
				[/resistance]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
#textdomain wesnoth-units
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="3"
				range="melee"
				type="pierce"
			[/attack]
			[attack]
				damage="5"
				description=_ "javelin"
				icon="attacks/javelin-human.png"
				name="javelin"
				number="1"
				range="ranged"
				type="pierce"
			[/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^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="Trapper"
			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="4"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="30"
			id="Poacher-11"
			image="units/human-outlaws/poacher.png"
#textdomain wesnoth-units
			language_name=_ "Poacher"
			level="1"
			max_attacks="1"
			max_experience="16"
			max_hitpoints="30"
			max_moves="6"
			movement="5"
			movement_type="smallfoot"
			moves="0"
			name="Runnyc"
			profile="portraits/humans/poacher.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Poacher"
			undead_variation="archer"
			underlying_id="11"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			x="21"
			y="19"
			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/human-outlaws/poacher-attack1.png"
						sound="bow.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-400"
						end="-250"
						image="units/human-outlaws/poacher-attack1.png"
						sound="bow-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-250"
					end="-100"
					image="units/human-outlaws/poacher-attack2.png"
				[/frame]
				[frame]
					begin="-100"
					end="0"
					image="units/human-outlaws/poacher-attack3.png"
				[/frame]
				[frame]
					begin="0"
					end="100"
					image="units/human-outlaws/poacher.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-150"
					image="units/human-outlaws/poacher-dagger.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-150"
						end="50"
						image="units/human-outlaws/poacher-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-150"
						end="50"
						image="units/human-outlaws/poacher-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="50"
					end="150"
					image="units/human-outlaws/poacher-dagger.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[filter_attack]
					range="melee"
				[/filter_attack]
				[frame]
					duration="1"
					image="units/human-outlaws/poacher-dagger.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/poacher-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/poacher-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/poacher-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/poacher-dagger.png"
				[/frame]
			[/defend]
			[defend]
				start_time="-126"
				[filter_attack]
					range="ranged"
				[/filter_attack]
				[frame]
					duration="1"
					image="units/human-outlaws/poacher.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/poacher-bow-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/poacher-bow-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/poacher-bow-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/poacher.png"
				[/frame]
			[/defend]
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="40"
				frozen="80"
				fungus="50"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="50"
				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="2"
				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="3"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="2"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="4"
				description=_ "bow"
				name="bow"
				number="4"
				range="ranged"
				type="pierce"
			[/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="0"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="14"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="35"
			id="Footpad-14"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="35"
			max_moves="7"
			movement="7"
			movement_type="elusivefoot"
			moves="0"
			name="Vinvan"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Footpad"
			underlying_id="14"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="26"
			y="14"
			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]
			[/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^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="Dwarvish Steelclad"
			alignment="neutral"
			alpha="256"
			attacks_left="1"
			cost="16"
			die_sound="dwarf-die-1.ogg,dwarf-die-2.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="38"
			id="Dwarvish Fighter-16"
			image="units/dwarves/fighter.png"
#textdomain wesnoth-units
			language_name=_ "Dwarvish Fighter"
			level="1"
			max_attacks="1"
			max_experience="29"
			max_hitpoints="38"
			max_moves="5"
			movement="4"
			movement_type="dwarvishfoot"
			moves="3"
			name="Glamthaol"
			profile="portraits/dwarves/fighter.png"
			race="dwarf"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Dwarvish Fighter"
			undead_variation="dwarf"
			underlying_id="16"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="16"
			y="9"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="hammer"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-150"
					image="units/dwarves/fighter-hammer.png"
				[/frame]
				[frame]
					begin="-150"
					end="-100"
					image="units/dwarves/fighter-hammer-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/dwarves/fighter-hammer-2.png"
						sound="mace.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/dwarves/fighter-hammer-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="175"
					image="units/dwarves/fighter-hammer-3.png"
				[/frame]
				[frame]
					begin="175"
					end="200"
					image="units/dwarves/fighter-hammer.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				offset="0.0~-0.15:30,-0.15~0.1:60,0.1~0.5:190,0.5~0.6:30,0.6~0.6:40,0.6~0.15:150,0.15~0.0:40"
				start_time="-350"
				[filter_attack]
					name="axe"
				[/filter_attack]
				[frame]
					duration="40"
					image="units/dwarves/fighter-axe-1.png"
				[/frame]
				[frame]
					duration="60"
					image="units/dwarves/fighter-axe-2.png"
				[/frame]
				[frame]
					duration="60"
					image="units/dwarves/fighter-axe-3.png"
				[/frame]
				[frame]
					duration="60"
					image="units/dwarves/fighter-axe-4.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="60"
						image="units/dwarves/fighter-axe-5.png"
						sound="axe.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="60"
						image="units/dwarves/fighter-axe-5.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="60"
					image="units/dwarves/fighter-axe-6.png"
				[/frame]
				[frame]
					duration="60"
					image="units/dwarves/fighter-axe-7.png"
				[/frame]
				[frame]
					duration="60"
					image="units/dwarves/fighter-axe-8.png"
				[/frame]
				[frame]
					duration="60"
					image="units/dwarves/fighter-axe-9.png"
				[/frame]
				[frame]
					duration="20"
					image="units/dwarves/fighter.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[filter_second_attack]
					name="axe"
				[/filter_second_attack]
				[frame]
					duration="1"
					image="units/dwarves/fighter-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/fighter-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/dwarves/fighter-defend-2.png"
						sound="dwarf-hit-1.ogg,dwarf-hit-2.ogg,dwarf-hit-3.ogg,dwarf-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/dwarves/fighter-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/dwarves/fighter-defend-1.png"
				[/frame]
			[/defend]
			[defend]
				start_time="-126"
				[filter_second_attack]
					name="hammer"
				[/filter_second_attack]
				[frame]
					duration="1"
					image="units/dwarves/fighter-hammer.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/fighter-hammer-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/dwarves/fighter-hammer-defend.png"
						sound="dwarf-hit-1.ogg,dwarf-hit-2.ogg,dwarf-hit-3.ogg,dwarf-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/dwarves/fighter-hammer-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/dwarves/fighter-hammer.png"
				[/frame]
			[/defend]
			[defend]
				start_time="-126"
				[filter_attack]
					range="ranged"
				[/filter_attack]
				[frame]
					duration="1"
					image="units/dwarves/fighter.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/fighter-defend-1.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/dwarves/fighter-defend-1.png"
						sound="dwarf-hit-1.ogg,dwarf-hit-2.ogg,dwarf-hit-3.ogg,dwarf-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/dwarves/fighter-defend-1.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/dwarves/fighter.png"
				[/frame]
			[/defend]
			[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="80"
				cold="90"
				fire="90"
				impact="80"
				pierce="80"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="7"
				description=_ "axe"
				name="axe"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="8"
				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]
				[trait]
					description=_ "Can rest while moving, takes a quarter less poison damage"
					female_name=_ "female^healthy"
					id="healthy"
					male_name=_ "healthy"
					name=_ "healthy"
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Dwarvish Thunderguard"
			alignment="neutral"
			alpha="256"
			attacks_left="0"
			cost="17"
			die_sound="dwarf-die-1.ogg,dwarf-die-2.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="35"
			id="Dwarvish Thunderer-17"
			image="units/dwarves/thunderer.png"
#textdomain wesnoth-units
			language_name=_ "Dwarvish Thunderer"
			level="1"
			max_attacks="1"
			max_experience="22"
			max_hitpoints="35"
			max_moves="4"
			movement="4"
			movement_type="dwarvishfoot"
			moves="0"
			name="Aigatil"
			profile="portraits/dwarves/thunderer.png"
			race="dwarf"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Dwarvish Thunderer"
			undead_variation="dwarf"
			underlying_id="17"
			unrenamable="no"
			upkeep="full"
			usage="mixed fighter"
			x="14"
			y="9"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="thunderstick"
				[/filter_attack]
				[if]
					direction="s"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="0~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-s-1.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-s-2.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-s-3.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-s.png"
						sound="thunderstick.ogg"
					[/frame]
				[/if]
				[else]
					direction="s"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-s.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[else]
					direction="ne,nw"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="20~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-ne-1.png"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-ne-2.png"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-ne-3.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-ne.png"
						sound="thunderstick.ogg"
					[/frame]
				[/else]
				[else]
					direction="ne,nw"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-ne.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[else]
					direction="n"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="20~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-n-1.png"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-n-2.png"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-n-3.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-n.png"
						sound="thunderstick.ogg"
					[/frame]
				[/else]
				[else]
					direction="n"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-n.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[else]
					direction="se,sw"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="0~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-se-1.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-se-2.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-se-3.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-se.png"
						sound="thunderstick.ogg"
					[/frame]
				[/else]
				[else]
					direction="se,sw"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-se.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="0"
					end="1"
					image="units/dwarves/thunderer-attack-se.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/dwarves/thunderer.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/dwarves/thunderer-melee1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="50"
						image="units/dwarves/thunderer-melee2.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="50"
						image="units/dwarves/thunderer-melee2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="50"
					end="100"
					image="units/dwarves/thunderer-melee1.png"
				[/frame]
				[frame]
					begin="100"
					end="125"
					image="units/dwarves/thunderer.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="200"
					image="units/dwarves/thunderer-die1.png"
				[/frame]
				[frame]
					begin="200"
					end="400"
					image="units/dwarves/thunderer-die2.png"
				[/frame]
				[frame]
					begin="400"
					end="600"
					image="units/dwarves/thunderer-die3.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/dwarves/thunderer.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/dwarves/thunderer-defend.png"
						sound="dwarf-hit-1.ogg,dwarf-hit-2.ogg,dwarf-hit-3.ogg,dwarf-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/dwarves/thunderer-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/dwarves/thunderer.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/dwarves/thunderer-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-3.png"
				[/frame]
				[frame]
					duration="800"
					image="units/dwarves/thunderer-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-5.png"
				[/frame]
				[frame]
					duration="300"
					image="units/dwarves/thunderer-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-5.png"
				[/frame]
				[frame]
					duration="300"
					image="units/dwarves/thunderer-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-5.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/dwarves/thunderer-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/dwarves/transparent/thunderer.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/dwarves/transparent/thunderer.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="80"
				cold="90"
				fire="90"
				impact="80"
				pierce="80"
			[/resistance]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="7"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="2"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="18"
				description=_ "thunderstick"
				name="thunderstick"
				number="1"
				range="ranged"
				type="pierce"
			[/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^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]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Dwarvish Thunderguard"
			alignment="neutral"
			alpha="256"
			attacks_left="0"
			cost="17"
			die_sound="dwarf-die-1.ogg,dwarf-die-2.ogg"
			ellipse="misc/ellipse"
			experience="10"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="36"
			id="Dwarvish Thunderer-20"
			image="units/dwarves/thunderer.png"
#textdomain wesnoth-units
			language_name=_ "Dwarvish Thunderer"
			level="1"
			max_attacks="1"
			max_experience="28"
			max_hitpoints="41"
			max_moves="4"
			movement="4"
			movement_type="dwarvishfoot"
			moves="0"
			name="Alcatlos"
			profile="portraits/dwarves/thunderer.png"
			race="dwarf"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Dwarvish Thunderer"
			undead_variation="dwarf"
			underlying_id="20"
			unrenamable="no"
			upkeep="full"
			usage="mixed fighter"
			x="27"
			y="14"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="thunderstick"
				[/filter_attack]
				[if]
					direction="s"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="0~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-s-1.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-s-2.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-s-3.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-s.png"
						sound="thunderstick.ogg"
					[/frame]
				[/if]
				[else]
					direction="s"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-s.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[else]
					direction="ne,nw"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="20~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-ne-1.png"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-ne-2.png"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-ne-3.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-ne.png"
						sound="thunderstick.ogg"
					[/frame]
				[/else]
				[else]
					direction="ne,nw"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-ne.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[else]
					direction="n"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="20~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-n-1.png"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-n-2.png"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-n-3.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-n.png"
						sound="thunderstick.ogg"
					[/frame]
				[/else]
				[else]
					direction="n"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-n.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[else]
					direction="se,sw"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="0~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-se-1.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-se-2.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-se-3.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-se.png"
						sound="thunderstick.ogg"
					[/frame]
				[/else]
				[else]
					direction="se,sw"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-se.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="0"
					end="1"
					image="units/dwarves/thunderer-attack-se.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/dwarves/thunderer.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/dwarves/thunderer-melee1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="50"
						image="units/dwarves/thunderer-melee2.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="50"
						image="units/dwarves/thunderer-melee2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="50"
					end="100"
					image="units/dwarves/thunderer-melee1.png"
				[/frame]
				[frame]
					begin="100"
					end="125"
					image="units/dwarves/thunderer.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="200"
					image="units/dwarves/thunderer-die1.png"
				[/frame]
				[frame]
					begin="200"
					end="400"
					image="units/dwarves/thunderer-die2.png"
				[/frame]
				[frame]
					begin="400"
					end="600"
					image="units/dwarves/thunderer-die3.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/dwarves/thunderer.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/dwarves/thunderer-defend.png"
						sound="dwarf-hit-1.ogg,dwarf-hit-2.ogg,dwarf-hit-3.ogg,dwarf-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/dwarves/thunderer-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/dwarves/thunderer.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/dwarves/thunderer-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-3.png"
				[/frame]
				[frame]
					duration="800"
					image="units/dwarves/thunderer-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-5.png"
				[/frame]
				[frame]
					duration="300"
					image="units/dwarves/thunderer-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-5.png"
				[/frame]
				[frame]
					duration="300"
					image="units/dwarves/thunderer-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-5.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/dwarves/thunderer-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/dwarves/transparent/thunderer.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/dwarves/transparent/thunderer.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="80"
				cold="90"
				fire="90"
				impact="80"
				pierce="80"
			[/resistance]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="6"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="2"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="18"
				description=_ "thunderstick"
				name="thunderstick"
				number="1"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					description=_ "Can rest while moving, takes a quarter less poison damage"
					female_name=_ "female^healthy"
					id="healthy"
					male_name=_ "healthy"
					name=_ "healthy"
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/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="Dwarvish Stalwart"
			alignment="neutral"
			alpha="256"
			attacks_left="0"
			cost="19"
			die_sound="dwarf-die-1.ogg,dwarf-die-2.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="sw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="33"
			id="Dwarvish Guardsman-21"
			image="units/dwarves/guard.png"
#textdomain wesnoth-units
			language_name=_ "Dwarvish Guardsman"
			level="1"
			max_attacks="1"
			max_experience="33"
			max_hitpoints="45"
			max_moves="5"
			movement="4"
			movement_type="dwarvishfoot"
			moves="0"
			name="Nardrsol"
			profile="portraits/dwarves/guard.png"
			race="dwarf"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Dwarvish Guardsman"
			undead_variation="dwarf"
			underlying_id="21"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="15"
			y="8"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="javelin"
				[/filter_attack]
				[missile_frame]
					begin="-150"
					end="0"
					image="projectiles/spear-n.png"
					image_diagonal="projectiles/spear-ne.png"
				[/missile_frame]
				[frame]
					begin="-250"
					end="-150"
					image="units/dwarves/guard-defend-1.png"
					sound="throw-1.wav,throw-2.wav,throw-3.wav,throw-4.wav"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-150"
						end="-50"
						image="units/dwarves/guard-attack.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-150"
						end="-50"
						image="units/dwarves/guard-attack.png"
					[/frame]
				[/else]
				[frame]
					begin="-50"
					end="0"
					image="units/dwarves/guard.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-150"
					image="units/dwarves/guard.png"
				[/frame]
				[frame]
					begin="-150"
					end="-100"
					image="units/dwarves/guard-defend-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="50"
						image="units/dwarves/guard-attack.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="50"
						image="units/dwarves/guard-attack.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="50"
					end="75"
					image="units/dwarves/guard-defend-2.png"
				[/frame]
				[frame]
					begin="75"
					end="150"
					image="units/dwarves/guard.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/dwarves/guard-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/guard-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/dwarves/guard-defend-2.png"
						sound="dwarf-hit-1.ogg,dwarf-hit-2.ogg,dwarf-hit-3.ogg,dwarf-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/dwarves/guard-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/dwarves/guard-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/dwarves/guard-idle-1.png"
				[/frame]
				[frame]
					duration="500"
					image="units/dwarves/guard-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/guard-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/guard-idle-4.png"
				[/frame]
				[frame]
					duration="400"
					image="units/dwarves/guard-idle-5.png"
				[/frame]
				[frame]
					duration="500"
					image="units/dwarves/guard-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/guard-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/dwarves/transparent/guard.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/dwarves/transparent/guard.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="50"
				impassable="50"
				mountains="40"
				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="80"
				cold="90"
				fire="90"
				impact="80"
				pierce="80"
			[/resistance]
			[abilities]
				[resistance]
					active_on="defense"
					affect_self="yes"
					apply_to="blade,pierce,impact,fire,cold,arcane"
#textdomain wesnoth
					description=_ "Steadfast:
This unit's resistances are doubled, up to a maximum of 50%, when defending. Vulnerabilities are not affected."
					female_name=_ "female^steadfast"
					id="steadfast"
					max_value="50"
					multiply="2"
					name=_ "steadfast"
					[filter_base_value]
						greater_than="0"
						less_than_equal_to="50"
					[/filter_base_value]
				[/resistance]
			[/abilities]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="5"
#textdomain wesnoth-units
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="3"
				range="melee"
				type="pierce"
			[/attack]
			[attack]
				damage="5"
				description=_ "javelin"
				icon="attacks/javelin-human.png"
				name="javelin"
				number="1"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					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^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 Berserker"
			alignment="neutral"
			alpha="256"
			attacks_left="1"
			cost="19"
			die_sound="dwarf-die-1.ogg,dwarf-die-2.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="36"
			id="Dwarvish Ulfserker-25"
			image="units/dwarves/ulfserker.png"
#textdomain wesnoth-units
			language_name=_ "Dwarvish Ulfserker"
			level="1"
			max_attacks="1"
			max_experience="24"
			max_hitpoints="36"
			max_moves="5"
			movement="5"
			movement_type="dwarvishfoot"
			moves="0"
			name="Gomdurus"
			profile="portraits/dwarves/ulfserker.png"
			race="dwarf"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Dwarvish Ulfserker"
			undead_variation="dwarf"
			underlying_id="25"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="25"
			y="17"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="berserker frenzy"
				[/filter_attack]
				[if]
					offset="0.0~-0.15:20,-0.15~0.1:30,0.1~0.5:190,0.5~0.6:30,0.6~0.6:30,0.6~0.15:100,0.15~0.0:30"
					start_time="-240"
					swing="1"
					[filter_second_attack]
					[/filter_second_attack]
				[/if]
				[else]
					offset="0.0~0.0:3400,0.0~-0.15:20,-0.15~0.1:30,0.1~0.5:190,0.5~0.6:30,0.6~0.6:30,0.6~0.15:100,0.15~0.0:30"
					start_time="-3640"
					swing="1"
					[frame]
						duration="200"
						image="units/dwarves/ulfserker.png"
					[/frame]
					[frame]
						duration="400"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-2.png"
						sound="dwarf-laugh.wav"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-2.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-2.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-2.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-2.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-2.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-2.png"
					[/frame]
					[frame]
						duration="200"
						image="units/dwarves/ulfserker-laugh-1.png"
					[/frame]
				[/else]
				[else]
					[frame]
						duration="1"
						image="units/dwarves/ulfserker.png"
					[/frame]
				[/else]
				[frame]
					duration="40"
					image="units/dwarves/ulfserker-attack-1.png"
				[/frame]
				[frame]
					duration="50"
					image="units/dwarves/ulfserker-attack-2.png"
				[/frame]
				[frame]
					duration="50"
					image="units/dwarves/ulfserker-attack-3.png"
				[/frame]
				[frame]
					duration="50"
					image="units/dwarves/ulfserker-attack-4.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="50"
						image="units/dwarves/ulfserker-attack-5.png"
						sound="axe.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="50"
						image="units/dwarves/ulfserker-attack-5.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="60"
					image="units/dwarves/ulfserker-attack-6.png"
				[/frame]
				[frame]
					duration="40"
					image="units/dwarves/ulfserker-attack-7.png"
				[/frame]
				[frame]
					duration="30"
					image="units/dwarves/ulfserker-attack-8.png"
				[/frame]
				[frame]
					duration="30"
					image="units/dwarves/ulfserker-attack-1.png"
				[/frame]
				[frame]
					duration="30"
					image="units/dwarves/ulfserker.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/dwarves/ulfserker-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/ulfserker-idle-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/dwarves/ulfserker-idle-2.png"
						sound="dwarf-hit-1.ogg,dwarf-hit-2.ogg,dwarf-hit-3.ogg,dwarf-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/dwarves/ulfserker-idle-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/dwarves/ulfserker-idle-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/dwarves/ulfserker-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/ulfserker-idle-2.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/ulfserker-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/ulfserker-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/ulfserker-idle-5.png"
				[/frame]
				[frame]
					duration="300"
					image="units/dwarves/ulfserker-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/ulfserker-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/ulfserker-idle-5.png"
				[/frame]
				[frame]
					duration="300"
					image="units/dwarves/ulfserker-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/ulfserker-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/ulfserker-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/ulfserker-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/dwarves/transparent/ulfserker.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/dwarves/transparent/ulfserker.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="60"
				cave="60"
				deep_water="80"
				flat="70"
				forest="70"
				frozen="70"
				fungus="60"
				hills="60"
				impassable="50"
				mountains="50"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="60"
			[/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="80"
				cold="90"
				fire="90"
				impact="80"
				pierce="80"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="4"
				description=_ "berserker frenzy"
				icon="attacks/frenzy.png"
				name="berserker frenzy"
				number="4"
				range="melee"
				type="blade"
				[specials]
					[berserk]
#textdomain wesnoth
						description=_ "Berserk:
Whether used offensively or defensively, this attack presses the engagement until one of the combatants is slain, or 30 rounds of attacks have occurred."
						id="berserk"
						name=_ "berserk"
						value="30"
					[/berserk]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
				[trait]
					description=_ "Can rest while moving, takes a quarter less poison damage"
					female_name=_ "female^healthy"
					id="healthy"
					male_name=_ "healthy"
					name=_ "healthy"
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Dwarvish Steelclad"
			alignment="neutral"
			alpha="256"
			attacks_left="1"
			cost="16"
			die_sound="dwarf-die-1.ogg,dwarf-die-2.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="sw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="36"
			id="Dwarvish Fighter-26"
			image="units/dwarves/fighter.png"
#textdomain wesnoth-units
			language_name=_ "Dwarvish Fighter"
			level="1"
			max_attacks="1"
			max_experience="23"
			max_hitpoints="36"
			max_moves="5"
			movement="4"
			movement_type="dwarvishfoot"
			moves="1"
			name="Pelalomalus"
			profile="portraits/dwarves/fighter.png"
			race="dwarf"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Dwarvish Fighter"
			undead_variation="dwarf"
			underlying_id="26"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="18"
			y="11"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="hammer"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-150"
					image="units/dwarves/fighter-hammer.png"
				[/frame]
				[frame]
					begin="-150"
					end="-100"
					image="units/dwarves/fighter-hammer-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/dwarves/fighter-hammer-2.png"
						sound="mace.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/dwarves/fighter-hammer-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="175"
					image="units/dwarves/fighter-hammer-3.png"
				[/frame]
				[frame]
					begin="175"
					end="200"
					image="units/dwarves/fighter-hammer.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				offset="0.0~-0.15:30,-0.15~0.1:60,0.1~0.5:190,0.5~0.6:30,0.6~0.6:40,0.6~0.15:150,0.15~0.0:40"
				start_time="-350"
				[filter_attack]
					name="axe"
				[/filter_attack]
				[frame]
					duration="40"
					image="units/dwarves/fighter-axe-1.png"
				[/frame]
				[frame]
					duration="60"
					image="units/dwarves/fighter-axe-2.png"
				[/frame]
				[frame]
					duration="60"
					image="units/dwarves/fighter-axe-3.png"
				[/frame]
				[frame]
					duration="60"
					image="units/dwarves/fighter-axe-4.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="60"
						image="units/dwarves/fighter-axe-5.png"
						sound="axe.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="60"
						image="units/dwarves/fighter-axe-5.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="60"
					image="units/dwarves/fighter-axe-6.png"
				[/frame]
				[frame]
					duration="60"
					image="units/dwarves/fighter-axe-7.png"
				[/frame]
				[frame]
					duration="60"
					image="units/dwarves/fighter-axe-8.png"
				[/frame]
				[frame]
					duration="60"
					image="units/dwarves/fighter-axe-9.png"
				[/frame]
				[frame]
					duration="20"
					image="units/dwarves/fighter.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[filter_second_attack]
					name="axe"
				[/filter_second_attack]
				[frame]
					duration="1"
					image="units/dwarves/fighter-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/fighter-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/dwarves/fighter-defend-2.png"
						sound="dwarf-hit-1.ogg,dwarf-hit-2.ogg,dwarf-hit-3.ogg,dwarf-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/dwarves/fighter-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/dwarves/fighter-defend-1.png"
				[/frame]
			[/defend]
			[defend]
				start_time="-126"
				[filter_second_attack]
					name="hammer"
				[/filter_second_attack]
				[frame]
					duration="1"
					image="units/dwarves/fighter-hammer.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/fighter-hammer-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/dwarves/fighter-hammer-defend.png"
						sound="dwarf-hit-1.ogg,dwarf-hit-2.ogg,dwarf-hit-3.ogg,dwarf-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/dwarves/fighter-hammer-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/dwarves/fighter-hammer.png"
				[/frame]
			[/defend]
			[defend]
				start_time="-126"
				[filter_attack]
					range="ranged"
				[/filter_attack]
				[frame]
					duration="1"
					image="units/dwarves/fighter.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/fighter-defend-1.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/dwarves/fighter-defend-1.png"
						sound="dwarf-hit-1.ogg,dwarf-hit-2.ogg,dwarf-hit-3.ogg,dwarf-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/dwarves/fighter-defend-1.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/dwarves/fighter.png"
				[/frame]
			[/defend]
			[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="80"
				cold="90"
				fire="90"
				impact="80"
				pierce="80"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="7"
				description=_ "axe"
				name="axe"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="8"
				description=_ "hammer"
				icon="attacks/hammer-dwarven.png"
				name="hammer"
				number="2"
				range="melee"
				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="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="0"
			cost="13"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="23"
			id="Thief-27"
			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="0"
			name="Middreorran"
			profile="portraits/humans/thief.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Thief"
			underlying_id="27"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="13"
			y="9"
			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]
			[/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^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 Thunderguard"
			alignment="neutral"
			alpha="256"
			attacks_left="0"
			cost="17"
			die_sound="dwarf-die-1.ogg,dwarf-die-2.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="35"
			id="Dwarvish Thunderer-29"
			image="units/dwarves/thunderer.png"
#textdomain wesnoth-units
			language_name=_ "Dwarvish Thunderer"
			level="1"
			max_attacks="1"
			max_experience="22"
			max_hitpoints="39"
			max_moves="4"
			movement="4"
			movement_type="dwarvishfoot"
			moves="0"
			name="Dulamatil"
			profile="portraits/dwarves/thunderer.png"
			race="dwarf"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Dwarvish Thunderer"
			undead_variation="dwarf"
			underlying_id="29"
			unrenamable="no"
			upkeep="full"
			usage="mixed fighter"
			x="15"
			y="9"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="thunderstick"
				[/filter_attack]
				[if]
					direction="s"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="0~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-s-1.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-s-2.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-s-3.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-s.png"
						sound="thunderstick.ogg"
					[/frame]
				[/if]
				[else]
					direction="s"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-s.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[else]
					direction="ne,nw"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="20~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-ne-1.png"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-ne-2.png"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-ne-3.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-ne.png"
						sound="thunderstick.ogg"
					[/frame]
				[/else]
				[else]
					direction="ne,nw"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-ne.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[else]
					direction="n"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="20~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-n-1.png"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-n-2.png"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-n-3.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-n.png"
						sound="thunderstick.ogg"
					[/frame]
				[/else]
				[else]
					direction="n"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-n.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[else]
					direction="se,sw"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="0~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-se-1.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-se-2.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-se-3.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-se.png"
						sound="thunderstick.ogg"
					[/frame]
				[/else]
				[else]
					direction="se,sw"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-se.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="0"
					end="1"
					image="units/dwarves/thunderer-attack-se.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/dwarves/thunderer.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/dwarves/thunderer-melee1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="50"
						image="units/dwarves/thunderer-melee2.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="50"
						image="units/dwarves/thunderer-melee2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="50"
					end="100"
					image="units/dwarves/thunderer-melee1.png"
				[/frame]
				[frame]
					begin="100"
					end="125"
					image="units/dwarves/thunderer.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="200"
					image="units/dwarves/thunderer-die1.png"
				[/frame]
				[frame]
					begin="200"
					end="400"
					image="units/dwarves/thunderer-die2.png"
				[/frame]
				[frame]
					begin="400"
					end="600"
					image="units/dwarves/thunderer-die3.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/dwarves/thunderer.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/dwarves/thunderer-defend.png"
						sound="dwarf-hit-1.ogg,dwarf-hit-2.ogg,dwarf-hit-3.ogg,dwarf-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/dwarves/thunderer-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/dwarves/thunderer.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/dwarves/thunderer-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-3.png"
				[/frame]
				[frame]
					duration="800"
					image="units/dwarves/thunderer-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-5.png"
				[/frame]
				[frame]
					duration="300"
					image="units/dwarves/thunderer-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-5.png"
				[/frame]
				[frame]
					duration="300"
					image="units/dwarves/thunderer-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-5.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/dwarves/thunderer-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/dwarves/transparent/thunderer.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/dwarves/transparent/thunderer.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="80"
				cold="90"
				fire="90"
				impact="80"
				pierce="80"
			[/resistance]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="6"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="2"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="18"
				description=_ "thunderstick"
				name="thunderstick"
				number="1"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					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="Dwarvish Thunderguard"
			alignment="neutral"
			alpha="256"
			attacks_left="1"
			cost="17"
			die_sound="dwarf-die-1.ogg,dwarf-die-2.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="32"
			id="Dwarvish Thunderer-31"
			image="units/dwarves/thunderer.png"
#textdomain wesnoth-units
			language_name=_ "Dwarvish Thunderer"
			level="1"
			max_attacks="1"
			max_experience="22"
			max_hitpoints="32"
			max_moves="5"
			movement="4"
			movement_type="dwarvishfoot"
			moves="0"
			name="Glamdril"
			profile="portraits/dwarves/thunderer.png"
			race="dwarf"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Dwarvish Thunderer"
			undead_variation="dwarf"
			underlying_id="31"
			unrenamable="no"
			upkeep="full"
			usage="mixed fighter"
			x="14"
			y="11"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="thunderstick"
				[/filter_attack]
				[if]
					direction="s"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="0~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-s-1.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-s-2.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-s-3.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-s.png"
						sound="thunderstick.ogg"
					[/frame]
				[/if]
				[else]
					direction="s"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-s.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[else]
					direction="ne,nw"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="20~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-ne-1.png"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-ne-2.png"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-ne-3.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-ne.png"
						sound="thunderstick.ogg"
					[/frame]
				[/else]
				[else]
					direction="ne,nw"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-ne.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[else]
					direction="n"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="20~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-n-1.png"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-n-2.png"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-n-3.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-n.png"
						sound="thunderstick.ogg"
					[/frame]
				[/else]
				[else]
					direction="n"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-n.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[else]
					direction="se,sw"
					hits="yes"
					missile_halo_x="0~0"
					missile_halo_y="0~0"
					missile_offset="0.5~1.1:250,1.1~1.5:200,1.5~1.7:360"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/muzzle-flash-se-1.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="80"
						halo="projectiles/muzzle-flash-se-2.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="70"
						halo="projectiles/muzzle-flash-se-3.png~FL(vertical)"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-4.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-5.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-6.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-7.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-8.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-9.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-10.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-11.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-12.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-13.png"
					[/missile_frame]
					[missile_frame]
						duration="60"
						halo="projectiles/muzzle-flash-14.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-se.png"
						sound="thunderstick.ogg"
					[/frame]
				[/else]
				[else]
					direction="se,sw"
					hits="no"
					missile_offset="0.1"
					missile_start_time="-250"
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-1.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-2.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-3.png"
					[/missile_frame]
					[missile_frame]
						duration="100"
						halo="projectiles/misfire-spark-4.png"
					[/missile_frame]
					[frame]
						begin="-400"
						end="0"
						image="units/dwarves/thunderer-attack-se.png"
						sound="thunderstick-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="0"
					end="1"
					image="units/dwarves/thunderer-attack-se.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/dwarves/thunderer.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/dwarves/thunderer-melee1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="50"
						image="units/dwarves/thunderer-melee2.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="50"
						image="units/dwarves/thunderer-melee2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="50"
					end="100"
					image="units/dwarves/thunderer-melee1.png"
				[/frame]
				[frame]
					begin="100"
					end="125"
					image="units/dwarves/thunderer.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="200"
					image="units/dwarves/thunderer-die1.png"
				[/frame]
				[frame]
					begin="200"
					end="400"
					image="units/dwarves/thunderer-die2.png"
				[/frame]
				[frame]
					begin="400"
					end="600"
					image="units/dwarves/thunderer-die3.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/dwarves/thunderer.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/dwarves/thunderer-defend.png"
						sound="dwarf-hit-1.ogg,dwarf-hit-2.ogg,dwarf-hit-3.ogg,dwarf-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/dwarves/thunderer-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/dwarves/thunderer.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/dwarves/thunderer-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-3.png"
				[/frame]
				[frame]
					duration="800"
					image="units/dwarves/thunderer-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-5.png"
				[/frame]
				[frame]
					duration="300"
					image="units/dwarves/thunderer-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-5.png"
				[/frame]
				[frame]
					duration="300"
					image="units/dwarves/thunderer-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-5.png"
				[/frame]
				[frame]
					duration="200"
					image="units/dwarves/thunderer-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/dwarves/thunderer-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/dwarves/thunderer-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/dwarves/transparent/thunderer.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/dwarves/transparent/thunderer.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="80"
				cold="90"
				fire="90"
				impact="80"
				pierce="80"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="6"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="2"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="18"
				description=_ "thunderstick"
				name="thunderstick"
				number="1"
				range="ranged"
				type="pierce"
			[/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="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="0"
			cost="13"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="s"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="30"
			id="Thief-32"
			image="units/human-outlaws/thief+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Thief"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="30"
			max_moves="6"
			movement="6"
			movement_type="elusivefoot"
			moves="0"
			name="Clyra"
			profile="portraits/humans/thief+female.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Thief"
			underlying_id="32"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="13"
			y="21"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief+female-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief+female-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/attack_anim]
			[death]
				start_time="0"
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-7.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief+female-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief+female-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief+female-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief+female-defend-2-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief+female-defend-2-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief+female-defend-2-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief+female-defend-3-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief+female-defend-3-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief+female-defend-3-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief+female-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief+female-defend.png"
					sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief+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/thief+female-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief+female-idle-5.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief+female-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief+female-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-8.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-outlaws/thief+female-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-8.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief+female-idle-7.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief+female-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief+female-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/thief+female.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/thief+female.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]
			[/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=_ "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^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]
			[/modifications]
		[/unit]
	[/side]
	[side]
		action_bonus_count="6"
		aggression="0.5"
		allow_player="yes"
		caution="0.25"
		colour="2"
		controller="human"
		countdown_time="0"
		current_player="human2"
		disallow_observers="no"
		fog="yes"
		global_recruitment_pattern="fighter,fighter,fighter,archer,mixed fighter,scout"
		gold="21"
		hidden="no"
		id="atlyx2"
		income="0"
		leader_value="3"
		name="atlyx"
		no_leader="yes"
		number_of_possible_recruits_to_force_recruit="3.1"
		objectives=_ "Victory:
@Defeat enemy leader(s)"
		objectives_changed="no"
		recruit="Bowman,Cavalryman,Fencer,Heavy Infantryman,Horseman,Mage,Merman Fighter,Spearman"
		recruitment_pattern="fighter,fighter,fighter,archer,mixed fighter,scout"
		save_id="atlyx2"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="2"
		start_gold="100"
		team_name="north"
#textdomain wesnoth-multiplayer
		user_team_name=_ "teamname^North"
		village_gold="2"
		village_value="1"
		villages_per_scout="8"
		[ai]
			recruitment_pattern="fighter,fighter,fighter,archer,mixed fighter,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="11"
			y="4"
		[/village]
		[village]
			x="14"
			y="8"
		[/village]
		[village]
			x="20"
			y="5"
		[/village]
		[village]
			x="21"
			y="9"
		[/village]
		[village]
			x="24"
			y="6"
		[/village]
		[unit]
			advances_to="Master Bowman"
			alignment="lawful"
			allow_changes="yes"
			allow_player="yes"
			alpha="256"
			attacks_left="1"
			canrecruit="yes"
			colour="2"
			controller="network"
			cost="26"
			current_player="atlyx"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			experience="0"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			fog="yes"
			gender="male"
			gold="100"
			goto_x="-999"
			goto_y="-999"
			hitpoints="51"
			id="atlyx2"
			image="units/human-loyalists/longbowman.png"
			income="0"
#textdomain wesnoth-units
			language_name=_ "Longbowman"
			leader="Lieutenant,Swordsman,Pikeman,Javelineer,Shock Trooper,Longbowman,White Mage,Red Mage"
			level="2"
			max_attacks="1"
			max_experience="48"
			max_hitpoints="51"
			max_moves="5"
			movement="5"
			movement_type="smallfoot"
			moves="5"
			mp_countdown="no"
			mp_countdown_action_bonus="13"
			mp_countdown_init_time="270"
			mp_countdown_reservoir_time="330"
			mp_countdown_turn_bonus="60"
			name="human2"
			profile="portraits/humans/longbowman.png"
			race="human"
			random_leader="Lieutenant,Swordsman,Pikeman,Javelineer,Longbowman,Red Mage"
			random_traits="no"
			recruit="Cavalryman,Horseman,Spearman,Fencer,Heavy Infantryman,Bowman,Mage,Merman Fighter"
			resting="yes"
			save_id="atlyx2"
			share_maps="no"
			share_view="yes"
			shroud="no"
			side="2"
			team_name="north"
			terrain_liked="Gg, Ww, Wo"
			type="Longbowman"
			undead_variation="archer"
			underlying_id="2"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			user_team_name="wesnoth-multiplayerteamname^North"
			village_gold="2"
			x="15"
			y="2"
			zoc="yes"
			[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]
			[portrait]
				image="portraits/humans/transparent/longbowman.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/longbowman.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="8"
				description=_ "sword"
				icon="attacks/sword-human.png"
				name="sword"
				number="2"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="10"
				description=_ "bow"
				name="bow"
				number="3"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
			[/modifications]
		[/unit]
		[unit]
			advances_to="White Mage,Red Mage"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="20"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="26"
			id="Mage-8"
			image="units/human-magi/mage.png"
			language_name=_ "Mage"
			level="1"
			max_attacks="1"
			max_experience="34"
			max_hitpoints="29"
			max_moves="5"
			movement="5"
			movement_type="smallfoot"
			moves="5"
			name="Blyddyn"
			profile="portraits/humans/mage.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Mage"
			underlying_id="8"
			unrenamable="no"
			upkeep="full"
			usage="mixed fighter"
			x="25"
			y="12"
			zoc="yes"
			[attack_anim]
				magic_missile_flare_start_time="-750"
				magic_missile_start_time="-750"
				magic_missile_trail_1_start_time="-350"
				magic_missile_trail_2_start_time="-350"
				magic_missile_trail_3_start_time="-350"
				offset="0"
				[filter_attack]
					name="missile"
				[/filter_attack]
				[magic_missile_frame]
					duration="400"
					halo="halo/mage-halo1.png,halo/mage-halo2.png,halo/mage-halo3.png,halo/mage-halo4.png,halo/mage-halo5.png"
					halo_x="11~0"
					halo_y="-20~-54"
					offset="0.001~-0.083,-0.083~-0.25,-0.25~-0.5"
				[/magic_missile_frame]
				[magic_missile_frame]
					duration="350"
					halo="halo/mage-halo1.png,halo/mage-halo2.png,halo/mage-halo3.png,halo/mage-halo4.png,halo/mage-halo5.png,misc/blank-hex.png:1"
					halo_y="-54~-45,-45~-27,-27~0"
					offset="-0.5~-0.25,-0.25~0.25,0.25~1.0"
				[/magic_missile_frame]
				[magic_missile_trail_1_frame]
					duration="350"
					halo="misc/blank-hex.png:40,halo/mage-preparation-halo1.png,halo/mage-preparation-halo2.png,halo/mage-preparation-halo3.png,halo/mage-preparation-halo4.png,halo/mage-preparation-halo5.png,halo/mage-preparation-halo6.png,halo/mage-preparation-halo7.png,misc/blank-hex.png:1"
					halo_y="-54:40,-54~-45,-45~-27,-27~0"
					offset="0.001:40,-0.5~-0.25,-0.25~0.25,0.25~1.0"
				[/magic_missile_trail_1_frame]
				[magic_missile_trail_2_frame]
					duration="350"
					halo="misc/blank-hex.png:80,halo/mage-preparation-halo1.png,halo/mage-preparation-halo2.png,halo/mage-preparation-halo3.png,halo/mage-preparation-halo4.png,halo/mage-preparation-halo5.png,halo/mage-preparation-halo6.png,halo/mage-preparation-halo7.png,misc/blank-hex.png:1"
					halo_y="-54:80,-54~-45,-45~-27,-27~0"
					offset="0.001:80,-0.5~-0.25,-0.25~0.25,0.25~1.0"
				[/magic_missile_trail_2_frame]
				[magic_missile_trail_3_frame]
					duration="350"
					halo="misc/blank-hex.png:120,halo/mage-preparation-halo1.png,halo/mage-preparation-halo2.png,halo/mage-preparation-halo3.png,halo/mage-preparation-halo4.png,halo/mage-preparation-halo5.png,halo/mage-preparation-halo6.png,halo/mage-preparation-halo7.png,misc/blank-hex.png:1"
					halo_y="-54:120,-54~-45,-45~-27,-27~0"
					offset="0.001:120,-0.5~-0.25,-0.25~0.25,0.25~1.0"
				[/magic_missile_trail_3_frame]
				[magic_missile_flare_frame]
					duration="600"
					halo="halo/mage-preparation-halo1.png,halo/mage-preparation-halo2.png,halo/mage-preparation-halo3.png,halo/mage-preparation-halo4.png,halo/mage-preparation-halo5.png,halo/mage-preparation-halo6.png,halo/mage-preparation-halo7.png,misc/blank-hex.png:1"
					halo_x="11"
					halo_y="-20"
					offset="0"
				[/magic_missile_flare_frame]
				[frame]
					begin="-800"
					end="-700"
					image="units/human-magi/mage-attack-magic1.png"
				[/frame]
				[frame]
					begin="-700"
					end="-350"
					image="units/human-magi/mage-attack-magic2.png"
				[/frame]
				[if]
					hits="no"
					[frame]
						begin="-350"
						end="-100"
						image="units/human-magi/mage-attack-magic2.png"
						sound="magic-missile-1-miss.ogg,magic-missile-2-miss.ogg,magic-missile-3-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-350"
						end="-100"
						image="units/human-magi/mage-attack-magic2.png"
						sound="magic-missile-1.ogg,magic-missile-2.ogg,magic-missile-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-100"
					end="100"
					image="units/human-magi/mage-attack-magic1.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="staff"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-magi/mage.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-magi/mage-attack-staff1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-magi/mage-attack-staff2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-magi/mage-attack-staff2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-magi/mage-attack-magic1.png"
				[/frame]
				[frame]
					begin="150"
					end="200"
					image="units/human-magi/mage.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-magi/mage.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-magi/mage-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-magi/mage-defend.png"
						sound="human-old-hit-1.ogg,human-old-hit-2.ogg,human-old-hit-3.ogg,human-old-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-magi/mage-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-magi/mage.png"
				[/frame]
			[/defend]
			[portrait]
				image="portraits/humans/transparent/mage.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/mage.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[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="5"
				description=_ "staff"
				icon="attacks/staff-magic.png"
				name="staff"
				number="1"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="7"
				description=_ "missile"
				icon="attacks/magic-missile.png"
				name="missile"
				number="3"
				range="ranged"
				type="fire"
				[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=_ "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="Dragoon"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="17"
			die_sound="horse-die.ogg"
			ellipse="misc/ellipse"
			experience="4"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="31"
			id="Cavalryman-9"
			image="units/human-loyalists/cavalryman.png"
#textdomain wesnoth-units
			language_name=_ "Cavalryman"
			level="1"
			max_attacks="1"
			max_experience="22"
			max_hitpoints="36"
			max_moves="9"
			movement="8"
			movement_type="mounted"
			moves="9"
			name="Sennyc"
			profile="portraits/humans/cavalryman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Cavalryman"
			undead_variation="mounted"
			underlying_id="9"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="23"
			y="12"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="sword"
				[/filter_attack]
				[frame]
					begin="-225"
					end="-200"
					image="units/human-loyalists/cavalryman.png"
				[/frame]
				[frame]
					begin="-200"
					end="-150"
					image="units/human-loyalists/cavalryman-moving.png"
					sound="horse-canter.wav"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-150"
						end="150"
						image="units/human-loyalists/cavalryman-attack.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-150"
						end="150"
						image="units/human-loyalists/cavalryman-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="150"
					end="200"
					image="units/human-loyalists/cavalryman-moving.png"
				[/frame]
				[frame]
					begin="200"
					end="225"
					image="units/human-loyalists/cavalryman.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="200"
					image="units/human-loyalists/cavalryman-die-1.png"
				[/frame]
				[frame]
					begin="200"
					end="400"
					image="units/human-loyalists/cavalryman-die-2.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-loyalists/cavalryman.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/cavalryman-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/cavalryman-defend.png"
						sound="horse-hit-1.ogg,horse-hit-2.ogg,horse-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-loyalists/cavalryman-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/cavalryman.png"
				[/frame]
			[/defend]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/human-loyalists/cavalryman-moving.png"
				[/frame]
			[/movement_anim]
			[defense]
				castle="60"
				cave="80"
				deep_water="80"
				flat="60"
				forest="70"
				frozen="70"
				fungus="80"
				hills="60"
				impassable="80"
				mountains="80"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="4"
				deep_water="99"
				flat="1"
				forest="3"
				frozen="2"
				fungus="4"
				hills="2"
				impassable="99"
				mountains="99"
				reef="3"
				sand="2"
				shallow_water="4"
				swamp_water="4"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="70"
				cold="80"
				fire="100"
				impact="60"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="6"
				description=_ "sword"
				icon="attacks/sword-human.png"
				name="sword"
				number="3"
				range="melee"
				type="blade"
			[/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="Swordsman,Pikeman,Javelineer"
			alignment="lawful"
			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="4"
			facing="s"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="12"
			id="Spearman-12"
			image="units/human-loyalists/spearman.png"
#textdomain wesnoth-units
			language_name=_ "Spearman"
			level="1"
			max_attacks="1"
			max_experience="29"
			max_hitpoints="42"
			max_moves="5"
			movement="5"
			movement_type="smallfoot"
			moves="5"
			name="Rheraercyn"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Spearman"
			underlying_id="12"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="6"
			y="6"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="javelin"
				[/filter_attack]
				[missile_frame]
					begin="-150"
					end="0"
					image="projectiles/spear-n.png"
					image_diagonal="projectiles/spear-ne.png"
				[/missile_frame]
				[frame]
					begin="-250"
					end="-150"
					image="units/human-loyalists/spearman-death1.png"
					sound="throw-1.wav,throw-2.wav,throw-3.wav,throw-4.wav"
				[/frame]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-loyalists/spearman-attack-ranged.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="-50"
						image="units/human-loyalists/spearman-attack-ranged.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="-50"
						image="units/human-loyalists/spearman-attack-ranged.png"
					[/frame]
				[/else]
				[frame]
					begin="-50"
					end="50"
					image="units/human-loyalists/spearman-attack-ranged2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="s"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-150"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[frame]
					begin="-150"
					end="-50"
					image="units/human-loyalists/spearman-attack-s-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-50"
						end="100"
						image="units/human-loyalists/spearman-attack-s-2.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-50"
						end="100"
						image="units/human-loyalists/spearman-attack-s-2.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman-attack-s-1.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="n"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-n.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-n.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="ne,nw"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-ne.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-ne.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="se,sw"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="125"
					image="units/human-loyalists/spearman-death1.png"
				[/frame]
				[frame]
					begin="125"
					end="250"
					image="units/human-loyalists/spearman-death2.png"
				[/frame]
				[frame]
					begin="250"
					end="375"
					image="units/human-loyalists/spearman-death3.png"
				[/frame]
				[frame]
					begin="375"
					end="500"
					image="units/human-loyalists/spearman-death4.png"
				[/frame]
			[/death]
			[defend]
				[frame]
					begin="-100"
					end="-90"
					image="units/human-loyalists/spearman-defend-2.png"
				[/frame]
				[frame]
					begin="-90"
					end="90"
					image="units/human-loyalists/spearman-defend.png"
				[/frame]
				[frame]
					begin="90"
					end="100"
					image="units/human-loyalists/spearman-defend-2.png"
				[/frame]
			[/defend]
			[portrait]
				image="portraits/humans/transparent/spearman.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/spearman.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[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="8"
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="3"
				range="melee"
				type="pierce"
				[specials]
					[firststrike]
#textdomain wesnoth
						description=_ "First Strike:
This unit always strikes first with this attack, even if they are defending."
						id="firststrike"
						name=_ "firststrike"
					[/firststrike]
				[/specials]
			[/attack]
			[attack]
				damage="6"
#textdomain wesnoth-units
				description=_ "javelin"
				icon="attacks/javelin-human.png"
				name="javelin"
				number="1"
				range="ranged"
				type="pierce"
			[/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="Dragoon"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="17"
			die_sound="horse-die.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="sw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="36"
			id="Cavalryman-18"
			image="units/human-loyalists/cavalryman.png"
#textdomain wesnoth-units
			language_name=_ "Cavalryman"
			level="1"
			max_attacks="1"
			max_experience="22"
			max_hitpoints="36"
			max_moves="9"
			movement="8"
			movement_type="mounted"
			moves="9"
			name="Saent"
			profile="portraits/humans/cavalryman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Cavalryman"
			undead_variation="mounted"
			underlying_id="18"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="13"
			y="6"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="sword"
				[/filter_attack]
				[frame]
					begin="-225"
					end="-200"
					image="units/human-loyalists/cavalryman.png"
				[/frame]
				[frame]
					begin="-200"
					end="-150"
					image="units/human-loyalists/cavalryman-moving.png"
					sound="horse-canter.wav"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-150"
						end="150"
						image="units/human-loyalists/cavalryman-attack.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-150"
						end="150"
						image="units/human-loyalists/cavalryman-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="150"
					end="200"
					image="units/human-loyalists/cavalryman-moving.png"
				[/frame]
				[frame]
					begin="200"
					end="225"
					image="units/human-loyalists/cavalryman.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="200"
					image="units/human-loyalists/cavalryman-die-1.png"
				[/frame]
				[frame]
					begin="200"
					end="400"
					image="units/human-loyalists/cavalryman-die-2.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-loyalists/cavalryman.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/cavalryman-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/cavalryman-defend.png"
						sound="horse-hit-1.ogg,horse-hit-2.ogg,horse-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-loyalists/cavalryman-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/cavalryman.png"
				[/frame]
			[/defend]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/human-loyalists/cavalryman-moving.png"
				[/frame]
			[/movement_anim]
			[defense]
				castle="60"
				cave="80"
				deep_water="80"
				flat="60"
				forest="70"
				frozen="70"
				fungus="80"
				hills="60"
				impassable="80"
				mountains="80"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="4"
				deep_water="99"
				flat="1"
				forest="3"
				frozen="2"
				fungus="4"
				hills="2"
				impassable="99"
				mountains="99"
				reef="3"
				sand="2"
				shallow_water="4"
				swamp_water="4"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="70"
				cold="80"
				fire="100"
				impact="60"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="6"
				description=_ "sword"
				icon="attacks/sword-human.png"
				name="sword"
				number="3"
				range="melee"
				type="blade"
			[/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="Longbowman"
			alignment="lawful"
			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="n"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="38"
			id="Bowman-19"
			image="units/human-loyalists/bowman.png"
#textdomain wesnoth-units
			language_name=_ "Bowman"
			level="1"
			max_attacks="1"
			max_experience="22"
			max_hitpoints="38"
			max_moves="5"
			movement="5"
			movement_type="smallfoot"
			moves="5"
			name="Aethaercyn"
			profile="portraits/humans/bowman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Bowman"
			undead_variation="archer"
			underlying_id="19"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			x="25"
			y="13"
			zoc="yes"
			[attack_anim]
				start_time="-445"
				[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]
				[frame]
					duration="65"
					image="units/human-loyalists/bowman-bow.png"
				[/frame]
				[frame]
					duration="75"
					image="units/human-loyalists/bowman-bow-attack-1.png"
				[/frame]
				[frame]
					duration="75"
					image="units/human-loyalists/bowman-bow-attack-2.png"
				[/frame]
				[if]
					hits="no"
					[frame]
						duration="100"
						image="units/human-loyalists/bowman-bow-attack-3.png"
						sound="bow-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						duration="100"
						image="units/human-loyalists/bowman-bow-attack-3.png"
						sound="bow.ogg"
					[/frame]
				[/else]
				[frame]
					duration="130"
					image="units/human-loyalists/bowman-bow-attack-4.png"
				[/frame]
				[frame]
					duration="65"
					image="units/human-loyalists/bowman-bow-attack-1.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				start_time="-275"
				[filter_attack]
					name="short sword"
				[/filter_attack]
				[frame]
					duration="50"
					image="units/human-loyalists/bowman-melee-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/bowman-melee-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="100"
						image="units/human-loyalists/bowman-melee-attack-2.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="100"
						image="units/human-loyalists/bowman-melee-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="100"
					image="units/human-loyalists/bowman-melee-attack-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/bowman-melee-attack-4.png"
				[/frame]
				[frame]
					duration="50"
					image="units/human-loyalists/bowman-melee-defend-1.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[filter_attack]
					range="melee"
				[/filter_attack]
				[frame]
					duration="1"
					image="units/human-loyalists/bowman-melee-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/bowman-melee-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/bowman-melee-defend-2.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-loyalists/bowman-melee-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/bowman-melee-defend-1.png"
				[/frame]
			[/defend]
			[defend]
				start_time="-126"
				[filter_attack]
					range="ranged"
				[/filter_attack]
				[frame]
					duration="1"
					image="units/human-loyalists/bowman-bow.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/bowman-bow-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/bowman-bow-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-loyalists/bowman-bow-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/bowman-bow.png"
				[/frame]
			[/defend]
			[portrait]
				image="portraits/humans/transparent/bowman.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/bowman.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[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="4"
				description=_ "short sword"
				icon="attacks/sword-human-short.png"
				name="short sword"
				number="2"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="6"
				description=_ "bow"
				name="bow"
				number="3"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					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="Swordsman,Pikeman,Javelineer"
			alignment="lawful"
			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="sw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="41"
			id="Spearman-24"
			image="units/human-loyalists/spearman.png"
#textdomain wesnoth-units
			language_name=_ "Spearman"
			level="1"
			max_attacks="1"
			max_experience="24"
			max_hitpoints="41"
			max_moves="5"
			movement="5"
			movement_type="smallfoot"
			moves="5"
			name="Gullyrraedd"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Spearman"
			underlying_id="24"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="22"
			y="12"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="javelin"
				[/filter_attack]
				[missile_frame]
					begin="-150"
					end="0"
					image="projectiles/spear-n.png"
					image_diagonal="projectiles/spear-ne.png"
				[/missile_frame]
				[frame]
					begin="-250"
					end="-150"
					image="units/human-loyalists/spearman-death1.png"
					sound="throw-1.wav,throw-2.wav,throw-3.wav,throw-4.wav"
				[/frame]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-loyalists/spearman-attack-ranged.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="-50"
						image="units/human-loyalists/spearman-attack-ranged.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="-50"
						image="units/human-loyalists/spearman-attack-ranged.png"
					[/frame]
				[/else]
				[frame]
					begin="-50"
					end="50"
					image="units/human-loyalists/spearman-attack-ranged2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="s"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-150"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[frame]
					begin="-150"
					end="-50"
					image="units/human-loyalists/spearman-attack-s-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-50"
						end="100"
						image="units/human-loyalists/spearman-attack-s-2.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-50"
						end="100"
						image="units/human-loyalists/spearman-attack-s-2.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman-attack-s-1.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="n"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-n.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-n.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="ne,nw"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-ne.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-ne.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="se,sw"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="125"
					image="units/human-loyalists/spearman-death1.png"
				[/frame]
				[frame]
					begin="125"
					end="250"
					image="units/human-loyalists/spearman-death2.png"
				[/frame]
				[frame]
					begin="250"
					end="375"
					image="units/human-loyalists/spearman-death3.png"
				[/frame]
				[frame]
					begin="375"
					end="500"
					image="units/human-loyalists/spearman-death4.png"
				[/frame]
			[/death]
			[defend]
				[frame]
					begin="-100"
					end="-90"
					image="units/human-loyalists/spearman-defend-2.png"
				[/frame]
				[frame]
					begin="-90"
					end="90"
					image="units/human-loyalists/spearman-defend.png"
				[/frame]
				[frame]
					begin="90"
					end="100"
					image="units/human-loyalists/spearman-defend-2.png"
				[/frame]
			[/defend]
			[portrait]
				image="portraits/humans/transparent/spearman.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/spearman.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[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="7"
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="3"
				range="melee"
				type="pierce"
				[specials]
					[firststrike]
#textdomain wesnoth
						description=_ "First Strike:
This unit always strikes first with this attack, even if they are defending."
						id="firststrike"
						name=_ "firststrike"
					[/firststrike]
				[/specials]
			[/attack]
			[attack]
				damage="6"
#textdomain wesnoth-units
				description=_ "javelin"
				icon="attacks/javelin-human.png"
				name="javelin"
				number="1"
				range="ranged"
				type="pierce"
			[/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^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="Swordsman,Pikeman,Javelineer"
			alignment="lawful"
			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="4"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="37"
			id="Spearman-28"
			image="units/human-loyalists/spearman.png"
#textdomain wesnoth-units
			language_name=_ "Spearman"
			level="1"
			max_attacks="1"
			max_experience="29"
			max_hitpoints="39"
			max_moves="6"
			movement="5"
			movement_type="smallfoot"
			moves="6"
			name="Yrullyn"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Spearman"
			underlying_id="28"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="14"
			y="8"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="javelin"
				[/filter_attack]
				[missile_frame]
					begin="-150"
					end="0"
					image="projectiles/spear-n.png"
					image_diagonal="projectiles/spear-ne.png"
				[/missile_frame]
				[frame]
					begin="-250"
					end="-150"
					image="units/human-loyalists/spearman-death1.png"
					sound="throw-1.wav,throw-2.wav,throw-3.wav,throw-4.wav"
				[/frame]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-loyalists/spearman-attack-ranged.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="-50"
						image="units/human-loyalists/spearman-attack-ranged.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="-50"
						image="units/human-loyalists/spearman-attack-ranged.png"
					[/frame]
				[/else]
				[frame]
					begin="-50"
					end="50"
					image="units/human-loyalists/spearman-attack-ranged2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="s"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-150"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[frame]
					begin="-150"
					end="-50"
					image="units/human-loyalists/spearman-attack-s-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-50"
						end="100"
						image="units/human-loyalists/spearman-attack-s-2.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-50"
						end="100"
						image="units/human-loyalists/spearman-attack-s-2.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman-attack-s-1.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="n"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-n.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-n.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="ne,nw"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-ne.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-ne.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="se,sw"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="125"
					image="units/human-loyalists/spearman-death1.png"
				[/frame]
				[frame]
					begin="125"
					end="250"
					image="units/human-loyalists/spearman-death2.png"
				[/frame]
				[frame]
					begin="250"
					end="375"
					image="units/human-loyalists/spearman-death3.png"
				[/frame]
				[frame]
					begin="375"
					end="500"
					image="units/human-loyalists/spearman-death4.png"
				[/frame]
			[/death]
			[defend]
				[frame]
					begin="-100"
					end="-90"
					image="units/human-loyalists/spearman-defend-2.png"
				[/frame]
				[frame]
					begin="-90"
					end="90"
					image="units/human-loyalists/spearman-defend.png"
				[/frame]
				[frame]
					begin="90"
					end="100"
					image="units/human-loyalists/spearman-defend-2.png"
				[/frame]
			[/defend]
			[portrait]
				image="portraits/humans/transparent/spearman.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/spearman.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[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="7"
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="3"
				range="melee"
				type="pierce"
				[specials]
					[firststrike]
#textdomain wesnoth
						description=_ "First Strike:
This unit always strikes first with this attack, even if they are defending."
						id="firststrike"
						name=_ "firststrike"
					[/firststrike]
				[/specials]
			[/attack]
			[attack]
				damage="6"
#textdomain wesnoth-units
				description=_ "javelin"
				icon="attacks/javelin-human.png"
				name="javelin"
				number="1"
				range="ranged"
				type="pierce"
			[/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^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="Duelist"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="16"
			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="33"
			id="Fencer-30"
			image="units/human-loyalists/fencer.png"
#textdomain wesnoth-units
			language_name=_ "Fencer"
			level="1"
			max_attacks="1"
			max_experience="24"
			max_hitpoints="33"
			max_moves="6"
			movement="6"
			movement_type="elusivefoot"
			moves="6"
			name="Tuddry"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Fencer"
			underlying_id="30"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="21"
			y="9"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="saber"
				[/filter_attack]
				[frame]
					begin="-300"
					end="-250"
					image="units/human-loyalists/fencer-attack-1.png"
					offset="0.0~-0.07"
				[/frame]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-loyalists/fencer-attack-2.png"
					offset="-0.07~-0.15"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-200"
						end="-150"
						image="units/human-loyalists/fencer-attack-3.png"
						offset="-0.15~-0.25"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-200"
						end="-150"
						image="units/human-loyalists/fencer-attack-3.png"
						offset="-0.15~-0.25"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-loyalists/fencer-attack-4.png"
					offset="-0.25~-0.2"
				[/frame]
				[frame]
					begin="-100"
					end="-50"
					image="units/human-loyalists/fencer-attack-5.png"
					offset="-0.2~-0.1"
				[/frame]
				[frame]
					begin="-50"
					end="0"
					image="units/human-loyalists/fencer-attack-6.png"
					offset="-0.1~0.25"
				[/frame]
				[frame]
					begin="0"
					end="50"
					image="units/human-loyalists/fencer-attack-7.png"
					offset="0.25~0.55"
				[/frame]
				[frame]
					begin="50"
					end="100"
					image="units/human-loyalists/fencer-attack-8.png"
					offset="0.55~0.25"
				[/frame]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/fencer-attack-9.png"
					offset="0.25~0.1"
				[/frame]
				[frame]
					begin="150"
					end="200"
					image="units/human-loyalists/fencer-attack-1.png"
					offset="0.1~0.0"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/human-loyalists/fencer-die1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/human-loyalists/fencer-die2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-loyalists/fencer-die3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/human-loyalists/fencer-die4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/human-loyalists/fencer-die5.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-loyalists/fencer.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-loyalists/fencer-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-loyalists/fencer-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-loyalists/fencer-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-loyalists/fencer-defend-1-1.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-loyalists/fencer.png"
				[/frame]
				[frame]
					begin="-125"
					end="-25"
					image="units/human-loyalists/fencer-defend.png"
				[/frame]
				[frame]
					begin="-25"
					end="125"
					image="units/human-loyalists/fencer-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-loyalists/fencer.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-loyalists/fencer.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-loyalists/fencer-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-loyalists/fencer.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-loyalists/fencer-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-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="90"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[abilities]
				[skirmisher]
					affect_self="yes"
#textdomain wesnoth
					description=_ "Skirmisher:
This unit is skilled in moving past enemies quickly, and ignores all enemy Zones of Control."
					female_name=_ "female^skirmisher"
					id="skirmisher"
					name=_ "skirmisher"
				[/skirmisher]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="4"
#textdomain wesnoth-units
				description=_ "saber"
				icon="attacks/saber-human.png"
				name="saber"
				number="4"
				range="melee"
				type="blade"
			[/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^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]
	[/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]
	[item]
		image="items/burial.png"
		visible_in_fog="yes"
		x="4"
		y="9"
	[/item]
	[item]
		image="items/burial.png"
		visible_in_fog="yes"
		x="15"
		y="13"
	[/item]
	[item]
		image="items/burial.png"
		visible_in_fog="yes"
		x="26"
		y="16"
	[/item]
	[music]
		ms_after="0"
		ms_before="12000"
		name="knolls.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="wanderer.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="battle.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="transience.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="revelation.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="loyalists.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="the_king_is_dead.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="knalgan_theme.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="the_city_falls.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="nunc_dimittis.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="breaking_the_chains.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="elvish-theme.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="legends_of_the_north.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="traveling_minstrels.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="underground.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="vengeful.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="frantic.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="the_dangerous_symphony.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="heroes_rite.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="suspense.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="the_deep_path.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="siege_of_laurelmor.ogg"
	[/music]
	[variables]
		damage_inflicted="6"
		side_number="2"
		turn_number="17"
	[/variables]
	[player]
		can_recruit="Dwarvish Fighter,Dwarvish Guardsman,Dwarvish Thunderer,Dwarvish Ulfserker,Footpad,Gryphon Rider,Poacher,Thief"
		gold="-1"
		gold_add="no"
		save_id="Gauteamus1"
	[/player]
	[player]
		can_recruit="Bowman,Cavalryman,Fencer,Heavy Infantryman,Horseman,Mage,Merman Fighter,Spearman"
		gold="-1"
		gold_add="no"
		save_id="atlyx2"
	[/player]
[/snapshot]
[replay_start]
	current_tod="0"
#textdomain wesnoth-multiplayer
	description=_ "This most unusual of caves was once known as the Chamber of Laughing Devils, and was the inner citadel of the Kah Ruuk Oni. The Kah Ruuk were a wicked and cunning race of man-eating demons, who terrorized the people of the Eastern Lands for nearly four hundred years, before vanishing from Irdya without a trace. Since that time, many factions have vied for dominion over the Den of Onis, hoping to unlock the strange and mysterious magics of its creators."
	experience_modifier="70"
	hash="0UcdixDPqLm3+hh>V5qedNftTzpDzEnpcCt9okfubpKJFPc+N02noXfLREz,CUoR2IfA>Kgve5rc.2fi6bgul1BoAlggOrqRAY4K1w,Am7P<VLAwGeU,.pw-Ir84kuiX"
	id="multiplayer_Den_of_Onis"
	map_data="border_size=1
usage=map

Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ql          , Ql          , Ql          , 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          , Ql          , Ql          , Ql          , 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          , Ur          , 2 Kud       , Uu          , Ql          , Ql          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Uh          , Wwf^Uf      , Wwf         , Rd          , Rd          , Cud         , Ur          , Uu^Uf       , Rd          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ur          , Uu^Vu       , Ur          , Wwf         , Rd          , Cud         , Cud         , Ur          , Ur          , Hh          , Ss          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Rd          , Xu          , Wwf         , Rd          , Rd          , Ur          , Ur          , Wwf         , Wwf         , Rd          , Rd          , Cud         , Rp          , Gs^Fp       , Ss^Vhs      , Ss          , Rd          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Ur          , Ur          , Ur          , Rd          , Rd          , Wwf         , Rd          , Mm          , Ur          , Ur          , Ur^Fp       , Rd^Fp       , Uh          , Rd          , Rd          , Rp          , Wwf         , Rd          , Hh          , Rd          , Uu^Vu       , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Ql          , Uu^Uf       , Xu          , Ur          , Xu          , Xu          , Wwf         , Wwf         , Rd          , Ql          , Ql          , Ur          , Uu^Uf       , Wwf         , Rd          , Rd          , Hh          , Gs^Fp       , Rp          , Xu          , Rd          , Wwf         , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Rd          , Gs^Fp       , Rd          , Ur          , Xu          , Ww          , Ww          , Xu          , Xu          , Xu          , Uu^Vu       , Wwf         , Rd          , Rd          , Rd          , Rd          , Rd          , Rd          , Xu          , Xu          , Rp          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Ql          , Xu          , Rd          , Uu^Vu       , Xu          , Rd          , Xu          , Ww          , Wwf         , Uh          , Rd          , Rd          , Rd          , Rd^Fp       , Hh          , Rd          , Rp          , Mm          , Wwf         , Ss^Vhs      , Rd          , Rd          , Gs^Fp       , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Rp          , Xu          , Xu          , Uh          , Gs^Fp       , Xu          , Wwf         , Mm          , Wwf         , Gs^Fp       , Mm          , Hh          , Rd          , Rd          , Rd          , Rp          , Hh          , Wwf         , Rd          , Xu          , Xu          , Uh          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Wwf         , Wwf         , Gs^Fp       , Rd          , Rd          , Uu^Uf       , Xu          , Wwf         , Wwf         , Wwf         , Ww          , Ww          , Hh          , Rp          , Rd          , Rd          , Hh          , Gs^Fp       , Hh          , Wwf         , Xu          , Rp          , Rd          , Uu^Uf       , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Rp          , Wwf         , Rp          , Rp          , Rd          , Xu          , Ur          , Xu          , Wwf         , Rp          , Ww          , Rp          , Gs^Fp       , Rp          , Rp          , Rd          , Rd          , Rd          , Gs^Fp       , Rp          , Wwf         , Uh          , Gs^Fp       , Rd          , Rd          , Uh          , Xu          , Wo          , Xu          , Xu          
Xu          , Xu          , Wo          , Ww          , Uh          , Uh          , Rd          , Xu          , Uh          , Wwf         , Rp          , Rd          , Rd          , Rp          , Rd          , Rd          , Rp          , Rp          , Rp          , Rd          , Rp          , Wwf         , Xu          , Xu          , Xu          , Uh          , Rp          , Ww          , Wwf         , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Rd          , Rd          , Gs^Fp       , Xu          , Wwf         , Hh          , Gs^Fp       , Hh          , Rd          , Rd          , Rp          , Hh          , Gs^Fp       , Ww          , Ww          , Wwf         , Wwf         , Xu          , Rd          , Rd          , Rd          , Gs^Fp       , Rp          , Wwf         , Rp          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Uu^Uf       , Uh          , Rp          , Xu          , Wwf         , Wwf         , Gs^Fp       , Rp          , Rd          , Rd          , Rp          , Hh          , Ww          , Gs^Fp       , Wwf         , Mm          , Wwf         , Xu          , Uu^Uf       , Uh          , Rd          , Xu          , Wwf         , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Gs^Fp       , Xu          , Rd          , Rd          , Wwf         , Hh          , Rp          , Rd          , Hh          , Rd          , Rd          , Mm          , Rd          , Wwf         , Wwf         , Wwf         , Xu          , Gs^Fp       , Xu          , Xu          , Rd          , Rd          , Ql          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Rp          , Rp          , Xu          , Ss^Vhs      , Rd          , Mm          , Rd          , Rd          , Rd          , Rd^Fp       , Uu^Vu       , Rd          , Xu          , Uh          , Ww          , Ww          , Xu          , Rd          , Rd          , Uu^Vu       , Rd          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Wwf         , Xu          , Xu          , Rd          , Rd^Fp       , Rd          , Rd          , Rd          , Wwf         , Wwf         , Ur          , Xu          , Ql          , Xu          , Wwf         , Ww          , Xu          , Ur          , Ur          , Gs^Fp       , Uu^Uf       , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Uu^Vu       , Rd          , Hh          , Rp          , Wwf         , Hh          , Rd          , Rd          , Uh          , Uu^Uf       , Ur^Fp       , Ql          , Ur          , Rd          , Rd          , Wwf         , Rd          , Xu          , Ur          , Xu          , Ur          , Ql          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Rd          , Rd          , Rd          , Ss^Vhs      , Rp          , Rp          , Rd          , Rd          , Rd^Fp       , Wwf         , Ur          , Ur          , Mm          , Rd          , Wwf         , Wwf         , Rd          , Rd          , Ur          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ss          , Ss          , Gs^Fp       , Ur          , Cud         , Cud         , Rd          , Rd          , Wwf         , Ur          , Ur          , Ur          , Rd          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Hh          , Rd          , Ur          , Ur          , Cud         , Rd          , Wwf         , Wwf         , Uu^Vu       , Uh          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ql          , Uu^Uf       , Uu          , Cud         , Ur          , Rd          , Xu          , Wwf^Uf      , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ql          , Ql          , 1 Kud       , Ql          , 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          , Ql          , Ql          , Ql          , Ql          , Ql          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
"
	mp_countdown="no"
	mp_countdown_action_bonus="13"
	mp_countdown_init_time="270"
	mp_countdown_reservoir_time="330"
	mp_countdown_turn_bonus="60"
	mp_fog="yes"
	mp_shroud="no"
	mp_use_map_settings="yes"
	mp_village_gold="2"
	name=_ "2p - Den of Onis"
	next_underlying_unit_id="0"
#textdomain wesnoth
	objectives=_ "Victory:
@Defeat enemy leader(s)"
	observer="yes"
	random_seed="26859"
	random_start_time="no"
	scenario="(ladder) for atly"
	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]
	[item]
		image="items/burial.png"
		x="15"
		y="13"
	[/item]
	[item]
		image="items/burial.png"
		x="26"
		y="16"
	[/item]
	[item]
		image="items/burial.png"
		x="4"
		y="9"
	[/item]
	[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="human"
		current_player="Gauteamus"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="Gauteamus1"
		image="units/dwarves/steelclad.png"
		income="0"
		leader="Dwarvish Steelclad,Dwarvish Thunderguard,Dwarvish Stalwart,Rogue,Trapper"
		mp_countdown="no"
		mp_countdown_action_bonus="13"
		mp_countdown_init_time="270"
		mp_countdown_reservoir_time="330"
		mp_countdown_turn_bonus="60"
		name="Gauteamus"
		random_leader="Dwarvish Steelclad,Dwarvish Thunderguard,Rogue,Trapper"
		recruit="Dwarvish Guardsman,Dwarvish Fighter,Dwarvish Ulfserker,Dwarvish Thunderer,Thief,Poacher,Footpad,Gryphon Rider"
		save_id="Gauteamus1"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="1"
		team_name="south"
		terrain_liked="Hh, Ha, Mm"
		type="Rogue"
		user_team_name="wesnoth-multiplayerteamname^South"
		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]
	[side]
		allow_changes="yes"
		allow_player="yes"
		canrecruit="yes"
		colour="2"
		controller="network"
		current_player="atlyx"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="atlyx2"
		image="units/human-loyalists/lieutenant.png"
		income="0"
		leader="Lieutenant,Swordsman,Pikeman,Javelineer,Shock Trooper,Longbowman,White Mage,Red Mage"
		mp_countdown="no"
		mp_countdown_action_bonus="13"
		mp_countdown_init_time="270"
		mp_countdown_reservoir_time="330"
		mp_countdown_turn_bonus="60"
		name="atlyx"
		random_leader="Lieutenant,Swordsman,Pikeman,Javelineer,Longbowman,Red Mage"
		recruit="Cavalryman,Horseman,Spearman,Fencer,Heavy Infantryman,Bowman,Mage,Merman Fighter"
		save_id="atlyx2"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="2"
		team_name="north"
		terrain_liked="Gg, Ww, Wo"
		type="Longbowman"
		user_team_name="wesnoth-multiplayerteamname^North"
		village_gold="2"
		[ai]
			recruitment_pattern="fighter,fighter,fighter,archer,mixed fighter,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="2S – Die Höhle von Onis"
		[team]
			[recruits]
				Dwarvish Fighter="2"
				Dwarvish Guardsman="2"
				Dwarvish Thunderer="4"
				Dwarvish Ulfserker="2"
				Footpad="2"
				Gryphon Rider="1"
				Poacher="1"
				Thief="2"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
			[/advances]
			[deaths]
				Gryphon Rider="1"
			[/deaths]
			[killed]
				Bowman="1"
				Fencer="1"
				Mage="1"
				Spearman="2"
			[/killed]
			[attacks]
				[sequence]
					s0="1"
					s00="1"
					_num="30"
				[/sequence]
				[sequence]
					s0="2"
					s00="1"
					s000="1"
					s010="1"
					s1="1"
					_num="40"
				[/sequence]
				[sequence]
					s0="1"
					s00="1"
					s0001110101="1"
					s01="1"
					s010="1"
					s01100111="1"
					s0111="1"
					s1="2"
					s10="1"
					s11="2"
					s1100="1"
					s1110="1"
					_num="60"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="1"
					_num="0"
				[/sequence]
				[sequence]
					s00="1"
					s1101001="1"
					_num="30"
				[/sequence]
				[sequence]
					s010="1"
					_num="40"
				[/sequence]
				[sequence]
					s00="1"
					s01="4"
					s1="1"
					s10="1"
					s1000="1"
					s101="1"
					s111="1"
					_num="60"
				[/sequence]
			[/defends]
			recruit_cost="268"
			recall_cost="0"
			damage_inflicted="250"
			damage_taken="193"
			expected_damage_inflicted="289814"
			expected_damage_taken="240722"
			turn_damage_inflicted="64"
			turn_damage_taken="20"
			turn_expected_damage_inflicted="75010"
			turn_expected_damage_taken="30830"
			save_id="Gauteamus1"
		[/team]
		[team]
			[recruits]
				Bowman="2"
				Cavalryman="2"
				Fencer="2"
				Mage="2"
				Spearman="5"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
			[/advances]
			[deaths]
				Bowman="1"
				Fencer="1"
				Mage="1"
				Spearman="2"
			[/deaths]
			[killed]
				Gryphon Rider="1"
			[/killed]
			[attacks]
				[sequence]
					s000="3"
					s0000="1"
					s010="1"
					s011="1"
					_num="30"
				[/sequence]
				[sequence]
					s0000110="1"
					_num="60"
				[/sequence]
				[sequence]
					s000="1"
					s011="1"
					s1="1"
					s101="1"
					s1010="1"
					s110="1"
					s111="1"
					_num="70"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="7"
					_num="0"
				[/sequence]
				[sequence]
					s0="1"
					s00="1"
					_num="30"
				[/sequence]
				[sequence]
					s000="1"
					s1="1"
					_num="40"
				[/sequence]
				[sequence]
					s100="1"
					s101="1"
					_num="50"
				[/sequence]
				[sequence]
					s10="1"
					_num="60"
				[/sequence]
				[sequence]
					s="1"
					s0="2"
					s1="3"
					s111="1"
					s11101110="1"
					_num="70"
				[/sequence]
			[/defends]
			recruit_cost="204"
			recall_cost="0"
			damage_inflicted="193"
			damage_taken="250"
			expected_damage_inflicted="240722"
			expected_damage_taken="289814"
			turn_damage_inflicted="0"
			turn_damage_taken="0"
			turn_expected_damage_inflicted="0"
			turn_expected_damage_taken="0"
			save_id="atlyx2"
		[/team]
	[/scenario]
[/statistics]
