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

[svn] Fix broken spell target 38 (script target).
Implement linked spells, but will not enable it before testing.

Original author: megamage
Date: 2008-10-29 14:19:31-05:00

Files:
1 modified

Legend:

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

    r122 r131  
    923923    if(m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->AI()) 
    924924        ((Creature*)m_caster)->AI()->SpellHitTarget(unit, m_spellInfo); 
     925 
     926    if(int32 spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id, 1)) 
     927    { 
     928        if(spell_triggered > 0) 
     929            m_caster->CastSpell(unit, spell_triggered, true); 
     930        else 
     931            unit->RemoveAurasDueToSpell(-spell_triggered); 
     932    } 
    925933} 
    926934 
     
    12871295        radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex)); 
    12881296 
     1297    uint32 EffectChainTarget = m_spellInfo->EffectChainTarget[i]; 
     1298    uint32 unMaxTargets = m_spellInfo->MaxAffectedTargets; 
    12891299    if(m_originalCaster) 
     1300    { 
    12901301        if(Player* modOwner = m_originalCaster->GetSpellModOwner()) 
     1302        { 
    12911303            modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius,this); 
    1292  
    1293     uint32 EffectChainTarget = m_spellInfo->EffectChainTarget[i]; 
    1294     if(m_originalCaster) 
    1295         if(Player* modOwner = m_originalCaster->GetSpellModOwner()) 
    12961304            modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, EffectChainTarget, this); 
    1297  
    1298     uint32 unMaxTargets = m_spellInfo->MaxAffectedTargets; 
     1305        } 
     1306    } 
     1307 
    12991308    switch(cur) 
    13001309    { 
     
    15521561                    m_targets.setDestination(goScriptTarget->GetPositionX(),goScriptTarget->GetPositionY(),goScriptTarget->GetPositionZ()); 
    15531562            } 
     1563            else 
     1564            { 
     1565                if(creatureScriptTarget) 
     1566                    TagUnitMap.push_back(creatureScriptTarget); 
     1567                else if(goScriptTarget) 
     1568                    AddGOTarget(goScriptTarget, i); 
     1569            } 
    15541570        }break; 
    1555  
    15561571 
    15571572        // dummy 
     
    21762191            } 
    21772192        } 
     2193    } 
     2194 
     2195    if(int32 spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id, 0)) 
     2196    { 
     2197        if(spell_triggered > 0) 
     2198            m_caster->CastSpell(m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster, spell_triggered, true); 
     2199        else 
     2200            m_caster->RemoveAurasDueToSpell(-spell_triggered); 
    21782201    } 
    21792202