Core/Auras: Implemented SPELL_AURA_MOD_ROOT_DISABLE_GRAVITY
Port From (https://github.com/TrinityCore/TrinityCore/commit/dbed48becc30e10b4b17d95f595056d08a987bad)
This commit is contained in:
@@ -2467,6 +2467,28 @@ namespace Game.Spells
|
||||
target.SetControlled(false, UnitState.Fleeing);
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.ModRootDisableGravity)]
|
||||
void HandleAuraModRootAndDisableGravity(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
if (!mode.HasAnyFlag(AuraEffectHandleModes.Real))
|
||||
return;
|
||||
|
||||
Unit target = aurApp.GetTarget();
|
||||
|
||||
target.SetControlled(apply, UnitState.Root);
|
||||
|
||||
// Do not remove DisableGravity if there are more than this auraEffect of that kind on the unit or if it's a creature with DisableGravity on its movement template.
|
||||
if (!apply
|
||||
&& (target.HasAuraType(GetAuraType())
|
||||
|| target.HasAuraType(AuraType.ModStunDisableGravity)
|
||||
|| (target.IsCreature() && target.ToCreature().GetMovementTemplate().Flight == CreatureFlightMovementType.DisableGravity)))
|
||||
return;
|
||||
|
||||
if (target.SetDisableGravity(apply))
|
||||
if (!apply && !target.IsFlying())
|
||||
target.GetMotionMaster().MoveFall();
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.ModStunDisableGravity)]
|
||||
void HandleAuraModStunAndDisableGravity(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user