diff options
author | Shauren <shauren.trinity@gmail.com> | 2018-01-27 12:21:35 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2018-01-27 12:21:35 +0100 |
commit | f963b8a225a70e7007536d5d4787483a2cade978 (patch) | |
tree | a1bbf348ce038c49ea77191bb0ee079d9211c4a9 | |
parent | f97239718fa1e1c6e89c6ebf4ec1899708def61f (diff) |
Core/Spells: Removed outdated mechanic (spell downranking coef penalty)
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 32 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 1 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 1 |
3 files changed, 4 insertions, 30 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3af131af679..f4242061c78 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2205,22 +2205,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) { WorldPackets::Combat::AttackStart packet; @@ -6490,15 +6474,13 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin float coeff = effect->BonusCoefficient; if (DoneAdvertisedBenefit) { - float factorMod = CalculateLevelPenalty(spellProto) * stack; - if (Player* modOwner = GetSpellModOwner()) { coeff *= 100.0f; modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_BONUS_MULTIPLIER, coeff); coeff /= 100.0f; } - DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod); + DoneTotal += int32(DoneAdvertisedBenefit * coeff * stack); } // Done Percentage for DOT is already calculated, no need to do it again. The percentage mod is applied in Aura::HandleAuraSpecificMods. @@ -6639,7 +6621,6 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui // Default calculation if (TakenAdvertisedBenefit) { - float factorMod = CalculateLevelPenalty(spellProto) * stack; // level penalty still applied on Taken bonus - is it blizzlike? if (Player* modOwner = GetSpellModOwner()) { @@ -6647,7 +6628,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_BONUS_MULTIPLIER, coeff); coeff /= 100.0f; } - TakenTotal += int32(TakenAdvertisedBenefit * coeff * factorMod); + TakenTotal += int32(TakenAdvertisedBenefit * coeff * stack); } } @@ -6936,7 +6917,6 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui // Check for table values float coeff = spellEffect->BonusCoefficient; - float factorMod = 1.0f; if (spellEffect->BonusCoefficientFromAP > 0.0f) { DoneTotal += int32(spellEffect->BonusCoefficientFromAP * stack * GetTotalAttackPowerValue( @@ -6952,8 +6932,6 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui // Default calculation if (DoneAdvertisedBenefit) { - factorMod *= CalculateLevelPenalty(spellProto) * stack; - if (Player* modOwner = GetSpellModOwner()) { coeff *= 100.0f; @@ -6961,7 +6939,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui coeff /= 100.0f; } - DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod); + DoneTotal += int32(DoneAdvertisedBenefit * coeff * stack); } for (SpellEffectInfo const* effect : spellProto->GetEffectsForDifficulty(GetMap()->GetDifficultyID())) @@ -7048,7 +7026,6 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u // Check for table values float coeff = spellEffect->BonusCoefficient; - float factorMod = 1.0f; if (coeff <= 0.0f) { // No bonus healing for SPELL_DAMAGE_CLASS_NONE class spells by default @@ -7062,7 +7039,6 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u // Default calculation if (TakenAdvertisedBenefit) { - factorMod *= CalculateLevelPenalty(spellProto) * int32(stack); if (Player* modOwner = GetSpellModOwner()) { coeff *= 100.0f; @@ -7070,7 +7046,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 7d55926915f..db8bcfe6b2c 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1745,7 +1745,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_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index a8502c9e6d9..7113fe1ea2b 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -1080,7 +1080,6 @@ class spell_warl_shadow_ward : public SpellScriptLoader float bonus = 0.8068f; bonus *= caster->SpellBaseHealingBonusDone(GetSpellInfo()->GetSchoolMask()); - bonus *= caster->CalculateLevelPenalty(GetSpellInfo()); amount += int32(bonus); } |