diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index cb0d0e43a8..fbe3ca9366 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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(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(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); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 83a92a0b71..e645946c46 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2096,7 +2096,6 @@ class TC_GAME_API Unit : public WorldObject int32 ModSpellDuration(SpellInfo const* spellProto, Unit const* target, int32 duration, bool positive, uint32 effectMask); void ModSpellCastTime(SpellInfo const* spellProto, int32& castTime, Spell* spell = NULL); void ModSpellDurationTime(SpellInfo const* spellProto, int32& castTime, Spell* spell = NULL); - float CalculateLevelPenalty(SpellInfo const* spellProto) const; void addFollower(FollowerReference* pRef) { m_FollowingRefManager.insertFirst(pRef); } void removeFollower(FollowerReference* /*pRef*/) { /* nothing to do yet */ } diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 6864d676ab..999af5a0dc 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -512,7 +512,6 @@ class spell_mage_fire_frost_ward : public SpellScriptLoader float bonus = 0.8068f; bonus *= caster->SpellBaseHealingBonusDone(GetSpellInfo()->GetSchoolMask()); - bonus *= caster->CalculateLevelPenalty(GetSpellInfo()); amount += int32(bonus); } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index d8f6ad4314..6b44155e25 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -920,7 +920,6 @@ class spell_pri_power_word_shield : public SpellScriptLoader // Improved PW: Shield: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :) // Improved PW: Shield is only applied at the spell healing bonus because it was already applied to the base value in CalculateSpellDamage bonus = caster->ApplyEffectModifiers(GetSpellInfo(), aurEff->GetEffIndex(), bonus); - bonus *= caster->CalculateLevelPenalty(GetSpellInfo()); amount += int32(bonus); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 80715de783..a307932b88 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -1107,9 +1107,7 @@ class spell_warl_shadow_ward : public SpellScriptLoader { // +80.68% from sp bonus float bonus = 0.8068f; - bonus *= caster->SpellBaseHealingBonusDone(GetSpellInfo()->GetSchoolMask()); - bonus *= caster->CalculateLevelPenalty(GetSpellInfo()); amount += int32(bonus); }