*Fix power update after spellcast - by w12x

*Some cleanups in Player::UpdateManaRegen.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-04-14 17:22:35 +02:00
parent 2b52663e42
commit 829b7a4536
3 changed files with 14 additions and 32 deletions

View File

@@ -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);
}