Spells/Auras: Properly handle negative health modifiers on application.
Port From (https://github.com/TrinityCore/TrinityCore/commit/d3f93bcc2632ed334ddf7acd1f068734bd507877)
This commit is contained in:
@@ -3315,21 +3315,14 @@ namespace Game.Spells
|
||||
|
||||
Unit target = aurApp.GetTarget();
|
||||
|
||||
if (apply)
|
||||
{
|
||||
target.HandleStatFlatModifier(UnitMods.Health, UnitModifierFlatType.Total, GetAmount(), apply);
|
||||
target.ModifyHealth(GetAmount());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (target.GetHealth() > 0)
|
||||
{
|
||||
int value = (int)Math.Min(target.GetHealth() - 1, (ulong)GetAmount());
|
||||
target.ModifyHealth(-value);
|
||||
}
|
||||
int amt = apply ? GetAmount() : -GetAmount();
|
||||
if (amt < 0)
|
||||
target.ModifyHealth(Math.Max((int)(1 - target.GetHealth()), amt));
|
||||
|
||||
target.HandleStatFlatModifier(UnitMods.Health, UnitModifierFlatType.Total, GetAmount(), apply);
|
||||
}
|
||||
target.HandleStatFlatModifier(UnitMods.Health, UnitModifierFlatType.Total, GetAmount(), apply);
|
||||
|
||||
if (amt > 0)
|
||||
target.ModifyHealth(amt);
|
||||
}
|
||||
|
||||
void HandleAuraModIncreaseMaxHealth(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
|
||||
Reference in New Issue
Block a user