Core/Spells: Implement TRIGGERED_IGNORE_TARGET_CHECK TriggerCastFlag to allow ignoring most target checks (mostly the default DBC ones)

This commit is contained in:
Shocker committed 2013-04-16 02:21:29 +03:00
1 parent 647a20138f
commit 7e17679ada
2 files changed
+5

No files matched your search

+1
View File
@@ -422,6 +422,7 @@ enum TriggerCastFlags
TRIGGERED_DISALLOW_PROC_EVENTS = 0x00020000, //! Disallows proc events from triggered spell (default)
TRIGGERED_DONT_REPORT_CAST_ERROR = 0x00040000, //! Will return SPELL_FAILED_DONT_REPORT in CheckCast functions
TRIGGERED_IGNORE_EQUIPPED_ITEM_REQUIREMENT = 0x00080000, //! Will ignore equipped item requirements
TRIGGERED_IGNORE_TARGET_CHECK = 0x00100000, //! Will ignore most target checks (mostly DBC target checks)
TRIGGERED_FULL_MASK = 0xFFFFFFFF
};
+4
View File
@@ -2996,6 +2996,10 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
m_needComboPoints = false;
SpellCastResult result = CheckCast(true);
// target is checked in too many locations and with different results to handle each of them
// handle just the general SPELL_FAILED_BAD_TARGETS result which is the default result for most DBC target checks
if (_triggeredCastFlags & TRIGGERED_IGNORE_TARGET_CHECK && result == SPELL_FAILED_BAD_TARGETS)
result = SPELL_CAST_OK;
if (result != SPELL_CAST_OK && !IsAutoRepeat()) //always cast autorepeat dummy for triggering
{
// Periodic auras should be interrupted when aura triggers a spell which can't be cast