diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 037c3260a..6b2271396 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2996,7 +2996,7 @@ bool Player::_addSpell(uint32 spellId, uint8 addSpecMask, bool temporary, bool l // 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 && (learnFromSkill || !spellInfo->HasAttribute(SpellAttr0(SPELL_ATTR0_PASSIVE | SPELL_ATTR0_DO_NOT_DISPLAY)) || !spellInfo->HasAnyAura()) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL)) + if (IsInWorld() && !isBeingLoaded() && temporary && !learnFromSkill && (!spellInfo->HasAttribute(SpellAttr0(SPELL_ATTR0_PASSIVE | SPELL_ATTR0_DO_NOT_DISPLAY)) || !spellInfo->HasAnyAura()) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL)) SendLearnPacket(spellInfo->Id, true); // xinef: DO NOT allow to learn spell with effect learn spell! @@ -3168,7 +3168,7 @@ bool Player::IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const (!form && spellInfo->HasAttribute(SPELL_ATTR2_ALLOW_WHILE_NOT_SHAPESHIFTED))); } -void Player::learnSpell(uint32 spellId, bool temporary) +void Player::learnSpell(uint32 spellId, bool temporary /*= false*/, bool learnFromSkill /*= false*/) { // Xinef: don't allow to learn active spell once more if (HasActiveSpell(spellId)) @@ -3179,7 +3179,7 @@ void Player::learnSpell(uint32 spellId, bool temporary) uint32 firstRankSpellId = sSpellMgr->GetFirstSpellInChain(spellId); bool thisSpec = GetTalentSpellCost(firstRankSpellId) > 0 || sSpellMgr->IsAdditionalTalentSpell(firstRankSpellId); - bool added = addSpell(spellId, thisSpec ? GetActiveSpecMask() : SPEC_MASK_ALL, true, temporary); + bool added = addSpell(spellId, thisSpec ? GetActiveSpecMask() : SPEC_MASK_ALL, true, temporary, learnFromSkill); if (added) { sScriptMgr->OnPlayerLearnSpell(this, spellId); @@ -11260,11 +11260,11 @@ void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 skill_value) if (!IsInWorld()) { - addSpell(pAbility->Spell, SPEC_MASK_ALL, true, true, false); + addSpell(pAbility->Spell, SPEC_MASK_ALL, true, true); } else { - learnSpell(pAbility->Spell, true); + learnSpell(pAbility->Spell, true, true); } } } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index fc22a0863..9c2d47118 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1629,7 +1629,7 @@ public: void SendLearnPacket(uint32 spellId, bool learn); 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, bool temporary = false); + void learnSpell(uint32 spellId, bool temporary = false, bool learnFromSkill = false); void removeSpell(uint32 spellId, uint8 removeSpecMask, bool onlyTemporary); void resetSpells(); void LearnCustomSpells();