Changeset 226 for trunk/src/game/Spell.cpp
- Timestamp:
- 11/19/08 13:48:11 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Spell.cpp
r220 r226 955 955 if( !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO) ) 956 956 { 957 if(!unit->IsStandState() && !unit->hasUnitState(UNIT_STAT_STUNNED))958 unit->SetStandState(PLAYER_STATE_NONE);959 960 957 m_caster->CombatStart(unit); 961 958 } … … 1283 1280 cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster)); 1284 1281 } 1285 if(!( spellmgr.GetSpellCustomAttr(m_spellInfo->Id) & SPELL_ATTR_CU_PLAYERS_ONLY))1282 if(!(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_PLAYERS_ONLY)) 1286 1283 { 1287 1284 TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_object_notifier(notifier); … … 2298 2295 2299 2296 // 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)) 2301 2298 { 2302 2299 … … 2325 2322 { 2326 2323 m_spellState = SPELL_STATE_CASTING; 2324 m_caster->AddInterruptMask(m_spellInfo->ChannelInterruptFlags); 2327 2325 SendChannelStart(GetSpellDuration(m_spellInfo)); 2328 2326 } … … 2568 2566 { 2569 2567 // always cancel for channeled spells 2570 if( m_spellState == SPELL_STATE_CASTING )2571 cancel();2568 //if( m_spellState == SPELL_STATE_CASTING ) 2569 // cancel(); 2572 2570 // 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)) 2574 2573 cancel(); 2575 2574 } … … 2602 2601 // check for incapacitating player states 2603 2602 if( m_caster->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED)) 2604 cancel();2605 2606 // check if player has turned if flag is set2607 if( m_spellInfo->ChannelInterruptFlags & CHANNEL_FLAG_TURNING && m_castOrientation != m_caster->GetOrientation() )2608 2603 cancel(); 2609 2604 } … … 2669 2664 if(!m_caster) 2670 2665 return; 2666 2667 if(IsChanneledSpell(m_spellInfo)) 2668 m_caster->UpdateInterruptMask(); 2671 2669 2672 2670 if(m_spellState == SPELL_STATE_FINISHED) … … 4762 4760 } 4763 4761 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-backed4762 void 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 4771 4769 4772 4770 // 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; 4775 4773 4776 4774 //check resist chance