mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[12049] Let PossessedSummons despawn on Channeled-Aura interrupt
Maybe this mechanic should also be used for normal possessed mobs, but then their special handling must be removed Also not entirely sure if this a great place for this code to be - but I didn't catch a better suiting one
This commit is contained in:
parent
161b18b760
commit
f946197259
2 changed files with 32 additions and 2 deletions
|
|
@ -4360,6 +4360,36 @@ void Spell::SendChannelUpdate(uint32 time)
|
|||
{
|
||||
if (time == 0)
|
||||
{
|
||||
// Reset farsight for some possessing auras of possessed summoned (as they might work with different aura types)
|
||||
if (m_spellInfo->HasAttribute(SPELL_ATTR_EX_FARSIGHT) && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->GetCharmGuid()
|
||||
&& !IsSpellHaveAura(m_spellInfo, SPELL_AURA_MOD_POSSESS) && !IsSpellHaveAura(m_spellInfo, SPELL_AURA_MOD_POSSESS_PET))
|
||||
{
|
||||
Player* player = (Player*)m_caster;
|
||||
// These Auras are applied to self, so get the possessed first
|
||||
Unit* possessed = player->GetCharm();
|
||||
|
||||
player->SetCharm(NULL);
|
||||
if (possessed)
|
||||
player->SetClientControl(possessed, 0);
|
||||
player->SetMover(NULL);
|
||||
player->GetCamera().ResetView();
|
||||
player->RemovePetActionBar();
|
||||
|
||||
if (possessed)
|
||||
{
|
||||
possessed->clearUnitState(UNIT_STAT_CONTROLLED);
|
||||
possessed->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
|
||||
possessed->SetCharmerGuid(ObjectGuid());
|
||||
// TODO - Requires more specials for target?
|
||||
|
||||
// Some possessed might want to despawn?
|
||||
if (possessed->GetUInt32Value(UNIT_CREATED_BY_SPELL) == m_spellInfo->Id && possessed->GetTypeId() == TYPEID_UNIT)
|
||||
((Creature*)possessed)->ForcedDespawn();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
m_caster->RemoveAurasByCasterSpell(m_spellInfo->Id, m_caster->GetObjectGuid());
|
||||
|
||||
ObjectGuid target_guid = m_caster->GetChannelObjectGuid();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "12048"
|
||||
#define REVISION_NR "12049"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue