Show
Ignore:
Timestamp:
11/19/08 13:48:11 (17 years ago)
Author:
yumileroy
Message:

[svn] Some update on channeled spells.

Original author: megamage
Date: 2008-11-14 14:19:23-06:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Spell.cpp

    r220 r226  
    955955        if( !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO) ) 
    956956        { 
    957             if(!unit->IsStandState() && !unit->hasUnitState(UNIT_STAT_STUNNED)) 
    958                 unit->SetStandState(PLAYER_STATE_NONE); 
    959  
    960957            m_caster->CombatStart(unit); 
    961958        } 
     
    12831280        cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster)); 
    12841281    } 
    1285     if(!(spellmgr.GetSpellCustomAttr(m_spellInfo->Id) & SPELL_ATTR_CU_PLAYERS_ONLY)) 
     1282    if(!(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_PLAYERS_ONLY)) 
    12861283    { 
    12871284        TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier); 
     
    22982295 
    22992296    // Okay, everything is prepared. Now we need to distinguish between immediate and evented delayed spells 
    2300     if (m_spellInfo->speed > 0.0f) 
     2297    if (m_spellInfo->speed > 0.0f && !IsChanneledSpell(m_spellInfo)) 
    23012298    { 
    23022299 
     
    23252322    { 
    23262323        m_spellState = SPELL_STATE_CASTING; 
     2324        m_caster->AddInterruptMask(m_spellInfo->ChannelInterruptFlags); 
    23272325        SendChannelStart(GetSpellDuration(m_spellInfo)); 
    23282326    } 
     
    25682566    { 
    25692567        // always cancel for channeled spells 
    2570         if( m_spellState == SPELL_STATE_CASTING ) 
    2571             cancel(); 
     2568        //if( m_spellState == SPELL_STATE_CASTING ) 
     2569        //    cancel(); 
    25722570        // don't cancel for melee, autorepeat, triggered and instant spells 
    2573         else if(!IsNextMeleeSwingSpell() && !IsAutoRepeat() && !m_IsTriggeredSpell && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT)) 
     2571        //else 
     2572        if(!IsNextMeleeSwingSpell() && !IsAutoRepeat() && !m_IsTriggeredSpell && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT)) 
    25742573            cancel(); 
    25752574    } 
     
    26022601                    // check for incapacitating player states 
    26032602                    if( m_caster->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED)) 
    2604                         cancel(); 
    2605  
    2606                     // check if player has turned if flag is set 
    2607                     if( m_spellInfo->ChannelInterruptFlags & CHANNEL_FLAG_TURNING && m_castOrientation != m_caster->GetOrientation() ) 
    26082603                        cancel(); 
    26092604                } 
     
    26692664    if(!m_caster) 
    26702665        return; 
     2666 
     2667    if(IsChanneledSpell(m_spellInfo)) 
     2668        m_caster->UpdateInterruptMask(); 
    26712669 
    26722670    if(m_spellState == SPELL_STATE_FINISHED) 
     
    47624760} 
    47634761 
    4764 void Spell::Delayed() 
    4765 { 
    4766     if(!m_caster || m_caster->GetTypeId() != TYPEID_PLAYER) 
    4767         return; 
    4768  
    4769     if (m_spellState == SPELL_STATE_DELAYED) 
    4770         return;                                             // spell is active and can't be time-backed 
     4762void Spell::Delayed() // only called in DealDamage() 
     4763{ 
     4764    if(!m_caster)// || m_caster->GetTypeId() != TYPEID_PLAYER) 
     4765        return; 
     4766 
     4767    //if (m_spellState == SPELL_STATE_DELAYED) 
     4768    //    return;                                             // spell is active and can't be time-backed 
    47714769 
    47724770    // spells not loosing casting time ( slam, dynamites, bombs.. ) 
    4773     if(!(m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_DAMAGE)) 
    4774         return; 
     4771    //if(!(m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_DAMAGE)) 
     4772    //    return; 
    47754773 
    47764774    //check resist chance