diff options
author | ariel- <ariel-@users.noreply.github.com> | 2017-02-23 02:51:31 -0300 |
---|---|---|
committer | ariel- <ariel-@users.noreply.github.com> | 2017-02-23 02:51:31 -0300 |
commit | 08fdac340c8af7d7426870d3ec51ab88c5dd77db (patch) | |
tree | 2e3047c877517a986a7c27cf8710dd7671bf39fd /src | |
parent | d61e0f79c40681ce7675e878e0ec0bdc2294527f (diff) |
Core/Players: fix 2 Seal of Righteousness spells on paladins
Closes #14239
Diffstat (limited to 'src')
-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); + } } } |