[8250] Cleanup code and data for spell_threat Author: nos4r2zod
* Load table data to std::map instead SQLStorage and add check loaded spell existance.
* Drop from table not existed spells.
--HG--
branch : trunk
This commit is contained in:
+11
-2
@@ -40,8 +40,6 @@ class Player;
|
||||
class Spell;
|
||||
struct SpellModifier;
|
||||
|
||||
extern SQLStorage sSpellThreatStore;
|
||||
|
||||
// only used in code
|
||||
enum SpellCategories
|
||||
{
|
||||
@@ -527,6 +525,7 @@ typedef UNORDERED_MAP<uint32, SpellBonusEntry> SpellBonusMap;
|
||||
|
||||
typedef std::map<uint32, uint8> SpellElixirMap;
|
||||
typedef std::map<uint32, float> SpellProcItemEnchantMap;
|
||||
typedef std::map<uint32, uint16> SpellThreatMap;
|
||||
|
||||
// Spell script target related declarations (accessed using SpellMgr functions)
|
||||
enum SpellScriptTargetType
|
||||
@@ -764,6 +763,15 @@ class SpellMgr
|
||||
return SPELL_NORMAL;
|
||||
}
|
||||
|
||||
uint16 GetSpellThreat(uint32 spellid) const
|
||||
{
|
||||
SpellThreatMap::const_iterator itr = mSpellThreatMap.find(spellid);
|
||||
if(itr==mSpellThreatMap.end())
|
||||
return 0;
|
||||
|
||||
return itr->second;
|
||||
}
|
||||
|
||||
// Spell proc events
|
||||
SpellProcEventEntry const* GetSpellProcEvent(uint32 spellId) const
|
||||
{
|
||||
@@ -1081,6 +1089,7 @@ class SpellMgr
|
||||
SpellLearnSpellMap mSpellLearnSpells;
|
||||
SpellTargetPositionMap mSpellTargetPositions;
|
||||
SpellElixirMap mSpellElixirs;
|
||||
SpellThreatMap mSpellThreatMap;
|
||||
SpellProcEventMap mSpellProcEventMap;
|
||||
SpellProcItemEnchantMap mSpellProcItemEnchantMap;
|
||||
SpellBonusMap mSpellBonusMap;
|
||||
|
||||
Reference in New Issue
Block a user