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 bca4dc9b59e..3021111b303 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -24574,7 +24574,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 d5c86f32b25..537bc68defa 100644
--- a/src/server/game/Spells/Auras/SpellAuraDefines.h
+++ b/src/server/game/Spells/Auras/SpellAuraDefines.h
@@ -579,7 +579,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 3c65a72b5f8..14b3e40b3ed 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::HandleCosmeticMounted, //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
@@ -3144,6 +3144,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))
@@ -3153,13 +3168,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
@@ -3174,13 +3183,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 aab03b03cf9..78b45cfd5c4 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -204,6 +204,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;