diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index ac2370e9c..07f490780 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -689,6 +689,9 @@ void Spell::prepareDataForTriggerSystem() case SPELLFAMILY_WARLOCK: // For Hellfire Effect / Rain of Fire / Seed of Corruption triggers need do it if (m_spellInfo->SpellFamilyFlags & 0x0000800000000060LL) m_canTrigger = true; break; + case SPELLFAMILY_PRIEST: // For Penance heal/damage triggers need do it + if (m_spellInfo->SpellFamilyFlags & 0x0001800000000000LL) m_canTrigger = true; + break; case SPELLFAMILY_HUNTER: // Hunter Explosive Trap Effect/Immolation Trap Effect/Frost Trap Aura/Snake Trap Effect if (m_spellInfo->SpellFamilyFlags & 0x0000200000000014LL) m_canTrigger = true; break; @@ -2258,8 +2261,12 @@ void Spell::handle_immediate() // start channeling if applicable if(IsChanneledSpell(m_spellInfo)) { - m_spellState = SPELL_STATE_CASTING; - SendChannelStart(GetSpellDuration(m_spellInfo)); + int32 duration = GetSpellDuration(m_spellInfo); + if (duration) + { + m_spellState = SPELL_STATE_CASTING; + SendChannelStart(duration); + } } // process immediate effects (items, ground, etc.) also initialize some variables diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index fb368539d..46154ce57 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2145,6 +2145,25 @@ void Aura::HandleAuraDummy(bool apply, bool Real) m_target->CastSpell(m_target,47287,true,NULL,this); return; } + + if (caster && m_removeMode == AURA_REMOVE_BY_DEATH) + { + // Stop caster Arcane Missle chanelling on death + if (m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE && + m_spellProto->SpellFamilyFlags&0x0000000000000800LL) + { + caster->InterruptSpell(CURRENT_CHANNELED_SPELL); + return; + } + // Stop caster Penance chanelling on death + if (m_spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && + m_spellProto->SpellFamilyFlags2 & 0x00000080) + { + caster->InterruptSpell(CURRENT_CHANNELED_SPELL); + return; + } + + } } // AT APPLY & REMOVE @@ -6573,7 +6592,7 @@ void Aura::PeriodicDummyTick() if (spell->SpellFamilyFlags & 0x0000000000000020LL) { if (caster) - caster->CastCustomSpell(m_target, 52212, &m_modifier.m_amount, NULL, NULL, true); + caster->CastCustomSpell(m_target, 52212, &m_modifier.m_amount, NULL, NULL, true, 0, this); return; } // Raise Dead diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 35d0e79c4..0eae48c20 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1352,6 +1352,30 @@ void Spell::EffectDummy(uint32 i) } break; case SPELLFAMILY_PRIEST: + // Penance + if (m_spellInfo->SpellFamilyFlags & 0x0080000000000000LL) + { + if (!unitTarget) + return; + + int hurt = 0; + int heal = 0; + switch(m_spellInfo->Id) + { + case 47540: hurt = 47758; heal = 47757; break; + case 53005: hurt = 53001; heal = 52986; break; + case 53006: hurt = 53002; heal = 52987; break; + case 53007: hurt = 53003; heal = 52988; break; + default: + sLog.outError("Spell::EffectDummy: Spell %u Penance need set correct heal/damage spell", m_spellInfo->Id); + return; + } + if (m_caster->IsFriendlyTo(unitTarget)) + m_caster->CastSpell(unitTarget, heal, true, 0); + else + m_caster->CastSpell(unitTarget, hurt, true, 0); + return; + } switch(m_spellInfo->Id ) { case 28598: // Touch of Weakness triggered spell