Core/Auras: implement Aura 379 (SPELL_AURA_MOD_MANA_REGEN_PCT)

This commit is contained in:
hondacrx
2018-04-08 18:55:25 -04:00
parent c69c715cc0
commit da61c920b7
4 changed files with 28 additions and 12 deletions
@@ -400,7 +400,7 @@ namespace Framework.Constants
ModCurrencyGainFromSource = 376, // NYI ModCurrencyGainFromSource = 376, // NYI
CastWhileWalking2 = 377, // NYI CastWhileWalking2 = 377, // NYI
Unk378 = 378, Unk378 = 378,
Unk379 = 379, ModManaRegenPct = 379,
ModGlobalCooldownByHaste = 380, // Allows melee abilities to benefit from haste GCD reduction ModGlobalCooldownByHaste = 380, // Allows melee abilities to benefit from haste GCD reduction
Unk381 = 381, Unk381 = 381,
ModPetStatPct = 382, // NYI ModPetStatPct = 382, // NYI
+12 -10
View File
@@ -997,19 +997,21 @@ namespace Game.Entities
if (manaIndex == (int)PowerType.Max) if (manaIndex == (int)PowerType.Max)
return; return;
// Mana regen from spirit // Get base of Mana Pool in sBaseMPGameTable
float spirit_regen = 0.0f; uint basemana;
// Apply PCT bonus from SPELL_AURA_MOD_POWER_REGEN_PERCENT aura on spirit base regen Global.ObjectMgr.GetPlayerClassLevelInfo(GetClass(), getLevel(), out basemana);
spirit_regen *= GetTotalAuraMultiplierByMiscValue(AuraType.ModPowerRegenPercent, (int)PowerType.Mana); float base_regen = basemana / 100.0f;
// CombatRegen = 5% of Base Mana base_regen += GetTotalAuraModifierByMiscValue(AuraType.ModPowerRegen, (int)PowerType.Mana);
float base_regen = GetCreateMana() * 0.02f + GetTotalAuraModifierByMiscValue(AuraType.ModPowerRegen, (int)PowerType.Mana) / 5.0f;
// Set regen rate in cast state apply only on spirit based regen // Apply PCT bonus from SPELL_AURA_MOD_POWER_REGEN_PERCENT
int modManaRegenInterrupt = GetTotalAuraModifier(AuraType.ModManaRegenInterrupt); base_regen *= GetTotalAuraMultiplierByMiscValue(AuraType.ModPowerRegenPercent, (int)PowerType.Mana);
SetFloatValue(UnitFields.PowerRegenInterruptedFlatModifier + manaIndex, base_regen + MathFunctions.CalculatePct(spirit_regen, modManaRegenInterrupt)); // Apply PCT bonus from SPELL_AURA_MOD_MANA_REGEN_PCT
SetFloatValue(UnitFields.PowerRegenFlatModifier + manaIndex, 0.001f + spirit_regen + base_regen); base_regen *= GetTotalAuraMultiplierByMiscValue(AuraType.ModManaRegenPct, (int)PowerType.Mana);
SetFloatValue(UnitFields.PowerRegenInterruptedFlatModifier + manaIndex, base_regen);
SetFloatValue(UnitFields.PowerRegenFlatModifier + manaIndex, base_regen);
} }
public void UpdateSpellDamageAndHealingBonus() public void UpdateSpellDamageAndHealingBonus()
+1 -1
View File
@@ -429,7 +429,7 @@ namespace Game.Entities
mask = UnitTypeMask.Minion; mask = UnitTypeMask.Minion;
break; break;
default: default:
if (properties.Flags.HasAnyFlag<uint>(512)) // Mirror Image, Summon Gargoyle if (properties.Flags.HasAnyFlag(SummonPropFlags.Unk10)) // Mirror Image, Summon Gargoyle
mask = UnitTypeMask.Guardian; mask = UnitTypeMask.Guardian;
break; break;
} }
+14
View File
@@ -3343,6 +3343,20 @@ namespace Game.Spells
target.ToPlayer().UpdateManaRegen(); target.ToPlayer().UpdateManaRegen();
} }
[AuraEffectHandler(AuraType.ModManaRegenPct)]
void HandleModManaRegenPct(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{
if (!mode.HasAnyFlag(AuraEffectHandleModes.ChangeAmountMask | AuraEffectHandleModes.Stat))
return;
Unit target = aurApp.GetTarget();
if (!target.IsPlayer())
return;
target.ToPlayer().UpdateManaRegen();
}
[AuraEffectHandler(AuraType.ModIncreaseHealth)] [AuraEffectHandler(AuraType.ModIncreaseHealth)]
[AuraEffectHandler(AuraType.ModIncreaseHealth2)] [AuraEffectHandler(AuraType.ModIncreaseHealth2)]
[AuraEffectHandler(AuraType.ModMaxHealth)] [AuraEffectHandler(AuraType.ModMaxHealth)]