Show
Ignore:
Timestamp:
11/19/08 13:32:53 (17 years ago)
Author:
yumileroy
Message:

[svn] Implement a new table (spell_disabled) to allow disabling some spells for players and / or creatures. To disable a spell for a players and pets, set 20 in the disable_mask, to disable for creatures, set 21. The comment field is optional. Original patch provided by Craker.

Original author: w12x
Date: 2008-10-21 03:58:38-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/ObjectMgr.cpp

    r83 r85  
    62926292} 
    62936293 
     6294void 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 
    62946339void ObjectMgr::LoadFishingBaseSkillLevel() 
    62956340{