Core/Spells: Implement SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER (#17160)

* Core/Spells: Implement SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER
Closes #14972
(cherry picked from commit fd88a67182)
This commit is contained in:
mik1893
2016-06-14 20:06:00 +01:00
committed by joschiwald
parent d40c151cc8
commit 7f903afea2
2 changed files with 7 additions and 0 deletions

View File

@@ -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

View File

@@ -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);