From 16d64a1695070f644c2067b1a2ead927c4e850b6 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 22 Feb 2021 15:42:51 -0500 Subject: [PATCH] Core/Auras: Implemented SPELL_AURA_LEARN_SPELL Port From (https://github.com/TrinityCore/TrinityCore/commit/d2a995368459b28af0309292587a39f95fbf754c) --- Source/Game/Spells/Auras/AuraEffect.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Source/Game/Spells/Auras/AuraEffect.cs b/Source/Game/Spells/Auras/AuraEffect.cs index 7b415076f..5bd3c7ec1 100644 --- a/Source/Game/Spells/Auras/AuraEffect.cs +++ b/Source/Game/Spells/Auras/AuraEffect.cs @@ -4581,6 +4581,22 @@ namespace Game.Spells } } + [AuraEffectHandler(AuraType.LearnSpell)] + void HandleLearnSpell(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply) + { + if (!mode.HasAnyFlag(AuraEffectHandleModes.Real)) + return; + + Player player = aurApp.GetTarget().ToPlayer(); + if (player == null) + return; + + if (apply) + player.LearnSpell((uint)GetMiscValue(), true, 0, true); + else + player.RemoveSpell((uint)GetMiscValue(), false, false, true); + } + [AuraEffectHandler(AuraType.ComprehendLanguage)] void HandleComprehendLanguage(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply) {