diff options
author | ariel- <ariel-@users.noreply.github.com> | 2017-04-06 20:38:27 -0300 |
---|---|---|
committer | ariel- <ariel-@users.noreply.github.com> | 2017-04-06 20:38:27 -0300 |
commit | 5cb1555de6db43db03d6202b7edaa9c6835ecfab (patch) | |
tree | b1278f836e16267c74de283bd3b64bf3a628a9dd /src | |
parent | ab5920fc1cd490b0c4fce46d66afc3e32c955d9a (diff) |
Core/Player: fix weapon dependent aura talents not applied on talent learn
Closes #19408
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 16 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.h | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 26f47b5434f..33dfd479c3b 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3325,7 +3325,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()) @@ -3470,7 +3470,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)) @@ -3592,7 +3592,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 @@ -3601,12 +3601,18 @@ bool Player::IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const (!form && spellInfo->HasAttribute(SPELL_ATTR2_NOT_NEED_SHAPESHIFT))); // 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 (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { if (spellInfo->Effects[i].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 291325dc759..654811a58b5 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1550,7 +1550,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player> bool HasActiveSpell(uint32 spell) const; // show in spellbook TrainerSpellState GetTrainerSpellState(TrainerSpell const* trainer_spell) const; bool IsSpellFitByClassAndRace(uint32 spell_id) const; - bool IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const; + bool HandlePassiveSpellLearn(SpellInfo const* spellInfo); void SendProficiency(ItemClass itemClass, uint32 itemSubclassMask) const; void SendInitialSpells(); |