aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo <sirikfoll@hotmail.com>2017-02-24 08:20:20 -0300
committerShauren <shauren.trinity@gmail.com>2019-08-17 20:04:14 +0200
commit1d2f20d59a372cf3625db93a50da206a4e60e9b9 (patch)
treec2a6800de5046f01f94c9f08f080327ccd3363c2
parent38ea7154add7354c4e64fa231e773097a34cdf42 (diff)
Core/Unit: Correct speed calculus when affected by SPELL_AURA_MOD_MINIMUM_SPEED (#18136)
(cherrypicked from 4224259d83c336ef46fa627a8ba0015200a788eb)
-rw-r--r--sql/updates/world/master/2019_07_30_00_world_2017_02_24_00_world.sql2
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp6
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp1
3 files changed, 7 insertions, 2 deletions
diff --git a/sql/updates/world/master/2019_07_30_00_world_2017_02_24_00_world.sql b/sql/updates/world/master/2019_07_30_00_world_2017_02_24_00_world.sql
new file mode 100644
index 00000000000..c22e3b7db94
--- /dev/null
+++ b/sql/updates/world/master/2019_07_30_00_world_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 7249fdecca6..ffe8df10a6a 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -8559,7 +8559,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 dd25e6ae308..14cf6717f46 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
@@ -1436,7 +1436,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