Core/Spells: Implemented SPELL_ATTR9_IGNORE_CASTER_HEALING_MODIFIERS and SPELL_ATTR13_ALWAYS_ALLOW_NEGATIVE_HEALING_PERCENT_MODIFIERS
Port From (https://github.com/TrinityCore/TrinityCore/commit/96bfc5f39b4efc0c8437f97746f1a97f028c6dd4)
This commit is contained in:
@@ -1990,7 +1990,7 @@ namespace Framework.Constants
|
|||||||
SuppressVisualKitErrors = 0x200000, // Suppress Visual Kit Errors (client only)
|
SuppressVisualKitErrors = 0x200000, // Suppress Visual Kit Errors (client only)
|
||||||
SpellcastOverrideInSpellbook = 0x400000, // Spellcast Override In Spellbook (client only)
|
SpellcastOverrideInSpellbook = 0x400000, // Spellcast Override In Spellbook (client only)
|
||||||
JumpchargeNoFacingControl = 0x800000, // JumpCharge - no facing control
|
JumpchargeNoFacingControl = 0x800000, // JumpCharge - no facing control
|
||||||
Unk24 = 0x1000000, // 24
|
IgnoreCasterHealingModifiers = 0x1000000, // Ignore Caster Healing Modifiers
|
||||||
Unk25 = 0x2000000, // 25
|
Unk25 = 0x2000000, // 25
|
||||||
Unk26 = 0x4000000, // 26
|
Unk26 = 0x4000000, // 26
|
||||||
Unk27 = 0x8000000, // 27
|
Unk27 = 0x8000000, // 27
|
||||||
@@ -2132,7 +2132,7 @@ namespace Framework.Constants
|
|||||||
Unk23 = 0x800000, // 23
|
Unk23 = 0x800000, // 23
|
||||||
Unk24 = 0x01000000, // 24
|
Unk24 = 0x01000000, // 24
|
||||||
Unk25 = 0x02000000, // 25
|
Unk25 = 0x02000000, // 25
|
||||||
Unk26 = 0x04000000, // 26
|
AlwaysAllowNegativeHealingPercentModifiers = 0x04000000, // Always Allow Negative Healing Percent Modifiers
|
||||||
DoNotAllowDisableMovementInterrupt = 0x08000000, // 27
|
DoNotAllowDisableMovementInterrupt = 0x08000000, // 27
|
||||||
Unk28 = 0x10000000, // 28
|
Unk28 = 0x10000000, // 28
|
||||||
Unk29 = 0x20000000, // 29
|
Unk29 = 0x20000000, // 29
|
||||||
|
|||||||
@@ -513,6 +513,10 @@ namespace Game.Entities
|
|||||||
if (spellProto.HasAttribute(SpellAttr6.IgnoreHealingModifiers))
|
if (spellProto.HasAttribute(SpellAttr6.IgnoreHealingModifiers))
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
|
|
||||||
|
// Some spells don't benefit from done mods
|
||||||
|
if (spellProto.HasAttribute(SpellAttr9.IgnoreCasterHealingModifiers))
|
||||||
|
return 1.0f;
|
||||||
|
|
||||||
// No bonus healing for potion spells
|
// No bonus healing for potion spells
|
||||||
if (spellProto.SpellFamilyName == SpellFamilyNames.Potion)
|
if (spellProto.SpellFamilyName == SpellFamilyNames.Potion)
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
@@ -530,7 +534,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
DoneTotalMod *= maxModDamagePercentSchool;
|
DoneTotalMod *= maxModDamagePercentSchool;
|
||||||
}
|
}
|
||||||
else // SPELL_AURA_MOD_HEALING_DONE_PERCENT is included in m_activePlayerData->ModHealingDonePercent for players
|
else // SPELL_AURA_MOD_HEALING_DONE_PERCENT is included in m_activePlayerData.ModHealingDonePercent for players
|
||||||
DoneTotalMod *= GetTotalAuraMultiplier(AuraType.ModHealingDonePercent);
|
DoneTotalMod *= GetTotalAuraMultiplier(AuraType.ModHealingDonePercent);
|
||||||
|
|
||||||
// bonus against aurastate
|
// bonus against aurastate
|
||||||
@@ -550,17 +554,43 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public int SpellHealingBonusTaken(Unit caster, SpellInfo spellProto, int healamount, DamageEffectType damagetype)
|
public int SpellHealingBonusTaken(Unit caster, SpellInfo spellProto, int healamount, DamageEffectType damagetype)
|
||||||
{
|
{
|
||||||
|
bool allowPositive = !spellProto.HasAttribute(SpellAttr6.IgnoreHealingModifiers);
|
||||||
|
bool allowNegative = !spellProto.HasAttribute(SpellAttr6.IgnoreHealingModifiers) || spellProto.HasAttribute(SpellAttr13.AlwaysAllowNegativeHealingPercentModifiers);
|
||||||
|
if (!allowPositive && !allowNegative)
|
||||||
|
return healamount;
|
||||||
|
|
||||||
float TakenTotalMod = 1.0f;
|
float TakenTotalMod = 1.0f;
|
||||||
|
|
||||||
// Healing taken percent
|
// Healing taken percent
|
||||||
|
if (allowNegative)
|
||||||
|
{
|
||||||
float minval = GetMaxNegativeAuraModifier(AuraType.ModHealingPct);
|
float minval = GetMaxNegativeAuraModifier(AuraType.ModHealingPct);
|
||||||
if (minval != 0)
|
if (minval != 0)
|
||||||
MathFunctions.AddPct(ref TakenTotalMod, minval);
|
MathFunctions.AddPct(ref TakenTotalMod, minval);
|
||||||
|
|
||||||
|
if (damagetype == DamageEffectType.DOT)
|
||||||
|
{
|
||||||
|
// Healing over time taken percent
|
||||||
|
float minval_hot = GetMaxNegativeAuraModifier(AuraType.ModHotPct);
|
||||||
|
if (minval_hot != 0)
|
||||||
|
MathFunctions.AddPct(ref TakenTotalMod, minval_hot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (allowPositive)
|
||||||
|
{
|
||||||
float maxval = GetMaxPositiveAuraModifier(AuraType.ModHealingPct);
|
float maxval = GetMaxPositiveAuraModifier(AuraType.ModHealingPct);
|
||||||
if (maxval != 0)
|
if (maxval != 0)
|
||||||
MathFunctions.AddPct(ref TakenTotalMod, maxval);
|
MathFunctions.AddPct(ref TakenTotalMod, maxval);
|
||||||
|
|
||||||
|
if (damagetype == DamageEffectType.DOT)
|
||||||
|
{
|
||||||
|
// Healing over time taken percent
|
||||||
|
float maxval_hot = GetMaxPositiveAuraModifier(AuraType.ModHotPct);
|
||||||
|
if (maxval_hot != 0)
|
||||||
|
MathFunctions.AddPct(ref TakenTotalMod, maxval_hot);
|
||||||
|
}
|
||||||
|
|
||||||
// Nourish cast
|
// Nourish cast
|
||||||
if (spellProto.SpellFamilyName == SpellFamilyNames.Druid && spellProto.SpellFamilyFlags[1].HasAnyFlag(0x2000000u))
|
if (spellProto.SpellFamilyName == SpellFamilyNames.Druid && spellProto.SpellFamilyFlags[1].HasAnyFlag(0x2000000u))
|
||||||
{
|
{
|
||||||
@@ -569,31 +599,40 @@ namespace Game.Entities
|
|||||||
// increase healing by 20%
|
// increase healing by 20%
|
||||||
TakenTotalMod *= 1.2f;
|
TakenTotalMod *= 1.2f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (damagetype == DamageEffectType.DOT)
|
|
||||||
{
|
|
||||||
// Healing over time taken percent
|
|
||||||
float minval_hot = (float)GetMaxNegativeAuraModifier(AuraType.ModHotPct);
|
|
||||||
if (minval_hot != 0)
|
|
||||||
MathFunctions.AddPct(ref TakenTotalMod, minval_hot);
|
|
||||||
|
|
||||||
float maxval_hot = (float)GetMaxPositiveAuraModifier(AuraType.ModHotPct);
|
|
||||||
if (maxval_hot != 0)
|
|
||||||
MathFunctions.AddPct(ref TakenTotalMod, maxval_hot);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (caster != null)
|
if (caster != null)
|
||||||
{
|
{
|
||||||
TakenTotalMod *= GetTotalAuraMultiplier(AuraType.ModHealingReceived, aurEff =>
|
TakenTotalMod *= GetTotalAuraMultiplier(AuraType.ModHealingReceived, aurEff =>
|
||||||
{
|
{
|
||||||
if (caster.GetGUID() == aurEff.GetCasterGUID() && aurEff.IsAffectingSpell(spellProto))
|
if (caster.GetGUID() != aurEff.GetCasterGUID() || !aurEff.IsAffectingSpell(spellProto))
|
||||||
return true;
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (aurEff.GetAmount() > 0)
|
||||||
|
{
|
||||||
|
if (!allowPositive)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (!allowNegative)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
TakenTotalMod *= GetTotalAuraMultiplier(AuraType.ModHealingTakenFromCaster, aurEff =>
|
TakenTotalMod *= GetTotalAuraMultiplier(AuraType.ModHealingTakenFromCaster, aurEff =>
|
||||||
{
|
{
|
||||||
return aurEff.GetCasterGUID() == caster.GetGUID();
|
if (aurEff.GetCasterGUID() != caster.GetGUID())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (aurEff.GetAmount() > 0)
|
||||||
|
{
|
||||||
|
if (!allowPositive)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (!allowNegative)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user