aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellEffects.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index a34ec67d9c9..05f27b4567a 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -6376,6 +6376,14 @@ void Spell::EffectKnockBack(uint32 i)
return;
}
+ float ratio = m_caster->GetCombatReach() / unitTarget->GetCombatReach();
+ ratio = ratio * ratio * ratio; // volume = length^3
+ ratio *= 0.1f; // dbc value
+ float speedxy = float(m_spellInfo->EffectMiscValue[i]) * ratio;
+ float speedz = float(damage) * ratio;
+ if(speedxy < 0.1f && speedz < 0.1f)
+ return;
+
float x, y;
if(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
{
@@ -6388,9 +6396,6 @@ void Spell::EffectKnockBack(uint32 i)
y = m_caster->GetPositionY();
}
- float speedxy = float(m_spellInfo->EffectMiscValue[i])/10;
- float speedz = float(damage/10);
-
unitTarget->KnockbackFrom(x, y, speedxy, speedz);
}