label="2p - Hamlets Turn 13"
version="1.6"
completion="victory"
campaign_type="multiplayer"
difficulty="NORMAL"
random_seed="14940"
random_calls="0"
next_underlying_unit_id="30"
end_text_duration="0"
[variables]
[/variables]
[replay]
	[command]
		[start]
		[/start]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="13"
			y="7"
		[/recruit]
		[random]
			value="27217"
		[/random]
		[random]
			value="26497"
		[/random]
		[random]
			value="16265"
		[/random]
		[random]
			value="2393"
		[/random]
		[random]
			value="13348"
		[/random]
		[random]
			value="24896"
		[/random]
		[random]
			value="16100"
		[/random]
		[random]
			value="28346"
		[/random]
		[random]
			value="24036"
		[/random]
		[random]
			value="18835"
		[/random]
		[random]
			value="31600"
		[/random]
		[random]
			value="26065"
		[/random]
		[random]
			value="19123"
		[/random]
		[random]
			value="1064"
		[/random]
		[random]
			value="25322"
			[results]
				checksum="00J7>Z06wXgrZjiwa9d7cad.emOn+5f,-+.9cf<<+W1-4egW6m2jahna90i9fa3b.ld3k,h+bA1+Z,..>9<ImYcB->dd8+XYVckKYca0dYfE>btqe-anyQoXDDBuuCDO"
			[/results]
		[/random]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Vandarr"
			message="gl & hf"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="6"
			x="14"
			y="4"
		[/recruit]
		[random]
			value="13740"
		[/random]
		[random]
			value="19845"
		[/random]
		[random]
			value="20766"
		[/random]
		[random]
			value="13850"
		[/random]
		[random]
			value="1084"
		[/random]
		[random]
			value="32068"
		[/random]
		[random]
			value="6106"
		[/random]
		[random]
			value="26429"
		[/random]
		[random]
			value="19220"
		[/random]
		[random]
			value="23357"
		[/random]
		[random]
			value="8870"
		[/random]
		[random]
			value="9194"
		[/random]
		[random]
			value="7189"
		[/random]
		[random]
			value="30817"
		[/random]
		[random]
			value="11015"
			[results]
				checksum="J59kONwuL-Q+2062sP>0636mC5373eQ6,a5n2j.dTe2hl89<fZ.a.g-4+XcWi.Xef>.1Xyja86>c+>fg4o.2cih1iXao6r,8m4,Z.v3Dnk4Yd84dfCd5sga,Y<,09k7r"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="13"
			y="10"
		[/recruit]
		[random]
			value="15168"
		[/random]
		[random]
			value="25042"
		[/random]
		[random]
			value="17049"
		[/random]
		[random]
			value="32253"
		[/random]
		[random]
			value="24855"
		[/random]
		[random]
			value="11433"
		[/random]
		[random]
			value="3395"
		[/random]
		[random]
			value="31666"
		[/random]
		[random]
			value="12573"
		[/random]
		[random]
			value="14949"
		[/random]
		[random]
			value="24286"
		[/random]
		[random]
			value="14770"
		[/random]
		[random]
			value="29932"
		[/random]
		[random]
			value="13007"
		[/random]
		[random]
			value="29281"
			[results]
				checksum="6hs5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0YUg681h64jGjKk7ELbfXlO69>IPFNIDBGnBCSO3srDyLKztBBHx"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="13"
			y="8"
		[/recruit]
		[random]
			value="13971"
		[/random]
		[random]
			value="7507"
		[/random]
		[random]
			value="1161"
		[/random]
		[random]
			value="25653"
		[/random]
		[random]
			value="3639"
		[/random]
		[random]
			value="23116"
		[/random]
		[random]
			value="26674"
		[/random]
		[random]
			value="14019"
		[/random]
		[random]
			value="13875"
		[/random]
		[random]
			value="15016"
		[/random]
		[random]
			value="6247"
		[/random]
		[random]
			value="9090"
		[/random]
		[random]
			value="9245"
		[/random]
		[random]
			value="20410"
		[/random]
		[random]
			value="19208"
			[results]
				checksum="6hs5opl9pneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0WUg681h64jGjKk7ELbfXlO69>IPFNIDBGnoCSO3srDyLKztBBJx"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="13"
			y="8"
		[/recruit]
		[random]
			value="11544"
		[/random]
		[random]
			value="1830"
		[/random]
		[random]
			value="4295"
		[/random]
		[random]
			value="19639"
		[/random]
		[random]
			value="28132"
		[/random]
		[random]
			value="11542"
		[/random]
		[random]
			value="25152"
		[/random]
		[random]
			value="6573"
		[/random]
		[random]
			value="8472"
		[/random]
		[random]
			value="10863"
		[/random]
		[random]
			value="30096"
		[/random]
		[random]
			value="19693"
		[/random]
		[random]
			value="4618"
		[/random]
		[random]
			value="16582"
		[/random]
		[random]
			value="23367"
			[results]
				checksum="jfC5opl9pneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji-0Ug681h64jGjKk7ELYl9YI95gAxGxnvPuSVVEH>yBMtLAwyHUqR"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,10,9,8"
			y="3,3,4,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Iceant"
			message="same to u"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[recruit]
			value="1"
			x="11"
			y="24"
		[/recruit]
		[random]
			value="20827"
		[/random]
		[random]
			value="24682"
		[/random]
		[random]
			value="18642"
		[/random]
		[random]
			value="5902"
		[/random]
		[random]
			value="32112"
		[/random]
		[random]
			value="24757"
		[/random]
		[random]
			value="5778"
		[/random]
		[random]
			value="11559"
		[/random]
		[random]
			value="31573"
		[/random]
		[random]
			value="27574"
		[/random]
		[random]
			value="6083"
		[/random]
		[random]
			value="12862"
		[/random]
		[random]
			value="1115"
		[/random]
		[random]
			value="28936"
		[/random]
		[random]
			value="27362"
			[results]
				checksum="15,Wfc>cu2lH0olW9-5N-m<e6f60hfabkcij<4>i3h3e2.t0a1f<j870h0k565.Y0>ide2Ki80k.d8da021n<.26Z+40CN5c8b.-X,48K.7v3k3XdJFikGNQwGMoVOFH"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="7"
			x="9"
			y="22"
		[/recruit]
		[random]
			value="3678"
		[/random]
		[random]
			value="31186"
		[/random]
		[random]
			value="31279"
		[/random]
		[random]
			value="15766"
		[/random]
		[random]
			value="16346"
		[/random]
		[random]
			value="17881"
		[/random]
		[random]
			value="30441"
		[/random]
		[random]
			value="7746"
		[/random]
		[random]
			value="11660"
		[/random]
		[random]
			value="4314"
		[/random]
		[random]
			value="4060"
		[/random]
		[random]
			value="17092"
		[/random]
		[random]
			value="23086"
		[/random]
		[random]
			value="954"
		[/random]
		[random]
			value="30507"
			[results]
				checksum=",Ad3Y5f-Gtmsmp5jHbEoRiVrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNLmM8mwoFomIhFlq1.CLB<<ddNv5EsLNHBNzkOI"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="2"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="13000"
		[/random]
		[random]
			value="574"
		[/random]
		[random]
			value="25641"
		[/random]
		[random]
			value="18742"
		[/random]
		[random]
			value="18067"
		[/random]
		[random]
			value="8736"
		[/random]
		[random]
			value="18689"
		[/random]
		[random]
			value="19058"
		[/random]
		[random]
			value="15313"
		[/random]
		[random]
			value="16081"
		[/random]
		[random]
			value="18404"
		[/random]
		[random]
			value="28709"
		[/random]
		[random]
			value="32745"
		[/random]
		[random]
			value="32310"
		[/random]
		[random]
			value="25846"
			[results]
				checksum="RUQsCRORlSP,DLsxDMMfFuzJRDJCyOyPpHMVsOIMzEOKRzPuHEfJqwNzzmyJIhVwVwSxvLpMAS8wEVRB+JCszfJzd4kC+rc<MF13amk4yil5K7b35>-yp,-+8,eyb6ac"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Kendo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="7"
			x="11"
			y="22"
		[/recruit]
		[random]
			value="18239"
		[/random]
		[random]
			value="5933"
		[/random]
		[random]
			value="14260"
		[/random]
		[random]
			value="15256"
		[/random]
		[random]
			value="31796"
		[/random]
		[random]
			value="8052"
		[/random]
		[random]
			value="26796"
		[/random]
		[random]
			value="3468"
		[/random]
		[random]
			value="4352"
		[/random]
		[random]
			value="5463"
		[/random]
		[random]
			value="28012"
		[/random]
		[random]
			value="16979"
		[/random]
		[random]
			value="18138"
		[/random]
		[random]
			value="8067"
		[/random]
		[random]
			value="21244"
			[results]
				checksum=",Ad3Y5f-GtmsAp5jHbEoRiSrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNLAM8mwoFomIhFlq1.CLW<<ddNv5EsLNHBNzhOI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="SlayarBlade has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="5"
			x="10"
			y="22"
		[/recruit]
		[random]
			value="29864"
		[/random]
		[random]
			value="4326"
		[/random]
		[random]
			value="11996"
		[/random]
		[random]
			value="10906"
		[/random]
		[random]
			value="28015"
		[/random]
		[random]
			value="7671"
		[/random]
		[random]
			value="4020"
		[/random]
		[random]
			value="9517"
		[/random]
		[random]
			value="1700"
		[/random]
		[random]
			value="5836"
		[/random]
		[random]
			value="14875"
		[/random]
		[random]
			value="16521"
		[/random]
		[random]
			value="22817"
		[/random]
		[random]
			value="21735"
		[/random]
		[random]
			value="30041"
			[results]
				checksum="iDp,4nc1oNO1LLyKmJLIEhoF>vyBA6mszOAMDTywuzyODCrTtRLwFwmIsr1QENmxPFHFw.RFKFnqypNKAM8mwoFomIhFlq1.CL-<<ddBfkHDONNHvMSO1I9LGCHpACmL"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="11,12,13,14"
			y="23,22,22,22"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,10,9,8,7,6,5,4"
			y="2,2,3,3,4,4,4,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,7,6,5,4,3,2"
			y="4,4,3,3,2,2,1"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,13,13,14,14,15,16,16,17"
			y="3,4,5,5,6,7,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,14,15,16,17,18"
			y="4,4,4,4,4,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,10,9,9,9"
			y="5,6,6,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,10,9,9"
			y="4,5,6,6,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="11,11,11,11,12,12,13"
			y="22,21,20,19,18,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="11,12,13,14,15,16,16,17"
			y="21,20,20,19,19,18,17,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Partagas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Nojarost has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="9,8,7,6,5,4"
			y="22,22,23,22,23,22"
		[/move]
	[/command]
	[command]
		[move]
			x="10,10,10,10,9"
			y="22,21,20,19,19"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="tiffy has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="papajas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,12,13,14,15,16,17,18"
			y="24,24,24,23,24,24,24,24"
		[/move]
	[/command]
	[command]
		[move]
			x="14,13,12,11"
			y="22,23,23,23"
		[/move]
	[/command]
	[command]
		[recruit]
			value="3"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="4358"
		[/random]
		[random]
			value="2121"
		[/random]
		[random]
			value="20639"
		[/random]
		[random]
			value="25965"
		[/random]
		[random]
			value="13573"
		[/random]
		[random]
			value="21990"
		[/random]
		[random]
			value="22329"
		[/random]
		[random]
			value="11912"
		[/random]
		[random]
			value="16693"
		[/random]
		[random]
			value="21"
		[/random]
		[random]
			value="23727"
		[/random]
		[random]
			value="16734"
		[/random]
		[random]
			value="4427"
		[/random]
		[random]
			value="8005"
		[/random]
		[random]
			value="21763"
			[results]
				checksum="eKEMoMtJ2Sm2IxNK-ruIvyJD8uFQquOORqLQAKsDuHBwnqvBFyQvVsL8qHTmQQNRqrWuTuTxDUFQDPxfDLuyOcqNHBnCR5lymlS<1Ip648,gYgdg-Lb7,b2<2j8d74eh"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="CragHack has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,11,11,11"
			y="23,22,21,20"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Vandarr"
			message="you play very fast :)"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="2,3,4,5,6,7,8"
			y="1,2,2,3,3,4,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="4,5,6,7,8,9,10"
			y="3,4,4,4,4,5,5"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,8,7,6,5"
			y="8,8,9,9,10"
		[/move]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Vandarr"
			message="you obviously know the map very well"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,9,8,8,9"
			y="9,10,10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,18,19,19,20"
			y="4,5,6,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,16,15,14,13,12,11,10,9"
			y="9,9,10,9,10,9,9,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="4,4,4,4,5,5"
			y="22,21,20,19,19,18"
		[/move]
	[/command]
	[command]
		[move]
			x="18,19,19,20"
			y="24,24,23,22"
		[/move]
	[/command]
	[command]
		[move]
			x="11,11,11,11,10"
			y="21,20,19,18,17"
		[/move]
	[/command]
	[command]
		[move]
			x="9,9,9,9"
			y="19,18,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Orbis has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Iceant"
			message="i know it, its the first map i played and i am playn just one week"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="vader has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,14,14,13"
			y="17,16,15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="przemek has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="17,17,17,18,18"
			y="17,16,15,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Bob has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="18,19"
			y="13,13"
		[/move]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Vandarr"
			message="yes"
			side="2"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Vandarr"
			message="over one year here"
			side="2"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Vandarr"
			message="on and off"
			side="2"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Vandarr"
			message="very nice game"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="adilson2 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,11,11,11"
			y="20,21,22,23"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,9,10,11"
			y="4,4,3,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Iceant"
			message="indeed"
			side="1"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Vandarr"
			message="I used to play chess a lot"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="3"
			x="8"
			y="8"
		[/recruit]
		[random]
			value="25906"
		[/random]
		[random]
			value="6716"
		[/random]
		[random]
			value="30994"
		[/random]
		[random]
			value="29726"
		[/random]
		[random]
			value="18429"
		[/random]
		[random]
			value="6730"
		[/random]
		[random]
			value="8920"
		[/random]
		[random]
			value="3898"
		[/random]
		[random]
			value="27294"
		[/random]
		[random]
			value="7878"
		[/random]
		[random]
			value="30593"
		[/random]
		[random]
			value="29991"
		[/random]
		[random]
			value="28257"
		[/random]
		[random]
			value="20257"
		[/random]
		[random]
			value="7884"
			[results]
				checksum="H-Q.4kSV1kP6gOQR,wHJxusL-.Ekr06z8QM,E>N>OoNiAM-x,w+es6q9HO5BeFhCwtP2J9TQGVxuTw8SMUFUUA1FGHuc9g0x6zCvNjoC,6pf72FoLfpj9>yBpy8oZxof"
			[/results]
		[/random]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Vandarr"
			message="this has taken over :)"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="3"
			x="14"
			y="6"
		[/recruit]
		[random]
			value="1085"
		[/random]
		[random]
			value="16861"
		[/random]
		[random]
			value="32420"
		[/random]
		[random]
			value="19916"
		[/random]
		[random]
			value="23697"
		[/random]
		[random]
			value="21880"
		[/random]
		[random]
			value="27984"
		[/random]
		[random]
			value="1941"
		[/random]
		[random]
			value="5901"
		[/random]
		[random]
			value="700"
		[/random]
		[random]
			value="4762"
		[/random]
		[random]
			value="18093"
		[/random]
		[random]
			value="10786"
		[/random]
		[random]
			value="16549"
		[/random]
		[random]
			value="15015"
			[results]
				checksum="H-Q.4kSV1kP6gOQR,wHJxusL-.Ekr06z8QM,E>N>OoNiAM-x,w+es6q9HO5BeFhCwtP2J9TQGVxuTw8SMUFUUA1FGHuc9g0x6zCvNjoC,6pf72FoLfpj9>yBpy8oZxof"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="3"
			x="14"
			y="6"
		[/recruit]
		[random]
			value="10904"
		[/random]
		[random]
			value="389"
		[/random]
		[random]
			value="7939"
		[/random]
		[random]
			value="26659"
		[/random]
		[random]
			value="20133"
		[/random]
		[random]
			value="8554"
		[/random]
		[random]
			value="29296"
		[/random]
		[random]
			value="20177"
		[/random]
		[random]
			value="2306"
		[/random]
		[random]
			value="29537"
		[/random]
		[random]
			value="5280"
		[/random]
		[random]
			value="20029"
		[/random]
		[random]
			value="19978"
		[/random]
		[random]
			value="31400"
		[/random]
		[random]
			value="6894"
			[results]
				checksum="H-Q.4kSV1kP6gOQR,wHJxusL-.Ekr06z8QM,E>N>OoNiAM-x,w+es6q9HO5BeFhCwtP2J9TQGVxuTw8SMUFUUA1FGHuc9g0x6zCvNjoC,6pf72FoLfpj9>yBpy8oZxof"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="14"
			y="6"
		[/recruit]
		[random]
			value="5432"
		[/random]
		[random]
			value="11711"
		[/random]
		[random]
			value="17252"
		[/random]
		[random]
			value="14267"
		[/random]
		[random]
			value="526"
		[/random]
		[random]
			value="6013"
		[/random]
		[random]
			value="31400"
		[/random]
		[random]
			value="9395"
		[/random]
		[random]
			value="12831"
		[/random]
		[random]
			value="5285"
		[/random]
		[random]
			value="1124"
		[/random]
		[random]
			value="2084"
		[/random]
		[random]
			value="31009"
		[/random]
		[random]
			value="4576"
			[results]
				checksum="TtCMTozq7Vy-vHfNG<LtqmzARfmmFqV+ryEAuy4CQEqETFPCHGCyrKADxItsJVFvuOxEx3PuvGswNKRdEuCIrvtwzIGzixTLICN<rDI4RC8pMORdj<Pya5jb,a-,394R"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,11"
			y="3,4,5,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,11,11,11,11,11"
			y="5,6,7,8,9,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,11"
			y="10,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,13"
			y="9,9,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="SPEEDCORE has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,19,18,17,17"
			y="7,7,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,5,5,4"
			y="10,11,12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="4,3,3"
			y="12,13,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="FSR_Coaxke has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="20,20,19,19,19,18,17,17"
			y="22,21,21,20,19,18,18,17"
		[/move]
	[/command]
	[command]
		[move]
			x="9,9,10,11,12,13"
			y="16,17,17,18,17,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="norbert has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,9,8"
			y="17,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Maboul2 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="4"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="15485"
		[/random]
		[random]
			value="32212"
		[/random]
		[random]
			value="18520"
		[/random]
		[random]
			value="29862"
		[/random]
		[random]
			value="26074"
		[/random]
		[random]
			value="8911"
		[/random]
		[random]
			value="8562"
		[/random]
		[random]
			value="3961"
		[/random]
		[random]
			value="10306"
		[/random]
		[random]
			value="4923"
		[/random]
		[random]
			value="22660"
		[/random]
		[random]
			value="17277"
		[/random]
		[random]
			value="10699"
		[/random]
		[random]
			value="14884"
		[/random]
		[random]
			value="21629"
			[results]
				checksum="rhRteuCm>Im>OtyS+7ckzAuBMm0+Z8dI9a<pk8651Wl8Z5w.cldpBX>77bllckl2Y+5>aaii6<8+zkljb2ifil7.WgZ2.h<5-XxS+j>k2403-o4TA9v1-xH1iTk+fY8Y"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="goblin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,11"
			y="6,5,4,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="2"
			x="11"
			y="3"
		[/recruit]
		[random]
			value="8678"
		[/random]
		[random]
			value="22778"
		[/random]
		[random]
			value="19379"
		[/random]
		[random]
			value="18269"
		[/random]
		[random]
			value="17869"
		[/random]
		[random]
			value="28519"
		[/random]
		[random]
			value="22602"
		[/random]
		[random]
			value="12094"
		[/random]
		[random]
			value="28025"
		[/random]
		[random]
			value="16815"
		[/random]
		[random]
			value="20423"
		[/random]
		[random]
			value="7935"
		[/random]
		[random]
			value="14280"
		[/random]
		[random]
			value="16718"
		[/random]
		[random]
			value="13195"
			[results]
				checksum="<3k85mndU3eF>a,..P305kg7W0d6cpzj<c3>k7>a,+alX1ah,2Wi<0o.-bnee7bo56d2incd,4Z6occi45H-f-5057b>02aa.o6Z+40CN5c8b.<X,47J.7v3b3e4xt<3"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,12,13,13,14,15,15"
			y="2,3,3,4,5,5,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,13,14,15,15,16,17,18"
			y="3,4,4,5,6,6,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,14,15,16,16,17"
			y="4,4,5,5,6,6,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="tiffy has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,13,13,14,14"
			y="4,5,6,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,11"
			y="3,4,5,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11"
			y="11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,10,9"
			y="12,12,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Thar has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="logiz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="JudischerZwerg has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="yankjenets has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,11,11,10,9,8,7"
			y="21,20,19,18,18,18,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="STikaz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="7"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="7035"
		[/random]
		[random]
			value="32350"
		[/random]
		[random]
			value="2191"
		[/random]
		[random]
			value="8027"
		[/random]
		[random]
			value="4361"
		[/random]
		[random]
			value="22334"
		[/random]
		[random]
			value="14995"
		[/random]
		[random]
			value="6053"
		[/random]
		[random]
			value="12400"
		[/random]
		[random]
			value="18042"
		[/random]
		[random]
			value="20937"
		[/random]
		[random]
			value="15238"
		[/random]
		[random]
			value="16254"
		[/random]
		[random]
			value="893"
		[/random]
		[random]
			value="19839"
			[results]
				checksum=",Ad3Y5f-Gtmsop5jHbEoRiSrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNLoM8mwoFomIhFlq1.CLB<<ddNv5EsLNHBNzhOI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Goblin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="antoniopr has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="dasdasdas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="19,18,18,18,18"
			y="13,13,14,15,16"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Milic has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="dasdasdas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,11"
			y="6,5,4,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="11"
			y="3"
		[/recruit]
		[random]
			value="26970"
		[/random]
		[random]
			value="19046"
		[/random]
		[random]
			value="14364"
		[/random]
		[random]
			value="30744"
		[/random]
		[random]
			value="10682"
		[/random]
		[random]
			value="22853"
		[/random]
		[random]
			value="29117"
		[/random]
		[random]
			value="5564"
		[/random]
		[random]
			value="31102"
		[/random]
		[random]
			value="22311"
		[/random]
		[random]
			value="31437"
		[/random]
		[random]
			value="5027"
		[/random]
		[random]
			value="20665"
		[/random]
		[random]
			value="2528"
		[/random]
		[random]
			value="14245"
			[results]
				checksum="jfC5opl9pneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji-0Ug681h64jGjKk7ELYl9YI95gAxGxnvPuSVVEH>yBMtLAwyHUqR"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="3,3,3,4,5,5"
			y="14,13,12,11,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,10"
			y="12,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,10,9,9"
			y="13,12,11,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,13,13,13,13"
			y="11,10,9,8,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14,14,15"
			y="7,8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,18,19,20"
			y="7,7,7,6,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,19"
			y="7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Darklord has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18"
			y="8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,14,15,16"
			y="5,4,4,4,5,5"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="11,11,11,11,12,12"
			y="21,20,19,18,17,16"
		[/move]
	[/command]
	[command]
		[recruit]
			value="2"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="10913"
		[/random]
		[random]
			value="18362"
		[/random]
		[random]
			value="18724"
		[/random]
		[random]
			value="17522"
		[/random]
		[random]
			value="30421"
		[/random]
		[random]
			value="18936"
		[/random]
		[random]
			value="19484"
		[/random]
		[random]
			value="25530"
		[/random]
		[random]
			value="20655"
		[/random]
		[random]
			value="1168"
		[/random]
		[random]
			value="30235"
		[/random]
		[random]
			value="16801"
		[/random]
		[random]
			value="26510"
		[/random]
		[random]
			value="24952"
		[/random]
		[random]
			value="24854"
			[results]
				checksum="RVQsCRORlSP,DLsxDMMfFuzJRDJCyOyPpHMVsOIMzEOKRzPuHEfJqwNzzmyJIhVwVwSxvKmMAS8wEVRB+JCszfJzd4jC+rc<MF13amk4nil5K7b35>-yp,+.8,eyb6ac"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Legolass has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Izzenwrath has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="5,5,5,6,6"
			y="18,17,16,15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="tsr has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="8,8,7"
			y="16,15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="santo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,14"
			y="15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="13,14,14,13"
			y="17,16,15,15"
		[/move]
	[/command]
	[command]
		[move]
			x="17,16,15"
			y="17,16,16"
		[/move]
	[/command]
	[command]
		[move]
			x="15,14"
			y="16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Caphriel has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="akkon has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="7,6,6,6"
			y="18,17,16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Shifter has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="18,17,16,15"
			y="16,16,15,15"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="264000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,8"
			y="10,9,9,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="11"
			y="4"
		[/recruit]
		[random]
			value="14785"
		[/random]
		[random]
			value="8037"
		[/random]
		[random]
			value="29331"
		[/random]
		[random]
			value="14373"
		[/random]
		[random]
			value="1996"
		[/random]
		[random]
			value="24241"
		[/random]
		[random]
			value="21415"
		[/random]
		[random]
			value="26183"
		[/random]
		[random]
			value="32402"
		[/random]
		[random]
			value="5918"
		[/random]
		[random]
			value="29540"
		[/random]
		[random]
			value="20037"
		[/random]
		[random]
			value="2617"
		[/random]
		[random]
			value="23945"
		[/random]
		[random]
			value="18241"
			[results]
				checksum="6hs5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji--Ug681h64jGjKk7ELbfXlO69>IPFNIDBGnoCSO3srDyLKztBCMx"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,11,11,10"
			y="3,4,5,6,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,18"
			y="10,9,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="11,11,11,11,10,10"
			y="21,20,19,18,17,16"
		[/move]
	[/command]
	[command]
		[recruit]
			value="1"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="5790"
		[/random]
		[random]
			value="2541"
		[/random]
		[random]
			value="15519"
		[/random]
		[random]
			value="5659"
		[/random]
		[random]
			value="11934"
		[/random]
		[random]
			value="18719"
		[/random]
		[random]
			value="5300"
		[/random]
		[random]
			value="19228"
		[/random]
		[random]
			value="23835"
		[/random]
		[random]
			value="17771"
		[/random]
		[random]
			value="14280"
		[/random]
		[random]
			value="3130"
		[/random]
		[random]
			value="17396"
		[/random]
		[random]
			value="5763"
		[/random]
		[random]
			value="9937"
			[results]
				checksum="14,Wfc>cu2lH0olW9-5N-m<e6f60hfabkcij<4>i3h3e2.t0a1f<j870h0k565.Y0>ide2Hi80k.d8da021n<.26Z+40CN5c8b.-X,48K.7v3f3XdJFikGNVwGMoVOFH"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Nordmann has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,11,11,11,11,11,10"
			y="23,22,21,20,19,18,17"
		[/move]
	[/command]
	[command]
		[move]
			x="6,7,7,8"
			y="14,14,13,12"
		[/move]
	[/command]
	[command]
		[move]
			x="6,7,7,7"
			y="15,15,14,13"
		[/move]
	[/command]
	[command]
		[move]
			x="7,6,5,4,3"
			y="13,12,12,11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Itarille has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="7,7,6"
			y="15,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Leon has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="12,12,12,12,11"
			y="16,15,14,13,13"
		[/move]
	[/command]
	[command]
		[move]
			x="13,12,11"
			y="15,14,14"
		[/move]
	[/command]
	[command]
		[move]
			x="14,14,13"
			y="15,14,14"
		[/move]
	[/command]
	[command]
		[move]
			x="13,12,11,10"
			y="14,13,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lord_Gelesztas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Oziris has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,15,15"
			y="15,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Itsuka has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="rytdog has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="14,14,14,14,13"
			y="14,13,12,11,11"
		[/move]
	[/command]
	[command]
		[move]
			x="15,15"
			y="13,12"
		[/move]
	[/command]
	[command]
		[move]
			x="15,15,15"
			y="12,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="l3l0 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="233000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="left_behind has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Zodiak_xXOXx has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ArtuR has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,17,16,15"
			y="8,9,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="15"
				y="9"
			[/source]
			[destination]
				x="15"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="14921"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16218"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25518"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="neofutur has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="RequinB5 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,18,17,16,15,14,13,13"
			y="8,7,8,8,8,8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="13"
				y="10"
			[/source]
			[destination]
				x="13"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="18695"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26157"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27643"
			[results]
				chance="60"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28205"
			[results]
				chance="60"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,15,14,14,14,14"
			y="5,6,6,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="14"
				y="9"
			[/source]
			[destination]
				x="15"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="4341"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="9010"
			[results]
				chance="30"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7297"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,14,15,16,17,18,18,19,19,20"
			y="7,7,8,8,9,9,10,11,12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Maragan has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,19,18,17,16,15,14,13"
			y="7,7,7,8,8,8,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,7,6,5"
			y="8,9,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,9"
			y="10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,11,11,11"
			y="4,5,6,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,11,10,9"
			y="2,3,4,5,5,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,10,11,11,11"
			y="7,6,5,5,4,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="11"
			y="3"
		[/recruit]
		[random]
			value="17731"
		[/random]
		[random]
			value="17802"
		[/random]
		[random]
			value="30093"
		[/random]
		[random]
			value="8367"
		[/random]
		[random]
			value="17598"
		[/random]
		[random]
			value="9057"
		[/random]
		[random]
			value="13686"
		[/random]
		[random]
			value="2541"
		[/random]
		[random]
			value="28240"
		[/random]
		[random]
			value="22014"
		[/random]
		[random]
			value="29156"
		[/random]
		[random]
			value="12564"
		[/random]
		[random]
			value="22475"
		[/random]
		[random]
			value="8189"
		[/random]
		[random]
			value="5846"
			[results]
				checksum="6hs5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0YUg681h64jGjKk7ELbfXlO69>IPFNIDBGnBCSO3srDyLKztBBHx"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11"
			y="3,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="15,16,16,16"
			y="10,9,8,7"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16,17,18,18"
			y="7,6,6,5,4"
		[/move]
	[/command]
	[command]
		[move]
			x="13,14"
			y="11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Gustav has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="14,15,15"
			y="11,11,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="15"
				y="10"
			[/source]
			[destination]
				x="14"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="9977"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32740"
			[results]
				chance="50"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17055"
			[results]
				chance="60"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5776"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27787"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="scrouic has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,12,13,14,14,14"
			y="13,13,13,12,11,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="14"
				y="10"
			[/source]
			[destination]
				x="14"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="20536"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="3550"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1452"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23372"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="30161"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="11,10,9"
			y="14,13,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="9"
				y="13"
			[/source]
			[destination]
				x="9"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="27162"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17912"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10724"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="adilson has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,10,10,10,10"
			y="16,15,14,13,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="12"
			[/source]
			[destination]
				x="9"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="18808"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="53"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28361"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5362"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11125"
			[results]
				chance="40"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="6,6,6,6"
			y="13,12,11,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="10"
			[/source]
			[destination]
				x="5"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="11613"
			[results]
				chance="40"
				damage="15"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="31020"
			[results]
				chance="70"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="26639"
			[results]
				chance="40"
				damage="15"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="12471"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="8,8,7,7,6"
			y="12,11,11,10,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="9"
			[/source]
			[destination]
				x="5"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="20133"
			[results]
				chance="40"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="3056"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="20273"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6944"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="3124"
			[results]
				chance="40"
				damage="10"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="10,10,11,11,11,11,11"
			y="17,18,19,20,21,22,23"
		[/move]
	[/command]
	[command]
		[move]
			x="11,12,13,14,15,15,16,16,17"
			y="21,20,20,19,19,18,17,16,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="klisman has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="17,17"
			y="16,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ZgRZyt has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="dinosaur18241 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="3,4,5,5"
			y="11,11,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="wwwameng has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,11,12,12,12,13"
			y="13,14,14,15,16,17"
		[/move]
	[/command]
	[command]
		[recruit]
			value="7"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="989"
		[/random]
		[random]
			value="5841"
		[/random]
		[random]
			value="32296"
		[/random]
		[random]
			value="26235"
		[/random]
		[random]
			value="5549"
		[/random]
		[random]
			value="17926"
		[/random]
		[random]
			value="22492"
		[/random]
		[random]
			value="25511"
		[/random]
		[random]
			value="16022"
		[/random]
		[random]
			value="11337"
		[/random]
		[random]
			value="15197"
		[/random]
		[random]
			value="19083"
		[/random]
		[random]
			value="22769"
		[/random]
		[random]
			value="26206"
		[/random]
		[random]
			value="3818"
			[results]
				checksum=",Ad3Y5f-Gtmnsp5jHbEoRiVrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNQsM8mwoFomIhFlq1.CLW<<ddNv5EsLNHBNzkOI"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="238000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,12,11,10,9,8,7"
			y="9,9,9,9,10,10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="7"
				y="10"
			[/source]
			[destination]
				x="6"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="4113"
			[results]
				chance="70"
				damage="1"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7160"
			[results]
				chance="70"
				damage="1"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16874"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,12,11,10"
			y="10,10,11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="10"
				y="11"
			[/source]
			[destination]
				x="10"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="22611"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1471"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32593"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Dust has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14,14,14,13,12,11"
			y="9,8,7,6,6,5,5"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,14,13,13"
			y="9,8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="13"
				y="10"
			[/source]
			[destination]
				x="14"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="22153"
			[results]
				chance="60"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="244"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13893"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7599"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,17,17,18"
			y="9,8,7,6,5"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="18"
				y="5"
			[/source]
			[destination]
				x="18"
				y="4"
			[/destination]
		[/attack]
		[random]
			value="13528"
			[results]
				chance="30"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lysop has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Rein has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="donkey_noob_trash has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Goran has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,17"
			y="9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,20,19,19,18"
			y="12,11,11,10,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,9,9,8"
			y="6,7,8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,11,10,9,8"
			y="2,3,4,5,5,6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,10,9,8,8,9"
			y="9,9,10,10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="12"
			[/source]
			[destination]
				x="9"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="22175"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18517"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32248"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="tantedeinercousine has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Truiii-compressor has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11"
			y="4,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="11"
			y="3"
		[/recruit]
		[random]
			value="27095"
		[/random]
		[random]
			value="11378"
		[/random]
		[random]
			value="14538"
		[/random]
		[random]
			value="3449"
		[/random]
		[random]
			value="32690"
		[/random]
		[random]
			value="32741"
		[/random]
		[random]
			value="17315"
		[/random]
		[random]
			value="4243"
		[/random]
		[random]
			value="29112"
		[/random]
		[random]
			value="1310"
		[/random]
		[random]
			value="14943"
		[/random]
		[random]
			value="20592"
		[/random]
		[random]
			value="8236"
		[/random]
		[random]
			value="8414"
		[/random]
		[random]
			value="7684"
			[results]
				checksum="6hs5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji--Ug681h64jGjKk7ELbfXlO69>IPFNIDBGnoCSO3srDyLKztBCMx"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,14,14,15"
			y="3,3,4,4,5,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="smeeds_ has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="5,5,6,7"
			y="10,11,11,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="11"
			[/source]
			[destination]
				x="7"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="11334"
			[results]
				chance="40"
				damage="30"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Bal-Sagoth has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Slader has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="9,8"
			y="13,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="8"
				y="12"
			[/source]
			[destination]
				x="9"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="8342"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6832"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27343"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="6,5"
			y="10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Shadrak has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="6,7,7,8"
			y="9,10,11,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="11"
			[/source]
			[destination]
				x="9"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="30477"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21166"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="24018"
			[results]
				chance="40"
				damage="10"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="14,13"
			y="10,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="13"
				y="11"
			[/source]
			[destination]
				x="13"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="23213"
			[results]
				chance="40"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24678"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3913"
			[results]
				chance="40"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32465"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Mara has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,11,12,12"
			y="12,12,11,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="12"
				y="10"
			[/source]
			[destination]
				x="13"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="21184"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32363"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1230"
			[results]
				chance="40"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="notme has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,15,15,15,15,14"
			y="10,11,12,13,14,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Loy has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,14,14,14,13,12,11,10"
			y="17,16,15,14,14,13,13,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="12"
			[/source]
			[destination]
				x="10"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="13913"
			[results]
				chance="30"
				damage="11"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5839"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6872"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27108"
			[results]
				chance="30"
				damage="11"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="17,17,17,17,18"
			y="17,16,15,14,13"
		[/move]
	[/command]
	[command]
		[move]
			x="18,18,19,19,18"
			y="13,12,12,11,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="18"
				y="10"
			[/source]
			[destination]
				x="18"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="11951"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28689"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31043"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17165"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27443"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16159"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="NicaraguanAssassin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,11,11,12,12,13"
			y="21,20,19,18,17,17"
		[/move]
	[/command]
	[command]
		[recruit]
			value="5"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="5712"
		[/random]
		[random]
			value="7773"
		[/random]
		[random]
			value="26454"
		[/random]
		[random]
			value="30207"
		[/random]
		[random]
			value="9848"
		[/random]
		[random]
			value="29733"
		[/random]
		[random]
			value="20611"
		[/random]
		[random]
			value="810"
		[/random]
		[random]
			value="3106"
		[/random]
		[random]
			value="26078"
		[/random]
		[random]
			value="13426"
		[/random]
		[random]
			value="18510"
		[/random]
		[random]
			value="5410"
		[/random]
		[random]
			value="16350"
		[/random]
		[random]
			value="19633"
			[results]
				checksum="ixp,4nc1oNO<LLyKmJLIEhoF>vyBA6mszOAMDTywuzyODCrTtRLwFwmIsr1QENmxPFHFw.RFKFnqypNKqM8mwoFomIhFlq1.CL-<<ddBfkHDONNHvMSO1I9LGCHpACmL"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="11,11,11,11,11,11,12"
			y="23,22,21,20,19,18,17"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="236000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,10,10,10"
			y="11,10,9,8,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="commrad has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8,8,8,8"
			y="6,7,8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="10"
			[/source]
			[destination]
				x="8"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="27241"
			[results]
				chance="60"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6705"
			[results]
				chance="60"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14376"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3395"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1783"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,9"
			y="10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="11"
			[/source]
			[destination]
				x="8"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="16909"
			[results]
				chance="40"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4683"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="29022"
			[results]
				chance="40"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23191"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8301"
			[results]
				chance="40"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24300"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="19183"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="FuckingNoob has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="nightheaven has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="smeeds_ has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8,9,10,10"
			y="8,9,10,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="11"
			[/source]
			[destination]
				x="10"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="26367"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25238"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29493"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17502"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="20333"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,11,11,12"
			y="5,6,7,8,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="12"
				y="9"
			[/source]
			[destination]
				x="12"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="13470"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6203"
			[results]
				chance="30"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16822"
			[results]
				chance="30"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,11"
			y="7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,17,16"
			y="9,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,15,14,13,12,11,10,9"
			y="9,10,9,9,8,9,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,16,17,17,18"
			y="6,6,7,8,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="18"
				y="9"
			[/source]
			[destination]
				x="18"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="28950"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25893"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="30208"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,18"
			y="5,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,16,15,14,13"
			y="9,9,10,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="13"
				y="10"
			[/source]
			[destination]
				x="12"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="4095"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="20349"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11429"
			[results]
				chance="30"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="31352"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16263"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11119"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18125"
			[results]
				chance="60"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="LakeBass has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,12,13,13,13,14"
			y="2,3,3,4,5,6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="12"
				y="10"
			[/source]
			[destination]
				x="12"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="1393"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25468"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1672"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19004"
			[results]
				chance="30"
				damage="4"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Iceant"
			message="seems like i have lost"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Iceant"
			message=" ughh, that was lucky"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="stolto has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Vandarr"
			message="yep :)"
			side="2"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Vandarr"
			message="sometimes Wesnoth is like that :)"
			side="2"
		[/speak]
	[/command]
	[command]
		[move]
			x="5,6,7"
			y="10,9,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="10"
			[/source]
			[destination]
				x="8"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="12516"
			[results]
				chance="60"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17881"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18050"
			[results]
				chance="60"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32115"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Iceant"
			message="chess is more fair;)"
			side="1"
		[/speak]
	[/command]
	[command]
		[move]
			x="7,6,6,7,8"
			y="11,10,9,9,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="9"
			[/source]
			[destination]
				x="9"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="498"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32410"
			[results]
				chance="60"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18568"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7184"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27034"
			[results]
				chance="60"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lennart-Held has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="8,9"
			y="11,12"
		[/move]
	[/command]
	[command]
		[move]
			x="8,8"
			y="12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="8"
				y="11"
			[/source]
			[destination]
				x="9"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="10498"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21222"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11161"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="12"
			[/source]
			[destination]
				x="9"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="21514"
			[results]
				chance="40"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[choose]
			value="0"
		[/choose]
	[/command]
	[command]
		[move]
			x="10,9,8,7,7"
			y="12,13,12,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="11"
			[/source]
			[destination]
				x="8"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="5665"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3370"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28284"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3007"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18500"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="polymorph has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,14,14,15,15,15"
			y="17,16,15,15,14,13"
		[/move]
	[/command]
	[command]
		[move]
			x="11,11,11,12,13,13,14"
			y="21,20,19,18,18,17,16"
		[/move]
	[/command]
	[command]
		[move]
			x="12,12,11,11,11,11,11"
			y="17,18,19,20,21,22,23"
		[/move]
	[/command]
	[command]
		[recruit]
			value="7"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="7685"
		[/random]
		[random]
			value="22695"
		[/random]
		[random]
			value="32325"
		[/random]
		[random]
			value="12750"
		[/random]
		[random]
			value="31546"
		[/random]
		[random]
			value="16204"
		[/random]
		[random]
			value="27842"
		[/random]
		[random]
			value="10061"
		[/random]
		[random]
			value="24338"
		[/random]
		[random]
			value="12550"
		[/random]
		[random]
			value="279"
		[/random]
		[random]
			value="27146"
		[/random]
		[random]
			value="25327"
		[/random]
		[random]
			value="24437"
		[/random]
		[random]
			value="27889"
			[results]
				checksum=",Ad3Y5f-Gtmspp5jHbEoRiSrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNLpM8mwoFomIhFlq1.CLW<<ddNv5EsLNHBNzkOI"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="18,17,16,16,17"
			y="10,11,10,9,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="17"
				y="9"
			[/source]
			[destination]
				x="18"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="24347"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25486"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3344"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="16603"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27019"
			[results]
				chance="30"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="13,12"
			y="11,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="12"
				y="10"
			[/source]
			[destination]
				x="12"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="19306"
			[results]
				chance="60"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Malikim has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="14,14,14,13"
			y="14,15,16,17"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="10"
			[/source]
			[destination]
				x="8"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="18073"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="23264"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="23586"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="kataks has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Leon has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,9"
			y="11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="11"
			[/source]
			[destination]
				x="8"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="26772"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="94"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19791"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,10,9,8,7,6,5,5"
			y="10,9,8,8,7,8,8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="hjl_hk has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,10,10,9"
			y="7,8,8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="9"
				y="10"
			[/source]
			[destination]
				x="8"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="20186"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26548"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4204"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14,13,13,12"
			y="6,7,8,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="12"
				y="9"
			[/source]
			[destination]
				x="12"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="6296"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="24532"
			[results]
				chance="50"
				damage="11"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14400"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4597"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32083"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Yopdus has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,18,18,17,16,16"
			y="4,5,6,7,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="8"
			[/source]
			[destination]
				x="17"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="4731"
			[results]
				chance="60"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="405"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="846"
			[results]
				chance="60"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,17"
			y="9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="King_Google has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="grk has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="pizza has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="12"
			[/source]
			[destination]
				x="9"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="6458"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1582"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17489"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11450"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27609"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="575"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="8,7,7,8,9,10,11"
			y="9,9,8,7,8,8,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="11"
				y="9"
			[/source]
			[destination]
				x="12"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="21822"
			[results]
				chance="60"
				damage="15"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="3775"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="152"
			[results]
				chance="60"
				damage="15"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="12,12,12,12"
			y="10,11,12,13"
		[/move]
	[/command]
	[command]
		[move]
			x="15,15,15,15"
			y="13,12,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Rampager has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="14,14,15,15,15,16"
			y="16,15,15,14,13,12"
		[/move]
	[/command]
	[command]
		[move]
			x="11,11,11,12,13,13,14"
			y="21,20,19,18,18,17,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="11"
			[/source]
			[destination]
				x="8"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="4346"
			[results]
				chance="60"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="7,8"
			y="10,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="10"
			[/source]
			[destination]
				x="9"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="28257"
			[results]
				chance="70"
				damage="12"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="uiii has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="8,7,7,8"
			y="11,11,10,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="8"
				y="9"
			[/source]
			[destination]
				x="9"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="25808"
			[results]
				chance="70"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="jimi has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,15,14,13,12"
			y="8,8,8,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="12"
				y="9"
			[/source]
			[destination]
				x="11"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="8543"
			[results]
				chance="60"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10561"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7"
			[results]
				chance="60"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[choose]
			value="0"
		[/choose]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,6,7,8,9,10,10,9"
			y="10,9,8,8,7,8,8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="10"
			[/source]
			[destination]
				x="8"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="9537"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29180"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="29882"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12691"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,17,17"
			y="9,10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="17"
				y="12"
			[/source]
			[destination]
				x="16"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="8220"
			[results]
				chance="50"
				damage="11"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23833"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21636"
			[results]
				chance="50"
				damage="11"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Izzenwrath has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="16,16,16,16,16,17"
			y="12,13,14,15,16,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="maggot555 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,14,14,13"
			y="17,16,15,15"
		[/move]
	[/command]
	[command]
		[move]
			x="12,12,12,12,13"
			y="13,14,15,16,17"
		[/move]
	[/command]
	[command]
		[move]
			x="14,14,15,15,15,16"
			y="16,15,15,14,13,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="12"
			[/source]
			[destination]
				x="17"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="28663"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12999"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15839"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21803"
			[results]
				chance="50"
				damage="11"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9230"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="15,16,17,18,18"
			y="10,10,10,10,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="18"
				y="11"
			[/source]
			[destination]
				x="17"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="24847"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19517"
			[results]
				chance="50"
				damage="11"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23891"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2388"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17003"
			[results]
				chance="30"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Dasodelu has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="4"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="10160"
		[/random]
		[random]
			value="10372"
		[/random]
		[random]
			value="5057"
		[/random]
		[random]
			value="16146"
		[/random]
		[random]
			value="4980"
		[/random]
		[random]
			value="31484"
		[/random]
		[random]
			value="8012"
		[/random]
		[random]
			value="18132"
		[/random]
		[random]
			value="25410"
		[/random]
		[random]
			value="9115"
		[/random]
		[random]
			value="30098"
		[/random]
		[random]
			value="2771"
		[/random]
		[random]
			value="7438"
		[/random]
		[random]
			value="22038"
		[/random]
		[random]
			value="27336"
			[results]
				checksum="rhRteuCm>Im>OtyS+7ckzAuBMm0+Z8dI9a<pk8651Wl8Z5w.cldpBX>77bllckl2Y+5>aaii6<81mkljb2ifil7.WgZ2.h<5-XxS+j>k2403-p8TA9v1-xH1iTk+k58Y"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="11,11,11,11,11,12,13"
			y="23,22,21,20,19,18,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Shifter has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="9,10,10"
			y="12,11,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="10"
			[/source]
			[destination]
				x="9"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="31129"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="3087"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8395"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="216"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1853"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11537"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29561"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Loko23 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="10"
			[/source]
			[destination]
				x="9"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="1869"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15328"
			[results]
				chance="70"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15878"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10889"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="4404"
			[results]
				chance="70"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="8,7,6,5"
			y="9,10,10,10"
		[/move]
	[/command]
	[command]
		[move]
			x="7,7,8"
			y="11,10,9"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,11,10,9,8"
			y="9,9,8,8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="8"
			[/source]
			[destination]
				x="8"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="10112"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13116"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27685"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25822"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29235"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="888"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="10"
			[/source]
			[destination]
				x="8"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="13487"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="14308"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32550"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1251"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="30715"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="3296"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17"
			y="12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="17"
				y="11"
			[/source]
			[destination]
				x="18"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="18883"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26020"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9917"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="22119"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Syaoran has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="16,15,15,16"
			y="12,12,11,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="10"
			[/source]
			[destination]
				x="17"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="13108"
			[results]
				chance="40"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24509"
			[results]
				chance="60"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9131"
			[results]
				chance="40"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5569"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="4879"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="13,13,14,15,16,16"
			y="15,14,13,13,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="11"
			[/source]
			[destination]
				x="17"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="5032"
			[results]
				chance="40"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Vandarr"
			message="gg!"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Iceant"
			message="gg"
			side="1"
		[/speak]
	[/command]
[/replay]
[snapshot]
	campaign_type="multiplayer"
	completion="running"
	current_tod="0"
#textdomain wesnoth-multiplayer
	description=_ "Warfare transforms the simple farms and villages of a peaceful region into a subtly parceled battlefield."
	difficulty="NORMAL"
	end_text_duration="0"
	experience_modifier="70"
	hash="EqK,,,KxGHj1q>FS,UdqBn4erWBwx7tGxLe4nIo9f0-xnP6JQuOI6W-92qdedEsY3JamDYvGPYyVho<aFvF.erCJ<kAmykeuOUMfxjIttN.OSV6lVoINmB+HvhWlBQFe"
	id="multiplayer_Hamlets"
	label="2p - Hamlets"
	map_data="border_size=1
usage=map

Gs^Fp       , Hh          , Gg          , Wwf         , Wwf         , Gs^Fp       , Hh          , Gs^Fp       , Gg          , Gs^Fp       , Gs^Fp       , Wwf         , Gg          , Hh          , Gs^Fms      , Mm          , Wwf         , Wwf         , Hh          , Gs^Fp       , Hh          , Mm          , Mm          
Hh          , Hh          , Gg^Vh       , Wwf         , Wwf         , Gs^Fp       , Mm          , Hh          , Gg          , Gs^Fms      , Wwf         , Wwf         , Wwf         , Mm          , Hh          , Gs^Fms      , Wwf         , Wwf         , Gs^Fp       , Hh          , Hh          , Gs^Fms      , Hh          
Wwf         , Wwf         , Wwf         , Wwf         , Gg          , Wwf         , Wwf         , Hh          , Gg          , Gg          , Wwf         , Ch          , Wwf         , Gs^Fp       , Wwf         , Wwf         , Gg          , Gg          , Hh          , Mm          , Wwf         , Mm          , Hh          
Mm          , Hh          , Wwf         , Gg^Fp       , Gg^Ve       , Wwf         , Gg          , Gg          , Wwf         , Wwf         , Wwf         , 1 Kh        , Ch          , Wwf         , Gg          , Gg          , Rd          , Rd^Uf       , Wwf         , Wwf         , Gs^Fms      , Wwf         , Wwf         
Wwf         , Wwf         , Mm          , Wwf         , Gg^Fms      , Wwf         , Wwf         , Wwf         , Gg^Vh       , Gg          , Wwf         , Ch          , Wwf         , Ch          , Rd          , Rd          , Wwf         , Wwf         , Gg^Vh       , Gs^Fp       , Re^Gvs      , Hh          , Hh          
Gs^Fp       , Hh          , Wwf         , Gg^Fp       , Wwf         , Wwf         , Gg          , Gg          , Rd          , Gg          , Wwf         , Ch          , Gg          , Wwf         , Wwf         , Wwf         , Mm          , Gs^Fp       , Gg          , Re^Gvs      , Gg^Wm       , Re^Gvs      , Re^Gvs      
Wwf         , Wwf         , Mm          , Wwf         , Hh          , Gg^Fms      , Rd          , Rd          , Gg          , Gg          , Wwf         , Wwf         , Gs^Fms      , Gg          , Hh          , Gg          , Gg          , Gg          , Rd          , Gg          , Gg          , Hh          , Hh          
Gs^Fp       , Hh          , Gs^Fms      , Gg          , Gg          , Rd          , Gg          , Gg          , Wwf         , Wwf         , Gs^Fms      , Wwf         , Gs^Fp       , Mm          , Gg          , Gg          , Rd          , Rd          , Gg          , Ggf         , Mm          , Gs^Fp       , Gs^Fp       
Gs^Fp       , Gs^Fp       , Gg          , Gg          , Wwf         , Gg          , Wwf         , Wwf         , Mm          , Hh          , Wwf         , Wwf         , Gg          , Gg          , Rd          , Rd          , Rd          , Gg          , Gs^Fp       , Gs^Fms      , Gs^Fms      , Hh          , Hh          
Hh          , Hh          , Wwf         , Wwf         , Hh          , Wwf         , Gg          , Gg          , Gg          , Gg          , Wwf         , Gg          , Gg          , Rd          , Gg          , Gg          , Gg          , Gg^Vh       , Hh          , Gg          , Wwf         , Ggf         , Ggf         
Wwf         , Wwf         , Hh          , Ggf         , Gs^Fp       , Gg^Vh       , Re^Gvs      , Gg          , Gg          , Ss^Vhs      , Hh          , Ww          , Gs^Fms      , Gg          , Gs^Fp       , Hh          , Wwf         , Wwf         , Wwf         , Wwf         , Gg          , Wwf         , Wwf         
Hh          , Hh          , Gg          , Gg^Wm       , Re^Gvs      , Re^Gvs      , Re^Gvs      , Gg          , Gg          , Ss          , Gs^Fp       , Ww          , Hh          , Mm          , Wwf         , Wwf         , Gg          , Gg          , Rd^Uf       , Gg          , Gg          , Gs^Fp       , Gs^Fms      
Gs^Fp       , Gs^Fp       , Gg          , Gg          , Gg          , Re^Gvs      , Gg          , Gg          , Hh          , Mm          , Wwf         , Ww          , Ww          , Wo          , Wwf         , Gg          , Hh          , Gs^Fp       , Rd          , Rd          , Hh          , Gg          , Gg          
Rd          , Rd          , Gs^Fms      , Hh          , Rd          , Gg          , Gs^Fp       , Gg          , Gg          , Wwf         , Gg          , Gg          , Gg          , Wwf         , Gg          , Gg          , Gs^Fp       , Rd^Uf       , Rd          , Mm          , Gs^Fms      , Rd          , Rd          
Rd          , Rd          , Hh          , Mm          , Rd          , Rd^Uf       , Hh          , Gg          , Wwf         , Wwf         , Ww          , Gg          , Wwf         , Wwf         , Hh          , Gg          , Gg          , Gg          , Gg          , Hh          , Gg          , Rd          , Rd          
Gg          , Gg          , Gg          , Rd          , Rd^Uf       , Gs^Fp       , Gg          , Gg          , Wwf         , Wo          , Hh          , Ww          , Gs^Fp       , Mm          , Gg          , Gg          , Re^Gvs      , Re^Gvs      , Re^Gvs      , Gg          , Gg          , Gs^Fp       , Gs^Fp       
Gs^Fp       , Gs^Fp       , Gg          , Gg          , Wwf         , Gg          , Wwf         , Wwf         , Gs^Fms      , Mm          , Gs^Fp       , Ww          , Hh          , Ss          , Gg          , Gg          , Re^Gvs      , Re^Gvs      , Gs^Fms      , Gg^Wm       , Hh          , Hh          , Hh          
Wwf         , Wwf         , Wwf         , Wwf         , Hh          , Wwf         , Gg          , Hh          , Gg          , Gg          , Gg          , Ww          , Wwf         , Ss^Vhs      , Gg          , Gg          , Gg          , Gg^Vh       , Hh          , Ggf         , Wwf         , Wwf         , Wwf         
Ggf         , Ggf         , Gs^Fms      , Gg          , Gs^Fp       , Gg^Vh       , Rd          , Gg          , Rd          , Rd          , Gg          , Gg          , Wwf         , Gg          , Mm          , Gg          , Wwf         , Wwf         , Wwf         , Wwf         , Gg          , Mm          , Mm          
Hh          , Hh          , Mm          , Gs^Fp       , Gg          , Gg          , Rd          , Rd          , Gg          , Gg          , Gs^Fms      , Wwf         , Gs^Fms      , Hh          , Wwf         , Wwf         , Gg          , Gg          , Gg          , Gg          , Gs^Fp       , Gs^Fms      , Gs^Fms      
Gs^Fp       , Gs^Fp       , Gg          , Ggf         , Rd          , Rd          , Gg          , Gg          , Hh          , Mm          , Gg          , Wwf         , Wwf         , Wwf         , Gg          , Gg          , Rd          , Rd          , Hh          , Gg          , Mm          , Hh          , Hh          
Hh          , Hh          , Gg^Wm       , Gg          , Gg          , Gg          , Mm          , Gg          , Wwf         , Wwf         , Wwf         , Ch          , Gg          , Gg          , Rd          , Rd          , Gg          , Gg^Fp       , Wwf         , Wwf         , Wwf         , Wwf         , Wwf         
Re^Gvs      , Re^Gvs      , Re^Gvs      , Re^Gvs      , Gg^Vh       , Gs^Fp       , Wwf         , Wwf         , Rd          , Ch          , Ch          , Ch          , Gg          , Gg          , Gg^Vh       , Gg          , Wwf         , Wwf         , Gg^Fms      , Gg^Fp       , Gg^Ve       , Gg          , Gg          
Hh          , Hh          , Gs^Fms      , Gs^Fp       , Wwf         , Wwf         , Rd          , Rd          , Gg          , Gg          , Wwf         , 2 Kh        , Wwf         , Gg          , Wwf         , Wwf         , Gg          , Wwf         , Wwf         , Wwf         , Wwf         , Gs^Fp       , Gs^Fp       
Gs^Fp       , Mm          , Wwf         , Wwf         , Hh          , Rd^Uf       , Gs^Fp       , Hh          , Wwf         , Wwf         , Wwf         , Ch          , Wwf         , Wwf         , Hh          , Gg          , Ggf         , Wwf         , Gg^Vh       , Gg          , Wwf         , Mm          , Mm          
Gs^Fp       , Gs^Fp       , Wwf         , Gs^Fp       , Mm          , Hh          , Hh          , Wwf         , Gs^Fp       , Gs^Fp       , Gg          , Wwf         , Gg          , Gs^Fms      , Gs^Fms      , Gg          , Ggf         , Wwf         , Wwf         , Gg          , Gs^Fp       , Wwf         , Hh          
"
	mp_countdown="yes"
	mp_countdown_action_bonus="10"
	mp_countdown_init_time="270"
	mp_countdown_reservoir_time="270"
	mp_countdown_turn_bonus="100"
	mp_fog="yes"
	mp_shroud="no"
	mp_use_map_settings="yes"
	mp_village_gold="2"
	name=_ "2p - Hamlets"
	next_underlying_unit_id="30"
#textdomain wesnoth
	objectives=_ "Victory:
@Defeat enemy leader(s)"
	observer="yes"
	playing_team="1"
	random_calls="1"
	random_seed="14940"
	random_start_time="no"
	snapshot="yes"
	turn_at="13"
	turns="-1"
	unit_wml_ids="Cavalryman,Fencer,Goblin Spearman,Heavy Infantryman,Horseman,Javelineer,Lieutenant,Mage,Naga Fighter,Orcish Archer,Orcish Assassin,Orcish Grunt,Orcish Slayer,Orcish Warrior,Pikeman,Spearman,Swordsman,Wolf Rider,era_events"
	version="1.6"
	[side]
		action_bonus_count="10"
		aggression="0.5"
		allow_player="yes"
		caution="0.25"
		colour="1"
		controller="network"
		countdown_time="270000"
		current_player="Iceant"
		disallow_observers="no"
		fog="yes"
		global_recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
		gold="50"
		hidden="no"
		id="Iceant1"
		income="0"
		leader_value="3"
		name="Iceant"
		no_leader="yes"
		number_of_possible_recruits_to_force_recruit="3.1"
		objectives=_ "Victory:
@Defeat enemy leader(s)"
		objectives_changed="yes"
		recruit="Goblin Spearman,Naga Fighter,Orcish Archer,Orcish Assassin,Orcish Grunt,Troll Whelp,Wolf Rider"
		recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
		save_id="Iceant1"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="1"
		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,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]
		[unit]
			advances_to="Goblin Knight,Goblin Pillager"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="17"
			die_sound="wolf-die.wav"
			ellipse="misc/ellipse"
			experience="7"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="35"
			id="Wolf Rider-4"
			image="units/goblins/wolf-rider.png"
#textdomain wesnoth-units
			language_name=_ "Wolf Rider"
			level="1"
			max_attacks="1"
			max_experience="21"
			max_hitpoints="35"
			max_moves="9"
			movement="8"
			movement_type="orcishfoot"
			moves="9"
			name="Prong"
			race="wolf"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Wolf Rider"
			undead_variation="mounted"
			underlying_id="4"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="9"
			y="10"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="fangs"
				[/filter_attack]
				[if]
					hits="no"
					[frame]
						begin="-250"
						end="-200"
						image="units/goblins/wolf-rider.png"
						sound="wolf-bite-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-250"
						end="-200"
						image="units/goblins/wolf-rider.png"
						sound="wolf-bite.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-200"
					end="-100"
					image="units/goblins/wolf-rider-moving.png"
				[/frame]
				[frame]
					begin="-100"
					end="50"
					image="units/goblins/wolf-rider-attack.png"
				[/frame]
				[frame]
					begin="50"
					end="100"
					image="units/goblins/wolf-rider-moving.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/goblins/wolf-rider.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/goblins/wolf-rider.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/goblins/wolf-rider-defend.png"
						sound="wolf-hit.wav"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/goblins/wolf-rider-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/goblins/wolf-rider.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/goblins/wolf-rider-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-1.png"
				[/frame]
			[/idle_anim]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/goblins/wolf-rider-moving.png"
				[/frame]
			[/movement_anim]
			[standing_anim]
				start_time="-50"
				[frame]
					duration="50"
					image="units/goblins/wolf-rider.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				start_time="-50"
				terrain="Wo,Ww,Ww^Vm,Chs,Chw,Ss"
				[frame]
					duration="50"
					image="units/goblins/wolf-rider-water.png"
				[/frame]
			[/standing_anim]
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="60"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="70"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="3"
				hills="1"
				impassable="99"
				mountains="2"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="100"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "fangs"
				icon="attacks/fangs-animal.png"
				name="fangs"
				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^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="Orcish Warlord"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="26"
			die_sound="orc-die-1.ogg,orc-die-2.ogg,orc-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="s"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="64"
			id="Orcish Grunt-6"
			image="units/orcs/warrior.png"
#textdomain wesnoth-units
			language_name=_ "Orcish Warrior"
			level="2"
			max_attacks="1"
			max_experience="34"
			max_hitpoints="64"
			max_moves="5"
			movement="5"
			movement_type="orcishfoot"
			moves="5"
			name="Grarbagdush"
			profile="portraits/orcs/warlord4.png"
			race="orc"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Orcish Warrior"
			underlying_id="6"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="8"
			y="8"
			zoc="yes"
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="60"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="70"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="3"
				hills="1"
				impassable="99"
				mountains="2"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="100"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="100"
			[/resistance]
			[attack_anim]
				offset="0.0~0.15:100,0.15~0.35:100,0.35~0.45:75,0.45~0.5:100,0.5:20,0.5~0.4:30,0.4~0.2:75,0.2~0.0:75"
				start_time="-300"
				[filter_attack]
					name="greatsword"
				[/filter_attack]
				[frame]
					duration="50"
					image="units/orcs/warrior.png"
				[/frame]
				[frame]
					duration="50"
					image="units/orcs/warrior-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/orcs/warrior-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="75"
						image="units/orcs/warrior-attack-2.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="75"
						image="units/orcs/warrior-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="100"
					image="units/orcs/warrior-attack-3.png"
				[/frame]
				[frame]
					duration="20"
					image="units/orcs/warrior-attack-4.png"
				[/frame]
				[frame]
					duration="30"
					image="units/orcs/warrior-attack-4.png"
				[/frame]
				[frame]
					duration="75"
					image="units/orcs/warrior-attack-5.png"
				[/frame]
				[frame]
					duration="75"
					image="units/orcs/warrior.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/orcs/warrior-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/orcs/warrior-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/orcs/warrior-defend-2.png"
						sound="orc-hit-1.ogg,orc-hit-2.ogg,orc-hit-3.ogg,orc-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/orcs/warrior-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/orcs/warrior-defend-1.png"
				[/frame]
			[/defend]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="10"
				description=_ "greatsword"
				icon="attacks/greatsword-orcish.png"
				name="greatsword"
				number="3"
				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]
		[unit]
			advances_to="Goblin Knight,Goblin Pillager"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="17"
			die_sound="wolf-die.wav"
			ellipse="misc/ellipse"
			experience="7"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="35"
			id="Wolf Rider-4"
			image="units/goblins/wolf-rider.png"
#textdomain wesnoth-units
			language_name=_ "Wolf Rider"
			level="1"
			max_attacks="1"
			max_experience="21"
			max_hitpoints="35"
			max_moves="9"
			movement="8"
			movement_type="orcishfoot"
			moves="9"
			name="Prong"
			race="wolf"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Wolf Rider"
			undead_variation="mounted"
			underlying_id="4"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="fangs"
				[/filter_attack]
				[if]
					hits="no"
					[frame]
						begin="-250"
						end="-200"
						image="units/goblins/wolf-rider.png"
						sound="wolf-bite-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-250"
						end="-200"
						image="units/goblins/wolf-rider.png"
						sound="wolf-bite.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-200"
					end="-100"
					image="units/goblins/wolf-rider-moving.png"
				[/frame]
				[frame]
					begin="-100"
					end="50"
					image="units/goblins/wolf-rider-attack.png"
				[/frame]
				[frame]
					begin="50"
					end="100"
					image="units/goblins/wolf-rider-moving.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/goblins/wolf-rider.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/goblins/wolf-rider.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/goblins/wolf-rider-defend.png"
						sound="wolf-hit.wav"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/goblins/wolf-rider-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/goblins/wolf-rider.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/goblins/wolf-rider-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-1.png"
				[/frame]
			[/idle_anim]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/goblins/wolf-rider-moving.png"
				[/frame]
			[/movement_anim]
			[standing_anim]
				start_time="-50"
				[frame]
					duration="50"
					image="units/goblins/wolf-rider.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				start_time="-50"
				terrain="Wo,Ww,Ww^Vm,Chs,Chw,Ss"
				[frame]
					duration="50"
					image="units/goblins/wolf-rider-water.png"
				[/frame]
			[/standing_anim]
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="60"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="70"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="3"
				hills="1"
				impassable="99"
				mountains="2"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="100"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "fangs"
				icon="attacks/fangs-animal.png"
				name="fangs"
				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^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="Orcish Warlord"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="26"
			die_sound="orc-die-1.ogg,orc-die-2.ogg,orc-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="s"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="64"
			id="Orcish Grunt-6"
			image="units/orcs/warrior.png"
#textdomain wesnoth-units
			language_name=_ "Orcish Warrior"
			level="2"
			max_attacks="1"
			max_experience="34"
			max_hitpoints="64"
			max_moves="5"
			movement="5"
			movement_type="orcishfoot"
			moves="5"
			name="Grarbagdush"
			profile="portraits/orcs/warlord4.png"
			race="orc"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Orcish Warrior"
			underlying_id="6"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="60"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="70"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="3"
				hills="1"
				impassable="99"
				mountains="2"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="100"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="100"
			[/resistance]
			[attack_anim]
				offset="0.0~0.15:100,0.15~0.35:100,0.35~0.45:75,0.45~0.5:100,0.5:20,0.5~0.4:30,0.4~0.2:75,0.2~0.0:75"
				start_time="-300"
				[filter_attack]
					name="greatsword"
				[/filter_attack]
				[frame]
					duration="50"
					image="units/orcs/warrior.png"
				[/frame]
				[frame]
					duration="50"
					image="units/orcs/warrior-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/orcs/warrior-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="75"
						image="units/orcs/warrior-attack-2.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="75"
						image="units/orcs/warrior-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="100"
					image="units/orcs/warrior-attack-3.png"
				[/frame]
				[frame]
					duration="20"
					image="units/orcs/warrior-attack-4.png"
				[/frame]
				[frame]
					duration="30"
					image="units/orcs/warrior-attack-4.png"
				[/frame]
				[frame]
					duration="75"
					image="units/orcs/warrior-attack-5.png"
				[/frame]
				[frame]
					duration="75"
					image="units/orcs/warrior.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/orcs/warrior-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/orcs/warrior-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/orcs/warrior-defend-2.png"
						sound="orc-hit-1.ogg,orc-hit-2.ogg,orc-hit-3.ogg,orc-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/orcs/warrior-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/orcs/warrior-defend-1.png"
				[/frame]
			[/defend]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="10"
				description=_ "greatsword"
				icon="attacks/greatsword-orcish.png"
				name="greatsword"
				number="3"
				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]
	[side]
		action_bonus_count="2"
		aggression="0.5"
		allow_player="yes"
		caution="0.25"
		colour="2"
		controller="human"
		countdown_time="254200"
		current_player="Vandarr"
		disallow_observers="no"
		fog="yes"
		global_recruitment_pattern="fighter,fighter,fighter,archer,mixed fighter,scout"
		gold="18"
		hidden="no"
		id="Vandarr2"
		income="0"
		leader_value="3"
		name="Vandarr"
		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="Vandarr2"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="2"
		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,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="4"
			y="22"
		[/village]
		[village]
			x="5"
			y="10"
		[/village]
		[village]
			x="5"
			y="18"
		[/village]
		[village]
			x="13"
			y="17"
		[/village]
		[village]
			x="14"
			y="22"
		[/village]
		[village]
			x="17"
			y="17"
		[/village]
		[village]
			x="18"
			y="24"
		[/village]
		[village]
			x="20"
			y="22"
		[/village]
		[unit]
			advances_to="General"
			alignment="lawful"
			allow_changes="yes"
			allow_player="yes"
			alpha="256"
			attacks_left="1"
			canrecruit="yes"
			colour="2"
			controller="human"
			cost="35"
			current_player="Vandarr"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			experience="0"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			fog="yes"
			gender="male"
			gold="100"
			goto_x="-999"
			goto_y="-999"
			hitpoints="40"
			id="Vandarr2"
			image="units/human-loyalists/lieutenant.png"
			income="0"
#textdomain wesnoth-units
			language_name=_ "Lieutenant"
			leader="Lieutenant,Swordsman,Pikeman,Javelineer,Shock Trooper,Longbowman,White Mage,Red Mage"
			level="2"
			max_attacks="1"
			max_experience="56"
			max_hitpoints="40"
			max_moves="6"
			movement="6"
			movement_type="smallfoot"
			moves="6"
			mp_countdown="yes"
			mp_countdown_action_bonus="10"
			mp_countdown_init_time="270"
			mp_countdown_reservoir_time="270"
			mp_countdown_turn_bonus="100"
			name="Vandarr"
			profile="portraits/humans/lieutenant.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="Vandarr2"
			share_maps="no"
			share_view="yes"
			shroud="no"
			side="2"
			team_name="south"
			terrain_liked="Gg, Ww, Wo"
			type="Lieutenant"
			underlying_id="2"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			user_team_name="wesnoth-multiplayerteamname^South"
			village_gold="2"
			x="13"
			y="18"
			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]
			[abilities]
				[leadership]
					affect_self="no"
					cumulative="no"
#textdomain wesnoth
					description=_ "Leadership:
This unit can lead our own units that are next to it, making them fight better.

Adjacent own units of lower level will do more damage in battle. When a unit adjacent to, of a lower level than, and on the same side as a unit with Leadership engages in combat, its attacks do 25% more damage times the difference in their levels."
					female_name=_ "female^leadership"
					id="leadership"
					name=_ "leadership"
					value="50"
					[affect_adjacent]
						adjacent="n,ne,se,s,sw,nw"
						[filter]
							level="0"
						[/filter]
					[/affect_adjacent]
				[/leadership]
				[leadership]
					affect_self="no"
					cumulative="no"
					id="leadership"
					value="25"
					[affect_adjacent]
						adjacent="n,ne,se,s,sw,nw"
						[filter]
							level="1"
						[/filter]
					[/affect_adjacent]
				[/leadership]
			[/abilities]
			[portrait]
				image="portraits/humans/transparent/lieutenant.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/lieutenant.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="8"
#textdomain wesnoth-units
				description=_ "sword"
				icon="attacks/sword-human.png"
				name="sword"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="5"
				description=_ "crossbow"
				icon="attacks/crossbow-human.png"
				name="crossbow"
				number="3"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Dragoon"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="17"
			die_sound="horse-die.ogg"
			ellipse="misc/ellipse"
			experience="14"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="44"
			id="Cavalryman-8"
			image="units/human-loyalists/cavalryman.png"
			language_name=_ "Cavalryman"
			level="1"
			max_attacks="1"
			max_experience="28"
			max_hitpoints="44"
			max_moves="8"
			movement="8"
			movement_type="mounted"
			moves="8"
			name="Cun"
			profile="portraits/humans/cavalryman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Cavalryman"
			undead_variation="mounted"
			underlying_id="8"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="8"
			y="9"
			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="7"
				description=_ "sword"
				icon="attacks/sword-human.png"
				name="sword"
				number="3"
				range="melee"
				type="blade"
			[/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="Royal Guard"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="25"
			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="56"
			id="Spearman-9"
			image="units/human-loyalists/swordsman.png"
#textdomain wesnoth-units
			language_name=_ "Swordsman"
			level="2"
			max_attacks="1"
			max_experience="34"
			max_hitpoints="56"
			max_moves="5"
			movement="5"
			movement_type="smallfoot"
			moves="5"
			name="Ceorcynvan"
			profile="portraits/humans/swordsman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Swordsman"
			underlying_id="9"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="10"
			y="10"
			zoc="yes"
			[portrait]
				image="portraits/humans/transparent/swordsman.png"
				mirror="true"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/swordsman.png"
				mirror="false"
				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="80"
				cold="100"
				fire="100"
				impact="80"
				pierce="100"
			[/resistance]
			[attack_anim]
				[filter_attack]
					name="sword"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-175"
					image="units/human-loyalists/swordsman.png"
				[/frame]
				[frame]
					begin="-175"
					end="-75"
					image="units/human-loyalists/swordsman-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-75"
						end="75"
						image="units/human-loyalists/swordsman-attack-2.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-75"
						end="75"
						image="units/human-loyalists/swordsman-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="75"
					end="200"
					image="units/human-loyalists/swordsman-attack-3.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-loyalists/swordsman.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/swordsman-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/swordsman-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/swordsman-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/swordsman.png"
				[/frame]
			[/defend]
			[idle_anim]
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					begin="0"
					end="100"
					image="units/human-loyalists/swordsman-idle-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/human-loyalists/swordsman-idle-2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-loyalists/swordsman-idle-3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/human-loyalists/swordsman-idle-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/human-loyalists/swordsman-idle-5.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/human-loyalists/swordsman-idle-6.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/human-loyalists/swordsman-idle-7.png"
				[/frame]
				[frame]
					begin="700"
					end="800"
					image="units/human-loyalists/swordsman-idle-8.png"
				[/frame]
				[frame]
					begin="800"
					end="900"
					image="units/human-loyalists/swordsman-idle-9.png"
				[/frame]
				[frame]
					begin="900"
					end="1000"
					image="units/human-loyalists/swordsman-idle-10.png"
				[/frame]
				[frame]
					begin="1000"
					end="1100"
					image="units/human-loyalists/swordsman-idle-11.png"
				[/frame]
				[frame]
					begin="1100"
					end="1200"
					image="units/human-loyalists/swordsman-idle-12.png"
				[/frame]
				[frame]
					begin="1200"
					end="1600"
					image="units/human-loyalists/swordsman-idle-4.png"
				[/frame]
				[frame]
					begin="1600"
					end="1700"
					image="units/human-loyalists/swordsman-idle-12.png"
				[/frame]
				[frame]
					begin="1700"
					end="1800"
					image="units/human-loyalists/swordsman-idle-3.png"
				[/frame]
				[frame]
					begin="1800"
					end="1900"
					image="units/human-loyalists/swordsman-idle-2.png"
				[/frame]
				[frame]
					begin="1900"
					end="2000"
					image="units/human-loyalists/swordsman-idle-1.png"
				[/frame]
			[/idle_anim]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="9"
				description=_ "sword"
				icon="attacks/sword-human.png"
				name="sword"
				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^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="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="18"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="39"
			id="Spearman-11"
			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="Sec"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Spearman"
			underlying_id="11"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="16"
			y="11"
			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^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="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="15"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="29"
			id="Mage-12"
			image="units/human-magi/mage.png"
#textdomain wesnoth-units
			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="Deorcyn"
			profile="portraits/humans/mage.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Mage"
			underlying_id="12"
			unrenamable="no"
			upkeep="full"
			usage="mixed fighter"
			x="5"
			y="10"
			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="Shock Trooper"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="19"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="12"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="39"
			id="Heavy Infantryman-13"
			image="units/human-loyalists/heavyinfantry.png"
#textdomain wesnoth-units
			language_name=_ "Heavy Infantryman"
			level="1"
			max_attacks="1"
			max_experience="28"
			max_hitpoints="39"
			max_moves="4"
			movement="4"
			movement_type="armoredfoot"
			moves="4"
			name="Manryn"
			profile="portraits/humans/heavy-infantry.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Heavy Infantryman"
			underlying_id="13"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="8"
			y="10"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="mace"
				[/filter_attack]
				[frame]
					begin="-230"
					end="-100"
					image="units/human-loyalists/heavyinfantry-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/heavyinfantry-attack-2.png"
						sound="mace.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/heavyinfantry-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-loyalists/heavyinfantry.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-loyalists/heavyinfantry-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavyinfantry-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/heavyinfantry-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/heavyinfantry-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/heavyinfantry-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/human-loyalists/heavy-infantry-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-3.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-loyalists/heavy-infantry-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-7.png"
				[/frame]
				[frame]
					duration="1000"
					image="units/human-loyalists/heavy-infantry-idle-8.png"
				[/frame]
				[frame]
					duration="1000"
					image="units/human-loyalists/heavy-infantry-idle-9.png"
				[/frame]
				[frame]
					duration="1000"
					image="units/human-loyalists/heavy-infantry-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/heavy-infantry.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/heavy-infantry.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[trait]
#textdomain wesnoth
				description=_ "Fights normally during unfavorable times of day/night"
				female_name=_ "female^fearless"
				id="fearless"
				male_name=_ "fearless"
			[/trait]
			[defense]
				castle="50"
				cave="60"
				deep_water="80"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="60"
				mountains="80"
				reef="80"
				sand="80"
				shallow_water="90"
				swamp_water="90"
				unwalkable="80"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="4"
				fungus="2"
				hills="3"
				impassable="99"
				mountains="99"
				reef="3"
				sand="2"
				shallow_water="4"
				swamp_water="4"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="50"
				cold="110"
				fire="110"
				impact="90"
				pierce="60"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="12"
#textdomain wesnoth-units
				description=_ "mace"
				name="mace"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					description=_ "Fights normally during unfavorable times of day/night"
					female_name=_ "female^fearless"
					id="fearless"
					male_name=_ "fearless"
					name=_ "fearless"
				[/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="12"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="35"
			id="Spearman-20"
			image="units/human-loyalists/spearman.png"
#textdomain wesnoth-units
			language_name=_ "Spearman"
			level="1"
			max_attacks="1"
			max_experience="29"
			max_hitpoints="35"
			max_moves="6"
			movement="5"
			movement_type="smallfoot"
			moves="6"
			name="Rhobryn"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Spearman"
			underlying_id="20"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="13"
			y="17"
			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^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="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="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="41"
			id="Spearman-26"
			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="Middry"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Spearman"
			underlying_id="26"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="18"
			y="11"
			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="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="2"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="23"
			id="Mage-28"
			image="units/human-magi/mage.png"
#textdomain wesnoth-units
			language_name=_ "Mage"
			level="1"
			max_attacks="1"
			max_experience="34"
			max_hitpoints="23"
			max_moves="6"
			movement="5"
			movement_type="smallfoot"
			moves="6"
			name="Romyrcyn"
			profile="portraits/humans/mage.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Mage"
			underlying_id="28"
			unrenamable="no"
			upkeep="full"
			usage="mixed fighter"
			x="17"
			y="17"
			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^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="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="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="34"
			id="Spearman-29"
			image="units/human-loyalists/spearman.png"
#textdomain wesnoth-units
			language_name=_ "Spearman"
			level="1"
			max_attacks="1"
			max_experience="24"
			max_hitpoints="34"
			max_moves="6"
			movement="5"
			movement_type="smallfoot"
			moves="6"
			name="Veoddrygwyn"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Spearman"
			underlying_id="29"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="16"
			y="10"
			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^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Knight,Lancer"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="23"
			die_sound="horse-die.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="39"
			id="Horseman-30"
			image="units/human-loyalists/horseman.png"
#textdomain wesnoth-units
			language_name=_ "Horseman"
			level="1"
			max_attacks="1"
			max_experience="25"
			max_hitpoints="39"
			max_moves="8"
			movement="8"
			movement_type="mounted"
			moves="8"
			name="Gaent"
			profile="portraits/humans/horseman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Horseman"
			undead_variation="mounted"
			underlying_id="30"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="11"
			y="21"
			zoc="yes"
			[attack_anim]
				hits="no"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-225"
					image="units/human-loyalists/horseman.png"
					sound="horse-canter.wav"
				[/frame]
				[frame]
					begin="-225"
					end="-150"
					image="units/human-loyalists/horseman-moving.png"
				[/frame]
				[frame]
					begin="-150"
					end="100"
					image="units/human-loyalists/horseman-attack.png"
					sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
				[/frame]
				[frame]
					begin="100"
					end="175"
					image="units/human-loyalists/horseman-moving.png"
				[/frame]
				[frame]
					begin="175"
					end="200"
					image="units/human-loyalists/horseman.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				hits="yes"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-loyalists/horseman.png"
					sound="horse-canter.wav"
				[/frame]
				[frame]
					begin="-200"
					end="-150"
					image="units/human-loyalists/horseman-moving.png"
				[/frame]
				[frame]
					begin="-150"
					end="100"
					image="units/human-loyalists/horseman-attack.png"
					sound="spear.ogg"
				[/frame]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/horseman-moving.png"
				[/frame]
				[frame]
					begin="150"
					end="200"
					image="units/human-loyalists/horseman.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-loyalists/horseman.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/horseman-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/horseman-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/horseman-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/horseman.png"
				[/frame]
			[/defend]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/human-loyalists/horseman-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="80"
				cold="100"
				fire="100"
				impact="70"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="10"
				description=_ "spear"
				name="spear"
				number="2"
				range="melee"
				type="pierce"
				[specials]
					[damage]
						active_on="offense"
						apply_to="both"
#textdomain wesnoth
						description=_ "Charge:
When used offensively, this attack deals double damage to the target. It also causes this unit to take double damage from the target's counterattack."
						id="charge"
						multiply="2"
						name=_ "charge"
					[/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^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="General"
			alignment="lawful"
			allow_changes="yes"
			allow_player="yes"
			alpha="256"
			attacks_left="1"
			canrecruit="yes"
			colour="2"
			controller="human"
			cost="35"
			current_player="Vandarr"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			experience="0"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			fog="yes"
			gender="male"
			gold="100"
			goto_x="-999"
			goto_y="-999"
			hitpoints="40"
			id="Vandarr2"
			image="units/human-loyalists/lieutenant.png"
			income="0"
#textdomain wesnoth-units
			language_name=_ "Lieutenant"
			leader="Lieutenant,Swordsman,Pikeman,Javelineer,Shock Trooper,Longbowman,White Mage,Red Mage"
			level="2"
			max_attacks="1"
			max_experience="56"
			max_hitpoints="40"
			max_moves="6"
			movement="6"
			movement_type="smallfoot"
			moves="6"
			mp_countdown="yes"
			mp_countdown_action_bonus="10"
			mp_countdown_init_time="270"
			mp_countdown_reservoir_time="270"
			mp_countdown_turn_bonus="100"
			name="Vandarr"
			profile="portraits/humans/lieutenant.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="Vandarr2"
			share_maps="no"
			share_view="yes"
			shroud="no"
			side="2"
			team_name="south"
			terrain_liked="Gg, Ww, Wo"
			type="Lieutenant"
			underlying_id="2"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			user_team_name="wesnoth-multiplayerteamname^South"
			village_gold="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]
			[abilities]
				[leadership]
					affect_self="no"
					cumulative="no"
#textdomain wesnoth
					description=_ "Leadership:
This unit can lead our own units that are next to it, making them fight better.

Adjacent own units of lower level will do more damage in battle. When a unit adjacent to, of a lower level than, and on the same side as a unit with Leadership engages in combat, its attacks do 25% more damage times the difference in their levels."
					female_name=_ "female^leadership"
					id="leadership"
					name=_ "leadership"
					value="50"
					[affect_adjacent]
						adjacent="n,ne,se,s,sw,nw"
						[filter]
							level="0"
						[/filter]
					[/affect_adjacent]
				[/leadership]
				[leadership]
					affect_self="no"
					cumulative="no"
					id="leadership"
					value="25"
					[affect_adjacent]
						adjacent="n,ne,se,s,sw,nw"
						[filter]
							level="1"
						[/filter]
					[/affect_adjacent]
				[/leadership]
			[/abilities]
			[portrait]
				image="portraits/humans/transparent/lieutenant.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/lieutenant.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="8"
#textdomain wesnoth-units
				description=_ "sword"
				icon="attacks/sword-human.png"
				name="sword"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="5"
				description=_ "crossbow"
				icon="attacks/crossbow-human.png"
				name="crossbow"
				number="3"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Dragoon"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="17"
			die_sound="horse-die.ogg"
			ellipse="misc/ellipse"
			experience="14"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="44"
			id="Cavalryman-8"
			image="units/human-loyalists/cavalryman.png"
			language_name=_ "Cavalryman"
			level="1"
			max_attacks="1"
			max_experience="28"
			max_hitpoints="44"
			max_moves="8"
			movement="8"
			movement_type="mounted"
			moves="8"
			name="Cun"
			profile="portraits/humans/cavalryman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Cavalryman"
			undead_variation="mounted"
			underlying_id="8"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			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="7"
				description=_ "sword"
				icon="attacks/sword-human.png"
				name="sword"
				number="3"
				range="melee"
				type="blade"
			[/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="Royal Guard"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="25"
			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="56"
			id="Spearman-9"
			image="units/human-loyalists/swordsman.png"
#textdomain wesnoth-units
			language_name=_ "Swordsman"
			level="2"
			max_attacks="1"
			max_experience="34"
			max_hitpoints="56"
			max_moves="5"
			movement="5"
			movement_type="smallfoot"
			moves="5"
			name="Ceorcynvan"
			profile="portraits/humans/swordsman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Swordsman"
			underlying_id="9"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[portrait]
				image="portraits/humans/transparent/swordsman.png"
				mirror="true"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/swordsman.png"
				mirror="false"
				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="80"
				cold="100"
				fire="100"
				impact="80"
				pierce="100"
			[/resistance]
			[attack_anim]
				[filter_attack]
					name="sword"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-175"
					image="units/human-loyalists/swordsman.png"
				[/frame]
				[frame]
					begin="-175"
					end="-75"
					image="units/human-loyalists/swordsman-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-75"
						end="75"
						image="units/human-loyalists/swordsman-attack-2.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-75"
						end="75"
						image="units/human-loyalists/swordsman-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="75"
					end="200"
					image="units/human-loyalists/swordsman-attack-3.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-loyalists/swordsman.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/swordsman-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/swordsman-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/swordsman-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/swordsman.png"
				[/frame]
			[/defend]
			[idle_anim]
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					begin="0"
					end="100"
					image="units/human-loyalists/swordsman-idle-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/human-loyalists/swordsman-idle-2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-loyalists/swordsman-idle-3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/human-loyalists/swordsman-idle-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/human-loyalists/swordsman-idle-5.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/human-loyalists/swordsman-idle-6.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/human-loyalists/swordsman-idle-7.png"
				[/frame]
				[frame]
					begin="700"
					end="800"
					image="units/human-loyalists/swordsman-idle-8.png"
				[/frame]
				[frame]
					begin="800"
					end="900"
					image="units/human-loyalists/swordsman-idle-9.png"
				[/frame]
				[frame]
					begin="900"
					end="1000"
					image="units/human-loyalists/swordsman-idle-10.png"
				[/frame]
				[frame]
					begin="1000"
					end="1100"
					image="units/human-loyalists/swordsman-idle-11.png"
				[/frame]
				[frame]
					begin="1100"
					end="1200"
					image="units/human-loyalists/swordsman-idle-12.png"
				[/frame]
				[frame]
					begin="1200"
					end="1600"
					image="units/human-loyalists/swordsman-idle-4.png"
				[/frame]
				[frame]
					begin="1600"
					end="1700"
					image="units/human-loyalists/swordsman-idle-12.png"
				[/frame]
				[frame]
					begin="1700"
					end="1800"
					image="units/human-loyalists/swordsman-idle-3.png"
				[/frame]
				[frame]
					begin="1800"
					end="1900"
					image="units/human-loyalists/swordsman-idle-2.png"
				[/frame]
				[frame]
					begin="1900"
					end="2000"
					image="units/human-loyalists/swordsman-idle-1.png"
				[/frame]
			[/idle_anim]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="9"
				description=_ "sword"
				icon="attacks/sword-human.png"
				name="sword"
				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^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="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="18"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="39"
			id="Spearman-11"
			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="Sec"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Spearman"
			underlying_id="11"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			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^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="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="15"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="29"
			id="Mage-12"
			image="units/human-magi/mage.png"
#textdomain wesnoth-units
			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="Deorcyn"
			profile="portraits/humans/mage.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Mage"
			underlying_id="12"
			unrenamable="no"
			upkeep="full"
			usage="mixed fighter"
			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="Shock Trooper"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="19"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="12"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="39"
			id="Heavy Infantryman-13"
			image="units/human-loyalists/heavyinfantry.png"
#textdomain wesnoth-units
			language_name=_ "Heavy Infantryman"
			level="1"
			max_attacks="1"
			max_experience="28"
			max_hitpoints="39"
			max_moves="4"
			movement="4"
			movement_type="armoredfoot"
			moves="4"
			name="Manryn"
			profile="portraits/humans/heavy-infantry.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Heavy Infantryman"
			underlying_id="13"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="mace"
				[/filter_attack]
				[frame]
					begin="-230"
					end="-100"
					image="units/human-loyalists/heavyinfantry-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/heavyinfantry-attack-2.png"
						sound="mace.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/heavyinfantry-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-loyalists/heavyinfantry.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-loyalists/heavyinfantry-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavyinfantry-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/heavyinfantry-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/heavyinfantry-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/heavyinfantry-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/human-loyalists/heavy-infantry-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-3.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-loyalists/heavy-infantry-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-7.png"
				[/frame]
				[frame]
					duration="1000"
					image="units/human-loyalists/heavy-infantry-idle-8.png"
				[/frame]
				[frame]
					duration="1000"
					image="units/human-loyalists/heavy-infantry-idle-9.png"
				[/frame]
				[frame]
					duration="1000"
					image="units/human-loyalists/heavy-infantry-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/heavy-infantry.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/heavy-infantry.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[trait]
#textdomain wesnoth
				description=_ "Fights normally during unfavorable times of day/night"
				female_name=_ "female^fearless"
				id="fearless"
				male_name=_ "fearless"
			[/trait]
			[defense]
				castle="50"
				cave="60"
				deep_water="80"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="60"
				mountains="80"
				reef="80"
				sand="80"
				shallow_water="90"
				swamp_water="90"
				unwalkable="80"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="4"
				fungus="2"
				hills="3"
				impassable="99"
				mountains="99"
				reef="3"
				sand="2"
				shallow_water="4"
				swamp_water="4"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="50"
				cold="110"
				fire="110"
				impact="90"
				pierce="60"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="12"
#textdomain wesnoth-units
				description=_ "mace"
				name="mace"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					description=_ "Fights normally during unfavorable times of day/night"
					female_name=_ "female^fearless"
					id="fearless"
					male_name=_ "fearless"
					name=_ "fearless"
				[/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="12"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="35"
			id="Spearman-20"
			image="units/human-loyalists/spearman.png"
#textdomain wesnoth-units
			language_name=_ "Spearman"
			level="1"
			max_attacks="1"
			max_experience="29"
			max_hitpoints="35"
			max_moves="6"
			movement="5"
			movement_type="smallfoot"
			moves="6"
			name="Rhobryn"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Spearman"
			underlying_id="20"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			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^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="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="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="41"
			id="Spearman-26"
			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="Middry"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Spearman"
			underlying_id="26"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			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="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="2"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="23"
			id="Mage-28"
			image="units/human-magi/mage.png"
#textdomain wesnoth-units
			language_name=_ "Mage"
			level="1"
			max_attacks="1"
			max_experience="34"
			max_hitpoints="23"
			max_moves="6"
			movement="5"
			movement_type="smallfoot"
			moves="6"
			name="Romyrcyn"
			profile="portraits/humans/mage.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Mage"
			underlying_id="28"
			unrenamable="no"
			upkeep="full"
			usage="mixed fighter"
			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^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="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="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="34"
			id="Spearman-29"
			image="units/human-loyalists/spearman.png"
#textdomain wesnoth-units
			language_name=_ "Spearman"
			level="1"
			max_attacks="1"
			max_experience="24"
			max_hitpoints="34"
			max_moves="6"
			movement="5"
			movement_type="smallfoot"
			moves="6"
			name="Veoddrygwyn"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Spearman"
			underlying_id="29"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			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^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Knight,Lancer"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="23"
			die_sound="horse-die.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="39"
			id="Horseman-30"
			image="units/human-loyalists/horseman.png"
#textdomain wesnoth-units
			language_name=_ "Horseman"
			level="1"
			max_attacks="1"
			max_experience="25"
			max_hitpoints="39"
			max_moves="8"
			movement="8"
			movement_type="mounted"
			moves="8"
			name="Gaent"
			profile="portraits/humans/horseman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Horseman"
			undead_variation="mounted"
			underlying_id="30"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				hits="no"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-225"
					image="units/human-loyalists/horseman.png"
					sound="horse-canter.wav"
				[/frame]
				[frame]
					begin="-225"
					end="-150"
					image="units/human-loyalists/horseman-moving.png"
				[/frame]
				[frame]
					begin="-150"
					end="100"
					image="units/human-loyalists/horseman-attack.png"
					sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
				[/frame]
				[frame]
					begin="100"
					end="175"
					image="units/human-loyalists/horseman-moving.png"
				[/frame]
				[frame]
					begin="175"
					end="200"
					image="units/human-loyalists/horseman.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				hits="yes"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-loyalists/horseman.png"
					sound="horse-canter.wav"
				[/frame]
				[frame]
					begin="-200"
					end="-150"
					image="units/human-loyalists/horseman-moving.png"
				[/frame]
				[frame]
					begin="-150"
					end="100"
					image="units/human-loyalists/horseman-attack.png"
					sound="spear.ogg"
				[/frame]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/horseman-moving.png"
				[/frame]
				[frame]
					begin="150"
					end="200"
					image="units/human-loyalists/horseman.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-loyalists/horseman.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/horseman-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/horseman-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/horseman-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/horseman.png"
				[/frame]
			[/defend]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/human-loyalists/horseman-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="80"
				cold="100"
				fire="100"
				impact="70"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="10"
				description=_ "spear"
				name="spear"
				number="2"
				range="melee"
				type="pierce"
				[specials]
					[damage]
						active_on="offense"
						apply_to="both"
#textdomain wesnoth
						description=_ "Charge:
When used offensively, this attack deals double damage to the target. It also causes this unit to take double damage from the target's counterattack."
						id="charge"
						multiply="2"
						name=_ "charge"
					[/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^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]
	[/side]
	[time]
		blue="0"
		green="-20"
		id="dawn"
		image="misc/schedule-dawn.png"
		lawful_bonus="0"
		name=_ "Dawn"
		red="-20"
	[/time]
	[time]
		blue="0"
		green="0"
		id="morning"
		image="misc/schedule-morning.png"
		lawful_bonus="25"
		name=_ "Morning"
		red="0"
	[/time]
	[time]
		blue="0"
		green="0"
		id="afternoon"
		image="misc/schedule-afternoon.png"
		lawful_bonus="25"
		name=_ "Afternoon"
		red="0"
	[/time]
	[time]
		blue="-20"
		green="-20"
		id="dusk"
		image="misc/schedule-dusk.png"
		lawful_bonus="0"
		name=_ "Dusk"
		red="0"
	[/time]
	[time]
		blue="-10"
		green="-40"
		id="first_watch"
		image="misc/schedule-firstwatch.png"
		lawful_bonus="-25"
		name=_ "First Watch"
		red="-40"
	[/time]
	[time]
		blue="-10"
		green="-40"
		id="second_watch"
		image="misc/schedule-secondwatch.png"
		lawful_bonus="-25"
		name=_ "Second Watch"
		red="-40"
	[/time]
	[variables]
		damage_inflicted="8"
		side_number="2"
		turn_number="13"
	[/variables]
	[player]
		can_recruit="Goblin Spearman,Naga Fighter,Orcish Archer,Orcish Assassin,Orcish Grunt,Troll Whelp,Wolf Rider"
		gold="-1"
		gold_add="no"
		name="Iceant"
		save_id="Iceant1"
		[unit]
			advances_to="Goblin Knight,Goblin Pillager"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="17"
			die_sound="wolf-die.wav"
			ellipse="misc/ellipse"
			experience="7"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="35"
			id="Wolf Rider-4"
			image="units/goblins/wolf-rider.png"
#textdomain wesnoth-units
			language_name=_ "Wolf Rider"
			level="1"
			max_attacks="1"
			max_experience="21"
			max_hitpoints="35"
			max_moves="9"
			movement="8"
			movement_type="orcishfoot"
			moves="9"
			name="Prong"
			race="wolf"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Wolf Rider"
			undead_variation="mounted"
			underlying_id="4"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="fangs"
				[/filter_attack]
				[if]
					hits="no"
					[frame]
						begin="-250"
						end="-200"
						image="units/goblins/wolf-rider.png"
						sound="wolf-bite-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-250"
						end="-200"
						image="units/goblins/wolf-rider.png"
						sound="wolf-bite.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-200"
					end="-100"
					image="units/goblins/wolf-rider-moving.png"
				[/frame]
				[frame]
					begin="-100"
					end="50"
					image="units/goblins/wolf-rider-attack.png"
				[/frame]
				[frame]
					begin="50"
					end="100"
					image="units/goblins/wolf-rider-moving.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/goblins/wolf-rider.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/goblins/wolf-rider.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/goblins/wolf-rider-defend.png"
						sound="wolf-hit.wav"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/goblins/wolf-rider-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/goblins/wolf-rider.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/goblins/wolf-rider-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/goblins/wolf-rider-idle-1.png"
				[/frame]
			[/idle_anim]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/goblins/wolf-rider-moving.png"
				[/frame]
			[/movement_anim]
			[standing_anim]
				start_time="-50"
				[frame]
					duration="50"
					image="units/goblins/wolf-rider.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				start_time="-50"
				terrain="Wo,Ww,Ww^Vm,Chs,Chw,Ss"
				[frame]
					duration="50"
					image="units/goblins/wolf-rider-water.png"
				[/frame]
			[/standing_anim]
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="60"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="70"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="3"
				hills="1"
				impassable="99"
				mountains="2"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="100"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "fangs"
				icon="attacks/fangs-animal.png"
				name="fangs"
				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^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="Orcish Warlord"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="26"
			die_sound="orc-die-1.ogg,orc-die-2.ogg,orc-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="s"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="64"
			id="Orcish Grunt-6"
			image="units/orcs/warrior.png"
#textdomain wesnoth-units
			language_name=_ "Orcish Warrior"
			level="2"
			max_attacks="1"
			max_experience="34"
			max_hitpoints="64"
			max_moves="5"
			movement="5"
			movement_type="orcishfoot"
			moves="5"
			name="Grarbagdush"
			profile="portraits/orcs/warlord4.png"
			race="orc"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Orcish Warrior"
			underlying_id="6"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="60"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="70"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="3"
				hills="1"
				impassable="99"
				mountains="2"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="100"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="100"
			[/resistance]
			[attack_anim]
				offset="0.0~0.15:100,0.15~0.35:100,0.35~0.45:75,0.45~0.5:100,0.5:20,0.5~0.4:30,0.4~0.2:75,0.2~0.0:75"
				start_time="-300"
				[filter_attack]
					name="greatsword"
				[/filter_attack]
				[frame]
					duration="50"
					image="units/orcs/warrior.png"
				[/frame]
				[frame]
					duration="50"
					image="units/orcs/warrior-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/orcs/warrior-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="75"
						image="units/orcs/warrior-attack-2.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="75"
						image="units/orcs/warrior-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="100"
					image="units/orcs/warrior-attack-3.png"
				[/frame]
				[frame]
					duration="20"
					image="units/orcs/warrior-attack-4.png"
				[/frame]
				[frame]
					duration="30"
					image="units/orcs/warrior-attack-4.png"
				[/frame]
				[frame]
					duration="75"
					image="units/orcs/warrior-attack-5.png"
				[/frame]
				[frame]
					duration="75"
					image="units/orcs/warrior.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/orcs/warrior-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/orcs/warrior-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/orcs/warrior-defend-2.png"
						sound="orc-hit-1.ogg,orc-hit-2.ogg,orc-hit-3.ogg,orc-hit-4.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/orcs/warrior-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/orcs/warrior-defend-1.png"
				[/frame]
			[/defend]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="10"
				description=_ "greatsword"
				icon="attacks/greatsword-orcish.png"
				name="greatsword"
				number="3"
				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]
	[/player]
	[player]
		can_recruit="Bowman,Cavalryman,Fencer,Heavy Infantryman,Horseman,Mage,Merman Fighter,Spearman"
		gold="-1"
		gold_add="no"
		name="Vandarr"
		save_id="Vandarr2"
		[unit]
			advances_to="General"
			alignment="lawful"
			allow_changes="yes"
			allow_player="yes"
			alpha="256"
			attacks_left="1"
			canrecruit="yes"
			colour="2"
			controller="human"
			cost="35"
			current_player="Vandarr"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			experience="0"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			fog="yes"
			gender="male"
			gold="100"
			goto_x="-999"
			goto_y="-999"
			hitpoints="40"
			id="Vandarr2"
			image="units/human-loyalists/lieutenant.png"
			income="0"
#textdomain wesnoth-units
			language_name=_ "Lieutenant"
			leader="Lieutenant,Swordsman,Pikeman,Javelineer,Shock Trooper,Longbowman,White Mage,Red Mage"
			level="2"
			max_attacks="1"
			max_experience="56"
			max_hitpoints="40"
			max_moves="6"
			movement="6"
			movement_type="smallfoot"
			moves="6"
			mp_countdown="yes"
			mp_countdown_action_bonus="10"
			mp_countdown_init_time="270"
			mp_countdown_reservoir_time="270"
			mp_countdown_turn_bonus="100"
			name="Vandarr"
			profile="portraits/humans/lieutenant.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="Vandarr2"
			share_maps="no"
			share_view="yes"
			shroud="no"
			side="2"
			team_name="south"
			terrain_liked="Gg, Ww, Wo"
			type="Lieutenant"
			underlying_id="2"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			user_team_name="wesnoth-multiplayerteamname^South"
			village_gold="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]
			[abilities]
				[leadership]
					affect_self="no"
					cumulative="no"
#textdomain wesnoth
					description=_ "Leadership:
This unit can lead our own units that are next to it, making them fight better.

Adjacent own units of lower level will do more damage in battle. When a unit adjacent to, of a lower level than, and on the same side as a unit with Leadership engages in combat, its attacks do 25% more damage times the difference in their levels."
					female_name=_ "female^leadership"
					id="leadership"
					name=_ "leadership"
					value="50"
					[affect_adjacent]
						adjacent="n,ne,se,s,sw,nw"
						[filter]
							level="0"
						[/filter]
					[/affect_adjacent]
				[/leadership]
				[leadership]
					affect_self="no"
					cumulative="no"
					id="leadership"
					value="25"
					[affect_adjacent]
						adjacent="n,ne,se,s,sw,nw"
						[filter]
							level="1"
						[/filter]
					[/affect_adjacent]
				[/leadership]
			[/abilities]
			[portrait]
				image="portraits/humans/transparent/lieutenant.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/lieutenant.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="8"
#textdomain wesnoth-units
				description=_ "sword"
				icon="attacks/sword-human.png"
				name="sword"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="5"
				description=_ "crossbow"
				icon="attacks/crossbow-human.png"
				name="crossbow"
				number="3"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Dragoon"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="17"
			die_sound="horse-die.ogg"
			ellipse="misc/ellipse"
			experience="14"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="44"
			id="Cavalryman-8"
			image="units/human-loyalists/cavalryman.png"
			language_name=_ "Cavalryman"
			level="1"
			max_attacks="1"
			max_experience="28"
			max_hitpoints="44"
			max_moves="8"
			movement="8"
			movement_type="mounted"
			moves="8"
			name="Cun"
			profile="portraits/humans/cavalryman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Cavalryman"
			undead_variation="mounted"
			underlying_id="8"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			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="7"
				description=_ "sword"
				icon="attacks/sword-human.png"
				name="sword"
				number="3"
				range="melee"
				type="blade"
			[/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="Royal Guard"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="25"
			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="56"
			id="Spearman-9"
			image="units/human-loyalists/swordsman.png"
#textdomain wesnoth-units
			language_name=_ "Swordsman"
			level="2"
			max_attacks="1"
			max_experience="34"
			max_hitpoints="56"
			max_moves="5"
			movement="5"
			movement_type="smallfoot"
			moves="5"
			name="Ceorcynvan"
			profile="portraits/humans/swordsman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Swordsman"
			underlying_id="9"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[portrait]
				image="portraits/humans/transparent/swordsman.png"
				mirror="true"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/swordsman.png"
				mirror="false"
				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="80"
				cold="100"
				fire="100"
				impact="80"
				pierce="100"
			[/resistance]
			[attack_anim]
				[filter_attack]
					name="sword"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-175"
					image="units/human-loyalists/swordsman.png"
				[/frame]
				[frame]
					begin="-175"
					end="-75"
					image="units/human-loyalists/swordsman-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-75"
						end="75"
						image="units/human-loyalists/swordsman-attack-2.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-75"
						end="75"
						image="units/human-loyalists/swordsman-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="75"
					end="200"
					image="units/human-loyalists/swordsman-attack-3.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-loyalists/swordsman.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/swordsman-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/swordsman-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/swordsman-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/swordsman.png"
				[/frame]
			[/defend]
			[idle_anim]
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					begin="0"
					end="100"
					image="units/human-loyalists/swordsman-idle-1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/human-loyalists/swordsman-idle-2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-loyalists/swordsman-idle-3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/human-loyalists/swordsman-idle-4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/human-loyalists/swordsman-idle-5.png"
				[/frame]
				[frame]
					begin="500"
					end="600"
					image="units/human-loyalists/swordsman-idle-6.png"
				[/frame]
				[frame]
					begin="600"
					end="700"
					image="units/human-loyalists/swordsman-idle-7.png"
				[/frame]
				[frame]
					begin="700"
					end="800"
					image="units/human-loyalists/swordsman-idle-8.png"
				[/frame]
				[frame]
					begin="800"
					end="900"
					image="units/human-loyalists/swordsman-idle-9.png"
				[/frame]
				[frame]
					begin="900"
					end="1000"
					image="units/human-loyalists/swordsman-idle-10.png"
				[/frame]
				[frame]
					begin="1000"
					end="1100"
					image="units/human-loyalists/swordsman-idle-11.png"
				[/frame]
				[frame]
					begin="1100"
					end="1200"
					image="units/human-loyalists/swordsman-idle-12.png"
				[/frame]
				[frame]
					begin="1200"
					end="1600"
					image="units/human-loyalists/swordsman-idle-4.png"
				[/frame]
				[frame]
					begin="1600"
					end="1700"
					image="units/human-loyalists/swordsman-idle-12.png"
				[/frame]
				[frame]
					begin="1700"
					end="1800"
					image="units/human-loyalists/swordsman-idle-3.png"
				[/frame]
				[frame]
					begin="1800"
					end="1900"
					image="units/human-loyalists/swordsman-idle-2.png"
				[/frame]
				[frame]
					begin="1900"
					end="2000"
					image="units/human-loyalists/swordsman-idle-1.png"
				[/frame]
			[/idle_anim]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="9"
				description=_ "sword"
				icon="attacks/sword-human.png"
				name="sword"
				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^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="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="18"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="39"
			id="Spearman-11"
			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="Sec"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Spearman"
			underlying_id="11"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			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^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="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="15"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="29"
			id="Mage-12"
			image="units/human-magi/mage.png"
#textdomain wesnoth-units
			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="Deorcyn"
			profile="portraits/humans/mage.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Mage"
			underlying_id="12"
			unrenamable="no"
			upkeep="full"
			usage="mixed fighter"
			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="Shock Trooper"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="19"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="12"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="39"
			id="Heavy Infantryman-13"
			image="units/human-loyalists/heavyinfantry.png"
#textdomain wesnoth-units
			language_name=_ "Heavy Infantryman"
			level="1"
			max_attacks="1"
			max_experience="28"
			max_hitpoints="39"
			max_moves="4"
			movement="4"
			movement_type="armoredfoot"
			moves="4"
			name="Manryn"
			profile="portraits/humans/heavy-infantry.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Heavy Infantryman"
			underlying_id="13"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="mace"
				[/filter_attack]
				[frame]
					begin="-230"
					end="-100"
					image="units/human-loyalists/heavyinfantry-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/heavyinfantry-attack-2.png"
						sound="mace.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/heavyinfantry-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-loyalists/heavyinfantry.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-loyalists/heavyinfantry-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavyinfantry-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/heavyinfantry-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/heavyinfantry-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/heavyinfantry-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/human-loyalists/heavy-infantry-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-3.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-loyalists/heavy-infantry-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-7.png"
				[/frame]
				[frame]
					duration="1000"
					image="units/human-loyalists/heavy-infantry-idle-8.png"
				[/frame]
				[frame]
					duration="1000"
					image="units/human-loyalists/heavy-infantry-idle-9.png"
				[/frame]
				[frame]
					duration="1000"
					image="units/human-loyalists/heavy-infantry-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/heavy-infantry.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/heavy-infantry.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[trait]
#textdomain wesnoth
				description=_ "Fights normally during unfavorable times of day/night"
				female_name=_ "female^fearless"
				id="fearless"
				male_name=_ "fearless"
			[/trait]
			[defense]
				castle="50"
				cave="60"
				deep_water="80"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="60"
				mountains="80"
				reef="80"
				sand="80"
				shallow_water="90"
				swamp_water="90"
				unwalkable="80"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="4"
				fungus="2"
				hills="3"
				impassable="99"
				mountains="99"
				reef="3"
				sand="2"
				shallow_water="4"
				swamp_water="4"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="50"
				cold="110"
				fire="110"
				impact="90"
				pierce="60"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="12"
#textdomain wesnoth-units
				description=_ "mace"
				name="mace"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					description=_ "Fights normally during unfavorable times of day/night"
					female_name=_ "female^fearless"
					id="fearless"
					male_name=_ "fearless"
					name=_ "fearless"
				[/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="12"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="35"
			id="Spearman-20"
			image="units/human-loyalists/spearman.png"
#textdomain wesnoth-units
			language_name=_ "Spearman"
			level="1"
			max_attacks="1"
			max_experience="29"
			max_hitpoints="35"
			max_moves="6"
			movement="5"
			movement_type="smallfoot"
			moves="6"
			name="Rhobryn"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Spearman"
			underlying_id="20"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			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^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="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="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="41"
			id="Spearman-26"
			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="Middry"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Spearman"
			underlying_id="26"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			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="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="2"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="23"
			id="Mage-28"
			image="units/human-magi/mage.png"
#textdomain wesnoth-units
			language_name=_ "Mage"
			level="1"
			max_attacks="1"
			max_experience="34"
			max_hitpoints="23"
			max_moves="6"
			movement="5"
			movement_type="smallfoot"
			moves="6"
			name="Romyrcyn"
			profile="portraits/humans/mage.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Mage"
			underlying_id="28"
			unrenamable="no"
			upkeep="full"
			usage="mixed fighter"
			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^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="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="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="34"
			id="Spearman-29"
			image="units/human-loyalists/spearman.png"
#textdomain wesnoth-units
			language_name=_ "Spearman"
			level="1"
			max_attacks="1"
			max_experience="24"
			max_hitpoints="34"
			max_moves="6"
			movement="5"
			movement_type="smallfoot"
			moves="6"
			name="Veoddrygwyn"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Spearman"
			underlying_id="29"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			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^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Knight,Lancer"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="23"
			die_sound="horse-die.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="39"
			id="Horseman-30"
			image="units/human-loyalists/horseman.png"
#textdomain wesnoth-units
			language_name=_ "Horseman"
			level="1"
			max_attacks="1"
			max_experience="25"
			max_hitpoints="39"
			max_moves="8"
			movement="8"
			movement_type="mounted"
			moves="8"
			name="Gaent"
			profile="portraits/humans/horseman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="2"
			type="Horseman"
			undead_variation="mounted"
			underlying_id="30"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				hits="no"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-225"
					image="units/human-loyalists/horseman.png"
					sound="horse-canter.wav"
				[/frame]
				[frame]
					begin="-225"
					end="-150"
					image="units/human-loyalists/horseman-moving.png"
				[/frame]
				[frame]
					begin="-150"
					end="100"
					image="units/human-loyalists/horseman-attack.png"
					sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
				[/frame]
				[frame]
					begin="100"
					end="175"
					image="units/human-loyalists/horseman-moving.png"
				[/frame]
				[frame]
					begin="175"
					end="200"
					image="units/human-loyalists/horseman.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				hits="yes"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-loyalists/horseman.png"
					sound="horse-canter.wav"
				[/frame]
				[frame]
					begin="-200"
					end="-150"
					image="units/human-loyalists/horseman-moving.png"
				[/frame]
				[frame]
					begin="-150"
					end="100"
					image="units/human-loyalists/horseman-attack.png"
					sound="spear.ogg"
				[/frame]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/horseman-moving.png"
				[/frame]
				[frame]
					begin="150"
					end="200"
					image="units/human-loyalists/horseman.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-loyalists/horseman.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/horseman-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/horseman-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/horseman-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/horseman.png"
				[/frame]
			[/defend]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/human-loyalists/horseman-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="80"
				cold="100"
				fire="100"
				impact="70"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="10"
				description=_ "spear"
				name="spear"
				number="2"
				range="melee"
				type="pierce"
				[specials]
					[damage]
						active_on="offense"
						apply_to="both"
#textdomain wesnoth
						description=_ "Charge:
When used offensively, this attack deals double damage to the target. It also causes this unit to take double damage from the target's counterattack."
						id="charge"
						multiply="2"
						name=_ "charge"
					[/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^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]
	[/player]
[/snapshot]
[replay_start]
	current_tod="0"
#textdomain wesnoth-multiplayer
	description=_ "Warfare transforms the simple farms and villages of a peaceful region into a subtly parceled battlefield."
	experience_modifier="70"
	hash="EqK,,,KxGHj1q>FS,UdqBn4erWBwx7tGxLe4nIo9f0-xnP6JQuOI6W-92qdedEsY3JamDYvGPYyVho<aFvF.erCJ<kAmykeuOUMfxjIttN.OSV6lVoINmB+HvhWlBQFe"
	id="multiplayer_Hamlets"
	map_data="border_size=1
usage=map

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[event]
			name="prestart"
			[store_unit]
				kill="yes"
				variable="leaders_to_make_quick"
				[filter]
					canrecruit="yes"
					[filter_wml]
						max_moves="4"
					[/filter_wml]
				[/filter]
			[/store_unit]
			[set_variable]
				name="i"
				value="0"
			[/set_variable]
			[while]
				[variable]
					less_than="$leaders_to_make_quick.length"
					name="i"
				[/variable]
				[do]
					[set_variables]
						mode="merge"
						name="leaders_to_make_quick[$i].modifications"
						[literal]
							[trait]
#textdomain wesnoth
								female_name=_ "female^quick"
								id="quick"
								male_name=_ "quick"
								[effect]
									apply_to="movement"
									increase="1"
								[/effect]
								[effect]
									apply_to="hitpoints"
									increase_total="-5%"
								[/effect]
							[/trait]
						[/literal]
					[/set_variables]
					[clear_variable]
						name="leaders_to_make_quick[$i].max_moves,leaders_to_make_quick[$i].moves,leaders_to_make_quick[$i].max_hitpoints,leaders_to_make_quick[$i].hitpoints"
					[/clear_variable]
					[unstore_unit]
						variable="leaders_to_make_quick[$i]"
					[/unstore_unit]
					[set_variable]
						add="1"
						name="i"
					[/set_variable]
				[/do]
			[/while]
			[clear_variable]
				name="i"
			[/clear_variable]
			[clear_variable]
				name="leaders_to_make_quick"
			[/clear_variable]
		[/event]
	[/era]
	[side]
		allow_changes="yes"
		allow_player="yes"
		canrecruit="yes"
		colour="1"
		controller="human"
		current_player="Iceant"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="Iceant1"
		image="units/orcs/warrior.png"
		income="0"
		leader="Orcish Warrior,Troll,Troll Rocklobber,Orcish Crossbowman,Orcish Slayer"
		mp_countdown="yes"
		mp_countdown_action_bonus="10"
		mp_countdown_init_time="270"
		mp_countdown_reservoir_time="270"
		mp_countdown_turn_bonus="100"
		name="Iceant"
		recruit="Orcish Grunt,Troll Whelp,Wolf Rider,Orcish Archer,Orcish Assassin,Naga Fighter,Goblin Spearman"
		save_id="Iceant1"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="1"
		team_name="north"
		terrain_liked="Hh, Ha, Mm, Ss"
		type="Orcish Slayer"
		user_team_name="wesnoth-multiplayerteamname^North"
		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="Vandarr"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="Vandarr2"
		image="units/human-loyalists/lieutenant.png"
		income="0"
		leader="Lieutenant,Swordsman,Pikeman,Javelineer,Shock Trooper,Longbowman,White Mage,Red Mage"
		mp_countdown="yes"
		mp_countdown_action_bonus="10"
		mp_countdown_init_time="270"
		mp_countdown_reservoir_time="270"
		mp_countdown_turn_bonus="100"
		name="Vandarr"
		random_leader="Lieutenant,Swordsman,Pikeman,Javelineer,Longbowman,Red Mage"
		recruit="Cavalryman,Horseman,Spearman,Fencer,Heavy Infantryman,Bowman,Mage,Merman Fighter"
		save_id="Vandarr2"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="2"
		team_name="south"
		terrain_liked="Gg, Ww, Wo"
		type="Lieutenant"
		user_team_name="wesnoth-multiplayerteamname^South"
		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="2p - Hamlets"
		[team]
			[recruits]
				Goblin Spearman="1"
				Naga Fighter="1"
				Orcish Archer="1"
				Orcish Assassin="3"
				Orcish Grunt="7"
				Wolf Rider="1"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
				Orcish Warrior="1"
			[/advances]
			[deaths]
				Goblin Spearman="1"
				Naga Fighter="1"
				Orcish Archer="1"
				Orcish Assassin="3"
				Orcish Grunt="6"
				Orcish Slayer="1"
			[/deaths]
			[killed]
				Cavalryman="1"
				Fencer="2"
				Horseman="1"
			[/killed]
			[attacks]
				[sequence]
					s010="2"
					s011="1"
					s1="1"
					_num="30"
				[/sequence]
				[sequence]
					s10="1"
					s11="1"
					_num="50"
				[/sequence]
				[sequence]
					s00="3"
					s0010="1"
					s01="1"
					s011="4"
					s10="1"
					s100="3"
					s101="2"
					s11="2"
					s111="1"
					_num="60"
				[/sequence]
				[sequence]
					s110="1"
					_num="70"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="3"
					_num="0"
				[/sequence]
				[sequence]
					s0="1"
					s01="1"
					_num="30"
				[/sequence]
				[sequence]
					s="1"
					s0="1"
					s00="2"
					_num="40"
				[/sequence]
				[sequence]
					s="1"
					s00="1"
					s01="1"
					s011="1"
					s10="2"
					_num="50"
				[/sequence]
				[sequence]
					s="4"
					s0="2"
					s001="1"
					s01="2"
					s1="1"
					s10="1"
					s101="1"
					s11="1"
					_num="60"
				[/sequence]
				[sequence]
					s="1"
					s01="1"
					s10="1"
					s101="1"
					_num="70"
				[/sequence]
			[/defends]
			recruit_cost="189"
			recall_cost="0"
			damage_inflicted="294"
			damage_taken="489"
			expected_damage_inflicted="296984"
			expected_damage_taken="413106"
			turn_damage_inflicted="43"
			turn_damage_taken="51"
			turn_expected_damage_inflicted="46584"
			turn_expected_damage_taken="36724"
			save_id="Iceant1"
		[/team]
		[team]
			[recruits]
				Cavalryman="2"
				Fencer="2"
				Heavy Infantryman="1"
				Horseman="2"
				Mage="2"
				Spearman="5"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
				Swordsman="1"
			[/advances]
			[deaths]
				Cavalryman="1"
				Fencer="2"
				Horseman="1"
			[/deaths]
			[killed]
				Goblin Spearman="1"
				Naga Fighter="1"
				Orcish Archer="1"
				Orcish Assassin="3"
				Orcish Grunt="6"
				Orcish Slayer="1"
			[/killed]
			[attacks]
				[sequence]
					s000="1"
					s001="2"
					s101="1"
					_num="30"
				[/sequence]
				[sequence]
					s01="2"
					s1="3"
					s101="2"
					s11="1"
					s110="2"
					_num="40"
				[/sequence]
				[sequence]
					s00="2"
					s011="1"
					s1000="1"
					_num="50"
				[/sequence]
				[sequence]
					s00="1"
					s001="1"
					s010="1"
					s1="2"
					s11="2"
					s110="1"
					_num="60"
				[/sequence]
				[sequence]
					s011="1"
					s1="2"
					s1010="1"
					s111="2"
					_num="70"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="7"
					_num="0"
				[/sequence]
				[sequence]
					s0="1"
					_num="30"
				[/sequence]
				[sequence]
					s0="2"
					s1="2"
					s110="1"
					s111="1"
					_num="40"
				[/sequence]
				[sequence]
					s0="1"
					s100="1"
					s111="1"
					_num="50"
				[/sequence]
				[sequence]
					s="1"
					s0="2"
					s010="1"
					s1="1"
					s100="1"
					s1111="1"
					_num="60"
				[/sequence]
				[sequence]
					s0="1"
					_num="70"
				[/sequence]
			[/defends]
			recruit_cost="241"
			recall_cost="0"
			damage_inflicted="489"
			damage_taken="294"
			expected_damage_inflicted="413106"
			expected_damage_taken="296984"
			turn_damage_inflicted="23"
			turn_damage_taken="9"
			turn_expected_damage_inflicted="15024"
			turn_expected_damage_taken="15984"
			save_id="Vandarr2"
		[/team]
	[/scenario]
[/statistics]
