diff options
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 14 | ||||
| -rw-r--r-- | src/server/game/Entities/Player/Player.h | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ae089ed5398..958d636f70c 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2936,7 +2936,7 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent if (active) { - if (spellInfo->IsPassive() && IsNeedCastPassiveSpellAtLearn(spellInfo)) + if (spellInfo->IsPassive() && HandlePassiveSpellLearn(spellInfo)) CastSpell(this, spellId, true); } else if (IsInWorld()) @@ -3063,7 +3063,7 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent // 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(SPELL_EFFECT_SKILL_STEP)) @@ -3194,7 +3194,7 @@ void Player::RemoveTemporarySpell(uint32 spellId) m_spells.erase(itr); } -bool Player::IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const +bool Player::HandlePassiveSpellLearn(SpellInfo const* 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 @@ -3206,12 +3206,16 @@ bool Player::IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const 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) { for (SpellEffectInfo const* effectInfo : spellInfo->GetEffectsForDifficulty(DIFFICULTY_NONE)) if (effectInfo && effectInfo->IsAura()) + { + if (!HasAura(spellInfo->Id) && HasItemFitToSpellRequirements(spellInfo)) + AddAura(spellInfo->Id, this); return false; + } } //Check CasterAuraStates diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 0eacdb13fe1..cd43d319960 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1556,7 +1556,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player> bool HasActiveSpell(uint32 spell) const; // show in spellbook SpellInfo const* GetCastSpellInfo(SpellInfo const* spellInfo) const override; bool IsSpellFitByClassAndRace(uint32 spell_id) const; - bool IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const; + bool HandlePassiveSpellLearn(SpellInfo const* spellInfo); bool IsCurrentSpecMasterySpell(SpellInfo const* spellInfo) const; void SendProficiency(ItemClass itemClass, uint32 itemSubclassMask) const; |
