| | 608 | bool 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 | } |