Jump to content

[fix][5839] Channeling Spells Which Cause Damage To Caster, Reduce Own Duration


Recommended Posts

Posted

What bug does the patch fix?

When channeling spells like Hellfire cause damage to caster, they shorten own duration.

For which SubVersion revision was the patch created?

5789

Who has been writing this patch?

Ultron

Index: Unit.cpp
===================================================================
--- Unit.cpp        (revision 5789)
+++ Unit.cpp        (working copy)
@@ -830,10 +830,13 @@
                                        uint32 channelInterruptFlags = pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->ChannelInterruptFlags;
                                        if( channelInterruptFlags & CHANNEL_FLAG_DELAY )
                                        {
-                                                int32 delay = int32(0.25f * GetSpellDuration(pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo));
+                                                if(pVictim!=this) //don't shorten the duration of channeling if you damage yourself
+                                                {
+                                                int32 delay = int32(0.25f * GetSpellDuration(pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo));
                                                sLog.outDetail("Spell %u delayed (%d) at damage!",pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id,delay);
                                                pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]->DelayedChannel(delay);
-                                        }
+                                                }
+                                        }
                                        else if( (channelInterruptFlags & (CHANNEL_FLAG_DAMAGE | CHANNEL_FLAG_DAMAGE2)) )
                                        {
                                                sLog.outDetail("Spell %u canceled at damage!",pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id);

http://filebeam.com/2fff10e28f9bff036719789d99b7c0de

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use