aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/SpellMgr.cpp')
-rw-r--r--src/game/SpellMgr.cpp49
1 files changed, 46 insertions, 3 deletions
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 9c9bb255ef2..ae708153142 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -1446,12 +1446,50 @@ void SpellMgr::LoadSpellElixirs()
void SpellMgr::LoadSpellThreats()
{
- sSpellThreatStore.Free(); // for reload
+ mSpellThreatMap.clear(); // need for reload case
- sSpellThreatStore.Load();
+ uint32 count = 0;
+
+ // 0 1
+ QueryResult *result = WorldDatabase.Query("SELECT entry, Threat FROM spell_threat");
+ if( !result )
+ {
+
+ barGoLink bar( 1 );
+
+ bar.step();
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %u aggro generating spells", count );
+ return;
+ }
+
+ barGoLink bar( result->GetRowCount() );
+
+ do
+ {
+ Field *fields = result->Fetch();
+
+ bar.step();
+
+ uint32 entry = fields[0].GetUInt32();
+ uint16 Threat = fields[1].GetUInt16();
+
+ if (!sSpellStore.LookupEntry(entry))
+ {
+ sLog.outErrorDb("Spell %u listed in `spell_threat` does not exist", entry);
+ continue;
+ }
+
+ mSpellThreatMap[entry] = Threat;
+
+ ++count;
+ } while( result->NextRow() );
+
+ delete result;
- sLog.outString( ">> Loaded %u aggro generating spells", sSpellThreatStore.RecordCount );
sLog.outString();
+ sLog.outString( ">> Loaded %u aggro generating spells", count );
}
bool SpellMgr::IsRankSpellDueToSpell(SpellEntry const *spellInfo_1,uint32 spellId_2) const
@@ -2843,6 +2881,11 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto
// Explicit Diminishing Groups
switch(spellproto->SpellFamilyName)
{
+ case SPELLFAMILY_GENERIC:
+ // some generic arena related spells have by some strange reason MECHANIC_TURN
+ if (spellproto->Mechanic == MECHANIC_TURN)
+ return DIMINISHING_NONE;
+ break;
case SPELLFAMILY_MAGE:
{
// Frostbite 0x80000000