<data>
	<powers>
	<!-- PRIEST -->
		<power r_name="'DivineBlessing'" r_template="'mainPowerTemplate'"
					 r_displayName="text.powerNameDivineBlessing"
					 r_graphic="'DivineBlessing.png'"
					 DivineAvatar="0"
					 powerBonus="DivineAvatar?10:ceil(packages.Priest.classLevel/2)"
					 powerTooltip="text.powerTooltipDivineBlessing">
			<modifier r_name="'Strength'" r_template="'mainPowerModifier'" r_modifierTarget="'Strength'" r_modifiedValue="$0+powerBonus"/>
			<modifier r_name="'Dexterity'" r_template="'mainPowerModifier'" r_modifierTarget="'Dexterity'" r_modifiedValue="$0+powerBonus"/>
			<modifier r_name="'Intelligence'" r_template="'mainPowerModifier'" r_modifierTarget="'Intelligence'" r_modifiedValue="$0+powerBonus"/>
		</power>
		<power r_name="'HolyAffinity'" r_template="'mainPowerTemplate'"
					 r_displayName="text.powerNameHolyAffinity"
					 r_graphic="'HolyAffinity.png'"
					 powerTooltip="text.powerTooltipHolyAffinity">
			<modifier r_name="'HolyAffinity'" r_template="'mainPowerModifier'" r_modifierTarget="'Holy'" r_modifiedValue="$0+1"/>
		</power>		
		<power r_name="'CurePoison'" r_template="{'activePowerTemplate','spellTemplate'}"
					 powerEffectTemplate="{'mainSelfEffectTemplate','controllerEffect'}"
					 r_displayName="text.powerNameCurePoison"
					 r_graphic="'CurePoison.png'"
					 powerRange="0"
					 powerFatigueCost="5"
					 powerTooltip="text.powerTooltipCurePoison"
					 added="1">
			<action r_name="'use'">
				<effect r_name="'mainEffect'"
								r_className="'CctlEffectRemoveDurable'"
								r_condition="contains(targetEffect.effectTags,'poison')"/>
				<effect r_name="'log'" r_template="'logPower'" r_enabled="costPaid"/>
			</action>
		</power>
		<power r_name="'Mesmerize'" r_template="{'mainMentalDebuffPowerTemplate','enchantmentMentalSpellTemplate'}"
		 			 r_displayName="text.powerNameMesmerize"
					 r_graphic="'Mesmerize.png'"
					 powerHitEffectTemplate="'mesmerizeEffect'"
					 basePowerHitBonus="1.5*packages.Priest.classLevel"
					 powerRange="7"
					 powerFatigueCost="5"
					 powerDuration="1000"
					 powerRecastRule="'fail'"
					 powerTooltip="text.powerTooltipMesmerize"
					 added="1"/>
		<power r_name="'DeathAffinity'" r_template="'mainPowerTemplate'"
					 r_displayName="text.powerNameDeathAffinity"
					 r_graphic="'DeathAffinity.png'"
					 powerTooltip="text.powerTooltipDeathAffinity">
			<modifier r_name="'DeathAffinity'" r_template="'mainPowerModifier'" r_modifierTarget="'Death'" r_modifiedValue="$0+1"/>
		</power>		
		<power r_name="'GreaterHealing'" r_template="'HealTemplate'"
					 r_displayName="text.powerNameGreaterHealing"
					 r_graphic="'GreaterHealing.png'"
					 powerHealBonus="20+4*Transmutation+10*Holy"
					 powerRange="0"
					 powerFatigueCost="20"
					 powerExhaustionCost="2"
					 powerTooltip="text.powerTooltipGreaterHealing"
					 actionLogMethod="'logPowerWithHeal'">
			<action r_name="'use'">
				<effect r_name="'mainEffect'"
								r_enabled="costPaid"
								healBonus="powerHealBonus"/>
			</action>
		</power>
		<power r_name="'DivineShield'" r_template="'mainPowerTemplate'"
		 			 r_displayName="text.powerNameDivineShield"
					 r_graphic="'DivineShield.png'"
					 powerTooltip="text.powerTooltipDivineShield">
			<modifier r_name="'customDamageAbsorption'" r_template="'mainPowerModifier'" r_modifierTarget="'customDamageAbsorption'" r_modifiedValue="$0+packages.Priest.classLevel/2"/>
		</power>
		<power r_name="'DivineIntervention'" r_template="'mainPowerTemplate'"
					 r_displayName="text.powerNameDivineIntervention"
					 r_graphic="'DivineIntervention.png'"
					 powerTooltip="text.powerTooltipDivineIntervention"
					 DivineInterventionActive="w_learned">
			<modifier r_name="'destructionOnDying'" r_template="'mainModifierTemplate'" r_enabled="DivineInterventionActive" r_modifierTarget="'destructionOnDying'" r_modifiedValue="0"/>
			<event r_name="'resurrection'" r_template="'mainEventTemplate'" r_eventTarget="'isDead'" r_targetType="'attribute'">
				<effect r_name="'resurrection'" r_template="{'mainSelfEffectTemplate','multiEffect'}" r_enabled="DivineInterventionActive&&isDead">
					<effect r_name="'gameOver'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="all({DivineInterventionActive=0,isDead=0,fatigue=exhaustion,hitPoints=maxHitPoints})"/>
					<effect r_name="'log'" r_template="'logResurrection'"/>
				</effect>
			</event>
		</power>
		<power r_name="'PowerOfLifeAndDeath'" r_template="'mainPowerTemplate'"
		 			 r_displayName="text.powerNamePowerOfLifeAndDeath"
					 r_graphic="'PowerOfLifeAndDeath.png'"
				 	 powerTooltip="text.powerTooltipPowerOfLifeAndDeath">
			<modifier r_name="'HolyAffinity'" r_template="'mainPowerModifier'" r_modifierTarget="'Holy'" r_modifiedValue="$0+1"/>
			<modifier r_name="'DeathAffinity'" r_template="'mainPowerModifier'" r_modifierTarget="'Death'" r_modifiedValue="$0+1"/>
		</power>
		<power r_name="'DivineAvatar'" r_template="'mainPowerTemplate'"
		 			 r_displayName="text.powerNameDivineAvatar"
					 r_graphic="'DivineAvatar.png'"
					 powerTooltip="text.powerTooltipDivineAvatar">
			<modifier r_name="'DivineAvatar'" r_template="'mainPowerModifier'" r_modifierTarget="'powers.DivineBlessing.DivineAvatar'" r_modifiedValue="1"/>
			<modifier r_name="'animatedWings'" r_template="'mainPowerModifier'" r_modifierTarget="'animatedWings'" r_modifiedValue="'w'"/>
			<modifier r_name="'isFlying'" r_template="'mainPowerModifier'" r_modifierTarget="'isFlying'" r_modifiedValue="($0==0)?1:(($0==1)?2:$0)"/>
		</power>

	<!-- NECROMANCER -->
		<power r_name="'UndeadLord'" r_template="'mainPowerTemplate'"
		 			 r_displayName="text.powerNameUndeadLord"
					 r_graphic="'UndeadLord.png'"
					 powerTooltip="text.powerTooltipUndeadLord">
			<modifier r_name="'undeadSummonArmor'" r_template="'mainPowerModifier'" r_modifierTarget="'undeadSummonArmor'" r_modifiedValue="ceil(packages.Necromancer.classLevel*3/5)"/>
			<modifier r_name="'undeadSummonMaxHitPoints'" r_template="'mainPowerModifier'" r_modifierTarget="'undeadSummonMaxHitPoints'" r_modifiedValue="1+packages.Necromancer.classLevel*0.08"/>
		</power>
		<power r_name="'UndeadFamiliar'" r_template="'mainPowerTemplate'"
		 			 r_displayName="text.powerNameUndeadFamiliar"
					 r_graphic="'DeathFamiliar.png'"
					 powerTooltip="text.powerTooltipUndeadFamiliar">
			<modifier r_name="'undeadFamiliar'" r_template="'mainPowerModifier'" r_modifierTarget="'powers.SummonFamiliar.undeadFamiliar'" r_modifiedValue="1"/>
		</power>
		<power r_name="'DrainLife'" r_template="{'mainPowerPhysicalAttackDamage','transmutationSpellTemplate'}"
					 r_displayName="text.powerNameDrainLife"
					 r_graphic="'DrainLife.png'"
					 powerTooltip="text.powerTooltipDrainLife"
					 basePowerDamage="5+2*Transmutation+3*Death"
					 powerRange="4"
					 powerFatigueCost="10"
					 actionLogMethod="'logDrainLifeAttack'"
					 added="1">
			<action r_name="'use'">
				<modifier r_name="'livingTarget'" r_template="'mainModifierTemplate'" r_modifierTarget="'r_canTarget'" r_modifiedValue="$0&&contains(target.encounterTags,'living')"/>
				<effect r_name="'mainEffect'">
					<effect r_name="'hitEffect'"
									resultingHeal="floor(resultingDamage*0.5)">
						<effect r_name="'heal'" r_template="'basicHealActor'" healAmount="resultingHeal"/>
						<event r_name="'resultingDamage'" r_template="'mainEventTemplate'" r_eventTarget="'resultingDamage'" r_targetType="'attribute'">
							<effect r_name="'capDamage'" r_template="{'mainTargetEffectTemplate','evaluationEffect'}" r_enabled="w_oldValue!=w_newValue" r_effect="resultingDamage=min(resultingDamage,target.hitPoints)"/>
						</event>
					</effect>
				</effect>
			</action>
		</power>
		<power r_name="'Reanimator'" r_template="'mainPowerTemplate'"
		 			 r_displayName="text.powerNameReanimator"
					 r_graphic="'Reanimator.png'"
					 powerTooltip="text.powerTooltipReanimator">
			<event r_name="'xpGain'" r_template="'mainEventTemplate'" r_enabled="w_learned" r_eventTarget="'Experience'" r_targetType="'attribute'">
				<effect r_name="'reanimate'" r_template="{'mainSelfEffectTemplate','controllerEffect'}"
								r_enabled="exists(target)&&target.isDead&&exists(targetSquare)&&contains(target.encounterTags,'living')"
								r_className="'CctlEffectLaunchAction'"
								r_newActor="'self'"
								r_newTarget="'targetSquare'"
								r_newActionType="'power'"
								r_newActionName="'RaiseSkeleton'"
								r_delayRequest="1"
								r_params="{{'isFree',1},{'recastCount',0}}"/>
			</event>
		</power>
		<power r_name="'SoulReaper'" r_template="'mainPowerTemplate'"
		 			 r_displayName="text.powerNameSoulReaper"
					 r_graphic="'SoulReaper.png'"
					 powerTooltip="text.powerTooltipSoulReaper">
			<event r_name="'xpGain'" r_template="'mainEventTemplate'" r_enabled="w_learned" r_eventTarget="'Experience'" r_targetType="'attribute'">
				<effect r_name="'soulReaping'" r_template="{'mainSelfEffectTemplate','multiEffect'}"
								r_enabled="exists(target)&&target.isDead&&contains(target.encounterTags,'living')"
								resultingHeal="0"
								resultingRestore="0">
					<effect r_name="'roll'" r_template="'evaluationEffect'" r_effect="all({resultingHeal=2D5-1,resultingRestore=2D3-1})"/>
			 		<effect r_name="'heal'" r_template="'basicHealSelf'" healAmount="resultingHeal"/>
			 		<effect r_name="'restore'" r_template="'basicRestoreSelf'" fatigueAmount="resultingRestore"/>
				</effect>
			</event>
		</power>

	<!-- ORACLE -->
		<power r_name="'MindPerfection'" r_template="'mainPowerTemplate'"
		 			 r_displayName="text.powerNameMindPerfection"
		 			 r_effectName="text.effectNameMindPerfection"
					 r_graphic="'MindPerfection.png'"
					 powerRestorationValue="floor(0.5+packages.Oracle.classLevel/2)"
					 powerTooltip="text.powerTooltipMindPerfection">
			<modifier r_name="'mentalResistance'" r_template="'mainPowerModifier'" r_modifierTarget="'MentalResistance'" r_modifiedValue="$0+packages.Oracle.classLevel"/>
			<event r_name="'restorationEventOnLearned'" r_template="'mainEventTemplate'" r_eventTarget="'w_learned'" r_targetType="'attribute'">
				<effect r_name="'restorationEffect'" r_template="'restorationEffect'" restorationValue="powerRestorationValue" maxRegenValue="exhaustion*0.5"/>
			</event>
			<event r_name="'restorationEventOnDungeon'" r_template="'mainEventTemplate'" r_enabled="exists(world.currentDungeon)" r_eventTarget="'world.currentDungeon.w_dungeonLoaded'" r_targetType="'attribute'">
				<effect r_name="'restorationEffect'" r_template="'restorationEffect'" restorationValue="powerRestorationValue" maxRegenValue="exhaustion*0.5"/>
			</event>
			<event r_name="'currentDungeonUpdate'" r_template="'mainEventTemplate'" r_eventTarget="'world.currentDungeon'" r_targetType="'evaluator'">
				<effect r_name="'eventRefresh'" r_template="{'mainSelfEffectTemplate','utilityEffect'}" r_className="'CutiEffectRefreshHierarchy'" r_refreshTarget="'MindPerfection'"/>
			</event>
		</power>
		<power r_name="'HolyWave'" r_template="{'activePowerTemplate','powerAttackDamageValueInterface','evocationSpellTemplate'}"
					 powerEffectTemplate="{'mainSquareEffectTemplate','controllerEffect'}"
					 powerHitEffectTemplate="'powerPhysicalDamageEffect'"
		 			 r_displayName="text.powerNameHolyWave"
					 r_graphic="'HolyWave.png'"
					 powerTooltip="text.powerTooltipHolyWave"
					 powerDefenseName="text.defensePhysicalResistance"
					 basePowerHitBonus="5+Holy"
					 basePowerDamage="5+3*Holy"
					 powerRange="0"
					 powerFatigueCost="10"
					 powerExhaustionCost="1"
					 added="1">
			<action r_name="'use'">
				<effect r_name="'mainEffect'"
								r_className="'CctlEffectLaunchAreaEffect'"
								r_area="{'circle',targetSquare.w_xCoord,targetSquare.w_yCoord,0,7}"
								r_areaTargetingType="'direct'">
					<effect r_name="'damageEffect'" r_template="'powerPhysicalAttackEffect'"
									r_enabled="exists(target)&&contains(target.encounterTags,'unholy')"/>
					<effect r_name="'healEffect'" r_template="'standardHealTemplate'"
									r_enabled="exists(target)&&!contains(target.encounterTags,'unholy')"
									actionLogMethod="'logPowerWithHeal'"
									healBonus="powerDamage"/>
					<effect r_name="'zoneEffectGraphic'" r_template="'zoneEffectGraphicTemplate'"
									zoneEffectGraphic="'holyAreaEffect'"
									delay="2*actor.square.distanceTo(targetSquare)"/>
				</effect>
			</action>
		</power>
		<power r_name="'BodyPerfection'" r_template="'mainPowerTemplate'"
		 			 r_displayName="text.powerNameBodyPerfection"
		 			 r_effectName="text.effectNameBodyPerfection"
					 r_graphic="'BodyPerfection.png'"
					 powerRegenerationValue="floor(0.5+packages.Oracle.classLevel/2)"
					 PhysicalResistanceValue="packages.Oracle.classLevel"
					 powerTooltip="text.powerTooltipBodyPerfection"
					 maximumRegeneration="maxHitPoints*0.5">
			<modifier r_name="'physicalResistance'" r_template="'mainPowerModifier'" r_modifierTarget="'PhysicalResistance'" r_modifiedValue="$0+PhysicalResistanceValue"/>
			<event r_name="'regenerationEventOnLearned'" r_template="'mainEventTemplate'" r_eventTarget="'w_learned'" r_targetType="'attribute'">
				<effect r_name="'regenerationEffect'" r_template="'regenerationEffect'" r_enabled="w_isInDungeon" regenerationValue="powerRegenerationValue" maxRegenValue="maximumRegeneration"/>
			</event>
			<event r_name="'regenerationEventOnDungeon'" r_template="'mainEventTemplate'" r_eventTarget="'w_isInDungeon'" r_targetType="'attribute'">
				<effect r_name="'regenerationEffect'" r_template="'regenerationEffect'" r_enabled="w_isInDungeon" regenerationValue="powerRegenerationValue" maxRegenValue="maximumRegeneration"/>
			</event>
		</power>
		<power r_name="'MysticBackfire'" r_template="'mainPowerTemplate'"
		 			 r_displayName="text.powerNameMysticBackfire"
					 r_graphic="'MysticBackfire.png'"
					 powerTooltip="text.powerTooltipMysticBackfire">
			<event r_name="'damaged'" r_template="'mainEventTemplate'" r_eventTarget="'hitPoints'" r_targetType="'attribute'">
				<effect r_name="'MysticBackfire'" r_template="{'mainTargetEffectTemplate','controllerEffect'}"
								r_enabled="exists(actor)&&!actor.isDead&&exists(target)&&(target!=actor)&&(target==self)&&actor.isActor&&(w_oldValue>w_newValue)"
								r_className="'CctlEffectLaunchAction'"
								r_newActor="'target'"
								r_newTarget="'actor'"
								r_newActionType="'power'"
								r_newActionName="'MysticBackfirePower'"
								r_delayRequest="0"
								r_params="{{'isFree',1}}"/>
			</event>
		</power>
		<power r_name="'MysticBackfirePower'" r_template="{'mainPowerMentalAttackDamage','evocationSpellTemplate'}"
					 r_displayName="text.powerNameMysticBackfire"
					 basePowerHitBonus="0"
					 basePowerDamage="0"
					 powerRange="7"
					 powerFatigueCost="0"
					 added="1">
			<action r_name="'use'"
							r_targetingType="'direct'"
							autoAddToActionList="0"
							canBeInActionList="0" />
		</power>
		<power r_name="'Sanctuary'" r_template="'mainBuffPowerTemplate'"
		 			 r_displayName="text.powerNameSanctuary"
		 			 r_effectName="text.effectNameSanctuary"
					 r_graphic="'Sanctuary.png'"
					 powerDuration="300"
					 powerFatigueCost="30"
					 powerTooltip="text.powerTooltipSanctuary">
			<action r_name="'use'">
				<effect r_name="'mainEffect'">
					<modifier r_name="'Absorption'" r_template="'mainEffectModifier'" r_modifierTarget="'target.customDamageAbsorption'" r_modifiedValue="$0+50"/>
				</effect>
			</action>
		</power>
	</powers>
</data>