From dfff597c9574865b2b046b59c3125a26155f6d9a Mon Sep 17 00:00:00 2001 From: killerwife Date: Tue, 2 Apr 2024 08:33:24 +0200 Subject: [PATCH] Spell/Unit: Fix default for coefficient being 0 and fix coeff for npc pets Closes https://github.com/cmangos/issues/issues/3685 again --- src/game/Entities/Unit.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/game/Entities/Unit.cpp b/src/game/Entities/Unit.cpp index bc4ac1c999..e201ff07bc 100644 --- a/src/game/Entities/Unit.cpp +++ b/src/game/Entities/Unit.cpp @@ -6899,11 +6899,9 @@ void Unit::EnergizeBySpell(Unit* victim, SpellEntry const* spellInfo, uint32 dam */ int32 Unit::SpellBonusWithCoeffs(SpellEntry const* spellProto, SpellEffectIndex effectIndex, int32 total, int32 benefit, int32 ap_benefit, DamageEffectType damagetype, bool donePart) { - // Distribute Damage over multiple effects, reduce by AoE - float coeff = 1.0f; - - // Not apply this to creature casted spells - if (GetTypeId() == TYPEID_UNIT && !((Creature*)this)->IsPet()) + float coeff = 0.f; // no coefficient by default + // does not apply to creatures + if (IsCreature() && !IsPlayerControlled()) coeff = 1.0f; // Check for table values if (spellProto->effectBonusCoefficient[effectIndex] > 0 || spellProto->effectBonusCoefficientFromAP[effectIndex] > 0)