[8251] Store in some DB tables only data for first rank.

* Allow add to DB data only for first rank in table `mangos_spell_bonus_data` and `mangos_spell_proc_event`.
* Copy data for other ranks for speedup use at loading for this data and data from `spell_proc_item_enchant`.
This commit is contained in:
VladimirMangos 2009-07-26 10:39:45 +04:00
parent fd2eb3cfee
commit 7ac4dc6f13
10 changed files with 440 additions and 225 deletions

View file

@ -1918,13 +1918,19 @@ void Pet::CastPetAura(PetAura const* aura)
CastSpell(this, auraId, true);
}
struct DoPetLearnSpell
{
DoPetLearnSpell(Pet& _pet) : pet(_pet) {}
void operator() (uint32 spell_id) { pet.learnSpell(spell_id); }
Pet& pet;
};
void Pet::learnSpellHighRank(uint32 spellid)
{
learnSpell(spellid);
SpellChainMapNext const& nextMap = spellmgr.GetSpellChainNext();
for(SpellChainMapNext::const_iterator itr = nextMap.lower_bound(spellid); itr != nextMap.upper_bound(spellid); ++itr)
learnSpellHighRank(itr->second);
DoPetLearnSpell worker(*this);
spellmgr.doForHighRanks(spellid,worker);
}
void Pet::SynchronizeLevelWithOwner()