mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
[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
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user