<data>
	<items>
		<!-- Armor Template -->
		<itemTemplate r_name="'mainArmorItemTemplate'" r_template="'mainItemTemplate'"
									itemArmor="0"
									itemDefense="0"
									strengthPrerequisite="0"
									enhancementBonus="0"
									additionalPrerequisiteTooltip="''"
									itemTooltip="''"
									tooltip="r_displayName+'\n'+valuesTooltip+prerequisiteTooltip+'\n'+itemTooltip"
									valuesTooltip="text.defense+' : ' + itemDefense + ', '+text.armor+' : ' + itemArmor"
									prerequisiteTooltip="((strengthPrerequisite>0)?(', '+text.requiredStrength+' : ' + strengthPrerequisite):'')+additionalPrerequisiteTooltip"
									r_autoEquip="(strengthPrerequisite==0)||(actor.Strength>=strengthPrerequisite)"
									properties="((enhancementBonus>0)?{('+'+enhancementBonus)}:{})"
									nameModifiers="((enhancementBonus>0)?{('+'+enhancementBonus)}:{})"
									equippedPenalty="(strengthPrerequisite>0)?max(0, strengthPrerequisite-Strength):0">
			<modifier r_name="'ItemTotalDefense'" r_template="'mainItemModifier'" r_modifierTarget="'ItemTotalDefense'" r_modifiedValue="$0+itemDefense"/>
			<modifier r_name="'ItemTotalArmor'" r_template="'mainItemModifier'" r_modifierTarget="'ItemTotalArmor'" r_modifiedValue="$0+itemArmor"/>
			<modifier r_name="'ItemTotalPenalty'" r_template="'mainItemModifier'" r_modifierTarget="'ItemTotalPenalty'" r_modifiedValue="$0+equippedPenalty"/>
		</itemTemplate>
		
		<itemTemplate r_name="'armorItemTemplate'" r_template="'mainArmorItemTemplate'"
			 						itemArmor="baseItemArmor+enhancementBonus"/>
		<itemTemplate r_name="'defenseItemTemplate'" r_template="'mainArmorItemTemplate'"
			 					 	itemDefense="baseItemDefense+enhancementBonus"/>
		
		<!-- body armors -->	 					 	
		<itemTemplate r_name="'mainBodyArmorTemplate'" r_template="'armorItemTemplate'" slot="'armor'" equippedGraphic="'ToBeReplaced'" damageAbsorption="0" dexBonusReduction="0.75" dodgeBonusReduction="1">
			<modifier r_name="'attackDamageAbsorption'" r_template="'mainItemModifier'" r_modifierTarget="'attackDamageAbsorption'" r_modifiedValue="$0+damageAbsorption"/>
			<modifier r_name="'tooltip'" r_template="'mainModifierTemplate'" r_modifierTarget="'valuesTooltip'" r_modifiedValue="$0+', '+text.tooltipDamageAbsorption+' : '+damageAbsorption"/>
		</itemTemplate>
		<itemTemplate r_name="'mainRobeTemplate'" r_template="'mainBodyArmorTemplate'"/>
		<itemTemplate r_name="'mainLightArmorTemplate'" r_template="'mainBodyArmorTemplate'" armorPrerequisite="0" additionalPrerequisiteTooltip="(armorPrerequisite>0)?(', '+text.tooltipRequiredArmorSkill+' : ' + armorPrerequisite):''">
			<modifier r_name="'ItemSkillPenalty'" r_template="'mainItemModifier'" r_modifierTarget="'equippedPenalty'" r_modifiedValue="$0+max(0, armorPrerequisite-ArmorSkill)"/>
			<modifier r_name="'autoEquip'" r_template="'mainItemModifier'" r_modifierTarget="'r_autoEquip'" r_modifiedValue="$0&&(actor.ArmorSkill>armorPrerequisite)"/>
			<modifier r_name="'animatedBody'" r_template="'mainItemModifier'" r_modifierTarget="'animatedBody'" r_modifiedValue="'2'"/>
		</itemTemplate>
		<itemTemplate r_name="'mainHeavyArmorTemplate'" r_template="'mainBodyArmorTemplate'" armorPrerequisite="0" additionalPrerequisiteTooltip="(armorPrerequisite>0)?(', '+text.tooltipRequiredArmorSkill+' : ' + armorPrerequisite):''" movementModifier="1.2" dexBonusReduction="0.2" dodgeBonusReduction="0.5">
			<modifier r_name="'ItemSkillPenalty'" r_template="'mainItemModifier'" r_modifierTarget="'equippedPenalty'" r_modifiedValue="$0+max(0, armorPrerequisite-ArmorSkill)"/>
			<modifier r_name="'autoEquip'" r_template="'mainItemModifier'" r_modifierTarget="'r_autoEquip'" r_modifiedValue="$0&&(actor.ArmorSkill>armorPrerequisite)"/>
			<modifier r_name="'animatedBody'" r_template="'mainItemModifier'" r_modifierTarget="'animatedBody'" r_modifiedValue="'3'"/>
		</itemTemplate>
		
		<!-- other armors -->
		<itemTemplate r_name="'mainHeadTemplate'" r_template="'armorItemTemplate'" slot="'head'"/>
		<itemTemplate r_name="'mainCloakTemplate'" r_template="'armorItemTemplate'" slot="'back'"/>
		<itemTemplate r_name="'mainBracerTemplate'" r_template="'armorItemTemplate'" slot="'bracers'"/>
		<itemTemplate r_name="'mainGloveTemplate'" r_template="'armorItemTemplate'" slot="'gloves'"/>
		<itemTemplate r_name="'mainBeltTemplate'" r_template="'armorItemTemplate'" slot="'belt'"/>
		<itemTemplate r_name="'mainBootTemplate'" r_template="'armorItemTemplate'" slot="'boots'"/>

		<!-- Armor pieces -->
		<item r_name="'Helm'" r_template="'mainHeadTemplate'"
					itemName="text.itemHelm"
					r_graphic="'casque0.png'"
					baseItemArmor="1"
					equippedGraphic="(enhancementBonus==0)?'helmet_0.png':(equippedGraphic='helmet_'+(1D5)+'.png')"
					itemTooltip="relocate(text.tooltipHelm)"/>
		<item r_name="'Cloak'" r_template="'mainCloakTemplate'"
					itemName="text.itemCloak"
					r_graphic="'cape0.png'"
					baseItemArmor="1"
					equippedGraphic="(enhancementBonus==0)?'cape_0.png':(equippedGraphic='cape_'+(1D3)+'.png')"
					itemTooltip="relocate(text.tooltipCloak)"/>
		<item r_name="'Bracers'" r_template="'mainBracerTemplate'"
					itemName="text.itemBracers"
					r_graphic="'bracelet0.png'"
					baseItemArmor="1"
					itemTooltip="relocate(text.tooltipBracers)"/>
		<item r_name="'Gloves'" r_template="'mainGloveTemplate'"
					itemName="text.itemGloves"
					r_graphic="'gain0.png'"
					baseItemArmor="1"
					itemTooltip="relocate(text.tooltipGloves)"/>
		<item r_name="'Belt'" r_template="'mainBeltTemplate'"
					itemName="text.itemBelt"
					r_graphic="'belt.png'"
					baseItemArmor="1"
					itemTooltip="relocate(text.tooltipBelt)"/>
		<item r_name="'Boots'" r_template="'mainBootTemplate'"
					itemName="text.itemBoots"
					r_graphic="'bottes0.png'"
					baseItemArmor="1"
					itemTooltip="relocate(text.tooltipBoots)"/>
					
		<!-- Robe -->
		<item r_name="'Robe'" r_template="'mainRobeTemplate'"
					itemName="text.itemRobe"
					r_graphic="'robe.png'"
					baseItemArmor="0"
					itemTooltip="relocate(text.tooltipRobe)"/>

		<!-- Body light armor -->
		<item r_name="'TrainingLightArmor'" r_template="'mainLightArmorTemplate'"
					itemName="text.itemLightTrainingArmor"
					r_graphic="'leatherarmor.png'"
					baseItemArmor="2"
					damageAbsorption="1"
					strengthPrerequisite="0"
					armorPrerequisite="1"
					itemTooltip="relocate(text.tooltipLightArmor)"/>
		<item r_name="'LeatherArmor'" r_template="'mainLightArmorTemplate'"
					itemName="text.itemLeatherArmor"
					r_graphic="'leatherarmor.png'"
					baseItemArmor="2"
					damageAbsorption="2"
					strengthPrerequisite="1"
					armorPrerequisite="2"
					itemTooltip="relocate(text.tooltipLightArmor)"/>
		<item r_name="'StuddedLeatherArmor'" r_template="'mainLightArmorTemplate'"
					itemName="text.itemStuddedLeatherArmor"
					r_graphic="'studdedLeatherarmor.png'"
					baseItemArmor="3"
					damageAbsorption="3"
					strengthPrerequisite="2"
					armorPrerequisite="4"
					itemTooltip="relocate(text.tooltipLightArmor)"/>
		<item r_name="'RingMail'" r_template="'mainLightArmorTemplate'"
					itemName="text.itemRingMail"
					r_graphic="'ringmail.png'"
					baseItemArmor="4"
					damageAbsorption="4"
					strengthPrerequisite="3"
					armorPrerequisite="6"
					itemTooltip="relocate(text.tooltipLightArmor)"/>
		<item r_name="'Hauberk'" r_template="'mainLightArmorTemplate'"
					itemName="text.itemHauberk"
					r_graphic="'hauberk.png'"
					baseItemArmor="5"
					damageAbsorption="4"
					strengthPrerequisite="4"
					armorPrerequisite="8"
					itemTooltip="relocate(text.tooltipLightArmor)"/>
					
		<!-- Body heavy armor -->
		<item r_name="'TrainingHeavyArmor'" r_template="'mainHeavyArmorTemplate'"
					itemName="text.itemHeavyTrainingArmor"
					r_graphic="'breastplate.png'"
					baseItemArmor="4"
					damageAbsorption="2"
					strengthPrerequisite="1"
					armorPrerequisite="1"
					itemTooltip="relocate(text.tooltipHeavyArmor)"/>
		<item r_name="'Breastplate'" r_template="'mainHeavyArmorTemplate'"
					itemName="text.itemBreastplate"
					r_graphic="'breastplate.png'"
					baseItemArmor="4"
					damageAbsorption="4"
					strengthPrerequisite="3"
					armorPrerequisite="2"
					itemTooltip="relocate(text.tooltipHeavyArmor)"/>
		<item r_name="'Cuirass'" r_template="'mainHeavyArmorTemplate'"
					itemName="text.itemCuirass"
					r_graphic="'cuirass.png'"
					baseItemArmor="6"
					damageAbsorption="5"
					strengthPrerequisite="5"
					armorPrerequisite="4"
					itemTooltip="relocate(text.tooltipHeavyArmor)"/>
		<item r_name="'ScaleArmor'" r_template="'mainHeavyArmorTemplate'"
					itemName="text.itemScaleArmor"
					r_graphic="'scalearmor.png'"
					baseItemArmor="8"
					damageAbsorption="6"
					strengthPrerequisite="7"
					armorPrerequisite="6"
					itemTooltip="relocate(text.tooltipHeavyArmor)"/>
		<item r_name="'PlateArmor'" r_template="'mainHeavyArmorTemplate'"
					itemName="text.itemPlateArmor"
					r_graphic="'platearmor.png'"
					baseItemArmor="10"
					damageAbsorption="7"
					strengthPrerequisite="9"
					armorPrerequisite="8"
					itemTooltip="relocate(text.tooltipHeavyArmor)"/>
		
		<!-- Shields -->
		<item r_name="'mainShieldTemplate'" r_template="{'mainWeaponTemplate','defenseItemTemplate'}"
					slot="'offhand'"
					shieldPrerequisite="0"
					additionalPrerequisiteTooltip="(shieldPrerequisite>0)?(', '+text.tooltipRequiredShieldSkill+' : ' + shieldPrerequisite):''"
					weaponSkillName="'Shield'"
					weaponSkill="Shield"
					shieldAttack="0">
			<modifier r_name="'ItemSkillPenalty'" r_template="'mainItemModifier'" r_modifierTarget="'equippedPenalty'" r_modifiedValue="$0+max(0, shieldPrerequisite-Shield)"/>
			<modifier r_name="'autoEquip'" r_template="'mainModifierTemplate'" r_modifierTarget="'r_autoEquip'" r_modifiedValue="$0&&(actor.Shield>=shieldPrerequisite)"/>
			<action r_name="'attackAction'" r_enabled="shieldAttack"/>
		</item>
		<item r_name="'Buckler'" r_template="'mainShieldTemplate'"
					itemName="text.itemBuckler"
					r_graphic="'buckler.png'"
					halfHand="1"
					baseItemDefense="1"
					shieldPrerequisite="2"
					strengthPrerequisite="2"
					equippedGraphic="(enhancementBonus==0)?'buckler_0.png':(equippedGraphic='buckler_'+(1D3)+'.png')"
					itemTooltip="relocate(text.itemTooltipShield)"
					baseWeaponDamage="2"
					baseWeaponHitBonus="0"/>
		<item r_name="'Shield'" r_template="'mainShieldTemplate'"
					itemName="text.itemShield"
					r_graphic="'shield.png'"
					baseItemDefense="2"
					shieldPrerequisite="4"
					strengthPrerequisite="4"
					equippedGraphic="(enhancementBonus==0)?'shield_0.png':(equippedGraphic='shield_'+(1D3)+'.png')"
					itemTooltip="relocate(text.itemTooltipShield)"
					baseWeaponDamage="6"
					baseWeaponHitBonus="0"/>
		<item r_name="'LargeShield'" r_template="'mainShieldTemplate'"
					itemName="text.itemLargeShield"
					r_graphic="'largeshield.png'"
					baseItemDefense="3"
					shieldPrerequisite="6"
					strengthPrerequisite="6"
					equippedGraphic="(enhancementBonus==0)?'largeshield_0.png':(equippedGraphic='largeshield_'+(1D3)+'.png')"
					itemTooltip="relocate(text.itemTooltipShield)"
					baseWeaponDamage="6"
					baseWeaponHitBonus="0"/>
		<item r_name="'TowerShield'" r_template="'mainShieldTemplate'"
					itemName="text.itemTowerShield"
					r_graphic="'towershield.png'"
					baseItemDefense="4"
					shieldPrerequisite="8"
					strengthPrerequisite="8"
					equippedGraphic="(enhancementBonus==0)?'pavois_0.png':(equippedGraphic='pavois_'+(1D3)+'.png')"
					itemTooltip="relocate(text.itemTooltipShield)"
					baseWeaponDamage="4"
					baseWeaponHitBonus="0"/>


		<itemTemplate r_name="'randomEnchantedArmorAdditionalTemplate'"
									enchantmentList="{}"
									mainEnchantment="mainEnchantment=randomElement(enchantmentList)">
			<map r_name="'enchantment'" r_template="mainEnchantment"/>
		</itemTemplate>
		<itemTemplate r_name="'randomRareArmorAdditionalTemplate'"
									enchantments="enchantments=shuffle({'strengthEnchantment','dexterityEnchantment','intelligenceEnchantment','constitutionEnchantment','physicalResistanceEnchantment','mentalResistanceEnchantment','resistanceEnchantment','protectionEnchantment','defensiveEnchantment'})">
			<map r_name="'enchantment0'" r_template="enchantments[0]"/>
			<map r_name="'enchantment1'" r_template="enchantments[1]"/>
		</itemTemplate>


		<item r_name="'randomHelm'" r_template="{'Helm','randomEnhancementBonusLow'}"/>
		<item r_name="'randomEnchantedHelm'" r_template="{'randomHelm','randomEnchantedArmorAdditionalTemplate'}"
					enchantmentList="{'intelligenceEnchantment','mentalResistanceEnchantment','protectionEnchantment','accuracyEnchantment'}"/>

		<item r_name="'randomCloak'" r_template="{'Cloak','randomEnhancementBonusLow'}"/>
		<item r_name="'randomEnchantedCloak'" r_template="{'randomCloak','randomEnchantedArmorAdditionalTemplate'}"
					enchantmentList="{'constitutionEnchantment','resistanceEnchantment','protectionEnchantment'}"/>

		<item r_name="'randomBracers'" r_template="{'Bracers','randomEnhancementBonusLow'}"/>
		<item r_name="'randomEnchantedBracers'" r_template="{'randomBracers','randomEnchantedArmorAdditionalTemplate'}"
					enchantmentList="{'strengthEnchantment','quicknessEnchantment','protectionEnchantment','accuracyEnchantment'}"/>

		<item r_name="'randomGloves'" r_template="{'Gloves','randomEnhancementBonusLow'}"/>
		<item r_name="'randomEnchantedGloves'" r_template="{'randomGloves','randomEnchantedArmorAdditionalTemplate'}"
					enchantmentList="{'strengthEnchantment','dexterityEnchantment','quicknessEnchantment','accuracyEnchantment'}"/>

		<item r_name="'randomBelt'" r_template="{'Belt','randomEnhancementBonusLow'}"/>
		<item r_name="'randomEnchantedBelt'" r_template="{'randomBelt','randomEnchantedArmorAdditionalTemplate'}"
					enchantmentList="{'constitutionEnchantment','physicalResistanceEnchantment'}"/>

		<item r_name="'randomBoots'" r_template="{'Boots','randomEnhancementBonusLow'}"/>
		<item r_name="'randomEnchantedBoots'" r_template="{'randomBoots','randomEnchantedArmorAdditionalTemplate'}"
					enchantmentList="{'dexterityEnchantment','runEnchantment'}"/>

		<item r_name="'randomRobe'" r_template="{'Robe','randomEnhancementBonusLow'}"/>
		<item r_name="'randomEnchantedRobe'" r_template="{'randomRobe','randomEnchantedArmorAdditionalTemplate'}"
					enchantmentList="{'intelligenceEnchantment','resistanceEnchantment','defensiveEnchantment'}"/>

		<item r_name="'randomBasicLightArmor'" r_template="{'LeatherArmor','StuddedLeatherArmor','RingMail','Hauberk'}[eval(gameParameters.lootTiers4,dungeonDepth)]"/>
		<item r_name="'randomLightArmor'" r_template="{'randomBasicLightArmor','randomEnhancementBonusStandard'}"/>
		<item r_name="'randomEnchantedLightArmor'" r_template="{'randomLightArmor','randomEnchantedArmorAdditionalTemplate'}"
					enchantmentList="{'dexterityEnchantment','constitutionEnchantment','resistanceEnchantment','protectionEnchantment'}"/>

		<item r_name="'randomBasicHeavyArmor'" r_template="{'Breastplate','Cuirass','ScaleArmor','PlateArmor'}[eval(gameParameters.lootTiers4,dungeonDepth)]"/>
		<item r_name="'randomHeavyArmor'" r_template="{'randomBasicHeavyArmor','randomEnhancementBonusStandard'}"/>
		<item r_name="'randomEnchantedHeavyArmor'" r_template="{'randomHeavyArmor','randomEnchantedArmorAdditionalTemplate'}"
					enchantmentList="{'strengthEnchantment','constitutionEnchantment','resistanceEnchantment','protectionEnchantment'}"/>

		<item r_name="'randomBasicShield'" r_template="{'Buckler','Shield','LargeShield','TowerShield'}[eval(gameParameters.lootTiers4,dungeonDepth)]"/>
		<item r_name="'randomShield'" r_template="{'randomBasicShield','randomEnhancementBonusLow'}"/>
		<item r_name="'randomEnchantedShield'" r_template="{'randomShield','randomEnchantedArmorAdditionalTemplate'}"
					enchantmentList="{'constitutionEnchantment','strengthEnchantment','resistanceEnchantment','protectionEnchantment','defensiveEnchantment'}"/>

		<item r_name="'randomMonsterShield'" r_template="{{'Buckler','Shield','LargeShield','TowerShield'}[min(level/2,eval(gameParameters.lootTiers4,dungeonDepth))]}+{{},{'randomEnhancementBonusStandard'},{'randomEnhancementBonusStandard','randomEnchantedArmorAdditionalTemplate'},{'randomEnhancementBonusStandard','randomEnchantedArmorAdditionalTemplate','randomRareArmorAdditionalTemplate'}}[eval(gameParameters.lootPowerEquipment,dungeonDepth)]"
					enchantmentList="{'constitutionEnchantment','strengthEnchantment','resistanceEnchantment','protectionEnchantment','defensiveEnchantment'}"/>

		<item r_name="'randomArmor'" r_template="randomElement({'randomHelm','randomCloak','randomBracers','randomGloves','randomBelt','randomBoots','randomRobe'}+createArray(2,'randomShield')+createArray(2,'randomLightArmor')+createArray(2,'randomHeavyArmor'))"/>
		<item r_name="'randomEnchantedArmor'" r_template="randomElement({'randomEnchantedHelm','randomEnchantedCloak','randomEnchantedBracers','randomEnchantedGloves','randomEnchantedBelt','randomEnchantedBoots','randomEnchantedRobe'}+createArray(2,'randomEnchantedShield')+createArray(3,'randomEnchantedLightArmor')+createArray(2,'randomEnchantedHeavyArmor'))"/>
		<item r_name="'randomRareArmor'" r_template="{'randomEnchantedArmor','randomRareArmorAdditionalTemplate'}"/>
	</items>
</data>