mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
*Fix power update after spellcast - by w12x
*Some cleanups in Player::UpdateManaRegen. --HG-- branch : trunk
This commit is contained in:
@@ -697,21 +697,11 @@ void Player::UpdateManaRegen()
|
||||
power_regen_mp5 += GetStat(Stats((*i)->GetMiscValue())) * (*i)->GetAmount() / 500.0f;
|
||||
}
|
||||
|
||||
// Bonus from some dummy auras
|
||||
AuraEffectList const& mDummyAuras = GetAurasByType(SPELL_AURA_PERIODIC_DUMMY);
|
||||
for(AuraEffectList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
|
||||
if((*i)->GetId() == 34074) // Aspect of the Viper
|
||||
{
|
||||
power_regen_mp5 += (*i)->GetAmount() * Intellect / 500.0f;
|
||||
// Add regen bonus from level in this dummy
|
||||
power_regen_mp5 += getLevel() * 35 / 100;
|
||||
}
|
||||
|
||||
// Set regen rate in cast state apply only on spirit based regen
|
||||
int32 modManaRegenInterrupt = GetTotalAuraModifier(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT);
|
||||
if (modManaRegenInterrupt > 100)
|
||||
modManaRegenInterrupt = 100;
|
||||
SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, power_regen_mp5 + power_regen * modManaRegenInterrupt / 100.0f);
|
||||
SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, (power_regen_mp5 + power_regen) * modManaRegenInterrupt / 100.0f);
|
||||
|
||||
SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, power_regen_mp5 + power_regen);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user