Core/Units: Implemented versatility
This commit is contained in:
@@ -2782,6 +2782,15 @@ namespace Game.Entities
|
||||
else
|
||||
TakenTotalMod *= GetTotalAuraMultiplier(AuraType.ModRangedDamageTakenPct);
|
||||
|
||||
// Versatility
|
||||
Player modOwner = GetSpellModOwner();
|
||||
if (modOwner)
|
||||
{
|
||||
// only 50% of SPELL_AURA_MOD_VERSATILITY for damage reduction
|
||||
float versaBonus = modOwner.GetTotalAuraModifier(AuraType.ModVersatility) / 2.0f;
|
||||
MathFunctions.AddPct(ref TakenTotalMod, -(modOwner.GetRatingBonusValue(CombatRating.VersatilityDamageTaken) + versaBonus));
|
||||
}
|
||||
|
||||
float tmpDamage = 0.0f;
|
||||
|
||||
if (TakenTotalCasterMod != 0)
|
||||
|
||||
@@ -180,6 +180,11 @@ namespace Game.Entities
|
||||
if (IsTypeId(TypeId.Unit) && !IsPet())
|
||||
DoneTotalMod *= ToCreature().GetSpellDamageMod(ToCreature().GetCreatureTemplate().Rank);
|
||||
|
||||
// Versatility
|
||||
Player modOwner = GetSpellModOwner();
|
||||
if (modOwner)
|
||||
MathFunctions.AddPct(ref DoneTotalMod, modOwner.GetRatingBonusValue(CombatRating.VersatilityDamageDone) + modOwner.GetTotalAuraModifier(AuraType.ModVersatility));
|
||||
|
||||
float maxModDamagePercentSchool = 0.0f;
|
||||
if (IsTypeId(TypeId.Player))
|
||||
{
|
||||
@@ -270,6 +275,15 @@ namespace Game.Entities
|
||||
// get all auras from caster that allow the spell to ignore resistance (sanctified wrath)
|
||||
TakenTotalCasterMod += GetTotalAuraModifierByMiscMask(AuraType.ModIgnoreTargetResist, (int)spellProto.GetSchoolMask());
|
||||
|
||||
// Versatility
|
||||
Player modOwner = GetSpellModOwner();
|
||||
if (modOwner)
|
||||
{
|
||||
// only 50% of SPELL_AURA_MOD_VERSATILITY for damage reduction
|
||||
float versaBonus = modOwner.GetTotalAuraModifier(AuraType.ModVersatility) / 2.0f;
|
||||
MathFunctions.AddPct(ref TakenTotalMod, -(modOwner.GetRatingBonusValue(CombatRating.VersatilityDamageTaken) + versaBonus));
|
||||
}
|
||||
|
||||
// from positive and negative SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
|
||||
// multiplicative bonus, for example Dispersion + Shadowform (0.10*0.85=0.085)
|
||||
TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(AuraType.ModDamagePercentTaken, (uint)spellProto.GetSchoolMask());
|
||||
@@ -291,7 +305,6 @@ namespace Game.Entities
|
||||
if (TakenAdvertisedBenefit != 0)
|
||||
{
|
||||
// level penalty still applied on Taken bonus - is it blizzlike?
|
||||
Player modOwner = GetSpellModOwner();
|
||||
if (modOwner)
|
||||
{
|
||||
coeff *= 100.0f;
|
||||
@@ -490,6 +503,9 @@ namespace Game.Entities
|
||||
if (spellProto.SpellFamilyName == SpellFamilyNames.Potion)
|
||||
return 1.0f;
|
||||
|
||||
if (IsPlayer())
|
||||
return GetFloatValue(PlayerFields.ModHealingDonePct);
|
||||
|
||||
float DoneTotalMod = 1.0f;
|
||||
|
||||
// Healing done percent
|
||||
|
||||
Reference in New Issue
Block a user