[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

@ -7028,8 +7028,7 @@ void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType)
}
// Use first rank to access spell item enchant procs
uint32 firstRank = spellmgr.GetFirstSpellInChain(spellInfo->Id);
float ppmRate = spellmgr.GetItemEnchantProcChance(firstRank);
float ppmRate = spellmgr.GetItemEnchantProcChance(spellInfo->Id);
float chance = ppmRate
? GetPPMProcChance(proto->Delay, ppmRate)
@ -19680,13 +19679,19 @@ bool Player::IsAllowUseFlyMountsHere() const
return v_map == 530 || v_map == 571 && HasSpell(54197);
}
struct DoPlayerLearnSpell
{
DoPlayerLearnSpell(Player& _player) : player(_player) {}
void operator() (uint32 spell_id) { player.learnSpell(spell_id,false); }
Player& player;
};
void Player::learnSpellHighRank(uint32 spellid)
{
learnSpell(spellid,false);
SpellChainMapNext const& nextMap = spellmgr.GetSpellChainNext();
for(SpellChainMapNext::const_iterator itr = nextMap.lower_bound(spellid); itr != nextMap.upper_bound(spellid); ++itr)
learnSpellHighRank(itr->second);
DoPlayerLearnSpell worker(*this);
spellmgr.doForHighRanks(spellid,worker);
}
void Player::_LoadSkills()