Added global disable system and moved all disable fields/tables/configs into it

NOTE: instance disables were not converted for new system! if you had some then you need to fix that using new system

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-07-21 12:14:23 +02:00
parent 0bda7fd361
commit 6a539270ec
23 changed files with 435 additions and 258 deletions
+6 -24
View File
@@ -51,6 +51,7 @@
#include "SpellAuraEffects.h"
#include "ScriptMgr.h"
#include "ConditionMgr.h"
#include "DisableMgr.h"
#define SPELL_CHANNEL_UPDATE_INTERVAL (1 * IN_MILLISECONDS)
@@ -2740,31 +2741,12 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const * triggere
finish(false);
return;
}
if (m_caster->GetTypeId() == TYPEID_PLAYER)
if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_SPELL, m_spellInfo->Id, m_caster))
{
if (objmgr.IsPlayerSpellDisabled(m_spellInfo->Id))
{
SendCastResult(SPELL_FAILED_SPELL_UNAVAILABLE);
finish(false);
return;
}
}
else if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet())
{
if (objmgr.IsPetSpellDisabled(m_spellInfo->Id))
{
SendCastResult(SPELL_FAILED_SPELL_UNAVAILABLE);
finish(false);
return;
}
}
else
{
if (objmgr.IsCreatureSpellDisabled(m_spellInfo->Id))
{
finish(false);
return;
}
SendCastResult(SPELL_FAILED_SPELL_UNAVAILABLE);
finish(false);
return;
}
if (m_caster->GetTypeId() == TYPEID_PLAYER)
+3 -3
View File
@@ -52,9 +52,9 @@ enum SpellCategories
enum SpellDisableTypes
{
SPELL_DISABLE_PLAYER = 1,
SPELL_DISABLE_CREATURE = 2,
SPELL_DISABLE_PET = 4
SPELL_DISABLE_PLAYER = 1,
SPELL_DISABLE_CREATURE = 2,
SPELL_DISABLE_PET = 4
};
enum SpellEffectTargetTypes