Core/Spells: Implemented target type TARGET_DEST_DEST_TARGET_TOWARDS_CASTER

Port From (https://github.com/TrinityCore/TrinityCore/commit/80e22230c34106753cd6be57d9a496642e47216d)
This commit is contained in:
hondacrx
2023-06-24 09:21:46 -04:00
parent 7ce0136423
commit 4b76323d6a
3 changed files with 14 additions and 2 deletions
+12
View File
@@ -1185,6 +1185,18 @@ namespace Game.Spells
case Targets.DestDestGround:
dest.Position.posZ = m_caster.GetMapHeight(dest.Position.GetPositionX(), dest.Position.GetPositionY(), dest.Position.GetPositionZ());
break;
case Targets.DestDestTargetTowardsCaster:
{
float dist = spellEffectInfo.CalcRadius(m_caster);
Position pos = dest.Position;
float angle = pos.GetAbsoluteAngle(m_caster) - m_caster.GetOrientation();
m_caster.MovePositionToFirstCollision(pos, dist, angle);
pos.SetOrientation(m_caster.GetAbsoluteAngle(dest.Position));
dest.Relocate(pos);
break;
}
default:
{
float angle = targetType.CalcDirectionAngle();