void Reset()
    {
        Initialize();

        if (me->isAlive())
            instance->SetBossState(DATA_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
    }
    void DamageTaken(Unit* /*pDoneBy*/, uint32 &damage)
    {
        if (damage < me->GetHealth() || _bHasDied || _bFakeDeath)
            return;

        // On first death, fake death and open door, as well as initiate whitemane if exist
        if (Unit* Whitemane = Unit::GetUnit((*me), instance->GetData64(DATA_WHITEMANE)))
        {
            instance->SetBossState(DATA_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS);

            Whitemane->GetMotionMaster()->MovePoint(1, 1163.113370, 1398.856812, 32.527786);

            me->GetMotionMaster()->MovementExpired();
            me->GetMotionMaster()->MoveIdle();

            me->SetHealth(0);

            if (me->IsNonMeleeSpellCasted(false))
                me->InterruptNonMeleeSpells(false);

            me->ClearComboPointHolders();
            me->RemoveAllAuras();
            me->ClearAllReactives();

            me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
            me->SetStandState(UNIT_STAND_STATE_DEAD);

            _bHasDied = true;
            _bFakeDeath = true;

            damage = 0;
        }
    }
    void SpellHit(Unit* /*who*/, const SpellEntry* pSpell)
    {
        // When hit with ressurection say text
        if (pSpell->Id == SPELL_SCARLETRESURRECTION)
        {
            DoScriptText(SAY_MO_RESSURECTED, me);
            _bFakeDeath = false;

            instance->SetBossState(DATA_MOGRAINE_AND_WHITE_EVENT, SPECIAL);
        }
    }
    void Reset()
    {
        Initialize();

        // Incase wipe during phase that mograine fake death
        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
        me->SetStandState(UNIT_STAND_STATE_STAND);

        if (me->isAlive())
            instance->SetBossState(DATA_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
    }
 void JustReachedHome()
 {
     if (instance->GetBossState(DATA_MOGRAINE_AND_WHITE_EVENT != NOT_STARTED))
         instance->SetBossState(DATA_MOGRAINE_AND_WHITE_EVENT, FAIL);
 }
Пример #6
0
    void UpdateAI(const uint32 uiDiff)
    {
        ScriptedAI::UpdateAI(uiDiff);
        if (uiTimer <= uiDiff)
        {
            switch(uiPhase)
            {
                case 0:
                    break;
                case 1:
                    pInstance->SetBossState(BOSS_RAZORSCALE, IN_PROGRESS);
                    summons.DespawnAll();
                    uiTimer = 1000;
                    uiPhase = 2;
                    break;
                case 2:
                    engineer[0] = me->SummonCreature(NPC_ENGINEER, 591.951477, -95.968292, 391.516998, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
                    engineer[0]->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
                    engineer[0]->SetSpeed(MOVE_RUN, 0.5f);
                    engineer[0]->SetHomePosition(posEng1);
                    engineer[0]->GetMotionMaster()->MoveTargetedHome();
                    engineer[1] = me->SummonCreature(NPC_ENGINEER, 591.951477, -95.968292, 391.516998, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
                    engineer[1]->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
                    engineer[1]->SetSpeed(MOVE_RUN, 0.5f);
                    engineer[1]->SetHomePosition(posEng2);
                    engineer[1]->GetMotionMaster()->MoveTargetedHome();
                    engineer[0]->MonsterYell(SAY_AGGRO_1, LANG_UNIVERSAL, 0);
                    uiPhase = 3;
                    uiTimer = 14000;
                    break;
                case 3:
                    uiPhase = 4;
                    break;
                case 4:
                    defender[0] = me->SummonCreature(NPC_DEFENDER, 600.75, -104.85, 391.516998, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
                    defender[0] ->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
                    defender[0] ->SetHomePosition(pos1);
                    defender[0] ->GetMotionMaster()->MoveTargetedHome();

                    defender[1] = me->SummonCreature(NPC_DEFENDER, 596.38, -110.26, 391.516998, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
                    defender[1] ->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
                    defender[1] ->SetHomePosition(pos2);
                    defender[1] ->GetMotionMaster()->MoveTargetedHome();
                    
                    defender[2] = me->SummonCreature(NPC_DEFENDER, 566.47, -103.63, 391.516998, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
                    defender[2] ->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
                    defender[2] ->SetHomePosition(pos3);
                    defender[2] ->GetMotionMaster()->MoveTargetedHome();

                    defender[3] = me->SummonCreature(NPC_DEFENDER, 570.41, -108.79, 391.516998, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
                    defender[3] ->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
                    defender[3] ->SetHomePosition(pos4);
                    defender[3] ->GetMotionMaster()->MoveTargetedHome();
                    uiPhase = 5;
                    break;
                case 5:
                    engineer[0]->HandleEmoteCommand(EMOTE_STATE_USESTANDING);
                    engineer[1]->HandleEmoteCommand(EMOTE_STATE_USESTANDING);
                    defender[0]->HandleEmoteCommand(EMOTE_STATE_READY2H);
                    defender[1]->HandleEmoteCommand(EMOTE_STATE_READY2H);
                    defender[2]->HandleEmoteCommand(EMOTE_STATE_READY2H);
                    defender[3]->HandleEmoteCommand(EMOTE_STATE_READY2H);
                    me->MonsterYell(SAY_AGGRO_2, LANG_UNIVERSAL, 0);
                    uiTimer = 16000;
                    uiPhase = 6;
                    break;
                case 6:
                    if (Creature *pRazorscale = me->GetCreature(*me, pInstance->GetData64(DATA_RAZORSCALE)))
                        if (pRazorscale->AI())
                            pRazorscale->AI()->DoAction(ACTION_EVENT_START);
                    engineer[0]->MonsterYell(SAY_AGGRO_3, LANG_UNIVERSAL, 0);
                    uiPhase =7;
                    break;
            }
            if (!UpdateVictim())
                return;
                
            DoMeleeAttackIfReady();
        }
        else uiTimer -= uiDiff;
    }