diff options
| author | Shauren <shauren.trinity@gmail.com> | 2022-07-02 23:17:57 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-07-02 23:17:57 +0200 |
| commit | 2a5329847636ddc080c461bda06375edfbf3815d (patch) | |
| tree | c5b526f9241622955b8ad628cd02820de1e9ccd9 /src/server/game/Spells | |
| parent | 1a967dcd140e1ec7b2adcc20f6bc62a28abf6589 (diff) | |
Core/Units: Defined many UnitFlags3 and implemented UNIT_FLAG3_ALTERNATIVE_DEFAULT_LANGUAGE
Diffstat (limited to 'src/server/game/Spells')
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 20 | ||||
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.h | 1 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 9bc8834c5bf..89129702089 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -555,7 +555,7 @@ NonDefaultConstructible<pAuraEffectHandler> AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //486 &AuraEffect::HandleCosmeticMounted, //487 SPELL_AURA_COSMETIC_MOUNTED &AuraEffect::HandleNULL, //488 - &AuraEffect::HandleNULL, //489 SPELL_AURA_MOD_ALTERNATIVE_DEFAULT_LANGUAGE + &AuraEffect::HandleModAlternativeDefaultLanguage, //489 SPELL_AURA_MOD_ALTERNATIVE_DEFAULT_LANGUAGE &AuraEffect::HandleNULL, //490 &AuraEffect::HandleNULL, //491 &AuraEffect::HandleNULL, //492 @@ -4937,6 +4937,24 @@ void AuraEffect::HandleComprehendLanguage(AuraApplication const* aurApp, uint8 m } } +void AuraEffect::HandleModAlternativeDefaultLanguage(AuraApplication const* aurApp, uint8 mode, bool apply) const +{ + if (!(mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK)) + return; + + Unit* target = aurApp->GetTarget(); + + if (apply) + target->SetUnitFlag3(UNIT_FLAG3_ALTERNATIVE_DEFAULT_LANGUAGE); + else + { + if (target->HasAuraType(GetAuraType())) + return; + + target->RemoveUnitFlag3(UNIT_FLAG3_ALTERNATIVE_DEFAULT_LANGUAGE); + } +} + void AuraEffect::HandleAuraLinked(AuraApplication const* aurApp, uint8 mode, bool apply) const { Unit* target = aurApp->GetTarget(); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 8ed3ef13e41..8e8bc66f59c 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -300,6 +300,7 @@ class TC_GAME_API AuraEffect void HandleAuraModFaction(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleLearnSpell(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleComprehendLanguage(AuraApplication const* aurApp, uint8 mode, bool apply) const; + void HandleModAlternativeDefaultLanguage(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleAuraLinked(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleAuraOpenStable(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleAuraModFakeInebriation(AuraApplication const* aurApp, uint8 mode, bool apply) const; |
