mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 00:18:43 +01:00
*Use dest to calculate time delay for missile spells. (Only SPELL_EFFECT_TRIGGER_MISSILE for now, need to fix all "dest required spells")
--HG-- branch : trunk
This commit is contained in:
@@ -800,7 +800,13 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex)
|
||||
if (m_spellInfo->speed > 0.0f)
|
||||
{
|
||||
// calculate spell incoming interval
|
||||
float dist = m_caster->GetDistance(pVictim->GetPositionX(), pVictim->GetPositionY(), pVictim->GetPositionZ());
|
||||
// TODO: this is a hack
|
||||
float dist;
|
||||
if(m_spellInfo->Effect[effIndex] == SPELL_EFFECT_TRIGGER_MISSILE && m_targets.HasDest())
|
||||
dist = m_caster->GetDistance(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ);
|
||||
else
|
||||
dist = m_caster->GetDistance(pVictim->GetPositionX(), pVictim->GetPositionY(), pVictim->GetPositionZ());
|
||||
|
||||
if (dist < 5.0f) dist = 5.0f;
|
||||
target.timeDelay = (uint64) floor(dist / m_spellInfo->speed * 1000.0f);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user