Changeset 222 for trunk

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

[svn] Fix blink. Bug: can blink through door. Author: GodsdoG.
Fix blessed recovery and martyrdom. Patch provided by Gomez.
setActive for Akama shade to see if this can fix the bug that it cannot find channeler.

Original author: megamage
Date: 2008-11-12 23:06:51-06:00

Location:
trunk
Files:
1 added
2 removed
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp

    r117 r222  
    197197    void Reset() 
    198198    { 
     199        m_creature->setActive(true); // TODO: setActive(true, time); 
    199200        FindChannelers(); 
    200201 
     
    213214                                if(m_creature->isAlive()) 
    214215                                { 
    215                 Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true); 
    216                 Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true); 
    217                 Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 
     216                    Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true); 
     217                    Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true); 
     218                    Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 
    218219                                } 
    219220            } 
  • trunk/src/game/SpellEffects.cpp

    r221 r222  
    55025502        return; 
    55035503 
    5504     uint32 mapid = unitTarget->GetMapId(); 
     5504    uint32 mapid = m_caster->GetMapId(); 
     5505    float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])); 
     5506 
     5507    // src point 
     5508    float *fx = new float[11], *fy = new float[11], *fz = new float[11]; 
     5509    unitTarget->GetPosition(fx[0], fy[0], fz[0]); 
     5510 
     5511    float orientation = unitTarget->GetOrientation(), itr_i, step = dis / 10.0, fx2, fy2, fz2, ground, floor; 
     5512    int itr_j = 1, last_valid = 0; 
     5513    bool hit = false; 
     5514 
     5515    for (itr_i = step; itr_i <= dis; itr_i += step) 
     5516    { 
     5517        fx[itr_j] = fx[0] + itr_i * cos(orientation); 
     5518        fy[itr_j] = fy[0] + itr_i * sin(orientation); 
     5519        ground = MapManager::Instance().GetMap(mapid, unitTarget)->GetHeight(fx[itr_j], fy[itr_j], MAX_HEIGHT, true); 
     5520        floor = MapManager::Instance().GetMap(mapid, unitTarget)->GetHeight(fx[itr_j], fy[itr_j], fz[last_valid], true); 
     5521        fz[itr_j] = fabs(ground - fz[last_valid]) <= fabs(floor - fz[last_valid]) ? ground : floor; 
     5522        if (fabs(fz[itr_j] - fz[0]) <= 6.0) 
     5523        { 
     5524            if (VMAP::VMapFactory::createOrGetVMapManager()->getObjectHitPos(mapid, fx[last_valid], fy[last_valid], fz[last_valid] + 0.5, fx[itr_j], fy[itr_j], fz[itr_j] + 0.5, fx2, fy2, fz2, -0.5)) 
     5525            { 
     5526                hit = true; 
     5527                fx[itr_j] = fx2 - 0.6 * cos(orientation); 
     5528                fy[itr_j] = fy2 - 0.6 * sin(orientation); 
     5529                ground = MapManager::Instance().GetMap(mapid, unitTarget)->GetHeight(fx[itr_j], fy[itr_j], MAX_HEIGHT, true); 
     5530                floor = MapManager::Instance().GetMap(mapid, unitTarget)->GetHeight(fx[itr_j], fy[itr_j], fz[last_valid], true); 
     5531                float tempz = fabs(ground - fz[last_valid]) <= fabs(floor - fz[last_valid]) ? ground : floor; 
     5532                fz[itr_j] = fabs(tempz - fz[last_valid]) <= fabs(fz2 - fz[last_valid]) ? tempz : fz2; 
     5533                break; 
     5534            } 
     5535            else 
     5536                last_valid = itr_j; 
     5537        } 
     5538        itr_j++; 
     5539    } 
     5540    if (hit == false) 
     5541        itr_j = last_valid; 
     5542 
     5543 
     5544    if (unitTarget->GetTypeId() == TYPEID_PLAYER) 
     5545        ((Player*)unitTarget)->TeleportTo(mapid, fx[itr_j], fy[itr_j], fz[itr_j] + 0.07531, orientation, TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget == m_caster ? TELE_TO_SPELL : 0)); 
     5546    else 
     5547        MapManager::Instance().GetMap(mapid, unitTarget)->CreatureRelocation((Creature*)unitTarget, fx[itr_j], fy[itr_j], fz[itr_j] + 0.07531, orientation); 
     5548 
     5549    delete [] fx; delete [] fy; delete [] fz; 
     5550 
     5551/*    uint32 mapid = unitTarget->GetMapId(); 
    55055552    float ox,oy,oz; 
    55065553    unitTarget->GetPosition(ox,oy,oz); 
     
    55135560        ((Player*)unitTarget)->TeleportTo(mapid, fx, fy, fz, unitTarget->GetOrientation(), TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0)); 
    55145561    else 
    5515         MapManager::Instance().GetMap(mapid, unitTarget)->CreatureRelocation((Creature*)unitTarget, fx, fy, fz, unitTarget->GetOrientation()); 
     5562        MapManager::Instance().GetMap(mapid, unitTarget)->CreatureRelocation((Creature*)unitTarget, fx, fy, fz, unitTarget->GetOrientation());*/ 
    55165563} 
    55175564