mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
*Do not allow to knockback target which is much larger than caster.
--HG-- branch : trunk
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user