From d21bb8f5ca2a807702cb76a50b32004662fe9e71 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Fri, 24 Feb 2017 08:20:20 -0300 Subject: [PATCH] Core/Unit: Correct speed calculus when affected by SPELL_AURA_MOD_MINIMUM_SPEED (#18136) --- sql/updates/world/3.3.5/2017_02_24_00_world.sql | 2 ++ src/server/game/Entities/Unit/Unit.cpp | 6 +++++- .../Northrend/IcecrownCitadel/boss_the_lich_king.cpp | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 sql/updates/world/3.3.5/2017_02_24_00_world.sql diff --git a/sql/updates/world/3.3.5/2017_02_24_00_world.sql b/sql/updates/world/3.3.5/2017_02_24_00_world.sql new file mode 100644 index 00000000000..c22e3b7db94 --- /dev/null +++ b/sql/updates/world/3.3.5/2017_02_24_00_world.sql @@ -0,0 +1,2 @@ +-- Val'kyr Shadowguard (Icecrown Citadel/Lich King, all 4 difficulties) +UPDATE `creature_template` SET `speed_run`=0.642857 WHERE `entry` IN (36609,39120,39121,39122); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a4a95ec8043..cba10829ace 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10996,7 +10996,11 @@ void Unit::UpdateSpeed(UnitMoveType mtype) if (float minSpeedMod = (float)GetMaxPositiveAuraModifier(SPELL_AURA_MOD_MINIMUM_SPEED)) { - float min_speed = minSpeedMod / 100.0f; + float baseMinSpeed = 1.0f; + if (!GetOwnerGUID().IsPlayer() && !IsHunterPet() && GetTypeId() == TYPEID_UNIT) + baseMinSpeed = ToCreature()->GetCreatureTemplate()->speed_run; + + float min_speed = CalculatePct(baseMinSpeed, minSpeedMod); if (speed < min_speed) speed = min_speed; } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 95ae76d529f..0afd67f924b 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -1431,7 +1431,6 @@ class npc_valkyr_shadowguard : public CreatureScript _events.Reset(); me->SetReactState(REACT_PASSIVE); DoCast(me, SPELL_WINGS_OF_THE_DAMNED, false); - me->SetSpeedRate(MOVE_FLIGHT, 0.642857f); } void IsSummonedBy(Unit* /*summoner*/) override