void Player::UpdateManaRegen() { float base_regen = GetCreateMana() * 0.01f; // Mana regen from spirit and intellect float spirit_regen = sqrt(GetStat(STAT_INTELLECT)) * 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); // Mana regen from SPELL_AURA_MOD_POWER_REGEN aura float power_regen_mp5 = GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA) / 5.0f; // Get bonus from SPELL_AURA_MOD_MANA_REGEN_FROM_STAT aura AuraList const& regenAura = GetAurasByType(SPELL_AURA_MOD_MANA_REGEN_FROM_STAT); for (AuraList::const_iterator i = regenAura.begin(); i != regenAura.end(); ++i) { Modifier* mod = (*i)->GetModifier(); power_regen_mp5 += GetStat(Stats(mod->m_miscvalue)) * mod->m_amount / 500.0f; } // 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, base_regen + power_regen_mp5 + spirit_regen * modManaRegenInterrupt / 100.0f); SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, base_regen + 0.001f + power_regen_mp5 + spirit_regen); }
void Player::UpdateManaRegen() { if (getPowerType() == POWER_MANA || getClass() == CLASS_DRUID) { // 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 *= 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; // 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); } else if (getClass() == CLASS_HUNTER) SetFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, -0.2f); }
void Player::UpdateManaRegen() { if (GetPowerIndex(POWER_MANA) == MAX_POWERS) return; // Mana regen from spirit float spirit_regen = OCTRegenMPPerSpirit(); float pctPerSec = 0.004f; float netherBonus = 1.0f; float regenRate = 1.0f; uint32 baseMana = GetCreateMana(); // CombatRegen = 2-5% of Base Mana depending on class // Warlock and Mage have 5% default regen switch (getClass()) { case CLASS_MAGE: // According to reports by QA, Nether Attunement should give a 65% regen boost if (HasAura(117957)) netherBonus = 1.13f; case CLASS_WARLOCK: // Base percent per second is higher for mages and warlocks pctPerSec = 0.01f; // Additionally add haste to the mana regen for Warlocks and Mages if (HasAuraType(SPELL_AURA_MOD_MANA_REGEN_BY_HASTE)) regenRate = GetFloatValue(UNIT_MOD_HASTE_REGEN); break; case CLASS_DRUID: // Druids should be calculated based off their mana pool after they gain Natural Insight if (HasAura(112857)) baseMana *= 5; break; case CLASS_PALADIN: // Paladins should be calculated based off their mana pool after they gain Holy Insight if (HasAura(112859)) baseMana *= 5; break; case CLASS_SHAMAN: // Shamans should be calculated based off their mana pool after they gain Spiritual Insight (also elemental shamans) if (HasAura(112858) || HasAura(123099)) baseMana *= 5; break; default: break; } float base_regen = (baseMana * pctPerSec * netherBonus) / regenRate + (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); // Questionable base_regen *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_MANA); SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER + GetPowerIndex(POWER_MANA), base_regen + CalculatePct(spirit_regen, modManaRegenInterrupt)); SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER + GetPowerIndex(POWER_MANA), 0.001f + spirit_regen + base_regen); }
void Player::UpdateManaRegen() { float Intellect = GetStat(STAT_INTELLECT); // Mana regen from spirit and intellect float power_regen = sqrt(Intellect) * OCTRegenMPPerSpirit(); // Apply PCT bonus from SPELL_AURA_MOD_POWER_REGEN_PERCENT aura on spirit base regen power_regen *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_MANA); // 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; float baseCombatRegen = GetCreateMana() * 0.01f + GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA) / 5.0f; SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, baseCombatRegen + power_regen * modManaRegenInterrupt / 100.0f); SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, baseCombatRegen + power_regen); }
void Player::UpdateManaRegen() { uint32 manaIndex = GetPowerIndex(POWER_MANA); if (manaIndex == MAX_POWERS) return; // Mana regen from spirit float spirit_regen = 0.0f; // 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); // CombatRegen = 5% of Base Mana float base_regen = GetCreateMana() * 0.02f + 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); SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER + manaIndex, base_regen + CalculatePct(spirit_regen, modManaRegenInterrupt)); SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER + manaIndex, 0.001f + spirit_regen + base_regen); }