diff options
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 876a5d1a626..191d52b175a 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -22923,10 +22923,31 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue) if (skillValue < ability->req_skill_value && ability->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) RemoveSpell(ability->spellId); // need learn - else if (!IsInWorld()) - AddSpell(ability->spellId, true, true, true, false, false, ability->skillId); else - LearnSpell(ability->spellId, true, ability->skillId); + { + // used to avoid double Seal of Righteousness on paladins, it's the only player spell which has both spell and forward spell in auto learn + if (ability->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && ability->forward_spellid) + { + bool skipCurrent = false; + auto bounds = sSpellMgr->GetSkillLineAbilityMapBounds(ability->forward_spellid); + for (auto itr = bounds.first; itr != bounds.second; ++itr) + { + if (itr->second->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && skillValue >= itr->second->req_skill_value) + { + skipCurrent = true; + break; + } + } + + if (skipCurrent) + continue; + } + + if (!IsInWorld()) + AddSpell(ability->spellId, true, true, true, false, false, ability->skillId); + else + LearnSpell(ability->spellId, true, ability->skillId); + } } } |