aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraDefines.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp39
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h1
4 files changed, 29 insertions, 15 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 24bc4ab9612..61f152d2539 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -23282,7 +23282,7 @@ void Player::SendInitialPacketsAfterAddToMap()
if (HasAuraType(SPELL_AURA_HOVER))
setCompoundState.StateChanges.emplace_back(SMSG_MOVE_SET_HOVERING, m_movementCounter++);
- if (HasAuraType(SPELL_AURA_MOD_ROOT_DISABLE_GRAVITY) || HasAuraType(SPELL_AURA_MOD_STUN_DISABLE_GRAVITY))
+ if (HasAuraType(SPELL_AURA_MOD_ROOT_DISABLE_GRAVITY) || HasAuraType(SPELL_AURA_MOD_STUN_DISABLE_GRAVITY) || HasAuraType(SPELL_AURA_DISABLE_GRAVITY))
setCompoundState.StateChanges.emplace_back(SMSG_MOVE_DISABLE_GRAVITY, m_movementCounter++);
if (HasAuraType(SPELL_AURA_CAN_TURN_WHILE_FALLING))
diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h
index ee797fcca7b..cff795065a0 100644
--- a/src/server/game/Spells/Auras/SpellAuraDefines.h
+++ b/src/server/game/Spells/Auras/SpellAuraDefines.h
@@ -580,7 +580,7 @@ enum AuraType : uint32
SPELL_AURA_MOD_MOVEMENT_FORCE_MAGNITUDE = 485,
SPELL_AURA_486 = 486,
SPELL_AURA_COSMETIC_MOUNTED = 487,
- SPELL_AURA_488 = 488,
+ SPELL_AURA_DISABLE_GRAVITY = 488,
SPELL_AURA_MOD_ALTERNATIVE_DEFAULT_LANGUAGE = 489,
SPELL_AURA_490 = 490,
SPELL_AURA_491 = 491,
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 66cd932b254..50cf9eff408 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -557,7 +557,7 @@ NonDefaultConstructible<pAuraEffectHandler> AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleModMovementForceMagnitude, //485 SPELL_AURA_MOD_MOVEMENT_FORCE_MAGNITUDE
&AuraEffect::HandleNULL, //486
&AuraEffect::HandleNULL, //487 SPELL_AURA_COSMETIC_MOUNTED
- &AuraEffect::HandleNULL, //488
+ &AuraEffect::HandleAuraDisableGravity, //488 SPELL_AURA_DISABLE_GRAVITY
&AuraEffect::HandleModAlternativeDefaultLanguage, //489 SPELL_AURA_MOD_ALTERNATIVE_DEFAULT_LANGUAGE
&AuraEffect::HandleNULL, //490
&AuraEffect::HandleNULL, //491
@@ -3087,6 +3087,21 @@ void AuraEffect::HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode,
target->SetControlled(false, UNIT_STATE_FLEEING);
}
+static void HandleAuraDisableGravity(Unit* target, bool apply)
+{
+ // 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)
+ if (target->HasAuraType(SPELL_AURA_MOD_ROOT_DISABLE_GRAVITY)
+ || target->HasAuraType(SPELL_AURA_MOD_STUN_DISABLE_GRAVITY)
+ || target->HasAuraType(SPELL_AURA_DISABLE_GRAVITY)
+ || (target->IsCreature() && target->ToCreature()->IsFloating()))
+ return;
+
+ if (target->SetDisableGravity(apply))
+ if (!apply && !target->IsFlying())
+ target->GetMotionMaster()->MoveFall();
+}
+
void AuraEffect::HandleAuraModRootAndDisableGravity(AuraApplication const* aurApp, uint8 mode, bool apply) const
{
if (!(mode & AURA_EFFECT_HANDLE_REAL))
@@ -3096,13 +3111,7 @@ void AuraEffect::HandleAuraModRootAndDisableGravity(AuraApplication const* aurAp
target->SetControlled(apply, UNIT_STATE_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(SPELL_AURA_MOD_STUN_DISABLE_GRAVITY) || (target->IsCreature() && target->ToCreature()->IsFloating())))
- return;
-
- if (target->SetDisableGravity(apply))
- if (!apply && !target->IsFlying())
- target->GetMotionMaster()->MoveFall();
+ ::HandleAuraDisableGravity(target, apply);
}
void AuraEffect::HandleAuraModStunAndDisableGravity(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -3117,13 +3126,17 @@ void AuraEffect::HandleAuraModStunAndDisableGravity(AuraApplication const* aurAp
if (apply)
target->GetThreatManager().EvaluateSuppressed();
- // 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(SPELL_AURA_MOD_ROOT_DISABLE_GRAVITY) || (target->IsCreature() && target->ToCreature()->IsFloating())))
+ ::HandleAuraDisableGravity(target, apply);
+}
+
+void AuraEffect::HandleAuraDisableGravity(AuraApplication const* aurApp, uint8 mode, bool apply) const
+{
+ if (!(mode & AURA_EFFECT_HANDLE_REAL))
return;
- if (target->SetDisableGravity(apply))
- if (!apply && !target->IsFlying())
- target->GetMotionMaster()->MoveFall();
+ Unit* target = aurApp->GetTarget();
+
+ ::HandleAuraDisableGravity(target, apply);
}
/***************************/
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index 181826895af..abe57a454b7 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -202,6 +202,7 @@ class TC_GAME_API AuraEffect
void HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraModRootAndDisableGravity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraModStunAndDisableGravity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
+ void HandleAuraDisableGravity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
// charm
void HandleModPossess(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleModPossessPet(AuraApplication const* aurApp, uint8 mode, bool apply) const;