aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-04-06 20:38:27 -0300
committerfunjoker <funjoker109@gmail.com>2020-04-27 12:25:52 +0200
commit7f64eaa3ee28d3eb29f602dd0f36435734014789 (patch)
treec0d757c70941a927a4392ec47d0aca5181e62e26 /src/server
parentaf3934e8ce181241db04b397299f36626bf0ed68 (diff)
Core/Player: fix weapon dependent aura talents not applied on talent learn
Closes #19408 (cherry picked from commit 5cb1555de6db43db03d6202b7edaa9c6835ecfab)
Diffstat (limited to 'src/server')
-rw-r--r--src/server/game/Entities/Player/Player.cpp14
-rw-r--r--src/server/game/Entities/Player/Player.h2
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;