@@ -132,7 +132,7 @@ enum AuraType : uint32
|
||||
SPELL_AURA_MOD_PACIFY_SILENCE = 60,
|
||||
SPELL_AURA_MOD_SCALE = 61,
|
||||
SPELL_AURA_PERIODIC_HEALTH_FUNNEL = 62,
|
||||
SPELL_AURA_MOD_ADDITIONAL_POWER_COST = 63, // NYI
|
||||
SPELL_AURA_MOD_ADDITIONAL_POWER_COST = 63,
|
||||
SPELL_AURA_PERIODIC_MANA_LEECH = 64,
|
||||
SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK = 65,
|
||||
SPELL_AURA_FEIGN_DEATH = 66,
|
||||
|
||||
@@ -129,7 +129,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
|
||||
&AuraEffect::HandleAuraModPacifyAndSilence, // 60 SPELL_AURA_MOD_PACIFY_SILENCE
|
||||
&AuraEffect::HandleAuraModScale, // 61 SPELL_AURA_MOD_SCALE
|
||||
&AuraEffect::HandleNoImmediateEffect, // 62 SPELL_AURA_PERIODIC_HEALTH_FUNNEL implemented in AuraEffect::PeriodicTick
|
||||
&AuraEffect::HandleNULL, // 63 SPELL_AURA_MOD_ADDITIONAL_POWER_COST
|
||||
&AuraEffect::HandleNoImmediateEffect, // 63 SPELL_AURA_MOD_ADDITIONAL_POWER_COST implemented in SpellInfo::CalcPowerCost
|
||||
&AuraEffect::HandleNoImmediateEffect, // 64 SPELL_AURA_PERIODIC_MANA_LEECH implemented in AuraEffect::PeriodicTick
|
||||
&AuraEffect::HandleModCastingSpeed, // 65 SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK
|
||||
&AuraEffect::HandleFeignDeath, // 66 SPELL_AURA_FEIGN_DEATH
|
||||
|
||||
@@ -3698,6 +3698,19 @@ std::vector<SpellPowerCost> SpellInfo::CalcPowerCost(Unit const* caster, SpellSc
|
||||
if (power->PowerCostMaxPct)
|
||||
healthCost += int32(CalculatePct(caster->GetMaxHealth(), power->PowerCostMaxPct));
|
||||
|
||||
int32 optionalCost = int32(power->OptionalCost);
|
||||
optionalCost += caster->GetTotalAuraModifier(SPELL_AURA_MOD_ADDITIONAL_POWER_COST, [this, power](AuraEffect const* aurEff) -> bool
|
||||
{
|
||||
return aurEff->GetMiscValue() == power->PowerType
|
||||
&& aurEff->IsAffectingSpell(this);
|
||||
});
|
||||
|
||||
if (optionalCost)
|
||||
{
|
||||
int32 remainingPower = caster->GetPower(Powers(power->PowerType)) - powerCost;
|
||||
powerCost += RoundToInterval<int32>(remainingPower, 0, optionalCost);
|
||||
}
|
||||
|
||||
if (power->PowerType != POWER_HEALTH)
|
||||
{
|
||||
// Flat mod from caster auras by spell school and power type
|
||||
|
||||
Reference in New Issue
Block a user