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

[svn] Spell target selection improvement. Remove most mangos hacks in spell target selection. (work almost done)
Merge mangos svn rev 6744.

Original author: megamage
Date: 2008-10-31 11:04:32-05:00

Files:
1 modified

Legend:

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

    r123 r139  
    472472} 
    473473 
    474 SingleEnemyTargetAura::SingleEnemyTargetAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, 
    475 Unit *caster, Item* castItem) : Aura(spellproto, eff, currentBasePoints, target, caster, castItem) 
    476 { 
    477     if (caster) 
    478         m_casters_target_guid = caster->GetTypeId()==TYPEID_PLAYER ? ((Player*)caster)->GetSelection() : caster->GetUInt64Value(UNIT_FIELD_TARGET); 
    479     else 
    480         m_casters_target_guid = 0; 
    481 } 
    482  
    483 SingleEnemyTargetAura::~SingleEnemyTargetAura() 
    484 { 
    485 } 
    486  
    487 Unit* SingleEnemyTargetAura::GetTriggerTarget() const 
    488 { 
    489     return ObjectAccessor::GetUnit(*m_target, m_casters_target_guid); 
    490 } 
    491  
    492474Aura* CreateAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem) 
    493475{ 
    494476    if (IsAreaAuraEffect(spellproto->Effect[eff])) 
    495477        return new AreaAura(spellproto, eff, currentBasePoints, target, caster, castItem); 
    496  
    497     uint32 triggeredSpellId = spellproto->EffectTriggerSpell[eff]; 
    498  
    499     SpellEntry const* triggredSpellInfo = sSpellStore.LookupEntry(triggeredSpellId); 
    500     if (triggredSpellInfo) 
    501         for (int i = 0; i < 3; ++i) 
    502             if (triggredSpellInfo->EffectImplicitTargetA[i] == TARGET_SINGLE_ENEMY) 
    503                 return new SingleEnemyTargetAura(spellproto, eff, currentBasePoints, target, caster, castItem); 
    504478 
    505479    return new Aura(spellproto, eff, currentBasePoints, target, caster, castItem); 
     
    19081882    } 
    19091883    // All ok cast by default case 
    1910     Spell *spell = new Spell(caster, triggredSpellInfo, true, originalCasterGUID ); 
     1884    Spell *spell = new Spell(m_target, triggredSpellInfo, true, originalCasterGUID ); 
    19111885 
    19121886    SpellCastTargets targets;