From 7de1b541e7bb1c3b0ee055e5fc2960807e51e12d Mon Sep 17 00:00:00 2001 From: r4dish Date: Sun, 25 Feb 2024 13:36:50 +0100 Subject: [PATCH] Core/Players: Move power regeneration calculations to Player::UpdatePowerRegen (cherry picked from commit a7dab01c2dc7105f5feddcbd4bf5489b330d70b5) --- src/server/game/Entities/Player/Player.cpp | 62 +------ src/server/game/Entities/Player/Player.h | 5 +- src/server/game/Entities/Unit/StatSystem.cpp | 152 +++++++++++++----- .../game/Spells/Auras/SpellAuraEffects.cpp | 34 ++-- .../game/Spells/Auras/SpellAuraEffects.h | 1 + 5 files changed, 139 insertions(+), 115 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 302c22a8c1..78739a553b 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1647,68 +1647,12 @@ void Player::Regenerate(Powers power) if (powerIndex == MAX_POWERS || powerIndex >= MAX_POWERS_PER_CLASS) return; - /// @todo possible use of miscvalueb instead of amount - if (HasAuraTypeWithValue(SPELL_AURA_PREVENT_REGENERATE_POWER, power)) - return; - - int32 curValue = GetPower(power); - - // TODO: updating haste should update UnitData::PowerRegenFlatModifier for certain power types PowerTypeEntry const* powerType = sDB2Manager.GetPowerTypeEntry(power); if (!powerType) return; - float addvalue = 0.0f; - if (!IsInCombat()) - { - if (powerType->GetFlags().HasFlag(PowerTypeFlags::UseRegenInterrupt) && m_regenInterruptTimestamp + Milliseconds(powerType->RegenInterruptTimeMS) >= GameTime::Now()) - return; - - addvalue = (powerType->RegenPeace + m_unitData->PowerRegenFlatModifier[powerIndex]) * 0.001f * m_regenTimer; - } - else - addvalue = (powerType->RegenCombat + m_unitData->PowerRegenInterruptedFlatModifier[powerIndex]) * 0.001f * m_regenTimer; - - static Rates const RatesForPower[MAX_POWERS] = - { - RATE_POWER_MANA, - RATE_POWER_RAGE_LOSS, - RATE_POWER_FOCUS, - RATE_POWER_ENERGY, - RATE_POWER_COMBO_POINTS_LOSS, - MAX_RATES, // runes - RATE_POWER_RUNIC_POWER_LOSS, - RATE_POWER_SOUL_SHARDS, - RATE_POWER_LUNAR_POWER, - RATE_POWER_HOLY_POWER, - MAX_RATES, // alternate - RATE_POWER_MAELSTROM, - RATE_POWER_CHI, - RATE_POWER_INSANITY, - MAX_RATES, // burning embers, unused - MAX_RATES, // demonic fury, unused - RATE_POWER_ARCANE_CHARGES, - RATE_POWER_FURY, - RATE_POWER_PAIN, - RATE_POWER_ESSENCE, - MAX_RATES, // runes - MAX_RATES, // runes - MAX_RATES, // runes - MAX_RATES, // alternate - MAX_RATES, // alternate - MAX_RATES, // alternate - }; - - if (RatesForPower[power] != MAX_RATES) - addvalue *= sWorld->getRate(RatesForPower[power]); - - // Mana regen calculated in Player::UpdateManaRegen(), energy regen calculated in Player::UpdateEnergyRegen() - if (power != POWER_MANA && power != POWER_ENERGY) - { - addvalue *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, power); - - addvalue += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, power) * static_cast(m_regenTimer) / static_cast(5 * IN_MILLISECONDS); - } + int32 curValue = GetPower(power); + float addvalue = GetPowerRegen(power) * 0.001f * m_regenTimer; int32 minPower = powerType->MinPower; int32 maxPower = GetMaxPower(power); @@ -5393,7 +5337,7 @@ void Player::UpdateRating(CombatRating cr) ApplyAttackTimePercentMod(BASE_ATTACK, newVal, true); ApplyAttackTimePercentMod(OFF_ATTACK, newVal, true); if (GetClass() == CLASS_DEATH_KNIGHT) - UpdateAllRunesRegen(); + UpdatePowerRegen(POWER_RUNES); break; case CR_HASTE_RANGED: ApplyAttackTimePercentMod(RANGED_ATTACK, oldVal, false); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 1f405d0759..d91987f967 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2254,9 +2254,8 @@ class TC_GAME_API Player final : public Unit, public GridObject void UpdateExpertise(WeaponAttackType attType); void ApplyManaRegenBonus(int32 amount, bool apply); void ApplyHealthRegenBonus(int32 amount, bool apply); - void UpdateManaRegen(); - void UpdateEnergyRegen(); - void UpdateAllRunesRegen(); + void UpdatePowerRegen(Powers power); + float GetPowerRegen(Powers power) const; void SetPetSpellPower(uint32 spellPower) { SetUpdateFieldValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::PetSpellPower), spellPower); } diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index ed0f2e138f..3aca7c1087 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -21,6 +21,7 @@ #include "Player.h" #include "Pet.h" #include "GameTables.h" +#include "GameTime.h" #include "ObjectMgr.h" #include "SharedDefines.h" #include "SpellAuras.h" @@ -143,7 +144,7 @@ bool Player::UpdateStats(Stats stat) UpdateArmor(); UpdateSpellDamageAndHealingBonus(); - UpdateManaRegen(); + UpdatePowerRegen(POWER_MANA); return true; } @@ -217,7 +218,10 @@ bool Player::UpdateAllStats() UpdateParryPercentage(); UpdateDodgePercentage(); UpdateSpellDamageAndHealingBonus(); - UpdateManaRegen(); + UpdatePowerRegen(POWER_MANA); + UpdatePowerRegen(POWER_RAGE); + UpdatePowerRegen(POWER_ENERGY); + UpdatePowerRegen(POWER_RUNIC_POWER); UpdateExpertise(BASE_ATTACK); UpdateExpertise(OFF_ATTACK); RecalculateRating(CR_ARMOR_PENETRATION); @@ -794,7 +798,7 @@ void Player::UpdateExpertise(WeaponAttackType attack) void Player::ApplyManaRegenBonus(int32 amount, bool apply) { _ModifyUInt32(apply, m_baseManaRegen, amount); - UpdateManaRegen(); + UpdatePowerRegen(POWER_MANA); } void Player::ApplyHealthRegenBonus(int32 amount, bool apply) @@ -802,57 +806,127 @@ void Player::ApplyHealthRegenBonus(int32 amount, bool apply) _ModifyUInt32(apply, m_baseHealthRegen, amount); } -void Player::UpdateManaRegen() +static constexpr std::array, MAX_POWERS> PowerRegenInfo = { - uint32 manaIndex = GetPowerIndex(POWER_MANA); - if (manaIndex == MAX_POWERS) + RATE_POWER_MANA, // POWER_MANA + RATE_POWER_RAGE_LOSS, // POWER_RAGE + RATE_POWER_FOCUS, // POWER_FOCUS + RATE_POWER_ENERGY, // POWER_ENERGY + RATE_POWER_COMBO_POINTS_LOSS, // POWER_COMBO_POINTS + std::nullopt, // POWER_RUNES + RATE_POWER_RUNIC_POWER_LOSS, // POWER_RUNIC_POWER + RATE_POWER_SOUL_SHARDS, // POWER_SOUL_SHARDS + RATE_POWER_LUNAR_POWER, // POWER_LUNAR_POWER + RATE_POWER_HOLY_POWER, // POWER_HOLY_POWER + std::nullopt, // POWER_ALTERNATE_POWER + RATE_POWER_MAELSTROM, // POWER_MAELSTROM + RATE_POWER_CHI, // POWER_CHI + RATE_POWER_INSANITY, // POWER_INSANITY + std::nullopt, // POWER_BURNING_EMBERS, Obsolete + std::nullopt, // POWER_DEMONIC_FURY, Obsolete + RATE_POWER_ARCANE_CHARGES, // POWER_ARCANE_CHARGES + RATE_POWER_FURY, // POWER_FURY + RATE_POWER_PAIN, // POWER_PAIN + RATE_POWER_ESSENCE, // POWER_ESSENCE + std::nullopt, // POWER_RUNE_BLOOD + std::nullopt, // POWER_RUNE_FROST + std::nullopt, // POWER_RUNE_UNHOLY + std::nullopt, // POWER_ALTERNATE_QUEST + std::nullopt, // POWER_ALTERNATE_ENCOUNTER + std::nullopt, // POWER_ALTERNATE_MOUNT +}; + +void Player::UpdatePowerRegen(Powers power) +{ + uint32 powerIndex = GetPowerIndex(power); + if (powerIndex == MAX_POWERS || powerIndex >= MAX_POWERS_PER_CLASS) return; - // Get base of Mana Pool in sBaseMPGameTable - uint32 basemana = 0; - sObjectMgr->GetPlayerClassLevelInfo(GetClass(), GetLevel(), basemana); - float base_regen = basemana / 100.f; + // TODO: updating haste should update UnitData::PowerRegenFlatModifier for certain power types + PowerTypeEntry const* powerType = sDB2Manager.GetPowerTypeEntry(power); + if (!powerType) + return; - base_regen += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA); + float result_regen = powerType->RegenPeace; // Out-of-combat / without last mana use effect + float result_regen_interrupted = powerType->RegenCombat; // In combat / with last mana use effect + float pct_modifier = 1.f; // Config rate or any other modifiers + float flat_modifier = 0.f; // other modifiers - // Apply PCT bonus from SPELL_AURA_MOD_POWER_REGEN_PERCENT - base_regen *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_MANA); + /// @todo possible use of miscvalueb instead of amount + if (HasAuraTypeWithValue(SPELL_AURA_PREVENT_REGENERATE_POWER, power)) + { + SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::PowerRegenFlatModifier, powerIndex), -powerType->RegenPeace); + SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::PowerRegenInterruptedFlatModifier, powerIndex), -powerType->RegenCombat); + return; + } - // Apply PCT bonus from SPELL_AURA_MOD_MANA_REGEN_PCT - base_regen *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_MANA_REGEN_PCT, POWER_MANA); + switch (power) + { + case POWER_MANA: + { + // Get base of Mana Pool in sBaseMPGameTable + uint32 basemana = 0; + sObjectMgr->GetPlayerClassLevelInfo(GetClass(), GetLevel(), basemana); + float base_regen = float(basemana) / 100.f; - SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::PowerRegenFlatModifier, manaIndex), base_regen); - SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::PowerRegenInterruptedFlatModifier, manaIndex), base_regen); + base_regen *= GetTotalAuraMultiplier(SPELL_AURA_MOD_MANA_REGEN_PCT); + + result_regen += base_regen; + result_regen_interrupted += base_regen; + break; + } + case POWER_RUNES: + { + float base_regen = float(1 * IN_MILLISECONDS) / float(GetRuneBaseCooldown()); + + result_regen = base_regen; + result_regen_interrupted = base_regen; + break; + } + default: + break; + } + + if (PowerRegenInfo[AsUnderlyingType(power)]) + pct_modifier *= sWorld->getRate(*PowerRegenInfo[AsUnderlyingType(power)]); // Config rate + + pct_modifier *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, AsUnderlyingType(power)); + flat_modifier += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, AsUnderlyingType(power)) / 5.f; + + result_regen *= pct_modifier; + result_regen_interrupted *= pct_modifier; + + result_regen += flat_modifier; + result_regen_interrupted += flat_modifier; + + // Unit fields contain an offset relative to the base power regeneration. + result_regen -= powerType->RegenPeace; + result_regen_interrupted -= powerType->RegenCombat; + + SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::PowerRegenFlatModifier, powerIndex), result_regen); + SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::PowerRegenInterruptedFlatModifier, powerIndex), result_regen_interrupted); } -void Player::UpdateEnergyRegen() +float Player::GetPowerRegen(Powers power) const { - uint32 energyIndex = GetPowerIndex(POWER_ENERGY); - if (energyIndex == MAX_POWERS) - return; + uint32 powerIndex = GetPowerIndex(power); + if (powerIndex == MAX_POWERS || powerIndex >= MAX_POWERS_PER_CLASS) + return 0.f; - float regenPerSecond = 10.f; // +10 energy per second - regenPerSecond *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_ENERGY); - regenPerSecond += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_ENERGY) / static_cast(5 * IN_MILLISECONDS); + PowerTypeEntry const* powerType = sDB2Manager.GetPowerTypeEntry(power); + if (!powerType) + return 0.f; - SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::PowerRegenFlatModifier, energyIndex), regenPerSecond - 10.f); - SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::PowerRegenInterruptedFlatModifier, energyIndex), regenPerSecond - 10.f); -} + if (powerType->GetFlags().HasFlag(PowerTypeFlags::UseRegenInterrupt) && m_regenInterruptTimestamp + Milliseconds(powerType->RegenInterruptTimeMS) >= GameTime::Now()) + return 0.f; -void Player::UpdateAllRunesRegen() -{ - if (GetClass() != CLASS_DEATH_KNIGHT) - return; + bool interrupted = HasAuraType(SPELL_AURA_INTERRUPT_REGEN) || + (powerType->GetFlags().HasFlag(PowerTypeFlags::UseRegenInterrupt) && m_regenInterruptTimestamp + Milliseconds(powerType->RegenInterruptTimeMS) >= GameTime::Now()) || + IsInCombat(); - uint32 runeIndex = GetPowerIndex(POWER_RUNES); - if (runeIndex == MAX_POWERS) - return; + float regen = interrupted ? powerType->RegenCombat + m_unitData->PowerRegenInterruptedFlatModifier[powerIndex] : powerType->RegenPeace + m_unitData->PowerRegenFlatModifier[powerIndex]; - PowerTypeEntry const* runeEntry = sDB2Manager.GetPowerTypeEntry(POWER_RUNES); - - uint32 cooldown = GetRuneBaseCooldown(); - SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::PowerRegenFlatModifier, runeIndex), float(1 * IN_MILLISECONDS) / float(cooldown) - runeEntry->RegenPeace); - SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::PowerRegenInterruptedFlatModifier, runeIndex), float(1 * IN_MILLISECONDS) / float(cooldown) - runeEntry->RegenCombat); + return regen; } void Player::_ApplyAllStatBonuses() diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 2111c15169..1221ed0aec 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -154,7 +154,7 @@ NonDefaultConstructible AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleWaterBreathing, // 82 SPELL_AURA_WATER_BREATHING &AuraEffect::HandleModBaseResistance, // 83 SPELL_AURA_MOD_BASE_RESISTANCE &AuraEffect::HandleNoImmediateEffect, // 84 SPELL_AURA_MOD_REGEN implemented in Player::RegenerateHealth - &AuraEffect::HandleModPowerRegen, // 85 SPELL_AURA_MOD_POWER_REGEN implemented in Player::Regenerate + &AuraEffect::HandleModPowerRegen, // 85 SPELL_AURA_MOD_POWER_REGEN &AuraEffect::HandleChannelDeathItem, // 86 SPELL_AURA_CHANNEL_DEATH_ITEM &AuraEffect::HandleNoImmediateEffect, // 87 SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN implemented in Unit::MeleeDamageBonus and Unit::SpellDamageBonus &AuraEffect::HandleNoImmediateEffect, // 88 SPELL_AURA_MOD_HEALTH_REGEN_PERCENT implemented in Player::RegenerateHealth @@ -163,7 +163,7 @@ NonDefaultConstructible AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoImmediateEffect, // 91 SPELL_AURA_MOD_DETECT_RANGE implemented in Creature::GetAttackDistance &AuraEffect::HandlePreventFleeing, // 92 SPELL_AURA_PREVENTS_FLEEING &AuraEffect::HandleModUnattackable, // 93 SPELL_AURA_MOD_UNATTACKABLE - &AuraEffect::HandleNoImmediateEffect, // 94 SPELL_AURA_INTERRUPT_REGEN implemented in Player::Regenerate + &AuraEffect::HandleNoImmediateEffect, // 94 SPELL_AURA_INTERRUPT_REGEN implemented in Player::GetPowerRegen &AuraEffect::HandleAuraGhost, // 95 SPELL_AURA_GHOST &AuraEffect::HandleNoImmediateEffect, // 96 SPELL_AURA_SPELL_MAGNET implemented in Unit::GetMagicHitRedirectTarget &AuraEffect::HandleNoImmediateEffect, // 97 SPELL_AURA_MANA_SHIELD implemented in Unit::CalcAbsorbResist @@ -179,7 +179,7 @@ NonDefaultConstructible AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoImmediateEffect, //107 SPELL_AURA_ADD_FLAT_MODIFIER implemented in AuraEffect::CalculateSpellMod() &AuraEffect::HandleNoImmediateEffect, //108 SPELL_AURA_ADD_PCT_MODIFIER implemented in AuraEffect::CalculateSpellMod() &AuraEffect::HandleNoImmediateEffect, //109 SPELL_AURA_ADD_TARGET_TRIGGER - &AuraEffect::HandleModPowerRegenPCT, //110 SPELL_AURA_MOD_POWER_REGEN_PERCENT implemented in Player::Regenerate, Creature::Regenerate + &AuraEffect::HandleModPowerRegenPCT, //110 SPELL_AURA_MOD_POWER_REGEN_PERCENT implemented in Player::UpdatePowerRegen, Creature::Regenerate &AuraEffect::HandleNoImmediateEffect, //111 SPELL_AURA_INTERCEPT_MELEE_RANGED_ATTACKS implemented in Unit::GetMeleeHitRedirectTarget &AuraEffect::HandleNoImmediateEffect, //112 SPELL_AURA_OVERRIDE_CLASS_SCRIPTS &AuraEffect::HandleNoImmediateEffect, //113 SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN implemented in Unit::MeleeDamageBonus @@ -363,7 +363,7 @@ NonDefaultConstructible AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_XP_QUEST_PCT implemented in Player::RewardQuest &AuraEffect::HandleAuraOpenStable, //292 SPELL_AURA_OPEN_STABLE &AuraEffect::HandleAuraOverrideSpells, //293 SPELL_AURA_OVERRIDE_SPELLS auras which probably add set of abilities to their target based on it's miscvalue - &AuraEffect::HandleNoImmediateEffect, //294 SPELL_AURA_PREVENT_REGENERATE_POWER implemented in Player::Regenerate(Powers power) + &AuraEffect::HandleAuraPreventRegeneratePower, //294 SPELL_AURA_PREVENT_REGENERATE_POWER &AuraEffect::HandleNoImmediateEffect, //295 SPELL_AURA_MOD_PERIODIC_DAMAGE_TAKEN implemented in Unit::MeleeDamageBonusTaken, Unit::SpellDamageBonusTaken &AuraEffect::HandleAuraSetVehicle, //296 SPELL_AURA_SET_VEHICLE_ID sets vehicle on target &AuraEffect::HandleAuraModRootAndDisableGravity, //297 SPELL_AURA_MOD_ROOT_DISABLE_GRAVITY @@ -4082,14 +4082,7 @@ void AuraEffect::HandleModPowerRegen(AuraApplication const* aurApp, uint8 mode, if (target->GetTypeId() != TYPEID_PLAYER) return; - // Update manaregen value - if (GetMiscValue() == POWER_MANA) - target->ToPlayer()->UpdateManaRegen(); - else if (GetMiscValue() == POWER_ENERGY) - target->ToPlayer()->UpdateEnergyRegen(); - else if (GetMiscValue() == POWER_RUNES) - target->ToPlayer()->UpdateAllRunesRegen(); - // other powers are not immediate effects - implemented in Player::Regenerate, Creature::Regenerate + target->ToPlayer()->UpdatePowerRegen(static_cast(GetMiscValue())); } void AuraEffect::HandleModPowerRegenPCT(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -4107,7 +4100,7 @@ void AuraEffect::HandleModManaRegenPct(AuraApplication const* aurApp, uint8 mode if (!target->IsPlayer()) return; - target->ToPlayer()->UpdateManaRegen(); + target->ToPlayer()->UpdatePowerRegen(POWER_MANA); } void AuraEffect::HandleAuraModIncreaseHealth(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -4423,7 +4416,7 @@ void AuraEffect::HandleAuraModRegenInterrupt(AuraApplication const* aurApp, uint if (!target->IsPlayer()) return; - target->ToPlayer()->UpdateManaRegen(); + target->ToPlayer()->UpdatePowerRegen(POWER_MANA); } void AuraEffect::HandleAuraModWeaponCritPercent(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const @@ -5529,6 +5522,19 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m } } +void AuraEffect::HandleAuraPreventRegeneratePower(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const +{ + if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) + return; + + Unit* target = aurApp->GetTarget(); + + if (target->GetTypeId() != TYPEID_PLAYER) + return; + + target->ToPlayer()->UpdatePowerRegen(static_cast(GetAmount())); /// @todo possible use of miscvalueb instead of amount +} + void AuraEffect::HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const { if (!(mode & AURA_EFFECT_HANDLE_REAL)) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 9b84886940..7f3e8dc407 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -315,6 +315,7 @@ class TC_GAME_API AuraEffect void HandleAuraOpenStable(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleAuraModFakeInebriation(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 mode, bool apply) const; + void HandleAuraPreventRegeneratePower(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleSetVignette(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandlePreventResurrection(AuraApplication const* aurApp, uint8 mode, bool apply) const;