Changeset 285 for trunk

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

Location:
trunk
Files:
1 added
3 modified

Legend:

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

    r284 r285  
    4949#include "BattleGround.h" 
    5050#include "Util.h" 
     51#include "TemporarySummon.h" 
    5152 
    5253#define SPELL_CHANNEL_UPDATE_INTERVAL 1000 
     
    21882189    } 
    21892190 
     2191    // Unsummon summon as possessed creatures on spell cancel 
     2192    for (int i = 0; i < 3; i++) 
     2193    { 
     2194        if (m_spellInfo->Effect[i] == SPELL_EFFECT_SUMMON &&  
     2195            (m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED ||  
     2196             m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 ||  
     2197             m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3)) 
     2198        { 
     2199            // Possession is removed in the UnSummon function 
     2200            if (m_caster->GetCharm()) 
     2201                ((TemporarySummon*)m_caster->GetCharm())->UnSummon();  
     2202        } 
     2203    } 
     2204 
    21902205    finish(false); 
    21912206    m_caster->RemoveDynObject(m_spellInfo->Id); 
  • 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 
  • trunk/src/game/Unit.cpp

    r284 r285  
    4747#include "CellImpl.h" 
    4848#include "Path.h" 
    49 #include "TemporarySummon.h" 
    5049 
    5150#include <math.h> 
     
    34133412    if (m_currentSpells[CURRENT_CHANNELED_SPELL] && (!spell_id || m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id==spell_id)) 
    34143413    { 
    3415         // Unsummon any summoned as possessed creatures on channel interrupt 
    3416         SpellEntry const *spellInfo = m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo; 
    3417         for (int i = 0; i < 3; i++) 
    3418         { 
    3419             if (spellInfo->Effect[i] == SPELL_EFFECT_SUMMON &&  
    3420                 (spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED ||  
    3421                  spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 ||  
    3422                  spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3)) 
    3423             { 
    3424                 // Possession is removed in the UnSummon function 
    3425                 if (GetCharm()) 
    3426                     ((TemporarySummon*)GetCharm())->UnSummon();  
    3427             } 
    3428         } 
    3429  
    34303414        if (m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED) 
    34313415            m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel();