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

[svn] Add function GameObject::CastSpell?. Used for hunter's trap and so.
Use original caster instead caster to check spell hit result.
Let spell triggers have the same faction as the summoner.
Fix the bug that trigger creatures attack enemy. (no need use civilian extra flag in the future, 128 is enough)
Fix shadow step.

Original author: megamage
Date: 2008-11-02 00:59:44-05:00

Files:
1 modified

Legend:

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

    r142 r145  
    9595} 
    9696 
    97 void SpellCastTargets::setDestination(float x, float y, float z, bool send, uint32 mapId) 
     97void SpellCastTargets::setDestination(float x, float y, float z, bool send, int32 mapId) 
    9898{ 
    9999    m_destX = x; 
     
    103103    if(send) 
    104104        m_targetMask |= TARGET_FLAG_DEST_LOCATION; 
    105     if(mapId) 
     105    if(mapId >= 0) 
    106106        m_mapId = mapId; 
    107107} 
     
    416416        std::list<Unit*> tmpUnitMap; 
    417417 
    418         // Note: this hack with search required until GO casting not implemented 
    419         // environment damage spells already have around enemies targeting but this not help in case not existed GO casting support 
    420         // currently each enemy selected explicitly and self cast damage 
    421         if(m_spellInfo->EffectImplicitTargetA[i] == TARGET_ALL_AROUND_CASTER 
    422             && m_spellInfo->EffectImplicitTargetB[i]==TARGET_ALL_ENEMY_IN_AREA  
    423             && m_spellInfo->Effect[i]==SPELL_EFFECT_ENVIRONMENTAL_DAMAGE) 
    424         { 
    425             tmpUnitMap.push_back(m_targets.getUnitTarget()); 
    426         } 
    427         else 
    428         { 
    429             SetTargetMap(i,m_spellInfo->EffectImplicitTargetA[i],tmpUnitMap); 
    430             SetTargetMap(i,m_spellInfo->EffectImplicitTargetB[i],tmpUnitMap); 
    431         } 
     418        SetTargetMap(i,m_spellInfo->EffectImplicitTargetA[i],tmpUnitMap); 
     419        SetTargetMap(i,m_spellInfo->EffectImplicitTargetB[i],tmpUnitMap); 
    432420 
    433421        if(m_targets.HasDest()) 
     
    717705 
    718706    // Calculate hit result 
    719     target.missCondition = m_caster->SpellHitResult(pVictim, m_spellInfo, m_canReflect); 
     707    if(m_originalCaster) 
     708        target.missCondition = m_originalCaster->SpellHitResult(pVictim, m_spellInfo, m_canReflect); 
     709    else 
     710        target.missCondition = SPELL_MISS_NONE; 
    720711    if (target.missCondition == SPELL_MISS_NONE) 
    721712        ++m_countOfHit; 
     
    14551446                    || m_spellInfo->Effect[1] == SPELL_EFFECT_TELEPORT_UNITS 
    14561447                    || m_spellInfo->Effect[2] == SPELL_EFFECT_TELEPORT_UNITS) 
    1457                     m_targets.setDestination(st->target_X, st->target_Y, st->target_Z, true, st->target_mapId); 
     1448                    m_targets.setDestination(st->target_X, st->target_Y, st->target_Z, true, (int32)st->target_mapId); 
    14581449                else if(st->target_mapId == m_caster->GetMapId()) 
    14591450                    m_targets.setDestination(st->target_X, st->target_Y, st->target_Z);