Core/Players: Only restore spells learned as quest rewards if they have the right AcquireMethod in SkillLineAbility.db2

Port From (https://github.com/TrinityCore/TrinityCore/commit/4acae3992bfecf85d68c0860007f7c538ca45a90)
This commit is contained in:
hondacrx
2020-05-22 14:17:06 -04:00
parent 3b44a21d76
commit 888d281aa7
3 changed files with 15 additions and 41 deletions
+11 -4
View File
@@ -119,12 +119,19 @@ namespace Game.Entities
uint learned_0 = effect.TriggerSpell;
if (!HasSpell(learned_0))
{
SpellInfo learnedInfo = Global.SpellMgr.GetSpellInfo(learned_0);
if (learnedInfo == null)
return;
found = false;
var skills = Global.SpellMgr.GetSkillLineAbilityMapBounds(learned_0);
foreach (var skillLine in skills)
{
if (skillLine.AcquireMethod == AbilityLearnType.RewardedFromQuest)
{
found = true;
break;
}
}
// profession specialization can be re-learned from npc
if (learnedInfo.GetEffect(0).Effect == SpellEffectName.TradeSkill && learnedInfo.GetEffect(1).Effect == 0 && learnedInfo.SpellLevel == 0)
if (!found)
return;
}