Show
Ignore:
Timestamp:
11/22/08 02:05:14 (17 years ago)
Author:
yumileroy
Message:

* Added missing part of mangos merge on interrupt channeling on aura cancel
* Removed hacks attempting to do the above only for possessing or farsight spells
* Moved summon as possessed unsummoning into more general area in Spell::cancel
* Added SQL updates for steam tonk and tonk mine scripts

Original author: gvcoman
Date: 2008-11-21 21:00:45-05:00

Files:
1 modified

Legend:

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

    r284 r285  
    359359        return; 
    360360 
    361     // Remove possess/charm/sight aura from the possessed/charmed as well 
    362     // TODO: Remove this once the ability to cancel aura sets at once is implemented 
    363     if(_player->GetCharm() || _player->GetFarsightTarget()) 
    364     { 
    365         for (int i = 0; i < 3; ++i) 
    366         { 
    367             if (spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_POSSESS || 
    368                 spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_POSSESS_PET || 
    369                 spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_CHARM || 
    370                 spellInfo->EffectApplyAuraName[i] == SPELL_AURA_BIND_SIGHT) 
    371             { 
    372                 // Fix me: creature may be killed during player aura cancel 
    373                 _player->RemoveAurasDueToSpellByCancel(spellId); 
    374                 if (_player->GetCharm()) 
    375                     _player->GetCharm()->RemoveAurasDueToSpellByCancel(spellId); 
    376                 else if (_player->GetFarsightTarget() && _player->GetFarsightTarget()->GetTypeId() != TYPEID_DYNAMICOBJECT) 
    377                     ((Unit*)_player->GetFarsightTarget())->RemoveAurasDueToSpellByCancel(spellId); 
    378                 return; 
    379             } 
    380             else if (spellInfo->Effect[i] == SPELL_EFFECT_SUMMON &&  
    381                 (spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED ||  
    382                  spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 ||  
    383                  spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3)) 
    384             { 
    385                 // Possession is removed in the UnSummon function 
    386                 ((TemporarySummon*)_player->GetCharm())->UnSummon(); 
    387             } 
    388         } 
    389     } 
    390  
    391361    // not allow remove non positive spells and spells with attr SPELL_ATTR_CANT_CANCEL 
    392362    if(!IsPositiveSpell(spellId) || (spellInfo->Attributes & SPELL_ATTR_CANT_CANCEL)) 
    393363        return; 
    394364 
     365    // channeled spell case (it currently casted then) 
     366    if(IsChanneledSpell(spellInfo)) 
     367    { 
     368        if(Spell* spell = _player->m_currentSpells[CURRENT_CHANNELED_SPELL]) 
     369        { 
     370            if(spell->m_spellInfo->Id==spellId) 
     371            { 
     372                spell->cancel(); 
     373                spell->SetReferencedFromCurrent(false); 
     374                _player->m_currentSpells[CURRENT_CHANNELED_SPELL] = NULL; 
     375            } 
     376        } 
     377        return; 
     378    } 
     379 
     380    // non channeled case 
    395381    _player->RemoveAurasDueToSpellByCancel(spellId); 
    396  
    397     if (spellId == 2584)                                    // Waiting to resurrect spell cancel, we must remove player from resurrect queue 
    398     { 
    399         BattleGround *bg = _player->GetBattleGround(); 
    400         if(!bg) 
    401             return; 
    402         bg->RemovePlayerFromResurrectQueue(_player->GetGUID()); 
    403     } 
    404382} 
    405383