Changeset 180

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

[svn] Fix hunter's trap (let original caster summon dynamic object).
Fix black temple boss 1's hurl spine.

Original author: megamage
Date: 2008-11-06 12:24:56-06:00

Location:
trunk/src
Files:
3 modified

Legend:

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

    r178 r180  
    385385    void Reset(); 
    386386 
    387     void JustSummoned(Creature* summon) 
    388     { 
    389         if(summon->GetCreatureInfo()->Entry == SHADOW_DEMON) 
    390         { 
    391             Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); 
    392             if(target && target->GetTypeId() == TYPEID_PLAYER) // only on players. 
    393             { 
    394                 summon->AddThreat(target, 5000000.0f); 
    395                 summon->AI()->AttackStart(target); 
    396             } 
    397             DoZoneInCombat(summon); 
    398         } 
    399     } 
     387    void JustSummoned(Creature* summon); 
    400388 
    401389    void SummonedCreatureDespawn(Creature* summon) 
     
    781769            case EVENT_FLAME_CRASH: 
    782770                DoCast(m_creature->getVictim(), SPELL_FLAME_CRASH); 
    783                 Timer[EVENT_FLAME_CRASH] = 35000; 
     771                Timer[EVENT_FLAME_CRASH] = 30000 + rand()%10000; 
    784772                break; 
    785773 
     
    790778                    if(target) 
    791779                        m_creature->CastSpell(target, SPELL_PARASITIC_SHADOWFIEND, true); 
     780                    Timer[EVENT_PARASITIC_SHADOWFIEND] = 35000 + rand()%10000; 
    792781                }break; 
    793782 
     
    798787            case EVENT_DRAW_SOUL: 
    799788                DoCast(m_creature->getVictim(), SPELL_DRAW_SOUL); 
    800                 Timer[EVENT_DRAW_SOUL] = 55000;           
     789                Timer[EVENT_DRAW_SOUL] = 50000 + rand()%10000;           
    801790                break; 
    802791 
     
    10601049 
    10611050    void Aggro(Unit *who) {} 
     1051    void MoveInLineOfSight(Unit *) {} 
    10621052 
    10631053    void MovementInform(uint32 MovementType, uint32 Data) {Timer = 1;} 
     
    16911681    uint64 TargetGUID; 
    16921682 
    1693     void Aggro(Unit *who) {} 
     1683    void Aggro(Unit *who) {DoZoneInCombat();} 
    16941684 
    16951685    void Reset() 
    16961686    { 
    16971687        TargetGUID = 0; 
    1698         DoCast(m_creature, SPELL_SHADOW_DEMON_PASSIVE, true); 
     1688        m_creature->CastSpell(m_creature, SPELL_SHADOW_DEMON_PASSIVE, true); 
    16991689    } 
    17001690 
    17011691    void JustDied(Unit *killer) 
    17021692    { 
    1703         Unit* target = Unit::GetUnit((*m_creature), TargetGUID); 
    1704         if(target) 
     1693        if(Unit* target = Unit::GetUnit((*m_creature), TargetGUID)) 
    17051694            target->RemoveAurasDueToSpell(SPELL_PARALYZE); 
    17061695    } 
     
    17081697    void UpdateAI(const uint32 diff) 
    17091698    { 
    1710         if(!m_creature->SelectHostilTarget() || !m_creature->getVictim()) return; 
     1699        if(!m_creature->SelectHostilTarget() && !m_creature->getVictim()) return; 
    17111700 
    17121701        if(m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players. 
     
    19351924    m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); 
    19361925    m_creature->setActive(false); 
     1926} 
     1927 
     1928void boss_illidan_stormrageAI::JustSummoned(Creature* summon) 
     1929{ 
     1930    switch(summon->GetEntry()) 
     1931    { 
     1932    case SHADOW_DEMON: 
     1933        { 
     1934            if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players. 
     1935            { 
     1936                summon->AddThreat(target, 5000000.0f); 
     1937                summon->AI()->AttackStart(target); 
     1938            } 
     1939        }break; 
     1940    case MAIEV_SHADOWSONG: 
     1941        { 
     1942            summon->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk 
     1943            summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); 
     1944            MaievGUID = summon->GetGUID(); 
     1945            ((boss_maievAI*)summon->AI())->GetIllidanGUID(m_creature->GetGUID()); 
     1946            ((boss_maievAI*)summon->AI())->EnterPhase(PHASE_TALK_SEQUENCE); 
     1947        }break; 
     1948    default: 
     1949        break; 
     1950    } 
    19371951} 
    19381952 
     
    20952109void boss_illidan_stormrageAI::SummonMaiev() 
    20962110{ 
    2097     DoCast(m_creature, SPELL_SHADOW_PRISON, true); 
    2098     Creature* Maiev = m_creature->SummonCreature(MAIEV_SHADOWSONG, m_creature->GetPositionX() + 10, m_creature->GetPositionY() + 5, m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0); 
    2099     if(Maiev) 
    2100     { 
    2101         Maiev->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk 
    2102         Maiev->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); 
    2103         MaievGUID = Maiev->GetGUID(); 
    2104         ((boss_maievAI*)Maiev->AI())->GetIllidanGUID(m_creature->GetGUID()); 
    2105         ((boss_maievAI*)Maiev->AI())->EnterPhase(PHASE_TALK_SEQUENCE); 
    2106     } 
    2107     else // If Maiev cannot be summoned, reset the encounter and post some errors to the console. 
     2111    m_creature->CastSpell(m_creature, SPELL_SHADOW_PRISON, true); 
     2112    m_creature->CastSpell(m_creature, 40403, true); 
     2113    if(!MaievGUID) // If Maiev cannot be summoned, reset the encounter and post some errors to the console. 
    21082114    { 
    21092115        EnterEvadeMode(); 
  • trunk/src/game/Spell.cpp

    r176 r180  
    982982 
    983983    // Recheck immune (only for delayed spells) 
    984     if( m_spellInfo->speed && ( 
    985         unit->IsImmunedToDamage(GetSpellSchoolMask(m_spellInfo),true) || 
     984    if( m_spellInfo->speed &&  
     985        !(m_spellInfo->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) 
     986        && (unit->IsImmunedToDamage(GetSpellSchoolMask(m_spellInfo),true) || 
    986987        unit->IsImmunedToSpell(m_spellInfo,true) )) 
    987988    { 
  • trunk/src/game/SpellEffects.cpp

    r178 r180  
    26342634{ 
    26352635    float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])); 
    2636  
    2637     if(Player* modOwner = m_caster->GetSpellModOwner()) 
     2636    Unit *caster = m_originalCasterGUID ? m_originalCaster : m_caster; 
     2637 
     2638    if(Player* modOwner = caster->GetSpellModOwner()) 
    26382639        modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius); 
    26392640 
    26402641    int32 duration = GetSpellDuration(m_spellInfo); 
    26412642    DynamicObject* dynObj = new DynamicObject; 
    2642     if(!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, i, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, radius)) 
     2643    if(!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, i, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, radius)) 
    26432644    { 
    26442645        delete dynObj; 
     
    26482649    dynObj->SetUInt32Value(GAMEOBJECT_DISPLAYID, 368003); 
    26492650    dynObj->SetUInt32Value(DYNAMICOBJECT_BYTES, 0x01eeeeee); 
    2650     m_caster->AddDynObject(dynObj); 
     2651    caster->AddDynObject(dynObj); 
    26512652    MapManager::Instance().GetMap(dynObj->GetMapId(), dynObj)->Add(dynObj); 
    26522653}