<data>
	<dungeons>
		<!-- DUNGEON MODEL TEMPLATE -->
		<dungeonTemplate r_name="'commonTemplate'"
										 r_displayName="r_name"
										 hexGraphic="'Cave.png'"
										 r_enabled="1"
										 w_dungeonLoaded="0"
										 r_enteringLevelIndex="0"
										 visible="accessible||victory"
										 accessible="0"
										 conditionVictory="0"
										 stairVictory="0"
										 victory="0"
										 tooltip="''"
										 objective="''"
										 completeTooltip="r_displayName+'\n'+tooltip"
										 completeObjective="'Mission : \n'+objective"
										 canFleeDungeon="1"
										 dungeonDepth="0"
										 w_creationProgress="0"
										 dungeonSurface="500"
										 dungeonTotalXP="0"
										 dungeonMinXPMonster="0"
										 dungeonMaxXPMonster="20"
										 victoryCondition="'stair'"
										 earnedExperience="0"
										 levelCount="1"
										 dungeonLootCount="dungeonLootCount=2D2"
										 dungeonChestCount="dungeonChestCount=2"
										 dungeonPotionCount="dungeonPotionCount=2D3">
			<!-- earnedExperience -->
			<event r_name="'onXPgain'" r_template="'mainEventTemplate'" r_enabled="exists(world)&&exists(heroes.@0)" r_eventTarget="'heroes.@0.Experience'" r_targetType="'attribute'">
				<effect r_name="'earnedExperience'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="earnedExperience+=max(w_newValue-w_oldValue,0)"/>
			</event>
			<event r_name="'onCreation'" r_template="'mainEventTemplate'" r_eventTarget="'w_creationProgress'" r_targetType="'attribute'">
				<effect r_name="'earnedExperience'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="earnedExperience=0"/>
			</event>
		</dungeonTemplate>
		<dungeonTemplate r_name="'finalDungeonTemplate'" r_template="'commonTemplate'"
										 victoryCondition="gameParameters.princessAlive?'saveNPC':'Boss'">
			<levelTemplate r_name="'finalLevelTemplate'" r_template="'standardTemplate'">
				<feature r_name="'prison'" r_template="'finalPrison'"/>
			</levelTemplate>
			<event r_name="'onVictory'" r_template="'mainEventTemplate'" r_eventTarget="'stairVictory'" r_targetType="'attribute'">
				<effect r_name="'victory'" r_template="{'mainSelfEffectTemplate','multiEffect'}" r_enabled="stairVictory">
					<effect r_name="'victory'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="gameParameters.campaignVictory=1"/>
				</effect>
			</event>
		</dungeonTemplate>
		<!-- DUNGEON MODEL -->
		<dungeon r_name="'sewer'" r_template="'commonTemplate'"
						 hexGraphic="'Sewers.png'"
						 r_displayName="text.townSewer"
						 tooltip="text.townSewerTooltip"
						 objective="text.townSewerObjective"
						 dungeonSurface="200"
						 levelCount="2">
			<level r_name="'level1'" r_template="'sewer0'" levelSurface="dungeonSurface/2" r_totalXP="dungeonTotalXP/2-25">
				<feature r_name="'ratTile1'" r_template="'mainFeatureTemplate'" r_tile="'monsterTile'" monsterName="'Rat'"/>
				<feature r_name="'ratTile2'" r_template="'mainFeatureTemplate'" r_tile="'monsterTile'" monsterName="'Rat'"/>
				<feature r_name="'ratTile3'" r_template="'mainFeatureTemplate'" r_tile="'monsterTile'" monsterName="'Rat'"/>
				<feature r_name="'ratTile4'" r_template="'mainFeatureTemplate'" r_tile="'monsterTile'" monsterName="'Rat'"/>
				<feature r_name="'ratTile5'" r_template="'mainFeatureTemplate'" r_tile="'monsterTile'" monsterName="'Rat'"/>
			</level>
			<level r_name="'level2'" r_template="'sewer'" levelSurface="dungeonSurface/2" r_totalXP="dungeonTotalXP/2-25">
				<feature r_name="'ratTile1'" r_template="'mainFeatureTemplate'" r_tile="'monsterTile'" monsterName="'Rat'"/>
				<feature r_name="'ratTile2'" r_template="'mainFeatureTemplate'" r_tile="'monsterTile'" monsterName="'Rat'"/>
				<feature r_name="'ratTile3'" r_template="'mainFeatureTemplate'" r_tile="'monsterTile'" monsterName="'Rat'"/>
				<feature r_name="'ratTile4'" r_template="'mainFeatureTemplate'" r_tile="'monsterTile'" monsterName="'Rat'"/>
				<feature r_name="'ratTile5'" r_template="'mainFeatureTemplate'" r_tile="'monsterTile'" monsterName="'Rat'"/>
			</level>
		</dungeon>
		<dungeon r_name="'dark_forest'" r_template="'commonTemplate'"
						 hexGraphic="'jungle.png'"
						 r_displayName="text.darkForest"
						 tooltip="text.darkForestTooltip"
						 objective="text.darkForestObjective"
						 victoryCondition="'saveNPC'"
						 levelCount="1">
			<level r_name="'level1'" r_template="'forest'" levelSurface="dungeonSurface" r_totalXP="dungeonTotalXP">
				<feature r_name="'merchant'" r_template="'mainFeatureTemplate'" r_tile="'monsterTile'" r_shape="'farStart1'" monsterName="'Merchant'"/>
			</level>
		</dungeon>
		<dungeon r_name="'old_forest'" r_template="'commonTemplate'"
						 hexGraphic="'jungle.png'"
						 r_displayName="text.oldForest"
						 tooltip="text.oldForestTooltip"
						 objective="text.oldForestObjective"
						 victoryCondition="'saveNPC'"
						 levelCount="1">
			<level r_name="'level1'" r_template="'forest'" levelSurface="dungeonSurface" r_totalXP="dungeonTotalXP">
				<feature r_name="'merchant'" r_template="'mainFeatureTemplate'" r_tile="'monsterTile'" r_shape="'farStart1'" monsterName="'Merchant'"/>
			</level>
		</dungeon>
		<dungeon r_name="'lost_jungle'" r_template="'commonTemplate'"
						 hexGraphic="'jungle.png'"
						 r_displayName="text.lostJungle"
						 tooltip="text.lostJungleTooltip"
						 objective="text.lostJungleObjective"
						 victoryCondition="'saveNPC'"
						 levelCount="1">
			<level r_name="'level1'" r_template="'jungle'" levelSurface="dungeonSurface" r_totalXP="dungeonTotalXP">
				<feature r_name="'merchant'" r_template="'mainFeatureTemplate'" r_tile="'monsterTile'" r_shape="'farStart1'" monsterName="'Merchant'"/>
			</level>
		</dungeon>
		<dungeon r_name="'broken_tower'" r_template="'commonTemplate'"
						 hexGraphic="'Castle.png'"
						 r_displayName="text.brokenTower"
						 tooltip="text.brokenTowerTooltip"
						 objective="text.brokenTowerObjective"
						 levelCount="5">
			<level r_name="'level1'" r_template="'castle'" levelSurface="dungeonSurface*0.25" r_totalXP="dungeonTotalXP/5"/>
			<level r_name="'level2'" r_template="'castle'" levelSurface="dungeonSurface*0.225" r_totalXP="dungeonTotalXP/5"/>
			<level r_name="'level3'" r_template="'castle'" levelSurface="dungeonSurface*0.2" r_totalXP="dungeonTotalXP/5"/>
			<level r_name="'level4'" r_template="'castle'" levelSurface="dungeonSurface*0.175" r_totalXP="dungeonTotalXP/5"/>
			<level r_name="'level5'" r_template="'castle'" levelSurface="dungeonSurface*0.15" r_totalXP="dungeonTotalXP/5">
				<feature r_name="'bookshelf'" r_template="'mainFeatureTemplate'" r_tile="'commonBookshelf'" r_shape="'farStart1'"/>
			</level>
		</dungeon>
		<dungeon r_name="'forgotten_tower'" r_template="'commonTemplate'"
						 hexGraphic="'Castle.png'"
						 r_displayName="text.forgottenTower"
						 tooltip="text.forgottenTowerTooltip"
						 objective="text.forgottenTowerObjective"
						 levelCount="5">
			<level r_name="'level1'" r_template="'castle'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP/5"/>
			<level r_name="'level2'" r_template="'castle'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP/5"/>
			<level r_name="'level3'" r_template="'castle'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP/5"/>
			<level r_name="'level4'" r_template="'castle'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP/5"/>
			<level r_name="'level5'" r_template="'castle'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP/5">
				<feature r_name="'bookshelf'" r_template="'mainFeatureTemplate'" r_tile="'commonBookshelf'" r_shape="'farStart1'"/>
			</level>
		</dungeon>
		<dungeon r_name="'tomb_of_Sigmund'" r_template="'commonTemplate'"
						 hexGraphic="'Castle.png'"
						 r_displayName="text.tombOfSigmund"
						 tooltip="text.tombOfSigmundTooltip"
						 objective="text.tombOfSigmundObjective"
						 levelCount="3">
			<level r_name="'level1'" r_template="'desert'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP/5"/>
			<level r_name="'level2'" r_template="'dungeon'" levelSurface="dungeonSurface*2/5" r_totalXP="dungeonTotalXP*2/5"/>
			<level r_name="'level3'" r_template="'dungeon'" levelSurface="dungeonSurface*2/5" r_totalXP="dungeonTotalXP*2/5">
				<feature r_name="'armorRack'" r_template="'mainFeatureTemplate'" r_tile="'commonArmorRack'" r_shape="'farStart1'"/>
			</level>
		</dungeon>
		<dungeon r_name="'mysterious_ruins'" r_template="'commonTemplate'"
						 hexGraphic="'Ruins.png'"
						 r_displayName="text.mysteriousRuins"
						 tooltip="text.mysteriousRuinsTooltip"
						 objective="text.mysteriousRuinsObjective"
						 levelCount="2">
			<level r_name="'level1'" r_template="'jungle'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP/5"/>
			<level r_name="'level2'" r_template="'ruin'" levelSurface="dungeonSurface*4/5" r_totalXP="dungeonTotalXP*4/5">
				<feature r_name="'armorRack'" r_template="'mainFeatureTemplate'" r_tile="'commonArmorRack'" r_shape="'farStart1'"/>
			</level>
		</dungeon>
		<dungeon r_name="'lonely_mansion'" r_template="'commonTemplate'"
						 hexGraphic="'Mansion.png'"
						 r_displayName="text.lonelyMansion"
						 tooltip="text.lonelyMansionTooltip"
						 objective="text.lonelyMansionObjective"
						 levelCount="3">
			<level r_name="'level1'" r_template="'swamp'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP/5"/>
			<level r_name="'level2'" r_template="'mansion'" levelSurface="dungeonSurface*3/5" r_totalXP="dungeonTotalXP*3/5"/>
			<level r_name="'level3'" r_template="'cave'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP/5">
				<feature r_name="'JewelleryDisplay'" r_template="'mainFeatureTemplate'" r_tile="'commonJewelleryDisplay'" r_shape="'farStart1'"/>
			</level>
		</dungeon>
		<dungeon r_name="'desert_of_death'" r_template="'commonTemplate'"
						 hexGraphic="'Desert.png'"
						 r_displayName="text.desertOfDeath"
						 tooltip="text.desertOfDeathTooltip"
						 objective="text.desertOfDeathObjective"
						 dungeonAltarActivated="0"
						 levelCount="2">
			<level r_name="'level1'" r_template="'desert'" levelSurface="dungeonSurface" r_totalXP="dungeonTotalXP">
				<feature r_name="'altar1'" r_template="'mainFeatureTemplate'" r_tile="'AirAltarTile'" r_shape="'farStart1'"/>
				<feature r_name="'altar2'" r_template="'mainFeatureTemplate'" r_tile="'FireAltarTile'" r_shape="'farStart1'"/>
			</level>
		</dungeon>
		<dungeon r_name="'torment_swamp'" r_template="'commonTemplate'"
						 hexGraphic="'Swamp.png'"
						 r_displayName="text.swampOfTorment"
						 tooltip="text.swampOfTormentTooltip"
						 objective="text.swampOfTormentObjective"
						 dungeonAltarActivated="0"
						 levelCount="1">
			<level r_name="'level1'" r_template="'swamp'" levelSurface="dungeonSurface" r_totalXP="dungeonTotalXP">
				<feature r_name="'altar1'" r_template="'mainFeatureTemplate'" r_tile="'DeathAltarTile'" r_shape="'farStart1'"/>
				<feature r_name="'altar2'" r_template="'mainFeatureTemplate'" r_tile="'WaterAltarTile'" r_shape="'farStart1'"/>
			</level>
		</dungeon>
		<dungeon r_name="'lake_island'" r_template="'commonTemplate'"
						 hexGraphic="'Island.png'"
						 r_displayName="text.lakesIsland"
						 tooltip="text.lakesIslandTooltip"
						 objective="text.lakesIslandObjective"
						 dungeonAltarActivated="0"
						 levelCount="2">
			<level r_name="'level1'" r_template="'jungle'" levelSurface="dungeonSurface*3/5" r_totalXP="dungeonTotalXP*3/5"/>
			<level r_name="'level2'" r_template="'temple'" levelSurface="dungeonSurface*2/5" r_totalXP="dungeonTotalXP*2/5">
				<feature r_name="'altar1'" r_template="'mainFeatureTemplate'" r_tile="'WaterAltarTile'" r_shape="'farStart1'"/>
				<feature r_name="'altar2'" r_template="'mainFeatureTemplate'" r_tile="'HolyAltarTile'" r_shape="'farStart1'"/>
			</level>
		</dungeon>
		<dungeon r_name="'fire_mountain'" r_template="'commonTemplate'"
						 hexGraphic="'LavaCave.png'"
						 r_displayName="text.fireMountain"
						 tooltip="text.fireMountainTooltip"
						 objective="text.fireMountainObjective"
						 dungeonAltarActivated="0"
						 levelCount="2">
			<level r_name="'level1'" r_template="'mountain'" levelSurface="dungeonSurface*2/5" r_totalXP="dungeonTotalXP*2/5"/>
			<level r_name="'level2'" r_template="'lavacave'" levelSurface="dungeonSurface*3/5" r_totalXP="dungeonTotalXP*3/5">
				<feature r_name="'altar1'" r_template="'mainFeatureTemplate'" r_tile="'EarthAltarTile'" r_shape="'farStart1'"/>
				<feature r_name="'altar2'" r_template="'mainFeatureTemplate'" r_tile="'FireAltarTile'" r_shape="'farStart1'"/>
			</level>
		</dungeon>
		<dungeon r_name="'eagles_peak'" r_template="'commonTemplate'"
						 hexGraphic="'Mountain.png'"
						 r_displayName="text.eaglesPeak"
						 tooltip="text.eaglesPeakTooltip"
						 objective="text.eaglesPeakObjective"
						 dungeonAltarActivated="0"
						 levelCount="4">
			<level r_name="'level1'" r_template="'mountain'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP/5"/>
			<level r_name="'level2'" r_template="'mountain'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP/5"/>
			<level r_name="'level3'" r_template="'mountain'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP/5"/>
			<level r_name="'level4'" r_template="'mountain'" levelSurface="dungeonSurface*2/5" r_totalXP="dungeonTotalXP*2/5">
				<feature r_name="'altar1'" r_template="'mainFeatureTemplate'" r_tile="'AirAltarTile'" r_shape="'farStart1'"/>
				<feature r_name="'altar2'" r_template="'mainFeatureTemplate'" r_tile="'EarthAltarTile'" r_shape="'farStart1'"/>
			</level>
		</dungeon>
		<dungeon r_name="'holy_temple'" r_template="'commonTemplate'"
						 hexGraphic="'Temple.png'"
						 r_displayName="text.holyTemple"
						 tooltip="text.holyTempleTooltip"
						 objective="text.holyTempleObjective"
						 dungeonAltarActivated="0"
						 levelCount="3">
			<level r_name="'level1'" r_template="'mountain'" levelSurface="dungeonSurface*2/5" r_totalXP="dungeonTotalXP*2/5"/>
			<level r_name="'level2'" r_template="'temple'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP/5"/>
			<level r_name="'level3'" r_template="'temple'" levelSurface="dungeonSurface*2/5" r_totalXP="dungeonTotalXP*2/5">
				<feature r_name="'altar1'" r_template="'mainFeatureTemplate'" r_tile="'HolyAltarTile'" r_shape="'farStart1'"/>
			</level>
		</dungeon>
		<dungeon r_name="'desecrate_ground'" r_template="'commonTemplate'"
						 hexGraphic="'Temple.png'"
						 r_displayName="text.desecrateGround"
						 tooltip="text.desecrateGroundTooltip"
						 objective="text.desecrateGroundObjective"
						 dungeonAltarActivated="0"
						 levelCount="2">
			<level r_name="'level1'" r_template="'swamp'" levelSurface="dungeonSurface*3/5" r_totalXP="dungeonTotalXP*3/5"/>
			<level r_name="'level2'" r_template="'temple'" levelSurface="dungeonSurface*2/5" r_totalXP="dungeonTotalXP*2/5">
				<feature r_name="'altar1'" r_template="'mainFeatureTemplate'" r_tile="'DeathAltarTile'" r_shape="'farStart1'"/>
			</level>
		</dungeon>
		<dungeon r_name="'elemental_temple'" r_template="'commonTemplate'"
						 hexGraphic="'Temple.png'"
						 r_displayName="text.elementalTemple"
						 tooltip="text.elementalTempleTooltip"
						 objective="text.elementalTempleObjective"
						 levelCount="4"
						 order="order=shuffle({0,1,2,3})"
						 levelTemplates="{'swamp','ruin','lavacave','cave'}"
						 elements="{'Water','Air','Fire','Earth'}">
			<levelTemplate r_name="'statueActivationInterface'" levelSurface="dungeonSurface/4" r_totalXP="dungeonTotalXP/4" downstairVisible="0">
				<feature r_name="'statue'" r_template="'mainFeatureTemplate'" r_enabled="!downstairVisible" r_tile="'tileStatue'+elements[order[index]]" r_shape="'farStart1'"/>
			</levelTemplate>
			<level r_name="'level1'" r_template="{levelTemplates[order[0]],'statueActivationInterface'}" index="0"/>
			<level r_name="'level2'" r_template="{levelTemplates[order[1]],'statueActivationInterface'}" index="1"/>
			<level r_name="'level3'" r_template="{levelTemplates[order[2]],'statueActivationInterface'}" index="2"/>
			<level r_name="'level4'" r_template="{levelTemplates[order[3]],'statueActivationInterface'}" index="3"/>
		</dungeon>
		<dungeon r_name="'the_lair'" r_template="'commonTemplate'"
						 hexGraphic="'Cave.png'"
						 r_displayName="text.theLair"
						 tooltip="text.theLairTooltip"
						 objective="text.theLairObjective"
						 victoryCondition="'boss'"
						 levelCount="3">
			<level r_name="'level1'" r_template="'mountain'" levelSurface="dungeonSurface/2" r_totalXP="(dungeonTotalXP)/2"/>
			<level r_name="'level2'" r_template="'cave'" levelSurface="dungeonSurface/2" r_totalXP="(dungeonTotalXP)/2"/>
			<level r_name="'level3'" r_template="'cave'" levelSurface="40" r_totalXP="0">
				<feature r_name="'boss'" r_template="'mainFeatureTemplate'" r_tile="'bossTile'" r_shape="'farStart1'" monsterName="'Hydra'"/>
			</level>
		</dungeon>
		<dungeon r_name="'bloodTemple'" r_template="'finalDungeonTemplate'"
						 hexGraphic="'EvilCastle.png'"
						 r_displayName="text.bloodTemple"
						 tooltip="text.bloodTempleTooltip"
						 objective="text.bloodTempleObjective"
						 levelCount="5"
						 dungeonSurface="1000">
			<level r_name="'level1'" r_template="'ruin'" levelSurface="dungeonSurface/10" r_totalXP="dungeonTotalXP*1/10"/>
			<level r_name="'level2'" r_template="'dungeon'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP*2/10"/>
			<level r_name="'level3'" r_template="'dungeon'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP*2/10"/>
			<level r_name="'level4'" r_template="'dungeon'" levelSurface="dungeonSurface/5" r_totalXP="dungeonTotalXP*2/10"/>
			<level r_name="'level5'" r_template="{'incrementalLayout', 'advUpstairInterface', 'finalLevelTemplate', 'dungeonAdvancedGraphics', 'dungeonMonsters'}" levelSurface="dungeonSurface*3/10" r_totalXP="dungeonTotalXP*3/10"/>
		</dungeon>
		<dungeon r_name="'lavaPit'" r_template="'commonTemplate'"
						 levelCount="1"
						 canFleeDungeon="0"
						 victoryCondition="'Boss'">
			<level r_name="'level1'" r_template="{'cellularLayout','lavaPitPortalInterface','lavacaveAdvancedGraphics'}" levelSurface="50" r_totalXP="0">
				<feature r_name="'demon'" r_template="'mainFeatureTemplate'" r_tile="'monsterTile'" r_shape="'farStart1'" monsterName="'DemonGod'"/>
			</level>
		</dungeon>
	</dungeons>
</data>