diff options
author | w12x <none@none> | 2008-10-21 03:58:38 -0500 |
---|---|---|
committer | w12x <none@none> | 2008-10-21 03:58:38 -0500 |
commit | 5e1c19e4d9b6e2deb247e6ce6b25ea132b8118d4 (patch) | |
tree | 57a6e1b306028999076e3e80bb52cadbc4af24e1 /src/game/Spell.cpp | |
parent | 23ff96ded9d418402b78832fd0555c781942eb5b (diff) |
[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 2^0 in the disable_mask, to disable for creatures, set 2^1. The comment field is optional. Original patch provided by Craker.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r-- | src/game/Spell.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 3c44df10cb9..848895306da 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2032,6 +2032,24 @@ void Spell::prepare(SpellCastTargets * targets, Aura* triggeredByAura) return; } + if(m_caster->GetTypeId() == TYPEID_PLAYER || (m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->isPet())) + { + if(objmgr.IsPlayerSpellDisabled(m_spellInfo->Id)) + { + SendCastResult(SPELL_FAILED_SPELL_UNAVAILABLE); + finish(false); + return; + } + } + else + { + if(objmgr.IsCreatureSpellDisabled(m_spellInfo->Id)) + { + finish(false); + return; + } + } + // Fill cost data m_powerCost = CalculatePowerCost(); |