Core/Spells: Fixed spell effect 93 (SPELL_EFFECT_FORCE_DESELECT) (#19001)

This commit is contained in:
xinef1 authored and Aokromes committed 2017-02-05 01:57:59 +01:00
1 parent 524b4f6121
commit a76da51e7f
3 files changed
+118 -2

No files matched your search

+22 -2
View File
@@ -47,6 +47,7 @@
#include "Util.h"
#include "TemporarySummon.h"
#include "GridNotifiers.h"
#include "CellImpl.h"
#include "Formulas.h"
#include "ScriptMgr.h"
#include "SpellHistory.h"
@@ -4358,9 +4359,28 @@ void Spell::EffectForceDeselect(SpellEffIndex /*effIndex*/)
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
return;
WorldPacket data(SMSG_CLEAR_TARGET, 8);
float dist = m_caster->GetVisibilityRange();
// clear focus
WorldPacket data(SMSG_BREAK_TARGET, m_caster->GetPackGUID().size());
data << m_caster->GetPackGUID();
Trinity::MessageDistDelivererToHostile notifierBreak(m_caster, &data, dist);
m_caster->VisitNearbyWorldObject(dist, notifierBreak);
// and selection
data.Initialize(SMSG_CLEAR_TARGET, 8);
data << uint64(m_caster->GetGUID());
m_caster->SendMessageToSet(&data, true);
Trinity::MessageDistDelivererToHostile notifierClear(m_caster, &data, dist);
m_caster->VisitNearbyWorldObject(dist, notifierClear);
// we should also force pets to remove us from current target
Unit::AttackerSet attackerSet;
for (Unit::AttackerSet::const_iterator itr = m_caster->getAttackers().begin(); itr != m_caster->getAttackers().end(); ++itr)
if ((*itr)->GetTypeId() == TYPEID_UNIT && !(*itr)->CanHaveThreatList())
attackerSet.insert(*itr);
for (Unit::AttackerSet::const_iterator itr = attackerSet.begin(); itr != attackerSet.end(); ++itr)
(*itr)->AttackStop();
}
void Spell::EffectSelfResurrect(SpellEffIndex effIndex)