Index: game/Unit.cpp =================================================================== --- game/Unit.cpp (revision 5278) +++ game/Unit.cpp (working copy) @@ -924,9 +925,23 @@ } } - if (damagetype != NODAMAGE) + if (damagetype != NODAMAGE && damagetype && pVictim->GetTypeId() == TYPEID_PLAYER) { - if(pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL] && pVictim->GetTypeId() == TYPEID_PLAYER && damage) + + for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++) + { + // skip channeled spell (processed differently below) + if (i == CURRENT_CHANNELED_SPELL) + continue; + + if(pVictim->m_currentSpells[i] && damagetype != DOT) + { + sLog.outDetail("Spell Delayed!%d",(int32)(0.25f * pVictim->m_currentSpells[i]->casttime)); + pVictim->m_currentSpells[i]->Delayed((int32)(0.25f * pVictim->m_currentSpells[i]->casttime)); + } + } + + if(pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]) { if (pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() == SPELL_STATE_CASTING) { @@ -2325,47 +2354,7 @@ } } - if (pVictim->GetTypeId() == TYPEID_PLAYER && *damage) - { - for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++) - { - // skip channeled spell (processed differently below) - if (i == CURRENT_CHANNELED_SPELL) - continue; - - if(pVictim->m_currentSpells[i]) - { - sLog.outDetail("Spell Delayed!%d",(int32)(0.25f * pVictim->m_currentSpells[i]->casttime)); - pVictim->m_currentSpells[i]->Delayed((int32)(0.25f * pVictim->m_currentSpells[i]->casttime)); - } - } - - // process channeled spell separately - if (pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]) - { - if (pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() == SPELL_STATE_CASTING) - { - uint32 channelInterruptFlags = pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->ChannelInterruptFlags; - if( channelInterruptFlags & CHANNEL_FLAG_DELAY ) - { - sLog.outDetail("Spell Delayed!%d",(int32)(0.25f * GetDuration(pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo))); - pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]->DelayedChannel((int32)(0.25f * GetDuration(pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo))); - return; - } - else if( !(channelInterruptFlags & (CHANNEL_FLAG_DAMAGE | CHANNEL_FLAG_DAMAGE2)) ) - return; - - sLog.outDetail("Spell Canceled!"); - pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel(); - } - else if (pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() == SPELL_STATE_DELAYED) - { - // break channeled spell in delayed state on damage - sLog.outDetail("Spell Canceled!"); - pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel(); - } - } - } + } void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool isTriggered)