From fa002503239f1c4db539ea6f7e482260787d4b73 Mon Sep 17 00:00:00 2001 From: SoglaHash <74299960+SoglaHash@users.noreply.github.com> Date: Sat, 1 Oct 2022 22:35:09 +0200 Subject: [PATCH] fix(CORE/Spells): Fix Scaling of some Guardians (#12625) * fix(CORE/Spells): Fix Scaling of some Guardians Guardians summoned by engineering and items have wrong scaling. This will fix Engineering items having the wrong stat scaling. Also fix some Guardians summoned by items to have appropriate level and stats. Closes AzerothCore issue #12446 * Fix whitespace * fix codestyle --- src/server/game/Spells/SpellEffects.cpp | 43 +++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 6fa9b83a6..87dbb64a6 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -6015,6 +6015,43 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* case 13049: summonLevel = 55; break; + + // Cleansed Timberling Heart: Summon Timberling + case 5666: + summonLevel = 7; + break; + + // Glowing Cat Figurine: Summon Ghost Saber + case 6084: + // minLevel 19, maxLevel 20 + summonLevel = 20; + break; + + // Spiked Collar: Summon Felhunter + case 8176: + summonLevel = 30; + break; + + // Dog Whistle: Summon Tracking Hound + case 9515: + summonLevel = 30; + break; + + // Barov Peasant Caller: Death by Peasant + case 18307: + case 18308: + summonLevel = 60; + break; + + // Thornling Seed: Plant Thornling + case 22792: + summonLevel = 60; + break; + + // Cannonball Runner: Summon Crimson Cannon + case 6251: + summonLevel = 61; + break; } } @@ -6056,6 +6093,12 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* // xinef: set calculated level summon->SetLevel(summonLevel); + // if summonLevel changed, set stats for calculated level + if (summonLevel != caster->getLevel()) + { + ((Guardian*)summon)->InitStatsForLevel(summonLevel); + } + // xinef: if we have more than one guardian, change follow angle if (summon->HasUnitTypeMask(UNIT_MASK_MINION) && totalNumGuardians > 1) ((Minion*)summon)->SetFollowAngle(m_caster->GetAbsoluteAngle(pos.GetPositionX(), pos.GetPositionY()));