Core/Spells: merged level penalty removal
This commit is contained in:
1 parent
c3a9f88171
commit
8a274f0329
5 files changed
+4
-33
No files matched your search
@@ -2304,22 +2304,6 @@ uint32 Unit::CalculateDamage(WeaponAttackType attType, bool normalized, bool add
|
||||
return urand(uint32(minDamage), uint32(maxDamage));
|
||||
}
|
||||
|
||||
float Unit::CalculateLevelPenalty(SpellInfo const* spellProto) const
|
||||
{
|
||||
if (spellProto->SpellLevel <= 0 || spellProto->SpellLevel >= spellProto->MaxLevel)
|
||||
return 1.0f;
|
||||
|
||||
float LvlPenalty = 0.0f;
|
||||
|
||||
if (spellProto->SpellLevel < 20)
|
||||
LvlPenalty = (20.0f - spellProto->SpellLevel) * 3.75f;
|
||||
float LvlFactor = (float(spellProto->SpellLevel) + 6.0f) / float(getLevel());
|
||||
if (LvlFactor > 1.0f)
|
||||
LvlFactor = 1.0f;
|
||||
|
||||
return AddPct(LvlFactor, -LvlPenalty);
|
||||
}
|
||||
|
||||
void Unit::SendMeleeAttackStart(Unit* victim)
|
||||
{
|
||||
WorldPacket data(SMSG_ATTACKSTART, 8 + 8);
|
||||
@@ -6586,15 +6570,13 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
|
||||
if (!bonus || coeff < 0)
|
||||
coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack);
|
||||
|
||||
float factorMod = CalculateLevelPenalty(spellProto) * stack;
|
||||
|
||||
if (Player* modOwner = GetSpellModOwner())
|
||||
{
|
||||
coeff *= 100.0f;
|
||||
modOwner->ApplySpellMod<SPELLMOD_BONUS_MULTIPLIER>(spellProto->Id, coeff);
|
||||
coeff /= 100.0f;
|
||||
}
|
||||
DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod);
|
||||
DoneTotal += int32(DoneAdvertisedBenefit * coeff * stack);
|
||||
}
|
||||
|
||||
float tmpDamage = (int32(pdamage) + DoneTotal);
|
||||
@@ -6880,7 +6862,6 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui
|
||||
if (!bonus || coeff < 0)
|
||||
coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack);
|
||||
|
||||
float factorMod = CalculateLevelPenalty(spellProto) * stack;
|
||||
// level penalty still applied on Taken bonus - is it blizzlike?
|
||||
if (Player* modOwner = GetSpellModOwner())
|
||||
{
|
||||
@@ -6888,7 +6869,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui
|
||||
modOwner->ApplySpellMod<SPELLMOD_BONUS_MULTIPLIER>(spellProto->Id, coeff);
|
||||
coeff /= 100.0f;
|
||||
}
|
||||
TakenTotal += int32(TakenAdvertisedBenefit * coeff * factorMod);
|
||||
TakenTotal += int32(TakenAdvertisedBenefit * coeff * stack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7328,7 +7309,6 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
|
||||
// Check for table values
|
||||
SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id);
|
||||
float coeff = 0;
|
||||
float factorMod = 1.0f;
|
||||
if (bonus)
|
||||
{
|
||||
if (damagetype == DOT)
|
||||
@@ -7359,8 +7339,6 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
|
||||
if (!bonus || coeff < 0)
|
||||
coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack) * 1.88f; // As wowwiki says: C = (Cast Time / 3.5) * 1.88 (for healing spells)
|
||||
|
||||
factorMod *= CalculateLevelPenalty(spellProto) * stack;
|
||||
|
||||
if (Player* modOwner = GetSpellModOwner())
|
||||
{
|
||||
coeff *= 100.0f;
|
||||
@@ -7368,7 +7346,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
|
||||
coeff /= 100.0f;
|
||||
}
|
||||
|
||||
DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod);
|
||||
DoneTotal += int32(DoneAdvertisedBenefit * coeff * stack);
|
||||
}
|
||||
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
@@ -7519,7 +7497,6 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u
|
||||
// Check for table values
|
||||
SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id);
|
||||
float coeff = 0;
|
||||
float factorMod = 1.0f;
|
||||
if (bonus)
|
||||
coeff = (damagetype == DOT) ? bonus->dot_damage : bonus->direct_damage;
|
||||
else
|
||||
@@ -7538,7 +7515,6 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u
|
||||
if (!bonus || coeff < 0)
|
||||
coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack) * 1.88f; // As wowwiki says: C = (Cast Time / 3.5) * 1.88 (for healing spells)
|
||||
|
||||
factorMod *= CalculateLevelPenalty(spellProto) * int32(stack);
|
||||
if (Player* modOwner = GetSpellModOwner())
|
||||
{
|
||||
coeff *= 100.0f;
|
||||
@@ -7546,7 +7522,7 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u
|
||||
coeff /= 100.0f;
|
||||
}
|
||||
|
||||
TakenTotal += int32(TakenAdvertisedBenefit * coeff * factorMod);
|
||||
TakenTotal += int32(TakenAdvertisedBenefit * coeff * stack);
|
||||
}
|
||||
|
||||
AuraEffectList const& mHealingGet= GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_RECEIVED);
|
||||
|
||||
Reference in new issue
Block a user