<data>
	<actors>
		<!-- isFlying: -1:cannot fly, 0:standard(no fly, but possible with spell), 1:flying, 2:improved speed flying -->
		<!-- move mask check are bitwise AND comparison with square's r_moveMask. Must be 0 to be OK. 1:character, 2+:custom use (1Quest : 2:wall/door, 4:water) -->
		<actorTemplate	r_name="'mainActorTemplate'"
										w_loaded="0"
										w_levelIndex="0"
										w_xCoord="0"
										w_yCoord="0"
										actorName="r_name"
										r_xpValue="0"								
										r_graphic="''"
										isAnimated="0"
										
										destructionOnDying="1"
										isDead="0"
										maxHitPoints="100+10*Constitution"
										hitPoints="hitPoints=maxHitPoints"
										fatigue="fatigue=exhaustion"
										exhaustion="exhaustion=maxExhaustion"
										maxExhaustion="100"
										r_viewRange="7"
										
										rw_currentTime="-1"
										actionTimeCostMultiplier="1"
										moveTimeCostMultiplier="1"
										canMove="1"
										r_moveCost="targetSquare.moveCost*moveTimeCostMultiplier"
										r_movePlannerCost="targetSquare.movePlannerCost*moveTimeCostMultiplier"
										openCost="100"
										knownTrapMoveCost="5"
										isFlying="0"
										r_moveMask="(isFlying>0)?3:7"
										r_visible="1"
										w_isInDungeon="0"

										Strength="0"
										Dexterity="0"
										Intelligence="0"
										Constitution="0"
										StrengthBonus="0"
										DexterityBonus="0"
										IntelligenceBonus="0"
										ConstitutionBonus="0"
										
										CloseCombat="0"
										Axe="0"
										Dagger="0"
										Mace="0"
										Polearm="0"
										Staff="0"
										Sword="0"

										RangedCombat="0"
										Bow="0"
										Crossbow="0"
										Throw="0"

										Dodge="0"
										Resistance="0"
										Shield="0"
										ArmorSkill="0"

										Magic="0"
										Conjuration="0"
										Evocation="0"
										Transmutation="0"
										Enchantment="0"
										
										Air="0"
										Death="0"
										Earth="0"
										Fire="0"
										Holy="0"
										Water="0"

										AirBonus="0"
										DeathBonus="0"
										EarthBonus="0"
										FireBonus="0"
										HolyBonus="0"
										WaterBonus="0"
										
										ItemTotalResistance="0"
										ItemTotalDefense="0"
										ItemTotalArmor="0"
										ItemTotalPenalty="0"
										ItemPenalty="ItemTotalPenalty"
										NaturalArmor="0"
										Defense="ItemTotalDefense+(exists(armor)?(Dodge*armor.dodgeBonusReduction+Dexterity*0.5*armor.dexBonusReduction):(Dodge+Dexterity*0.5))-ItemPenalty"
										closeCombatDefense="Defense+customCloseCombatDefenseBonus"
										rangedDefense="Defense+customRangedDefenseBonus"
										spellDefense="Defense+customRangedDefenseBonus"
										Armor="ItemTotalArmor+NaturalArmor"
										MentalResistance="ItemTotalResistance+Resistance+Intelligence/2"
										PhysicalResistance="ItemTotalResistance+Resistance+Constitution/2"
										suffersCritical="1"
										customDamageAbsorption="0"
										attackDamageAbsorption="customDamageAbsorption"
										physicalDamageAbsorption="customDamageAbsorption"
										mentalDamageAbsorption="customDamageAbsorption"
										
										customCloseCombatHitBonus="0"
										customRangedHitBonus="0"
										customCloseCombatDefenseBonus="0"
										customRangedDefenseBonus="0"
										customCloseCombatDamageBonus="0"
										customRangedDamageBonus="0"
										customCloseCombatPiercingBonus="0"
										customRangedPiercingBonus="0"
										
										dazed="0"
										rooted="0"
										slowed="0"
										stuned="0"
										silenced="0"

										dualWieldOffhandCostModifier="0.5"
										spellCostModifier="0"
										selfSpellSustainModifier="1"
										enchantSpellDurationModifier="1"
										undeadEnchantment="0"
										blastRangeModifier="0"
										missileRebound="0"
										conjurationSpellDurationModifier="1"
										summonSpellMaxHitPointModifier="1"
										summonSpellLevelBonus="0"
										summonSpellHitModifier="0"
										summonSpellDefenseModifier="0"
										summonSpellDamageModifier="0"
										summonSpellArmorModifier="0"
										undeadSummonMaxHitPoints="1"
										undeadSummonArmor="0"
										familiarShareLife="0"
										slashAndBlast="0"
										fireMarkPower="0">
			<!-- Powers -->
			<power r_template="'doNothing'"/>
			<power r_template="'endTurn'"/>
			<power r_template="'standardCloseCombat'"/>
			<power r_template="'standardRangedCombat'"/>
			<!-- Life and Fatigue events -->
			<event r_name="'destruction'" r_template="'mainEventTemplate'" r_eventTarget="'isDead'" r_targetType="'attribute'">
				<effect r_name="'destruction'" r_template="{'mainSelfEffectTemplate','multiEffect'}" r_enabled="isDead&&destructionOnDying">
					<effect r_name="'launchSound'" r_template="{'mainSelfEffectTemplate','controllerEffect'}" r_className="'CctlEffectSound'" r_soundName="'dead.mp3'" r_recastTimer="0.3"/>
					<effect r_name="'removeDurables'" r_template="{'mainSelfEffectTemplate','controllerEffect'}" r_className="'CctlEffectRemoveDurable'" r_condition="1"/>
					<effect r_name="'remove'" r_template="{'mainSelfEffectTemplate','controllerEffect'}" r_className="'CctlEffectDestructor'" r_loot="lootStuff"/>
					<effect r_name="'log'" r_template="'logDeath'"/>
					<effect r_name="'experience'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="heroes.@0.Experience+=r_xpValue"/>
				</effect>
			</event>
			<event r_name="'onMaxHitPoints'" r_template="'mainEventTemplate'" r_eventTarget="'maxHitPoints'" r_targetType="'attribute'">
				<effect r_name="'fullHPeffect'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(hitPoints>maxHitPoints)" r_effect="hitPoints:=maxHitPoints"/>
			</event>
			<event r_name="'onHitPoints'" r_template="'mainEventTemplate'" r_eventTarget="'hitPoints'" r_targetType="'attribute'">
				<effect r_name="'fullHPeffect'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="hitPoints>maxHitPoints" r_effect="hitPoints:=maxHitPoints"/>
				<effect r_name="'dead'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="!isDead&&(0>=hitPoints)" r_effect="isDead=1"/>
			</event>
			<event r_name="'onConstitution'" r_template="'mainEventTemplate'" r_eventTarget="'Constitution'" r_targetType="'attribute'">
				<effect r_name="'full'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="hitPoints>maxHitPoints" r_effect="hitPoints:=maxHitPoints"/>
			</event>			
			<event r_name="'onFatigue'" r_template="'mainEventTemplate'" r_eventTarget="'fatigue'" r_targetType="'attribute'">
				<effect r_name="'fullFatigueEffect'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="fatigue>exhaustion" r_effect="fatigue:=max(0,exhaustion)"/>
				<effect r_name="'emptyFatigueEffect'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="0>fatigue" r_effect="fatigue:=0"/>
			</event>
			<event r_name="'onExhaustion'" r_template="'mainEventTemplate'" r_eventTarget="'exhaustion'" r_targetType="'attribute'">
				<effect r_name="'fullExhaustionEffect'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="baseValue(exhaustion)>maxExhaustion" r_effect="exhaustion:=maxExhaustion"/>
				<effect r_name="'emptyExhaustionEffect'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="10>baseValue(exhaustion)" r_effect="exhaustion:=10"/>
				<effect r_name="'fatigueOverExhaustionEffect'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(w_oldValue>=w_newValue)&&(fatigue>exhaustion)" r_effect="fatigue:=max(0,exhaustion)"/>
			</event>
			<event r_name="'onMaxExhaustion'" r_template="'mainEventTemplate'" r_eventTarget="'maxExhaustion'" r_targetType="'attribute'">
				<effect r_name="'fullMaxExhaustionEffect'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(w_oldValue>w_newValue)&&(baseValue(exhaustion)>maxExhaustion)" r_effect="exhaustion:=maxExhaustion"/>
			</event>
			<!-- Other events -->
			<event r_name="'onViewRange'" r_template="'mainEventTemplate'" r_eventTarget="'r_viewRange'" r_targetType="'attribute'">
				<effect r_name="'visionUpdate'" r_template="'mainSelfEffectTemplate'" r_type="'Visibility'"/>
			</event>
			<event r_name="'onIsFlying'" r_template="'mainEventTemplate'" r_eventTarget="'isFlying'" r_targetType="'attribute'">
				<effect r_name="'dead'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="1>isFlying&&square.isWater" r_effect="isDead=1"/>
				<effect r_name="'eventRefresh'" r_template="{'mainSelfEffectTemplate','utilityEffect'}" r_className="'CutiEffectRefreshHierarchy'" r_refreshTarget="'onIsFlying'"/>
				<modifier r_name="'moveCost'" r_template="'mainModifierTemplate'" r_enabled="isFlying==2" r_modifierTarget="'moveTimeCostMultiplier'" r_modifiedValue="$0*0.8"/>
			</event>
			<event r_name="'onCanMove'" r_template="'mainEventTemplate'" r_eventTarget="'canMove'" r_targetType="'attribute'">
				<effect r_name="'eventRefresh'" r_template="{'mainSelfEffectTemplate','utilityEffect'}" r_className="'CutiEffectRefreshHierarchy'" r_refreshTarget="'onCanMove'"/>
				<modifier r_name="'moveCost'" r_template="'mainModifierTemplate'" r_enabled="!canMove" r_modifierTarget="'r_moveCost'" r_modifiedValue="-1"/>
				<modifier r_name="'movePlannerCost'" r_template="'mainModifierTemplate'" r_enabled="!canMove" r_modifierTarget="'r_movePlannerCost'" r_modifiedValue="-1"/>
			</event>
		</actorTemplate>
		
		<!-- faction : {hero (&summon), monster, neutral hero's ally(merchant,princess), neutral monster's ally(not used), neutral no ally(activable)} -->
		<actor	r_name="'Hero'" r_template="'mainActorTemplate'"
						r_displayName="gameParameters.characterName"
						r_visible="1"
						r_graphic="w_animation+animatedRace+animatedSex+animatedBody+animatedHead+animatedFace+animatedSide+animatedWeapon+animatedOffWeapon+animatedRanged+animatedOffWeaponIsShield+animatedCloak+animatedWings"
						animatedRace="''"
						animatedSex="''"
						animatedBody="'1'"
						animatedHead="exists(head)?animatedBody:'1'"
						animatedFace="'face'"
						animatedSide="'R'"
						animatedWeapon="exists(mainhand)?(mainhand.equippedGraphic):''"
						animatedOffWeapon="exists(offhand)?(offhand.equippedGraphic):''"
						animatedRanged="exists(ranged)?(ranged.equippedGraphic):''"
						animatedOffWeaponIsShield="(exists(offhand)&&exists(offhand.shieldPrerequisite))?'b':'_'"
						animatedCloak="exists(back)?(back.equippedGraphic):'_'"
						animatedWings="'_'"
						w_animation="'stand'"
						w_lastMoveOrientation=""
						w_lastActionOrientation=""
						isAnimated="1"
						
						knownTrapMoveCost="15"
						w_autoExplore="0"
						w_autoAttack="0"
						r_faction="0"
						r_hostileFaction="{0,1,0,0,0}"
						r_allyFaction="{1,0,1,0,0}"
						isActor="1"
						r_behavior="'behaviorHero'"
						encounterTags="{'living'}"
						immunities="{}"
						r_autoAttacks="{'standardCloseCombat','standardRangedCombat',''}"
						character="self"
						totalClassLevel="0"
						w_cannotAct=""
						lootStuff="0"
						
						ClassAutoPex="''"
						ClassSkillAutoPex="''"
						StrengthAutoPex="0"
						DexterityAutoPex="0"
						IntelligenceAutoPex="0"
						ConstitutionAutoPex="0"
						CloseCombatAutoPex="0"
						AxeAutoPex="0"
						DaggerAutoPex="0"
						MaceAutoPex="0"
						PolearmAutoPex="0"
						StaffAutoPex="0"
						SwordAutoPex="0"
						RangedCombatAutoPex="0"
						BowAutoPex="0"
						CrossbowAutoPex="0"
						ThrowAutoPex="0"
						DodgeAutoPex="0"
						ResistanceAutoPex="0"
						ShieldAutoPex="0"
						ArmorSkillAutoPex="0"
						MagicAutoPex="0"
						ConjurationAutoPex="0"
						EvocationAutoPex="0"
						TransmutationAutoPex="0"
						EnchantmentAutoPex="0"

						Experience="0"
						ArcanePoint="0"
						
						sortInventory="0">
			<eventTemplate r_name="'onEquipTemplate'" r_template="'mainEventTemplate'" r_eventTarget="''" r_targetType="'evaluator'">
				<effect r_name="'refresh'" r_template="'mainGraphicEffectTemplate'" r_enabled="exists(world)&&exists(world.currentDungeon)" r_type="'LocalRefresh'"/>
			</eventTemplate>
			<event r_name="'head'" r_template="'onEquipTemplate'" r_eventTarget="'head'"/>
			<event r_name="'armor'" r_template="'onEquipTemplate'" r_eventTarget="'armor'"/>
			<event r_name="'back'" r_template="'onEquipTemplate'" r_eventTarget="'back'"/>
			<event r_name="'mainhand'" r_template="'onEquipTemplate'" r_eventTarget="'mainhand'"/>
			<event r_name="'offhand'" r_template="'onEquipTemplate'" r_eventTarget="'offhand'"/>
			<event r_name="'onRaceTemplate'" r_template="'mainEventTemplate'" r_eventTarget="'animatedRace'" r_targetType="'attribute'">
				<effect r_name="'refresh'" r_template="'mainGraphicEffectTemplate'" r_enabled="exists(world)&&exists(world.currentDungeon)" r_type="'LocalRefresh'"/>
			</event>
			<event r_name="'destruction'">
				<effect r_name="'destruction'">
					<effect r_name="'deathAnimation'" r_template="{'mainSelfEffectTemplate','multiEffect'}" r_enabled="!globalParameters.r_nexus10Mode">
						<effect r_name="'hideHero'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="all({r_visible=0,w_animation='stand'})"/>
						<effect r_name="'camera'" r_template="'mainGraphicEffectTemplate'" r_type="'CenterCamera'"/>
						<effect r_name="'fadingBlackScreen'" r_template="{'mainGraphicEffectTemplate','controllerEffect'}" r_className="'CctlEffectCreateGraphicObject'" r_simpleObject="'fadingBlackScreen'" r_delay="10" r_duration="130" r_xStart="0" r_yStart="0" r_xEnd="0" r_yEnd="0" r_levelIndex="-1" r_scaleX="1" r_scaleY="1" r_speed="0"/>
						<effect r_name="'fakeHero'" r_template="{'mainGraphicEffectTemplate','controllerEffect'}" r_className="'CctlEffectCreateGraphicObject'" r_simpleObject="r_graphic" r_delay="0" r_duration="40" r_xStart="(globalParameters.w_stageWidth-32*globalParameters.rw_zoomDungeon)/2" r_yStart="(globalParameters.w_stageHeight-32*globalParameters.rw_zoomDungeon)/2" r_xEnd="(globalParameters.w_stageWidth-32*globalParameters.rw_zoomDungeon)/2" r_yEnd="(globalParameters.w_stageHeight-32*globalParameters.rw_zoomDungeon)/2" r_scaleX="globalParameters.rw_zoomDungeon" r_scaleY="globalParameters.rw_zoomDungeon" r_levelIndex="-1" r_speed="0"/>
						<effect r_name="'deathAnimation'" r_template="{'mainGraphicEffectTemplate','controllerEffect'}" r_className="'CctlEffectCreateGraphicObject'" r_simpleObject="'death'+animatedSide" r_delay="40" r_duration="100" r_xStart="(globalParameters.w_stageWidth-32*globalParameters.rw_zoomDungeon)/2" r_yStart="(globalParameters.w_stageHeight-32*globalParameters.rw_zoomDungeon)/2" r_xEnd="(globalParameters.w_stageWidth-32*globalParameters.rw_zoomDungeon)/2" r_yEnd="(globalParameters.w_stageHeight-32*globalParameters.rw_zoomDungeon)/2" r_scaleX="globalParameters.rw_zoomDungeon" r_scaleY="globalParameters.rw_zoomDungeon" r_levelIndex="-1" r_speed="0"/>
						<effect r_name="'freeze'" r_template="'mainGraphicEffectTemplate'" r_type="'Freeze'" r_freezeDelay="130"/>
						<effect r_name="'refresh'" r_template="'mainGraphicEffectTemplate'" r_type="'LocalRefresh'"/>
					</effect>
				</effect>
			</event>
			<event r_name="'onLoading'" r_template="'mainEventTemplate'" r_eventTarget="'w_loaded'" r_targetType="'attribute'">
				<effect r_name="'destruction'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="isDead" r_effect="isDead=isDead"/>
			</event>
			<event r_name="'onMove'" r_template="'mainEventTemplate'" r_eventTarget="'w_lastMoveOrientation'" r_targetType="'attribute'">
				<effect r_name="'animatedFace'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="animatedFace={animatedFace,'dos','dos','dos',animatedFace,'face','face','face'}[w_lastMoveOrientation]"/>
				<effect r_name="'animatedSide'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="animatedSide={'R','R',animatedSide,'L','L','L',animatedSide,'R'}[w_lastMoveOrientation]"/>
				<effect r_name="'anim'" r_template="'mainGraphicEffectTemplate'" r_enabled="w_animation!='move'" r_type="'LaunchAnimation'" r_animationName="'move'" r_freezeDelay="0"/>
			</event>
			<event r_name="'onAction'" r_template="'mainEventTemplate'" r_eventTarget="'w_lastActionOrientation'" r_targetType="'attribute'">
				<effect r_name="'animatedFace'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="animatedFace={animatedFace,'dos','dos','dos',animatedFace,'face','face','face'}[w_lastActionOrientation]"/>
				<effect r_name="'animatedSide'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="animatedSide={'R','R',animatedSide,'L','L','L',animatedSide,'R'}[w_lastActionOrientation]"/>
			</event>
			<event r_name="'onCannotAct'" r_template="'mainEventTemplate'" r_eventTarget="'w_cannotAct'" r_targetType="'attribute'">
				<effect r_name="'noMove'" r_template="'logCannotMove'" r_enabled="w_cannotAct=='noMove'"/>
				<effect r_name="'noExplore'" r_template="'logCannotNoMoreExplore'" r_enabled="w_cannotAct=='noExplore'"/>
				<effect r_name="'noAction'" r_template="'logCannotPayFatigue'" r_enabled="w_cannotAct=='noAction'"/>
				<effect r_name="'noTarget'" r_template="'logNoVisibleMonster'" r_enabled="w_cannotAct=='noTarget'"/>

				<effect r_name="'cannotActivateTarget'" r_template="'logCannotActivateTarget'" r_enabled="w_cannotAct=='cannotActivateTarget'"/>
				<effect r_name="'cannotMoveToTarget'" r_template="'logCannotMoveToTarget'" r_enabled="(w_cannotAct=='cannotMoveToTarget')&&(!exists(w_objective)||!w_objective.isWall)"/>
				<effect r_name="'cannotUseActionOnTarget'" r_template="'logCannotUseActionOnTarget'" r_enabled="w_cannotAct=='cannotUseActionOnTarget'"/>
				<effect r_name="'cannotAttackTarget'" r_template="'logCannotAttackTarget'" r_enabled="w_cannotAct=='cannotAttackTarget'"/>
				<effect r_name="'cannotAttackNoTarget'" r_template="'logCannotAttackNoTarget'" r_enabled="w_cannotAct=='cannotAttackNoTarget'"/>
				<effect r_name="'cannotGoToUnexplored'" r_template="'logCannotGoToUnexplored'" r_enabled="w_cannotAct=='cannotGoToUnexplored'"/>
				<effect r_name="'cannotUseAction'" r_template="'logCannotUseAction'" r_enabled="w_cannotAct=='cannotUseAction'"/>
				<effect r_name="'cannotExploreNoUnexplore'" r_template="'logCannotExploreNoUnexplore'" r_enabled="w_cannotAct=='cannotExploreNoUnexplore'"/>
				
				<effect r_name="'exploreAgain'" r_template="{'mainSelfEffectTemplate','controllerEffect'}" r_enabled="(w_cannotAct=='cannotExploreNoUnexplore')&&!world.currentDungeon.levels.(attributeByName('@'+w_levelIndex)).exitStairExplorable"	r_className="'CctlEffectUpdateBehavior'" r_newBehavior="'heroRestAndAutoExplore'"/>
				<effect r_name="'makeStairExplorable'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="w_cannotAct=='cannotExploreNoUnexplore'" r_effect="world.currentDungeon.levels.(attributeByName('@'+w_levelIndex)).exitStairExplorable=1"/>
			</event>
			<event r_name="'onAnimationEnded'" r_template="'mainEventTemplate'" r_eventTarget="'w_animation'" r_targetType="'attribute'">
				<effect r_name="'anim'" r_template="'mainGraphicEffectTemplate'" r_enabled="!isDead&&(w_animation=='')" r_type="'LaunchAnimation'" r_animationName="'stand'" r_freezeDelay="0" r_animationDelay="0"/>
			</event>
			<event r_name="'onNextAction'" r_template="'mainEventTemplate'" r_eventTarget="'w_nextAction'" r_targetType="'evaluator'">
				<effect r_name="'cannotExecute'" r_template="{'mainSelfEffectTemplate','multiEffect'}" r_enabled="exists(w_nextAction)&&!w_nextAction.r_canExecute">
					<effect r_name="'cannotPayFatigue'" r_template="'logCannotPayFatigue'" r_enabled="!w_nextAction.canPay"/>
					<effect r_name="'cannotCastWhileSilenced'" r_template="'logCannotCastWhileSilenced'" r_enabled="w_nextAction.canPay&&silenced"/>
					<effect r_name="'clearNextAction'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="w_nextAction=null"/>
				</effect>
			</event>
			<event r_name="'onSortInventory'" r_template="'mainEventTemplate'" r_eventTarget="'sortInventory'" r_targetType="'attribute'">
				<effect r_name="'sortInventory'" r_template="'mainSelfEffectTemplate'" r_type="'SortInventory'" r_startSort="0" r_finishSort="99"/>
			</event>
			<event r_name="'autoPexing'" r_template="'mainEventTemplate'" selectedHero="character" r_eventTarget="'Experience'" r_targetType="'attribute'">
				<effect r_name="'experienceRaised'" r_template="{'mainSelfEffectTemplate','multiEffect'}" r_enabled="w_newValue>w_oldValue">
					<effect r_name="'ClassAutoPex'" r_template="'classRaise'" characterClassName="ClassAutoPex"/>
					
					<effectTemplate r_name="'AttributeAutoPex'" r_template="'attributeRaise'" r_enabled="(autoPexValue>0)&&(Experience*autoPexValue>=raiseCost)" autoPexValue=""/>
					<effect r_name="'StrengthAutoPex'" r_template="'AttributeAutoPex'" autoPexValue="StrengthAutoPex" valueName="'Strength'"/>
					<effect r_name="'DexterityAutoPex'" r_template="'AttributeAutoPex'" autoPexValue="DexterityAutoPex" valueName="'Dexterity'"/>
					<effect r_name="'IntelligenceAutoPex'" r_template="'AttributeAutoPex'" autoPexValue="IntelligenceAutoPex" valueName="'Intelligence'"/>
					<effect r_name="'ConstitutionAutoPex'" r_template="'AttributeAutoPex'" autoPexValue="ConstitutionAutoPex" valueName="'Constitution'"/>
	
					<effectTemplate r_name="'SkillAutoPex'" r_template="'skillRaise'" r_enabled="(autoPexValue>0)&&(Experience*autoPexValue>=raiseCost)" autoPexValue=""/>
					<effect r_name="'CloseCombatAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="CloseCombatAutoPex" valueName="'CloseCombat'"/>
					<effect r_name="'AxeAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="AxeAutoPex" valueName="'Axe'"/>
					<effect r_name="'DaggerAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="DaggerAutoPex" valueName="'Dagger'"/>
					<effect r_name="'MaceAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="MaceAutoPex" valueName="'Mace'"/>
					<effect r_name="'PolearmAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="PolearmAutoPex" valueName="'Polearm'"/>
					<effect r_name="'StaffAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="StaffAutoPex" valueName="'Staff'"/>
					<effect r_name="'SwordAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="SwordAutoPex" valueName="'Sword'"/>
					<effect r_name="'RangedCombatAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="RangedCombatAutoPex" valueName="'RangedCombat'"/>
					<effect r_name="'BowAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="BowAutoPex" valueName="'Bow'"/>
					<effect r_name="'CrossbowAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="CrossbowAutoPex" valueName="'Crossbow'"/>
					<effect r_name="'ThrowAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="ThrowAutoPex" valueName="'Throw'"/>
					<effect r_name="'DodgeAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="DodgeAutoPex" valueName="'Dodge'"/>
					<effect r_name="'ResistanceAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="ResistanceAutoPex" valueName="'Resistance'"/>
					<effect r_name="'ShieldAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="ShieldAutoPex" valueName="'Shield'"/>
					<effect r_name="'ArmorSkillAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="ArmorSkillAutoPex" valueName="'ArmorSkill'"/>
					<effect r_name="'MagicAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="MagicAutoPex" valueName="'Magic'"/>
					<effect r_name="'ConjurationAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="ConjurationAutoPex" valueName="'Conjuration'"/>
					<effect r_name="'EvocationAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="EvocationAutoPex" valueName="'Evocation'"/>
					<effect r_name="'TransmutationAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="TransmutationAutoPex" valueName="'Transmutation'"/>
					<effect r_name="'EnchantmentAutoPex'" r_template="'SkillAutoPex'"	autoPexValue="EnchantmentAutoPex" valueName="'Enchantment'"/>
				</effect>
			</event>
			<event r_name="'classSkillAutoPexing'" r_template="'mainEventTemplate'" selectedHero="character" r_eventTarget="'ClassSkillAutoPex'" r_targetType="'attribute'">
				<effect r_name="'removeAllSkills'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="all({StrengthAutoPex=0,DexterityAutoPex=0,IntelligenceAutoPex=0,ConstitutionAutoPex=0,CloseCombatAutoPex=0,AxeAutoPex=0,DaggerAutoPex=0,MaceAutoPex=0,PolearmAutoPex=0,StaffAutoPex=0,SwordAutoPex=0,RangedCombatAutoPex=0,BowAutoPex=0,CrossbowAutoPex=0,ThrowAutoPex=0,DodgeAutoPex=0,ResistanceAutoPex=0,ShieldAutoPex=0,ArmorSkillAutoPex=0,MagicAutoPex=0,ConjurationAutoPex=0,EvocationAutoPex=0,TransmutationAutoPex=0,EnchantmentAutoPex=0})"/>
				<effect r_name="'setNewPrimarySkills'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="ClassSkillAutoPex!=''" r_effect="all(arraysToArray(attributeByName($0+'AutoPex')=1,packages.(attributeByName(ClassSkillAutoPex)).PrimarySkills))"/>
				<effect r_name="'setNewSecondarySkills'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="ClassSkillAutoPex!=''" r_effect="all(arraysToArray(attributeByName($0+'AutoPex')=0.5,packages.(attributeByName(ClassSkillAutoPex)).SecondarySkills))"/>
 			</event>			
			<event r_name="'rezAndRestore'" r_template="'mainEventTemplate'" r_enabled="exists(world)" r_eventTarget="'world.currentDungeon'" r_targetType="'evaluator'">
				<effect r_name="'rezAndRestore'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="!exists(world.currentDungeon)" r_effect="all({isDead?(exhaustion=maxExhaustion):0,gameParameters.totalTime+=rw_currentTime,isDead=0})"/>
				<effect r_name="'enterDungeon'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="exists(world.currentDungeon)" r_effect="all({hitPoints=maxHitPoints,exhaustion+=((world.isCampaign)?2:1),fatigue=exhaustion,w_animation='stand',r_visible=1})"/>
			</event>
			
			<modifier r_name="'AirBonus'" r_template="'mainModifierTemplate'" r_modifierTarget="'Air'" r_modifiedValue="$0+AirBonus"/>
			<modifier r_name="'DeathBonus'" r_template="'mainModifierTemplate'" r_modifierTarget="'Death'" r_modifiedValue="$0+DeathBonus"/>
			<modifier r_name="'EarthBonus'" r_template="'mainModifierTemplate'" r_modifierTarget="'Earth'" r_modifiedValue="$0+EarthBonus"/>
			<modifier r_name="'FireBonus'" r_template="'mainModifierTemplate'" r_modifierTarget="'Fire'" r_modifiedValue="$0+FireBonus"/>
			<modifier r_name="'HolyBonus'" r_template="'mainModifierTemplate'" r_modifierTarget="'Holy'" r_modifiedValue="$0+HolyBonus"/>
			<modifier r_name="'WaterBonus'" r_template="'mainModifierTemplate'" r_modifierTarget="'Water'" r_modifiedValue="$0+WaterBonus"/>

			<modifier r_name="'StrengthBonus'" r_template="'mainModifierTemplate'" r_modifierTarget="'Strength'" r_modifiedValue="$0+StrengthBonus"/>
			<modifier r_name="'DexterityBonus'" r_template="'mainModifierTemplate'" r_modifierTarget="'Dexterity'" r_modifiedValue="$0+DexterityBonus"/>
			<modifier r_name="'IntelligenceBonus'" r_template="'mainModifierTemplate'" r_modifierTarget="'Intelligence'" r_modifiedValue="$0+IntelligenceBonus"/>
			<modifier r_name="'ConstitutionBonus'" r_template="'mainModifierTemplate'" r_modifierTarget="'Constitution'" r_modifiedValue="$0+ConstitutionBonus"/>
		</actor>
		<actor	r_name="'HeroCheat'" r_template="'Hero'">
			<item r_template="'Robe'"/>
			<item r_template="'TrainingLightArmor'"/>
			<item r_template="'TrainingHeavyArmor'"/>
			<item r_template="'Buckler'"/>
			<item r_template="'Shield'"/>
			<item r_template="'LargeShield'"/>
			<item r_template="'TowerShield'"/>
			<item r_template="'Spear'"/>
			<item r_template="'Dagger'"/>
			<item r_template="'Dagger'"/>
			<item r_template="'Crossbow'"/>
			<item r_template="'Bow'"/>
			<item r_template="'Halberd'"/>
			<item r_template="'GreatAxe'"/>
		</actor>
	</actors>
</data>