[8250] Cleanup code and data for spell_threat

* Load table data to std::map instead SQLStorage and add check loaded spell existance.
* Drop from table not existed spells.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
nos4r2zod 2009-07-26 05:45:33 +04:00 committed by VladimirMangos
parent 13b709a10b
commit fd2eb3cfee
9 changed files with 64 additions and 33 deletions

View file

@ -3566,13 +3566,14 @@ void Spell::HandleThreatSpells(uint32 spellId)
if(!m_targets.getUnitTarget()->CanHaveThreatList())
return;
SpellThreatEntry const *threatSpell = sSpellThreatStore.LookupEntry<SpellThreatEntry>(spellId);
if(!threatSpell)
uint16 threat = spellmgr.GetSpellThreat(spellId);
if(!threat)
return;
m_targets.getUnitTarget()->AddThreat(m_caster, float(threatSpell->threat));
m_targets.getUnitTarget()->AddThreat(m_caster, float(threat));
DEBUG_LOG("Spell %u, rank %u, added an additional %i threat", spellId, spellmgr.GetSpellRank(spellId), threatSpell->threat);
DEBUG_LOG("Spell %u, rank %u, added an additional %i threat", spellId, spellmgr.GetSpellRank(spellId), threat);
}
void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i, float DamageMultiplier)