From dff455da9d801df61786c04f42f38da9990de8ed Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 6 May 2020 18:07:27 -0400 Subject: [PATCH] Core/Player: fix weapon dependent aura talents not applied on talent learn Port From (https://github.com/TrinityCore/TrinityCore/commit/7f64eaa3ee28d3eb29f602dd0f36435734014789) --- Source/Game/Entities/Player/Player.Spells.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Source/Game/Entities/Player/Player.Spells.cs b/Source/Game/Entities/Player/Player.Spells.cs index 0d1fec965..7d53cfa10 100644 --- a/Source/Game/Entities/Player/Player.Spells.cs +++ b/Source/Game/Entities/Player/Player.Spells.cs @@ -2276,7 +2276,7 @@ namespace Game.Entities SendPacket(unlearnedSpells); } } - bool IsNeedCastPassiveSpellAtLearn(SpellInfo spellInfo) + bool HandlePassiveSpellLearn(SpellInfo spellInfo) { // note: form passives activated with shapeshift spells be implemented by HandleShapeshiftBoosts instead of spell_learn_spell // talent dependent passives activated at form apply have proper stance data @@ -2288,12 +2288,18 @@ namespace Game.Entities need_cast &= IsCurrentSpecMasterySpell(spellInfo); // Check EquippedItemClass - // passive spells which apply aura and have an item requirement are to be added in Player::ApplyItemDependentAuras - if (spellInfo.IsPassive() && spellInfo.EquippedItemClass >= 0) + // passive spells which apply aura and have an item requirement are to be added manually, instead of casted + if (spellInfo.EquippedItemClass >= 0) { foreach (SpellEffectInfo effectInfo in spellInfo.GetEffectsForDifficulty(Difficulty.None)) + { if (effectInfo != null && effectInfo.IsAura()) + { + if (!HasAura(spellInfo.Id) && HasItemFitToSpellRequirements(spellInfo)) + AddAura(spellInfo.Id, this); return false; + } + } } //Check CasterAuraStates @@ -2400,7 +2406,7 @@ namespace Game.Entities if (active) { - if (spellInfo.IsPassive() && IsNeedCastPassiveSpellAtLearn(spellInfo)) + if (spellInfo.IsPassive() && HandlePassiveSpellLearn(spellInfo)) CastSpell(this, spellId, true); } else if (IsInWorld) @@ -2528,7 +2534,7 @@ namespace Game.Entities // also cast passive spells (including all talents without SPELL_EFFECT_LEARN_SPELL) with additional checks else if (spellInfo.IsPassive()) { - if (IsNeedCastPassiveSpellAtLearn(spellInfo)) + if (HandlePassiveSpellLearn(spellInfo)) CastSpell(this, spellId, true); } else if (spellInfo.HasEffect(SpellEffectName.SkillStep))