diff options
author | megamage <none@none> | 2009-08-25 16:34:17 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-25 16:34:17 -0500 |
commit | fa38449620ffc49c3510c03a3f731bb56e2d70d2 (patch) | |
tree | 388de88f477bb43d60b6550485171b950524ee73 /src | |
parent | 1f88411cccdba1e2b8ad00b23dea37332c481a5c (diff) |
*Do not allow to knockback target which is much larger than caster.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellEffects.cpp | 11 |
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); } |