mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Core/Trainers: Remove all "hidden" rank based requirements for learning spell from trainers and always only rely on trainer_spell.ReqAbility fields in database
This commit is contained in:
@@ -150,26 +150,11 @@ namespace Trainer
|
||||
hasLearnSpellEffect = true;
|
||||
if (!player->HasSpell(spellEffect->TriggerSpell))
|
||||
knowsAllLearnedSpells = false;
|
||||
|
||||
if (uint32 previousRankSpellId = sSpellMgr->GetPrevSpellInChain(spellEffect->TriggerSpell))
|
||||
if (!player->HasSpell(previousRankSpellId))
|
||||
return SpellState::Unavailable;
|
||||
}
|
||||
|
||||
if (!hasLearnSpellEffect)
|
||||
{
|
||||
if (uint32 previousRankSpellId = sSpellMgr->GetPrevSpellInChain(trainerSpell->SpellId))
|
||||
if (!player->HasSpell(previousRankSpellId))
|
||||
return SpellState::Unavailable;
|
||||
}
|
||||
else if (knowsAllLearnedSpells)
|
||||
if (hasLearnSpellEffect && knowsAllLearnedSpells)
|
||||
return SpellState::Known;
|
||||
|
||||
// check additional spell requirement
|
||||
for (auto const& requirePair : sSpellMgr->GetSpellsRequiredForSpellBounds(trainerSpell->SpellId))
|
||||
if (!player->HasSpell(requirePair.second))
|
||||
return SpellState::Unavailable;
|
||||
|
||||
return SpellState::Available;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user