mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[12050] Interrupt possessed channeling when possessed dies
This commit is contained in:
parent
f946197259
commit
ce11b046e3
2 changed files with 15 additions and 2 deletions
|
|
@ -1010,6 +1010,20 @@ void Unit::JustKilledCreature(Creature* victim)
|
||||||
((Player*)this)->KilledMonster(normalInfo, victim->GetObjectGuid());
|
((Player*)this)->KilledMonster(normalInfo, victim->GetObjectGuid());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Interrupt channeling spell when a Possessed Summoned is killed
|
||||||
|
SpellEntry const* spellInfo = sSpellStore.LookupEntry(victim->GetUInt32Value(UNIT_CREATED_BY_SPELL));
|
||||||
|
if (spellInfo && spellInfo->HasAttribute(SPELL_ATTR_EX_FARSIGHT) && spellInfo->HasAttribute(SPELL_ATTR_EX_CHANNELED_1))
|
||||||
|
{
|
||||||
|
Unit* creator = GetMap()->GetUnit(victim->GetCreatorGuid());
|
||||||
|
if (creator && creator->GetCharmGuid() == victim->GetObjectGuid())
|
||||||
|
{
|
||||||
|
Spell* channeledSpell = creator->GetCurrentSpell(CURRENT_CHANNELED_SPELL);
|
||||||
|
if (channeledSpell && channeledSpell->m_spellInfo->Id == spellInfo->Id)
|
||||||
|
creator->InterruptNonMeleeSpells(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ******************************* Inform various hooks ************************************ */
|
||||||
// Inform victim's AI
|
// Inform victim's AI
|
||||||
if (victim->AI())
|
if (victim->AI())
|
||||||
victim->AI()->JustDied(this);
|
victim->AI()->JustDied(this);
|
||||||
|
|
@ -3677,7 +3691,6 @@ void Unit::FinishSpell(CurrentSpellTypes spellType, bool ok /*= true*/)
|
||||||
spell->finish(ok);
|
spell->finish(ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skipAutorepeat) const
|
bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skipAutorepeat) const
|
||||||
{
|
{
|
||||||
// We don't do loop here to explicitly show that melee spell is excluded.
|
// We don't do loop here to explicitly show that melee spell is excluded.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "12049"
|
#define REVISION_NR "12050"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue