Core/Movement: Implemented movement forces

Port From (https://github.com/TrinityCore/TrinityCore/commit/8e98ceb2936842ea0032cbfdc04a510d6b1e5de0)
This commit is contained in:
hondacrx
2019-09-08 12:48:10 -04:00
parent 981e1e04c1
commit 5b67e2f539
9 changed files with 458 additions and 62 deletions
+27 -1
View File
@@ -2330,6 +2330,23 @@ namespace Game.Spells
target.SetCanTurnWhileFalling(apply);
}
[AuraEffectHandler(AuraType.IgnoreMovementForces)]
void HandleIgnoreMovementForces(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{
if (!mode.HasAnyFlag(AuraEffectHandleModes.SendForClientMask))
return;
Unit target = aurApp.GetTarget();
if (!apply)
{
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
if (target.HasAuraType(GetAuraType()))
return;
}
target.SetIgnoreMovementForces(apply);
}
/****************************/
/*** THREAT ***/
/****************************/
@@ -2722,6 +2739,15 @@ namespace Game.Spells
target.UpdateSpeed(UnitMoveType.Run);
}
[AuraEffectHandler(AuraType.ModMovementForceMagnitude)]
void HandleModMovementForceMagnitude(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{
if (!mode.HasAnyFlag(AuraEffectHandleModes.ChangeAmountMask))
return;
aurApp.GetTarget().UpdateMovementForcesModMagnitude();
}
/*********************************************************/
/*** IMMUNITY ***/
/*********************************************************/
@@ -6027,7 +6053,7 @@ namespace Game.Spells
uint summonEntry = (uint)spellEffect.MiscValue;
if (summonEntry != 0)
summonedEntries.Add(summonEntry);
}
}