Changeset 1148

Show
Ignore:
Timestamp:
02/06/2010 12:01:10 PM (5 weeks ago)
Author:
Hoffa
Message:

Applied Invincible Mount fix by Terrorblade -> http://arcemu.org/forums/index.php?showtopic=20707

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Trunk/src/SpellHandlers/ItemSpells_1.cpp

    r1108 r1148  
    606606} 
    607607 
     608bool Invincible(uint32 i, Aura * pAura, bool apply) 
     609{ 
     610        if( pAura->GetTarget()->GetTypeId() != TYPEID_PLAYER ) 
     611                return true; 
     612 
     613        if( apply ) 
     614        { 
     615                uint32 newspell = 0; 
     616                Player* pPlayer = TO_PLAYER( pAura->GetTarget() ); 
     617                AreaTable *pArea = dbcArea.LookupEntry(pPlayer->GetAreaID()); 
     618 
     619                if( pPlayer->_GetSkillLineCurrent( SKILL_RIDING, true) >= 225 && 
     620                        ( ( pArea->AreaFlags & 1024 && pPlayer->GetMapId() != 571 ) || 
     621                                ( pArea->AreaFlags & 1024 && pPlayer->GetMapId() == 571 && pPlayer->HasSpellwithNameHash( SPELL_HASH_COLD_WEATHER_FLYING ) ) ) ) 
     622                { 
     623                if( pPlayer->_GetSkillLineCurrent( SKILL_RIDING, true) == 300 ) 
     624                        newspell = 72284; 
     625                else 
     626                        newspell = 72283; 
     627                } 
     628 
     629                else if( pPlayer->_GetSkillLineCurrent( SKILL_RIDING, true ) >= 150 ) 
     630                        { 
     631                                newspell = 72282; 
     632                } 
     633                        else 
     634                                newspell = 72281; 
     635 
     636        SpellEntry *sp = dbcSpell.LookupEntry(newspell); 
     637        sEventMgr.AddEvent( pAura->GetTarget() ,&Unit::EventCastSpell , pAura->GetTarget() , sp , EVENT_UNK, 1 , 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT ); 
     638        } 
     639 
     640 
     641        return true; 
     642} 
    608643// ADD NEW FUNCTIONS ABOVE THIS LINE 
    609644// ***************************************************************************** 
     
    642677        mgr->register_dummy_aura( 47977, &MagicBroomMount);                     // Magic Broom Mount 
    643678        mgr->register_dummy_aura( 65917, &MagicRoosterMount);           // Magic Rooster Mount 
     679        mgr->register_dummy_aura( 72286, &Invincible);                          // Invincible 
    644680 
    645681