Core/Spells: Implemented SPELL_ATTR9_FACE_UNIT_TARGET_UPON_COMPLETION_OF_JUMP_CHARGE

Port From (https://github.com/TrinityCore/TrinityCore/commit/5cb4536bd0492b49432b092e7ca4a458010b7d53)
This commit is contained in:
Hondacrx
2024-08-26 16:56:29 -04:00
parent 87a8145275
commit 511ac17c55
2 changed files with 21 additions and 5 deletions
@@ -1978,7 +1978,7 @@ namespace Framework.Constants
NotInArena = 0x200, // 9 Not In Arena NotInArena = 0x200, // 9 Not In Arena
TargetMustBeGrounded = 0x400, // Target Must Be Grounded TargetMustBeGrounded = 0x400, // Target Must Be Grounded
AllowWhileBanishedAuraState = 0x800, // Doesn't seem to be doing anything, banish behaves like a regular stun now - tested on patch 10.2.7 with spell 17767 (doesn't have this attribute, only SPELL_ATTR5_ALLOW_WHILE_STUNNED and was castable while banished) AllowWhileBanishedAuraState = 0x800, // Doesn't seem to be doing anything, banish behaves like a regular stun now - tested on patch 10.2.7 with spell 17767 (doesn't have this attribute, only SPELL_ATTR5_ALLOW_WHILE_STUNNED and was castable while banished)
Unk12 = 0x1000, // 12 FaceUnitTargetUponCompletionOfJumpCharge = 0x1000, // Face unit target upon completion of jump charge
Slam = 0x2000, // 13 Slam = 0x2000, // 13
UsableInRatedBattlegrounds = 0x4000, // 14 Can Be Used In Rated Battlegrounds UsableInRatedBattlegrounds = 0x4000, // 14 Can Be Used In Rated Battlegrounds
Unk15 = 0x8000, // 15 Unk15 = 0x8000, // 15
+20 -4
View File
@@ -531,10 +531,16 @@ namespace Game.Spells
float speedXY, speedZ; float speedXY, speedZ;
CalculateJumpSpeeds(effectInfo, unitCaster.GetExactDist2d(unitTarget), out speedXY, out speedZ); CalculateJumpSpeeds(effectInfo, unitCaster.GetExactDist2d(unitTarget), out speedXY, out speedZ);
object facing = null;
Unit target = m_targets.GetUnitTarget();
if (target != null && m_spellInfo.HasAttribute(SpellAttr9.FaceUnitTargetUponCompletionOfJumpCharge))
facing = target;
JumpArrivalCastArgs arrivalCast = new(); JumpArrivalCastArgs arrivalCast = new();
arrivalCast.SpellId = effectInfo.TriggerSpell; arrivalCast.SpellId = effectInfo.TriggerSpell;
arrivalCast.Target = unitTarget.GetGUID(); arrivalCast.Target = unitTarget.GetGUID();
unitCaster.GetMotionMaster().MoveJump(unitTarget, speedXY, speedZ, EventId.Jump, null, arrivalCast); unitCaster.GetMotionMaster().MoveJump(unitTarget, speedXY, speedZ, EventId.Jump, facing, arrivalCast);
} }
[SpellEffectHandler(SpellEffectName.JumpDest)] [SpellEffectHandler(SpellEffectName.JumpDest)]
@@ -555,9 +561,14 @@ namespace Game.Spells
float speedXY, speedZ; float speedXY, speedZ;
CalculateJumpSpeeds(effectInfo, unitCaster.GetExactDist2d(destTarget), out speedXY, out speedZ); CalculateJumpSpeeds(effectInfo, unitCaster.GetExactDist2d(destTarget), out speedXY, out speedZ);
object facing = null;
if (!m_targets.GetUnitTargetGUID().IsEmpty()) object facing;
Unit target = m_targets.GetUnitTarget();
if (target != null && m_spellInfo.HasAttribute(SpellAttr9.FaceUnitTargetUponCompletionOfJumpCharge))
facing = target;
else
facing = destTarget.GetOrientation(); facing = destTarget.GetOrientation();
JumpArrivalCastArgs arrivalCast = new(); JumpArrivalCastArgs arrivalCast = new();
arrivalCast.SpellId = effectInfo.TriggerSpell; arrivalCast.SpellId = effectInfo.TriggerSpell;
unitCaster.GetMotionMaster().MoveJump(destTarget, speedXY, speedZ, EventId.Jump, facing, arrivalCast); unitCaster.GetMotionMaster().MoveJump(destTarget, speedXY, speedZ, EventId.Jump, facing, arrivalCast);
@@ -5567,6 +5578,11 @@ namespace Game.Spells
if (jumpParams.TreatSpeedAsMoveTimeSeconds) if (jumpParams.TreatSpeedAsMoveTimeSeconds)
speed = unitCaster.GetExactDist(destTarget) / jumpParams.Speed; speed = unitCaster.GetExactDist(destTarget) / jumpParams.Speed;
object facing = null;
Unit target = m_targets.GetUnitTarget();
if (target != null && m_spellInfo.HasAttribute(SpellAttr9.FaceUnitTargetUponCompletionOfJumpCharge))
facing = target;
JumpArrivalCastArgs arrivalCast = null; JumpArrivalCastArgs arrivalCast = null;
if (effectInfo.TriggerSpell != 0) if (effectInfo.TriggerSpell != 0)
{ {
@@ -5588,7 +5604,7 @@ namespace Game.Spells
effectExtra.ParabolicCurveId = jumpParams.ParabolicCurveId.Value; effectExtra.ParabolicCurveId = jumpParams.ParabolicCurveId.Value;
} }
unitCaster.GetMotionMaster().MoveJumpWithGravity(destTarget, speed, jumpParams.JumpGravity, EventId.Jump, null, arrivalCast, effectExtra); unitCaster.GetMotionMaster().MoveJumpWithGravity(destTarget, speed, jumpParams.JumpGravity, EventId.Jump, facing, arrivalCast, effectExtra);
} }
[SpellEffectHandler(SpellEffectName.LearnTransmogSet)] [SpellEffectHandler(SpellEffectName.LearnTransmogSet)]