aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-12-28 22:18:19 +0100
committerShauren <shauren.trinity@gmail.com>2012-12-28 22:18:19 +0100
commitfc9bbe1046c1adcb089d5532f9e5baaa9fb543f1 (patch)
treede6512138522a7a2d3a1fa68942c2c470b4c41ee /src
parentabbbf55931f8038ee0999a3741cf50fb5c550c2f (diff)
Core/Spells: Implemented SPELL_ATTR9_SPECIAL_DELAY_CALCULATION. Spells using this attribute have missile travel time stored in Speed field (in seconds) instead of speed
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Spell.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 6a6caed68f0..c7ecae443b8 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -795,7 +795,10 @@ void Spell::SelectSpellTargets()
else if (m_spellInfo->Speed > 0.0f)
{
float dist = m_caster->GetDistance(*m_targets.GetDstPos());
- m_delayMoment = (uint64) floor(dist / m_spellInfo->Speed * 1000.0f);
+ if (!(m_spellInfo->AttributesEx9 & SPELL_ATTR9_SPECIAL_DELAY_CALCULATION))
+ m_delayMoment = uint64(floor(dist / m_spellInfo->Speed * 1000.0f));
+ else
+ m_delayMoment = uint64(m_spellInfo->Speed * 1000.0f);
}
}
}
@@ -2162,7 +2165,11 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*=
if (dist < 5.0f)
dist = 5.0f;
- targetInfo.timeDelay = (uint64) floor(dist / m_spellInfo->Speed * 1000.0f);
+
+ if (!(m_spellInfo->AttributesEx9 & SPELL_ATTR9_SPECIAL_DELAY_CALCULATION))
+ targetInfo.timeDelay = uint64(floor(dist / m_spellInfo->Speed * 1000.0f));
+ else
+ targetInfo.timeDelay = uint64(m_spellInfo->Speed * 1000.0f);
// Calculate minimum incoming time
if (m_delayMoment == 0 || m_delayMoment > targetInfo.timeDelay)
@@ -2241,7 +2248,12 @@ void Spell::AddGOTarget(GameObject* go, uint32 effectMask)
float dist = m_caster->GetDistance(go->GetPositionX(), go->GetPositionY(), go->GetPositionZ());
if (dist < 5.0f)
dist = 5.0f;
- target.timeDelay = uint64(floor(dist / m_spellInfo->Speed * 1000.0f));
+
+ if (!(m_spellInfo->AttributesEx9 & SPELL_ATTR9_SPECIAL_DELAY_CALCULATION))
+ target.timeDelay = uint64(floor(dist / m_spellInfo->Speed * 1000.0f));
+ else
+ target.timeDelay = uint64(m_spellInfo->Speed * 1000.0f);
+
if (m_delayMoment == 0 || m_delayMoment > target.timeDelay)
m_delayMoment = target.timeDelay;
}