| 6294 | void ObjectMgr::LoadSpellDisabledEntrys() |
| 6295 | { |
| 6296 | m_DisabledPlayerSpells.clear(); // need for reload case |
| 6297 | m_DisabledCreatureSpells.clear(); |
| 6298 | QueryResult *result = WorldDatabase.Query("SELECT entry, disable_mask FROM spell_disabled"); |
| 6299 | |
| 6300 | uint32 total_count = 0; |
| 6301 | |
| 6302 | if( !result ) |
| 6303 | { |
| 6304 | barGoLink bar( 1 ); |
| 6305 | bar.step(); |
| 6306 | |
| 6307 | sLog.outString(); |
| 6308 | sLog.outString( ">> Loaded %u disabled spells", total_count ); |
| 6309 | return; |
| 6310 | } |
| 6311 | |
| 6312 | barGoLink bar( result->GetRowCount() ); |
| 6313 | |
| 6314 | Field* fields; |
| 6315 | do |
| 6316 | { |
| 6317 | bar.step(); |
| 6318 | fields = result->Fetch(); |
| 6319 | uint32 spellid = fields[0].GetUInt32(); |
| 6320 | if(!sSpellStore.LookupEntry(spellid)) |
| 6321 | { |
| 6322 | sLog.outErrorDb("Spell entry %u from `spell_disabled` doesn't exist in dbc, ignoring.",spellid); |
| 6323 | continue; |
| 6324 | } |
| 6325 | uint32 disable_mask = fields[1].GetUInt32(); |
| 6326 | if(disable_mask & SPELL_DISABLE_PLAYER) |
| 6327 | m_DisabledPlayerSpells.insert(spellid); |
| 6328 | if(disable_mask & SPELL_DISABLE_CREATURE) |
| 6329 | m_DisabledCreatureSpells.insert(spellid); |
| 6330 | ++total_count; |
| 6331 | } while ( result->NextRow() ); |
| 6332 | |
| 6333 | delete result; |
| 6334 | |
| 6335 | sLog.outString(); |
| 6336 | sLog.outString( ">> Loaded %u disabled spells from `spell_disabled`", total_count); |
| 6337 | } |
| 6338 | |