Core/Spells: updated haste related regenerations for Cataclysm
* this includes corrected focus regeneration, precise focus and energy regeneration as well as rune regeneration *thx to bigpwn
This commit is contained in:
1 parent
abfe8eb8e7
commit
344c31dcec
6 files changed
+142
-105
No files matched your search
@@ -765,51 +765,28 @@ void Player::ApplyHealthRegenBonus(int32 amount, bool apply)
|
||||
|
||||
void Player::UpdateManaRegen()
|
||||
{
|
||||
// Mana regen from spirit
|
||||
float spirit_regen = OCTRegenMPPerSpirit();
|
||||
// Apply PCT bonus from SPELL_AURA_MOD_POWER_REGEN_PERCENT aura on spirit base regen
|
||||
spirit_regen *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_MANA);
|
||||
if (getPowerType() == POWER_MANA)
|
||||
{
|
||||
// Mana regen from spirit
|
||||
float spirit_regen = OCTRegenMPPerSpirit();
|
||||
// Apply PCT bonus from SPELL_AURA_MOD_POWER_REGEN_PERCENT aura on spirit base regen
|
||||
spirit_regen *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_MANA);
|
||||
|
||||
// SpiritRegen(SPI, INT, LEVEL) = (0.001 + (SPI x sqrt(INT) x BASE_REGEN[LEVEL])) x 5
|
||||
if (GetStat(STAT_INTELLECT) > 0.0f)
|
||||
spirit_regen *= std::sqrt(GetStat(STAT_INTELLECT));
|
||||
// SpiritRegen(SPI, INT, LEVEL) = (0.001 + (SPI x sqrt(INT) x BASE_REGEN[LEVEL])) x 5
|
||||
if (GetStat(STAT_INTELLECT) > 0.0f)
|
||||
spirit_regen *= std::sqrt(GetStat(STAT_INTELLECT));
|
||||
|
||||
// CombatRegen = 5% of Base Mana
|
||||
float base_regen = GetCreateMana() * 0.01f + GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA) / 5.0f;
|
||||
// CombatRegen = 5% of Base Mana
|
||||
float base_regen = GetCreateMana() * 0.01f + GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA) / 5.0f;
|
||||
|
||||
// Set regen rate in cast state apply only on spirit based regen
|
||||
int32 modManaRegenInterrupt = GetTotalAuraModifier(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT);
|
||||
// Set regen rate in cast state apply only on spirit based regen
|
||||
int32 modManaRegenInterrupt = GetTotalAuraModifier(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT);
|
||||
|
||||
SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, base_regen + CalculatePct(spirit_regen, modManaRegenInterrupt));
|
||||
SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, 0.001f + spirit_regen + base_regen);
|
||||
}
|
||||
|
||||
void Player::UpdateRuneRegen(RuneType rune)
|
||||
{
|
||||
if (rune >= NUM_RUNE_TYPES)
|
||||
return;
|
||||
|
||||
uint32 cooldown = 0;
|
||||
|
||||
for (uint32 i = 0; i < MAX_RUNES; ++i)
|
||||
if (GetBaseRune(i) == rune)
|
||||
{
|
||||
cooldown = GetRuneBaseCooldown(i);
|
||||
break;
|
||||
}
|
||||
|
||||
if (cooldown <= 0)
|
||||
return;
|
||||
|
||||
float regen = float(1 * IN_MILLISECONDS) / float(cooldown);
|
||||
SetFloatValue(PLAYER_RUNE_REGEN_1 + uint8(rune), regen);
|
||||
}
|
||||
|
||||
void Player::UpdateAllRunesRegen()
|
||||
{
|
||||
for (uint8 i = 0; i < NUM_RUNE_TYPES; ++i)
|
||||
if (uint32 cooldown = GetRuneTypeBaseCooldown(RuneType(i)))
|
||||
SetFloatValue(PLAYER_RUNE_REGEN_1 + i, float(1 * IN_MILLISECONDS) / float(cooldown));
|
||||
SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, base_regen + CalculatePct(spirit_regen, modManaRegenInterrupt));
|
||||
SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, 0.001f + spirit_regen + base_regen);
|
||||
}
|
||||
else if (getClass() == CLASS_HUNTER)
|
||||
SetFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, -0.2f);
|
||||
}
|
||||
|
||||
void Player::_ApplyAllStatBonuses()
|
||||
|
||||
Reference in new issue
Block a user