aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2021-02-21 16:06:35 +0100
committerShauren <shauren.trinity@gmail.com>2021-02-21 16:06:35 +0100
commitd2a995368459b28af0309292587a39f95fbf754c (patch)
treef3fd8bfac06f03a3ead00cbcb2184d6254dfe2fe
parent84cb6718eee5a1beada137559f21396fb8f43705 (diff)
Core/Auras: Implemented SPELL_AURA_LEARN_SPELL
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp17
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h1
2 files changed, 17 insertions, 1 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 51ae0f7e695..1d3d4cb2251 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -263,7 +263,7 @@ NonDefaultConstructible<pAuraEffectHandler> AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleModMeleeRangedSpeedPct, //192 SPELL_AURA_MOD_MELEE_RANGED_HASTE
&AuraEffect::HandleModCombatSpeedPct, //193 SPELL_AURA_MELEE_SLOW (in fact combat (any type attack) speed pct)
&AuraEffect::HandleNoImmediateEffect, //194 SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL implemented in Unit::CalcAbsorbResist
- &AuraEffect::HandleNULL, //195 SPELL_AURA_LEARN_SPELL
+ &AuraEffect::HandleLearnSpell, //195 SPELL_AURA_LEARN_SPELL
&AuraEffect::HandleNULL, //196 SPELL_AURA_MOD_COOLDOWN - flat mod of spell cooldowns
&AuraEffect::HandleNoImmediateEffect, //197 SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE implemented in Unit::SpellCriticalBonus Unit::GetUnitCriticalChance
&AuraEffect::HandleNULL, //198 SPELL_AURA_MOD_COMBAT_RATING_FROM_COMBAT_RATING
@@ -4884,6 +4884,21 @@ void AuraEffect::HandleAuraModFaction(AuraApplication const* aurApp, uint8 mode,
}
}
+void AuraEffect::HandleLearnSpell(AuraApplication const* aurApp, uint8 mode, bool apply) const
+{
+ if (!(mode & AURA_EFFECT_HANDLE_REAL))
+ return;
+
+ Player* player = aurApp->GetTarget()->ToPlayer();
+ if (!player)
+ return;
+
+ if (apply)
+ player->LearnSpell(GetMiscValue(), true, 0, true);
+ else
+ player->RemoveSpell(GetMiscValue(), false, false, true);
+}
+
void AuraEffect::HandleComprehendLanguage(AuraApplication const* aurApp, uint8 mode, bool apply) const
{
if (!(mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK))
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index fa3f0d4b3f8..0f218e9e14f 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -296,6 +296,7 @@ class TC_GAME_API AuraEffect
void HandleForceReaction(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraEmpathy(AuraApplication const* aurApp, uint8 mode, bool apply) const;
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 HandleAuraLinked(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraOpenStable(AuraApplication const* aurApp, uint8 mode, bool apply) const;