Core/Spells: Implement SpellMisc.LaunchDelay

Port From (https://github.com/TrinityCore/TrinityCore/commit/c924840ce7fa7289fe73fb15b0f022bc74618ee1)
This commit is contained in:
hondacrx
2019-09-04 13:13:59 -04:00
parent 7066a959f1
commit 0877e73ff2
4 changed files with 61 additions and 36 deletions
+11
View File
@@ -4114,10 +4114,21 @@ namespace Game.Spells
if (m_preGeneratedPath.GetPathType() == PathType.Blank)
{
Position pos = unitTarget.GetFirstCollisionPosition(unitTarget.GetObjectSize(), unitTarget.GetRelativeAngle(m_caster.GetPosition()));
if (m_spellInfo.HasAttribute(SpellAttr9.SpecialDelayCalculation))
speed = pos.GetExactDist(m_caster) / speed;
m_caster.GetMotionMaster().MoveCharge(pos.posX, pos.posY, pos.posZ, speed, EventId.Charge, false, unitTarget, spellEffectExtraData);
}
else
{
if (m_spellInfo.HasAttribute(SpellAttr9.SpecialDelayCalculation))
{
Vector3 pos = m_preGeneratedPath.GetActualEndPosition();
speed = new Position(pos.X, pos.Y, pos.Z).GetExactDist(m_caster) / speed;
}
m_caster.GetMotionMaster().MoveCharge(m_preGeneratedPath, speed, unitTarget, spellEffectExtraData);
}
}
if (effectHandleMode == SpellEffectHandleMode.HitTarget)