[6938] Better check for skipping triggred spells at .learn all_myspell command use.

This not solve all cases unexpected spell learning for class but result a lot better
including avoid known examples problematic spells learned early.
This commit is contained in:
VladimirMangos 2008-12-24 06:51:53 +03:00
parent eeabb03e2d
commit f42eb05a4b
2 changed files with 5 additions and 3 deletions

View file

@ -1715,6 +1715,10 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(const char* /*args*/)
if(!spellInfo) if(!spellInfo)
continue; continue;
// skip server-side/triggered spells
if(spellInfo->spellLevel==0)
continue;
// skip wrong class/race skills // skip wrong class/race skills
if(!m_session->GetPlayer()->IsSpellFitByClassAndRace(spellInfo->Id)) if(!m_session->GetPlayer()->IsSpellFitByClassAndRace(spellInfo->Id))
continue; continue;
@ -1723,8 +1727,6 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(const char* /*args*/)
if( spellInfo->SpellFamilyName != family) if( spellInfo->SpellFamilyName != family)
continue; continue;
//TODO: skip triggered spells
// skip spells with first rank learned as talent (and all talents then also) // skip spells with first rank learned as talent (and all talents then also)
uint32 first_rank = spellmgr.GetFirstSpellInChain(spellInfo->Id); uint32 first_rank = spellmgr.GetFirstSpellInChain(spellInfo->Id);
if(GetTalentSpellCost(first_rank) > 0 ) if(GetTalentSpellCost(first_rank) > 0 )

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "6937" #define REVISION_NR "6938"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__