Changeset 276 for trunk

Show
Ignore:
Timestamp:
11/22/08 00:35:55 (17 years ago)
Author:
yumileroy
Message:

Unsummon summon as possessed creatures on spell channeling interrupt.

Original author: gvcoman
Date: 2008-11-18 15:52:52-05:00

Files:
1 modified

Legend:

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

    r272 r276  
    4747#include "CellImpl.h" 
    4848#include "Path.h" 
     49#include "TemporarySummon.h" 
    4950 
    5051#include <math.h> 
     
    34253426        m_currentSpells[CURRENT_CHANNELED_SPELL]->SetReferencedFromCurrent(false); 
    34263427        m_currentSpells[CURRENT_CHANNELED_SPELL] = NULL; 
     3428 
     3429        // Unsummon any summoned as possessed creatures on channel interrupt 
     3430        SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id); 
     3431        if (!spellInfo || !interrupted) 
     3432            return; 
     3433        for (int i = 0; i < 3; i++) 
     3434        { 
     3435            if (spellInfo->Effect[i] == SPELL_EFFECT_SUMMON &&  
     3436                (spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED ||  
     3437                 spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 ||  
     3438                 spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3)) 
     3439            { 
     3440                // Possession is removed in the UnSummon function 
     3441                if (GetCharm()) 
     3442                    ((TemporarySummon*)GetCharm())->UnSummon();  
     3443            } 
     3444        } 
    34273445    } 
    34283446}