diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index cbfbed075..fb90447b6 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3908,9 +3908,9 @@ void Player::SendLearnPacket(uint32 spellId, bool learn) } } -bool Player::addSpell(uint32 spellId, uint8 addSpecMask, bool updateActive, bool temporary) +bool Player::addSpell(uint32 spellId, uint8 addSpecMask, bool updateActive, bool temporary /*= false*/, bool learnFromSkill /*= false*/) { - if (!_addSpell(spellId, addSpecMask, temporary)) + if (!_addSpell(spellId, addSpecMask, temporary, learnFromSkill)) return false; if (!updateActive) @@ -3955,7 +3955,7 @@ bool Player::addSpell(uint32 spellId, uint8 addSpecMask, bool updateActive, bool return true; } -bool Player::_addSpell(uint32 spellId, uint8 addSpecMask, bool temporary) +bool Player::_addSpell(uint32 spellId, uint8 addSpecMask, bool temporary, bool learnFromSkill /*= false*/) { // pussywizard: this can be called to OVERWRITE currently existing spell params! usually to set active = false for lower ranks of a spell @@ -3971,7 +3971,7 @@ bool Player::_addSpell(uint32 spellId, uint8 addSpecMask, bool temporary) // xinef: send packet so client can properly recognize this new spell // xinef: ignore passive spells and spells with learn effect // xinef: send spells with no aura effects (ie dual wield) - if (IsInWorld() && !isBeingLoaded() && temporary && (!spellInfo->HasAttribute(SpellAttr0(SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE)) || !spellInfo->HasAnyAura()) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL)) + if (IsInWorld() && !isBeingLoaded() && temporary && (learnFromSkill || !spellInfo->HasAttribute(SpellAttr0(SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE)) || !spellInfo->HasAnyAura()) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL)) SendLearnPacket(spellInfo->Id, true); // xinef: DO NOT allow to learn spell with effect learn spell! @@ -24033,7 +24033,7 @@ void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 skill_value) continue; } - addSpell(pAbility->spellId, SPEC_MASK_ALL, true, true); + addSpell(pAbility->spellId, SPEC_MASK_ALL, true, true, true); } } } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 2b34c777b..051a0c876 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1695,8 +1695,8 @@ public: void SendProficiency(ItemClass itemClass, uint32 itemSubclassMask); void SendInitialSpells(); void SendLearnPacket(uint32 spellId, bool learn); - bool addSpell(uint32 spellId, uint8 addSpecMask, bool updateActive, bool temporary = false); - bool _addSpell(uint32 spellId, uint8 addSpecMask, bool temporary); + bool addSpell(uint32 spellId, uint8 addSpecMask, bool updateActive, bool temporary = false, bool learnFromSkill = false); + bool _addSpell(uint32 spellId, uint8 addSpecMask, bool temporary, bool learnFromSkill = false); void learnSpell(uint32 spellId); void removeSpell(uint32 spellId, uint8 removeSpecMask, bool onlyTemporary); void resetSpells();