aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormik1893 <michele.roscelli@gmail.com>2016-06-14 20:06:00 +0100
committerjoschiwald <joschiwald.trinity@gmail.com>2017-01-29 18:13:21 +0100
commit7f903afea27a7d2b370770f472ffef0f8d8177a8 (patch)
tree3d896c93fe525179181570dd5457c62d9a969035 /src
parentd40c151cc8aa10688362b010264b04bf8bb09358 (diff)
Core/Spells: Implement SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER (#17160)
* Core/Spells: Implement SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER Closes #14972 (cherry picked from commit fd88a67182b4915a702118151b1a1c6c87fe9ead)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Spell.cpp5
-rw-r--r--src/server/game/Spells/Spell.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 8c4de2a9efe..b43b6255447 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2364,6 +2364,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
// if target is flagged for pvp also flag caster if a player
if (unit->IsPvP() && m_caster->GetTypeId() == TYPEID_PLAYER)
enablePvP = true; // Decide on PvP flagging now, but act on it later.
+
SpellMissInfo missInfo2 = DoSpellHitOnUnit(spellHitTarget, mask, target->scaleAura);
if (missInfo2 != SPELL_MISS_NONE)
@@ -2504,6 +2505,10 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
unit->SetStandState(UNIT_STAND_STATE_STAND);
}
+ // Check for SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER
+ if (m_spellInfo->HasAttribute(SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER) && unit->GetTypeId() != TYPEID_PLAYER)
+ caster->CastSpell(unit, SPELL_INTERRUPT_NONPLAYER, true);
+
if (spellHitTarget)
{
//AI functions
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index ce8058beda3..53a9de5436f 100644
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -303,6 +303,8 @@ enum SpellEffectHandleMode
typedef std::list<std::pair<uint32, ObjectGuid>> DispelList;
+static const uint32 SPELL_INTERRUPT_NONPLAYER = 32747;
+
class TC_GAME_API Spell
{
friend void Unit::SetCurrentCastSpell(Spell* pSpell);