Core/Trainers: Remove all "hidden" rank based requirements for learning spell from trainers and always only rely on trainer_spell.ReqAbility fields in database

Port From (https://github.com/TrinityCore/TrinityCore/commit/65df9d424d88a50ec9155d05cba12e529e6f9557)
This commit is contained in:
hondacrx
2021-02-09 13:03:07 -05:00
parent addc831f0d
commit 3e5742d95a
+1 -18
View File
@@ -137,28 +137,11 @@ namespace Game.Entities
hasLearnSpellEffect = true;
if (!player.HasSpell(spellEffect.TriggerSpell))
knowsAllLearnedSpells = false;
uint previousRankSpellId = Global.SpellMgr.GetPrevSpellInChain(spellEffect.TriggerSpell);
if (previousRankSpellId != 0)
if (!player.HasSpell(previousRankSpellId))
return TrainerSpellState.Unavailable;
}
if (!hasLearnSpellEffect)
{
uint previousRankSpellId = Global.SpellMgr.GetPrevSpellInChain(trainerSpell.SpellId);
if (previousRankSpellId != 0)
if (!player.HasSpell(previousRankSpellId))
return TrainerSpellState.Unavailable;
}
else if (knowsAllLearnedSpells)
if (hasLearnSpellEffect && knowsAllLearnedSpells)
return TrainerSpellState.Known;
// check additional spell requirement
foreach (var spellId in Global.SpellMgr.GetSpellsRequiredForSpellBounds(trainerSpell.SpellId))
if (!player.HasSpell(spellId))
return TrainerSpellState.Unavailable;
return TrainerSpellState.Available;
}