diff options
| author | Rat <gmstreetrat@gmail.com> | 2014-12-01 20:44:06 +0100 |
|---|---|---|
| committer | Rat <gmstreetrat@gmail.com> | 2014-12-01 20:44:06 +0100 |
| commit | 16219b483d59073acd3419f8b135bba0ac99dff6 (patch) | |
| tree | f9f5b2e9c4772cc5c1dd0ec464ada6ffee8dbbfa /src/server/game/Spells/SpellMgr.cpp | |
| parent | 96bc2ce242b8e864778d7ed2456a16ccb934e355 (diff) | |
Core/Spells:
- some work on player starting spells and skills
- fixed basic spell learning
- fixed some spell related datastore loads
Diffstat (limited to 'src/server/game/Spells/SpellMgr.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 3211ff389e8..22c68271aba 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3739,3 +3739,42 @@ void SpellMgr::LoadSpellInfoCorrections() TC_LOG_INFO("server.loading", ">> Loaded SpellInfo corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); } + +void SpellMgr::LoadPetFamilySpellsStore() +{ + for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) + { + SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(j); + if (!skillLine) + continue; + + SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->SpellID); + if (!spellInfo) + continue; + + SpellLevelsEntry const* levels = sSpellLevelsStore.LookupEntry(spellInfo->LevelsID); + if (spellInfo->LevelsID && (!levels || levels->SpellLevel)) + continue; + + if (SpellMiscEntry const* spellMisc = sSpellMiscStore.LookupEntry(spellInfo->MiscID)) + { + if (spellMisc->Attributes & SPELL_ATTR0_PASSIVE) + { + for (uint32 i = 1; i < sCreatureFamilyStore.GetNumRows(); ++i) + { + CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(i); + if (!cFamily) + continue; + + if (skillLine->SkillLine != cFamily->SkillLine[0] && skillLine->SkillLine != cFamily->SkillLine[1]) + continue; + + if (skillLine->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) + continue; + + sPetFamilySpellsStore[i].insert(spellInfo->ID); + } + } + } + } +} |
