<data>
	<powers>
<!-- -->
<!-- TEMPLATE -->
<!-- -->
		<powerTemplate	r_name="'mainPowerTemplate'"
										r_displayName="r_name"
										r_enabled="1"
										powerEnabled="r_enabled"
										r_graphic="''"
										w_learned="0"
										nameTooltip="r_displayName"
										valueTooltip="''"
										powerTooltip="''"
										skillName="''"
										mainSkillName="''"
										tooltip="relocate(text.powerMainTooltip)"/>
		<powerTemplate	r_name="'activePowerTemplate'" r_template="'mainPowerTemplate'"
										powerActionTemplate="'mainActionWithFatigueTemplate'"
										powerEffectTemplate="'ToBeReplaced'"
										powerFatigueCost="0"
										powerExhaustionCost="0"
										nameTooltip="relocate(text.powerMainNameTooltip)"
										powerRange="1"
										valueTooltip="relocate(text.powerMainValueTooltip)">
			<action r_name="'use'" r_template="powerActionTemplate"
							actionEffectTemplate="powerEffectTemplate"
							r_enabled="powerEnabled"
							fatigueCost="powerFatigueCost"
							exhaustionCost="powerExhaustionCost"
							r_range="min(powerRange,r_viewRange)">
			</action>
		</powerTemplate>
		
<!-- -->
<!-- OFFENSIVE -->
<!-- -->
		<!-- All offensive powers use the same formula and values for effects and tooltips -->
		<!-- offensive effect associated with this interface should inherit from powerAttackEffectInterface -->
		<powerTemplate	r_name="'powerAttackValueInterface'"
										powerMissEffectTemplate="'standardMissTemplate'"
										basePowerHitBonus="0"
										powerHitBonus="basePowerHitBonus+((skillName!='')?attributeByName(skillName):0)+((mainSkillName!='')?(attributeByName(mainSkillName)/2):0)-ItemPenalty"
										powerDefenseName="text.defenseNothing"
										valueTooltip="relocate(text.powerAttackValueTooltip)"
										actionLogMethod="'logPower'"
										actionMissLogMethod="'logPowerMissed'"/>

		<!-- simple power that attack and does an effect -->
		<!-- powerEffectTemplate must be a mainAttackEffect child -->
		<powerTemplate	r_name="'mainPowerAttack'" r_template="{'activePowerTemplate','powerAttackValueInterface'}"
										powerEffectTemplate="'ToBeReplaced'"
										powerHitEffectTemplate="'ToBeReplaced'">
			<action r_name="'use'"
							canTargetFaction="(actor.r_hostileFaction)[target.r_faction]"
							missileXStart="actor.w_xCoord"
							missileYStart="actor.w_yCoord">
				<effect r_name="'mainEffect'">
					<effect r_name="'missileGraphic'" r_template="'missileGraphicTemplate'"
									r_xStart="missileXStart"
									r_yStart="missileYStart"/>
				</effect>
			</action>
		</powerTemplate>
		<powerTemplate	r_name="'mainPowerSpellAttack'" r_template="'mainPowerAttack'"
										powerDefenseName="text.defenseSpellDefense"
										powerEffectTemplate="{'mainTargetEffectTemplate','powerSpellAttackEffect'}"/>
		<powerTemplate	r_name="'mainPowerPhysicalAttack'" r_template="'mainPowerAttack'"
										powerDefenseName="text.defensePhysicalResistance"
										powerEffectTemplate="{'mainTargetEffectTemplate','powerPhysicalAttackEffect'}"/>
		<powerTemplate	r_name="'mainPowerMentalAttack'" r_template="'mainPowerAttack'"
										powerDefenseName="text.defenseMentalResistance"
										powerEffectTemplate="{'mainTargetEffectTemplate','powerMentalAttackEffect'}"/>


		<!-- All powers with damages use the same formula and values for effects and tooltips -->
		<!-- offensive effect associated with this interface should inherit from powerDamageEffectInterface -->
		<powerTemplate	r_name="'powerAttackDamageValueInterface'" r_template="'powerAttackValueInterface'"
										basePowerDamage="0"
										attributePowerDamage="Intelligence"
										powerDamage="max(basePowerDamage+attributePowerDamage+((mainSkillName!='')?(attributeByName(mainSkillName)/2):0),0)"
										actionLogMethod="'logPowerWithDamage'"
										valueTooltip="relocate(text.powerAttackDamageValueTooltip)"/>

		<powerTemplate	r_name="'mainPowerSpellAttackDamage'" r_template="{'mainPowerSpellAttack','powerAttackDamageValueInterface'}"
										actionLogMethod="'logStrikePowerWithDamage'"
										powerHitEffectTemplate="'powerStrikeDamageEffect'"/>
		<powerTemplate	r_name="'mainPowerPhysicalAttackDamage'" r_template="{'mainPowerPhysicalAttack','powerAttackDamageValueInterface'}"
										powerHitEffectTemplate="'powerPhysicalDamageEffect'"/>
		<powerTemplate	r_name="'mainPowerMentalAttackDamage'" r_template="{'mainPowerMentalAttack','powerAttackDamageValueInterface'}"
										powerHitEffectTemplate="'powerMentalDamageEffect'"/>

<!-- -->
<!-- BUFF&DEBUFF TEMPLATES -->
<!-- -->
		<powerTemplate r_name="'mainPowerWithBuffInterface'"
									 r_effectName="r_displayName"
									 actionLogMethod="'logPowerWithBuff'"
									 endBuffLogMethod="'logBuffEnd'"
									 cancellablePower="1"
									 powerDuration="-1"
									 powerRange="0"
									 powerTickCount="2"
									 powerRecastRule="'replace'"
									 buffExhaustionReduction="0"
									 valueTooltip="relocate(text.powerBuffValueTooltip)">
			<action r_name="'use'" canTargetFaction="(actor.r_allyFaction)[target.r_faction]" r_actionIndexOffset="(0>powerDuration)?200:0">
			</action>
		</powerTemplate>
		<powerTemplate r_name="'mainBuffPowerTemplate'" r_template="{'activePowerTemplate','mainPowerWithBuffInterface'}"
									 powerEffectTemplate="{'mainTargetEffectTemplate','mainBuffEffectTemplate'}">
			<action r_name="'use'">
				<effect r_name="'mainEffect'"
								r_tickDuration="powerDuration"
								r_tickCount="powerTickCount"
								cancellable="cancellablePower"
								recastRule="powerRecastRule">
					<modifier r_name="'ExhaustionReduction'" r_template="'mainModifierTemplate'" r_enabled="w_launched&&(buffExhaustionReduction>0)" r_modifierTarget="'actor.exhaustion'" r_modifiedValue="$0-buffExhaustionReduction"/>
				</effect>
			</action>
		</powerTemplate>
		<powerTemplate r_name="'mainPowerWithBuffTemplate'" r_template="{'activePowerTemplate','mainPowerWithBuffInterface'}"
									 powerEffectTemplate="{'mainTargetEffectTemplate','multiEffect'}">
			<action r_name="'use'">
				<effect r_name="'mainEffect'">
					<effect r_name="'buffEffect'" r_template="{'mainTargetEffectTemplate','mainBuffEffectTemplate'}"
									r_tickDuration="powerDuration"
									r_tickCount="powerTickCount"
									cancellable="cancellablePower"
									recastRule="powerRecastRule">
						<modifier r_name="'ExhaustionReduction'" r_template="'mainModifierTemplate'" r_enabled="w_launched&&(buffExhaustionReduction>0)" r_modifierTarget="'target.exhaustion'" r_modifiedValue="$0-buffExhaustionReduction"/>
					</effect>
				</effect>
			</action>
		</powerTemplate>
		<powerTemplate r_name="'mainDebuffPowerInterface'"
									 powerHitEffectTemplate="'mainDebuffEffectTemplate'"
									 actionLogMethod="'logPowerWithEffect'"
									 cancellablePower="0"
									 powerDuration="100"
									 powerTickCount="2"
									 valueTooltip="relocate(text.powerDebuffValueTooltip)"/>									 
		<powerTemplate r_name="'mainPhysicalDebuffPowerTemplate'" r_template="{'mainPowerPhysicalAttack','mainDebuffPowerInterface'}"
									 powerEffectTemplate="{'mainTargetEffectTemplate','powerPhysicalAttackEffect'}"/>
		<powerTemplate r_name="'mainMentalDebuffPowerTemplate'" r_template="{'mainPowerMentalAttack','mainDebuffPowerInterface'}"
									 powerEffectTemplate="{'mainTargetEffectTemplate','powerMentalAttackEffect'}"/>
		<powerTemplate r_name="'mainSpellDebuffPowerTemplate'" r_template="{'mainPowerSpellAttack','mainDebuffPowerInterface'}"
									 powerEffectTemplate="{'mainTargetEffectTemplate','powerSpellAttackEffect'}"/>
									 
		<!-- WEAPON PROC -->
		<powerTemplate r_name="'weaponProcTemplate'" r_template="'mainPowerTemplate'"
									 procEffectTemplate="'ToBeReplaced'"
									 procProbability="1"
									 noRecursiveProc="0"
									 isExecuting="0"
									 procLogName="''">
			<eventTemplate r_name="'eventProcTemplate'" r_template="'mainEventTemplate'"
										 r_enabled="exists(attributeByName(slotName))&&exists(attributeByName(slotName).action)"
										 r_targetType="'attribute'"
										 r_eventTarget="slotName+'.action.damageDone'"
										 slotName="''">
				<modifier r_name="'recursionLimiter'" r_template="'mainModifierTemplate'" r_modifierTarget="'procProbability'" r_modifiedValue="(isExecuting&&noRecursiveProc)?0:$0"/>
				<effect r_name="'procMultiEffect'" r_template="{'mainSelfEffectTemplate','multiEffect'}"
								r_enabled="procProbability&&(!target.isDead)&&(attributeByName(slotName).action.damageDone>0)">
				 	<effect r_name="'start'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="isExecuting=1"/>
				 	<effect r_name="'log'" r_template="'logPower'" r_enabled="procLogName!=''" r_displayName="procLogName"/>
					<effect r_name="'procEffect'" r_template="procEffectTemplate"/>
				 	<effect r_name="'finish'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="isExecuting=0"/>
				</effect>
			</eventTemplate>
		</powerTemplate>
		<powerTemplate r_name="'weaponProcAllWeaponsTemplate'" r_template="'weaponProcTemplate'">
			<event r_name="'procMainhand'" r_template="'eventProcTemplate'" slotName="'mainhand'"/>
			<event r_name="'procOffhand'" r_template="'eventProcTemplate'" slotName="'offhand'"/>
			<event r_name="'procRanged'" r_template="'eventProcTemplate'" slotName="'ranged'"/>
		</powerTemplate>
		<powerTemplate r_name="'WeaponAttackPowerTemplate'" r_template="'activePowerTemplate'"
									 slotName="''"
									 effectiveSlot="attributeByName(slotName)"
									 slotOK="exists(attributeByName(slotName))"
									 powerEffectTemplate="{'mainSelfEffectTemplate','multiEffect'}"
									 powerRange="slotOK?effectiveSlot.weaponMaxRange:0"
									 timeCost="slotOK?effectiveSlot.action.timeCost:0">
			<action r_name="'use'"
							r_minRange="slotOK?(effectiveSlot.action.r_minRange):1"
							r_range="slotOK?(effectiveSlot.action.r_range):0"
							r_targetingType="slotOK?effectiveSlot.action.r_targetingType:'none'"
							r_canTarget="slotOK?effectiveSlot.action.r_canTarget:0">
				<modifier r_name="'canExecute'" r_template="'mainModifierTemplate'" r_modifierTarget="'r_canExecute'" r_modifiedValue="$0&&slotOK"/>
				<effect r_name="'mainEffect'">
					<effect r_name="'strike'" r_template="{'mainTargetEffectTemplate','controllerEffect'}"
									r_enabled="costPaid"
									r_className="'CctlEffectLaunchAction'"
									r_newActor="'actor'"
									r_newTarget="'target'"
									r_newActionType="'equippedItem'"
									r_newActionName="slotName"
									r_delayRequest="0"
									r_params="{{'isFree',1}}"/>
				</effect>
			</action>
		</powerTemplate>
		<powerTemplate r_name="'WeaponAttackWithEffectTemplate'" r_template="'WeaponAttackPowerTemplate'"
									 powerEffectOnAttack="''">
			<action r_name="'use'">
				<effect r_name="'mainEffect'">
					<effect r_name="'powerEffect'" r_template="powerEffectOnAttack"
									r_enabled="costPaid&&(effectiveSlot.action.damageDone>0)&&(!target.isDead)"/>
				</effect>
			</action>
		</powerTemplate>
		
		<!-- Do not use for hero without reseting nextCastingTime when changing dungeon -->
		<powerTemplate r_name="'activePowerWithCooldownInterface'"
									 cooldown="100"
									 nextCastingTime="0">
			<action r_name="'use'">
				<modifier r_name="'enabledModifier'" r_template="'mainModifierTemplate'" r_modifierTarget="'r_enabled'" r_modifiedValue="$0&&(rw_currentTime>=nextCastingTime)"/>
				<effect r_name="'cooldownHandling'" r_template="{'mainActorEffectTemplate','evaluationEffect'}" r_enabled="costPaid&&(!isFree)" r_effect="nextCastingTime=rw_currentTime+cooldown"/>
			</action>
		</powerTemplate>
		
<!-- -->
<!-- STANDARD POWERS -->
<!-- -->
		<powerTemplate r_name="'doNothing'" r_template="'mainPowerTemplate'">
			<action r_name="'use'" r_template="'mainActionTemplate'"
							canBeInActionList="0"
							r_canTarget="1"/>
		</powerTemplate>	
		<powerTemplate r_name="'endTurn'" r_template="'mainPowerTemplate'">
			<action r_name="'use'" r_template="'mainActionTemplate'"
							canBeInActionList="0"
							r_canTarget="1">
				<effect r_name="'mainEffect'">
					<effect r_name="'rest'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="fatigue+=10"/>
				</effect>
			</action>
		</powerTemplate>
		<powerTemplate r_name="'standardCloseCombat'" r_template="'mainPowerTemplate'"
									 r_displayName="text.powerStandardCloseCombat"
									 r_graphic="'icon_cac.png'"
									 valueTooltip="text.powerStandardCloseCombatValueTooltip">
			<action r_name="'standardCloseCombat'" r_template="'mainActionTemplate'"
							r_autoAddToActionList="0"
							timeCost="0"
							r_minRange="exists(mainhand)?mainhand.action.r_minRange:0"
							r_range="exists(mainhand)?mainhand.action.r_range:0"
							r_targetingType="exists(mainhand)?mainhand.action.r_targetingType:'standard'"
							r_canExecute="exists(mainhand)?mainhand.action.r_canExecute:0"
							r_canTarget="exists(mainhand)?mainhand.action.r_canTarget:0"
							canBeInAutoAttack="1">
				<effect r_name="'mainEffect'"
								mainAttackOK="exists(mainhand)&&exists(mainhand.action)&&mainhand.action.costPaid"
								offAttackOK="exists(offhand)&&exists(offhand.action)&&offhand.action.costPaid">
					<effect r_name="'strikeMH'" r_template="{'mainTargetEffectTemplate','controllerEffect'}" r_enabled="exists(mainhand)&&exists(mainhand.action)&&mainhand.action.r_enabled" r_className="'CctlEffectLaunchAction'" r_newActor="'actor'" r_newTarget="'target'" r_newActionType="'equippedItem'" r_newActionName="'mainhand'" r_delayRequest="0" r_params="{{'timeCost',0},{'isFree',$0||isFree}}"/>
					<effect r_name="'strikeOH'" r_template="{'mainTargetEffectTemplate','controllerEffect'}" r_enabled="exists(offhand)&&exists(offhand.action)&&offhand.action.r_enabled" r_className="'CctlEffectLaunchAction'" r_newActor="'actor'" r_newTarget="'target'" r_newActionType="'equippedItem'" r_newActionName="'offhand'" r_delayRequest="0" r_params="{{'r_enabled',mainAttackOK},{'timeCost',$0*dualWieldOffhandCostModifier},{'fatigueCost',$0*dualWieldOffhandCostModifier},{'isFree',$0||isFree}}"/>
					<effect r_name="'timeCost'" r_template="{'mainActorEffectTemplate','evaluationEffect'}" r_enabled="!isFree&&mainAttackOK" r_effect="actor.rw_currentTime+=mainhand.action.timeCost"/>
				</effect>
				<effect r_name="'cannotPay'" r_template="'logCannotPayFatigue'" r_enabled="!costPaid&&r_canTarget"/>
			</action>
		</powerTemplate>
		<powerTemplate r_name="'standardRangedCombat'" r_template="'mainPowerTemplate'"
									 r_displayName="text.powerStandardRangedCombat"
									 r_graphic="'icon_ranged.png'"
									 valueTooltip="text.powerStandardRangedCombatValueTooltip">
			<action r_name="'standardRangedCombat'" r_template="'mainActionTemplate'"
							r_autoAddToActionList="0"
							timeCost="0"
							r_minRange="exists(ranged)?ranged.action.r_minRange:0"
							r_range="exists(ranged)?ranged.action.r_range:0"
							r_targetingType="exists(ranged)?ranged.action.r_targetingType:'standard'"
							r_canExecute="exists(ranged)?ranged.action.r_canExecute:0"
							r_canTarget="exists(ranged)?ranged.action.r_canTarget:0"
							canBeInAutoAttack="1">
				<effect r_name="'mainEffect'"
								rangedAttackOK="exists(ranged)&&exists(ranged.action)&&ranged.action.costPaid">
					<effect r_name="'strikeRanged'" r_template="{'mainTargetEffectTemplate','controllerEffect'}" r_enabled="exists(ranged)&&exists(ranged.action)&&ranged.action.r_enabled" r_className="'CctlEffectLaunchAction'" r_newActor="'actor'" r_newTarget="'target'" r_newActionType="'equippedItem'" r_newActionName="'ranged'" r_delayRequest="0" r_params="{{'isFree',$0||isFree}}"/>
				</effect>
				<effect r_name="'cannotPay'" r_template="'logCannotPayFatigue'" r_enabled="!costPaid&&r_canTarget"/>
			</action>
		</powerTemplate>
	</powers>
</data>