aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Auras
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-09-07 00:58:37 +0200
committerShauren <shauren.trinity@gmail.com>2024-09-07 00:58:37 +0200
commit010550da224c446461b26bc4f38ee5cc35d4aa3d (patch)
treed00906ba8a65931fe3baad234384492f8b95bfff /src/server/game/Spells/Auras
parent4eb6fe462c106b21f5c625074d75377db614767b (diff)
Core/Auras: Implemented SPELL_AURA_MOVE_SET_CANT_SWIM and related new opcodes
Diffstat (limited to 'src/server/game/Spells/Auras')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraDefines.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp19
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h1
3 files changed, 20 insertions, 2 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h
index c3fb03e4690..af7bcc784f5 100644
--- a/src/server/game/Spells/Auras/SpellAuraDefines.h
+++ b/src/server/game/Spells/Auras/SpellAuraDefines.h
@@ -636,7 +636,7 @@ enum AuraType : uint32
SPELL_AURA_TRIGGER_SPELL_ON_STACK_AMOUNT = 542, // NYI
SPELL_AURA_543 = 543,
SPELL_AURA_544 = 544,
- SPELL_AURA_545 = 545, // prevent swim
+ SPELL_AURA_MOVE_SET_CANT_SWIM = 545,
SPELL_AURA_546 = 546,
SPELL_AURA_547 = 547,
SPELL_AURA_548 = 548,
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 7e917275510..e3dbdc50eb6 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -614,7 +614,7 @@ NonDefaultConstructible<pAuraEffectHandler> AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleNULL, //542 SPELL_AURA_TRIGGER_SPELL_ON_STACK_AMOUNT
&AuraEffect::HandleNULL, //543
&AuraEffect::HandleNULL, //544
- &AuraEffect::HandleNULL, //545
+ &AuraEffect::HandleSetCantSwim, //545 SPELL_AURA_MOVE_SET_CANT_SWIM
&AuraEffect::HandleNULL, //546
&AuraEffect::HandleNULL, //547
&AuraEffect::HandleNULL, //548
@@ -2975,6 +2975,23 @@ void AuraEffect::HandleDisableInertia(AuraApplication const* aurApp, uint8 mode,
target->SetDisableInertia(apply);
}
+void AuraEffect::HandleSetCantSwim(AuraApplication const* aurApp, uint8 mode, bool apply) const
+{
+ if (!(mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK))
+ 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->SetMoveCantSwim(apply);
+}
+
/****************************/
/*** THREAT ***/
/****************************/
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index c6ac44bc24c..446f21b6be4 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -188,6 +188,7 @@ class TC_GAME_API AuraEffect
void HandleAuraCanTurnWhileFalling(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleIgnoreMovementForces(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleDisableInertia(AuraApplication const* aurApp, uint8 mode, bool apply) const;
+ void HandleSetCantSwim(AuraApplication const* aurApp, uint8 mode, bool apply) const;
// threat
void HandleModThreat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraModTotalThreat(AuraApplication const* aurApp, uint8 mode, bool apply) const;