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/Spell.cpp

    r69 r85  
    20332033    } 
    20342034 
     2035    if(m_caster->GetTypeId() == TYPEID_PLAYER || (m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->isPet())) 
     2036    { 
     2037        if(objmgr.IsPlayerSpellDisabled(m_spellInfo->Id)) 
     2038        { 
     2039            SendCastResult(SPELL_FAILED_SPELL_UNAVAILABLE); 
     2040            finish(false); 
     2041            return; 
     2042        } 
     2043    } 
     2044    else 
     2045    { 
     2046        if(objmgr.IsCreatureSpellDisabled(m_spellInfo->Id)) 
     2047        { 
     2048            finish(false); 
     2049            return; 
     2050        } 
     2051    } 
     2052 
    20352053    // Fill cost data 
    20362054    m_powerCost = CalculatePowerCost();