Changeset 15 for trunk

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

[svn] * Make Grounding totem disappear after any spell redirection
Patch provided by Albrecht de Endrau

Original author: Neo2003
Date: 2008-10-05 15:17:41-05:00

Location:
trunk/src/game
Files:
3 modified

Legend:

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

    r6 r15  
    268268    m_selfContainer = NULL; 
    269269    m_triggeringContainer = triggeringContainer; 
     270    m_magnetPair.first = false; 
     271    m_magnetPair.second = NULL; 
    270272    m_deletable = true; 
    271273    m_delayAtDamageCount = 0; 
     
    948950        return; 
    949951 
     952    // remove spell_magnet aura after first spell redirect and destroy target if its totem 
     953    if(m_magnetPair.first && m_magnetPair.second && m_magnetPair.second == unit) 
     954    { 
     955        if(unit->GetTypeId() == TYPEID_UNIT && ((Creature*)unit)->isTotem()) 
     956            unit->DealDamage(unit,unit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); 
     957        return; 
     958    } 
     959 
    950960    // Recheck immune (only for delayed spells) 
    951961    if( m_spellInfo->speed && ( 
     
    48384848{ 
    48394849    // Check targets for creature type mask and remove not appropriate (skip explicit self target case, maybe need other explicit targets) 
    4840     if(m_spellInfo->EffectImplicitTargetA[eff]!=TARGET_SELF ) 
     4850    if(m_spellInfo->EffectImplicitTargetA[eff]!=TARGET_SELF && !m_magnetPair.first) 
    48414851    { 
    48424852        if (!CheckTargetCreatureType(target)) 
     
    49194929            if(Unit* magnet = (*itr)->GetCaster()) 
    49204930            { 
    4921                 if(magnet->IsWithinLOSInMap(m_caster)) 
    4922                 { 
     4931                if((*itr)->m_procCharges>0 && magnet->IsWithinLOSInMap(m_caster)) 
     4932                { 
     4933                    (*itr)->SetAuraProcCharges((*itr)->m_procCharges-1); 
     4934                    m_magnetPair.first = true; 
     4935                    m_magnetPair.second = magnet; 
     4936 
    49234937                    target = magnet; 
    49244938                    m_targets.setUnitTarget(target); 
  • trunk/src/game/Spell.h

    r6 r15  
    336336 
    337337        Unit* SelectMagnetTarget(); 
     338        std::pair <bool,Unit *> m_magnetPair; 
    338339        bool CheckTarget( Unit* target, uint32 eff, bool hitPhase ); 
    339340 
  • trunk/src/game/SpellAuras.h

    r2 r15  
    284284 
    285285        int32 m_procCharges; 
     286        void SetAuraProcCharges(int32 charges) { m_procCharges = charges; } 
    286287 
    287288        virtual Unit* GetTriggerTarget() const { return m_target; }