[11857] Fix sent level in trainer spell list - this fixes problems especially with druid trainers

* This allows to really  overwrite required level for spells
* Adds proper checks when buying
* Fixes default level requirement

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
Schmoozerd 2011-12-04 19:17:00 +01:00
parent 20e2dddd6c
commit adfa88d236
6 changed files with 31 additions and 19 deletions

View file

@ -8269,6 +8269,8 @@ void ObjectMgr::LoadTrainers(char const* tableName, bool isTemplates)
trainerSpell.reqSkillValue = fields[4].GetUInt32();
trainerSpell.reqLevel = fields[5].GetUInt32();
trainerSpell.isProvidedReqLevel = trainerSpell.reqLevel > 0;
// calculate learned spell for profession case when stored cast-spell
trainerSpell.learnedSpell = spell;
for(int i = 0; i < MAX_EFFECT_INDEX; ++i)
@ -8290,7 +8292,7 @@ void ObjectMgr::LoadTrainers(char const* tableName, bool isTemplates)
}
// already checked as valid spell so exist.
SpellEntry const *learnSpellinfo = sSpellStore.LookupEntry(trainerSpell.learnedSpell);
SpellEntry const* learnSpellinfo = sSpellStore.LookupEntry(trainerSpell.learnedSpell);
if (SpellMgr::IsProfessionSpell(trainerSpell.learnedSpell))
{
data.trainerType = 2;