aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormik1893 <michele.roscelli@gmail.com>2016-06-14 20:06:00 +0100
committerGitHub <noreply@github.com>2016-06-14 20:06:00 +0100
commitfd88a67182b4915a702118151b1a1c6c87fe9ead (patch)
treeb6c3ef3b06730ae0e10e60c13fb0f098cdbc63de /src
parentd1d0c64ad11cb3faf986a5332fec6b704fb8026c (diff)
Core/Spells: Implement SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER (#17160)
* Core/Spells: Implement SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER Closes #14972
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Spell.cpp5
-rw-r--r--src/server/game/Spells/Spell.h2
-rw-r--r--src/server/game/Spells/SpellMgr.cpp7
3 files changed, 14 insertions, 0 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 51f1d71dae3..430e42c4412 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2327,6 +2327,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)
{
@@ -2466,6 +2467,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 b7134283ccb..46384fc54ec 100644
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -218,6 +218,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);
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 8a22898e326..8ea3a59c3e8 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3338,6 +3338,13 @@ void SpellMgr::LoadSpellInfoCorrections()
//! HACK: This spell break quest complete for alliance and on retail not used °_O
spellInfo->Effects[EFFECT_0].Effect = 0;
break;
+ case 47476: // Deathknight - Strangulate
+ case 15487: // Priest - Silence
+ case 5211: // Druid - Bash - R1
+ case 6798: // Druid - Bash - R2
+ case 8983: // Druid - Bash - R3
+ spellInfo->AttributesEx7 |= SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER;
+ break;
// VIOLET HOLD SPELLS
//
case 54258: // Water Globule (Ichoron)