コード例 #1
0
ファイル: boss_sindragosa.cpp プロジェクト: Sar777/scriptdev2
    void MovementInform(uint32 uiMovementType, uint32 uiData)
    {
        if (uiMovementType != POINT_MOTION_TYPE)
            return;

        if (uiData == POINT_AGGRO)
        {
            if (m_creature->getVictim())
            {
                DoCastSpellIfCan(m_creature, SPELL_FROST_AURA, CAST_TRIGGERED);
                DoCastSpellIfCan(m_creature, SPELL_PERMEATING_CHILL, CAST_TRIGGERED);
                SetLevitate(false);
                m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
                m_uiPhase = PHASE_GROUND;
            }
            else
                EnterEvadeMode();
        }
        else if (uiData == POINT_AIR)
        {
            m_uiPhase = PHASE_AIR;

            int max = m_bIs25Man ? 5 : 2;
            if (m_bIs25Man && m_bIsHeroic)
                max = 6;

            DoMark(max);

            // set timers
            m_uiIceTombTimer    = 5500;
            m_uiFrostBombTimer  = 12000;
            m_uiPhaseTimer      = 35000;
        }
        else if (uiData == POINT_LAND)
        {
            m_uiPhase = PHASE_GROUND;
            SetCombatMovement(true);
            SetLevitate(false);

            if (m_creature->getVictim())
                m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());

            m_uiPhaseTimer = 110000;
        }
    }
コード例 #2
0
ファイル: boss_sindragosa.cpp プロジェクト: AngelX/scriptdev2
    void UpdateAI(const uint32 uiDiff)
    {
        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        // Berserk
        if (m_uiBerserkTimer <= uiDiff)
        {
            if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK)
            {
                DoScriptText(SAY_BERSERK, m_creature);
                m_uiBerserkTimer = 10 * MINUTE * IN_MILLISECONDS;
            }
        }
        else
            m_uiBerserkTimer -= uiDiff;

        switch(m_uiPhase)
        {
            case PHASE_GROUND:
            {
                // Health Check
                if (m_creature->GetHealthPercent() <= 30.0f)
                {
                    if (DoCastSpellIfCan(m_creature, SPELL_MYSTIC_BUFFET, CAST_TRIGGERED) == CAST_OK)
                    {
                        m_uiPhase = PHASE_THREE;
                        DoScriptText(SAY_PHASE_3, m_creature);
                        m_uiFrostBeaconTimer = 10000;
                        m_uiIceTombTimer = 15000;
                        return;
                    }
                }

                // Cleave
                if (m_uiCleaveTimer <= uiDiff)
                {
                    if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE) == CAST_OK)
                        m_uiCleaveTimer = urand(5000, 15000);
                }
                else
                    m_uiCleaveTimer -= uiDiff;

                // Tail Smash
                if (m_uiTailSmashTimer <= uiDiff)
                {
                    if (DoCastSpellIfCan(m_creature, SPELL_TAIL_SMASH) == CAST_OK)
                        m_uiTailSmashTimer = urand(10000, 20000);
                }
                else
                    m_uiTailSmashTimer -= uiDiff;

                // Frost Breath
                if (m_uiFrostBreathTimer <= uiDiff)
                {
                    if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_FROST_BREATH) == CAST_OK)
                        m_uiFrostBreathTimer = urand(15000, 20000);
                }
                else
                    m_uiFrostBreathTimer -= uiDiff;

                // Unchained Magic
                if (m_uiUnchainedMagicTimer <= uiDiff)
                {
                    if (DoCastSpellIfCan(m_creature, SPELL_UNCHAINED_MAGIC) == CAST_OK)
                    {
                        m_uiUnchainedMagicTimer = urand(40000, 60000);
                        DoScriptText(SAY_UNCHAINED_MAGIC, m_creature);
                    }
                }
                else
                    m_uiUnchainedMagicTimer -= uiDiff;

                // Icy Grip and Blistering Cold
                if (m_uiIcyGripTimer <= uiDiff)
                {
                    if (DoCastSpellIfCan(m_creature, SPELL_ICY_GRIP) == CAST_OK)
                    {
                        m_uiIcyGripTimer = 70000;
                        DoScriptText(SAY_BLISTERING_COLD, m_creature);
                    }
                }
                else
                    m_uiIcyGripTimer -= uiDiff;

                // Phase 2 (air)
                if (m_uiPhaseTimer <= uiDiff)
                {
                    m_uiPhaseTimer = 35000;
                    m_uiPhase = PHASE_FLYING;
                    DoScriptText(SAY_TAKEOFF, m_creature);

                    // fly to the air point
                    SetCombatMovement(false);
                    SetLevitate(true);
                    m_creature->GetMotionMaster()->MovePoint(POINT_AIR, SindragosaLoc[1].x, SindragosaLoc[1].y, SindragosaLoc[1].z, false);
                }
                else
                    m_uiPhaseTimer -= uiDiff;

                break;
            }
            case PHASE_FLYING:
                // wait for arrival or evade after 60seconds
                if (m_uiFlyingTimer <= uiDiff)
                {
                    m_uiFlyingTimer = 60000;
                    m_creature->AI()->EnterEvadeMode();
                    return;
                }
                else
                    m_uiFlyingTimer -= uiDiff;

                return;
            case PHASE_AIR:
            {
                // Ice Tombs
                if (m_uiIceTombTimer <= uiDiff)
                {
                    if (DoCastSpellIfCan(m_creature, SPELL_ICE_TOMB) == CAST_OK)
                        m_uiIceTombTimer = 40000;
                }
                else
                    m_uiIceTombTimer -= uiDiff;

                // Frost Bomb
                if (m_uiFrostBombTimer <= uiDiff)
                {
                    DoFrostBomb();
                    m_uiFrostBombTimer = 6000;
                }
                else
                    m_uiFrostBombTimer -= uiDiff;

                // Phase One (ground)
                if (m_uiPhaseTimer <= uiDiff)
                {
                    m_uiPhase = PHASE_FLYING;
                    m_uiPhaseTimer = 42000;

                    // fly to the ground point
                    m_creature->GetMotionMaster()->MovePoint(POINT_LAND, SindragosaLoc[0].x, SindragosaLoc[0].y, SindragosaLoc[0].z, false);
                }
                else
                    m_uiPhaseTimer -= uiDiff;

                return;
            }
            case PHASE_THREE:
            {
                // Frost Beacon
                if (m_uiFrostBeaconTimer <= uiDiff)
                {
                    if (Unit *pVictim = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1, SPELL_FROST_BEACON, SELECT_FLAG_PLAYER))
                    {
                        if (DoCastSpellIfCan(pVictim, SPELL_FROST_BEACON) == CAST_OK)
                            m_uiFrostBeaconTimer = 15000;
                    }
                }
                else
                    m_uiFrostBeaconTimer -= uiDiff;

                // Ice Tomb
                if (m_uiIceTombTimer <= uiDiff)
                {
                    if (DoCastSpellIfCan(m_creature, SPELL_ICE_TOMB) == CAST_OK)
                        m_uiIceTombTimer = 15000;
                }
                else
                    m_uiIceTombTimer -= uiDiff;

                // Cleave
                if (m_uiCleaveTimer <= uiDiff)
                {
                    if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE) == CAST_OK)
                        m_uiCleaveTimer = urand(5000, 15000);
                }
                else
                    m_uiCleaveTimer -= uiDiff;

                // Tail Smash
                if (m_uiTailSmashTimer <= uiDiff)
                {
                    if (DoCastSpellIfCan(m_creature, SPELL_TAIL_SMASH) == CAST_OK)
                        m_uiTailSmashTimer = urand(10000, 20000);
                }
                else
                    m_uiTailSmashTimer -= uiDiff;

                // Frost Breath
                if (m_uiFrostBreathTimer <= uiDiff)
                {
                    if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_FROST_BREATH) == CAST_OK)
                        m_uiFrostBreathTimer = urand(15000, 20000);
                }
                else
                    m_uiFrostBreathTimer -= uiDiff;

                // Unchained Magic
                if (m_uiUnchainedMagicTimer <= uiDiff)
                {
                    if (DoCastSpellIfCan(m_creature, SPELL_UNCHAINED_MAGIC) == CAST_OK)
                        m_uiUnchainedMagicTimer = urand(40000, 60000);
                }
                else
                    m_uiUnchainedMagicTimer -= uiDiff;

                // Icy Grip and Blistering Cold
                if (m_uiIcyGripTimer <= uiDiff)
                {
                    if (DoCastSpellIfCan(m_creature, SPELL_ICY_GRIP) == CAST_OK)
                    {
                        DoScriptText(SAY_BLISTERING_COLD, m_creature);
                        m_uiIcyGripTimer = 70000;
                    }
                }
                else
                    m_uiIcyGripTimer -= uiDiff;

                break;
            }
        }

        DoMeleeAttackIfReady();
    }
コード例 #3
0
ファイル: boss_sindragosa.cpp プロジェクト: AngelX/scriptdev2
 void EnterEvadeMode()
 {
     SetLevitate(true);
     ScriptedAI::EnterEvadeMode();
 }
コード例 #4
0
    void MovementInform(uint32 uiMovementType, uint32 uiPointId)
    {
        if (uiMovementType != POINT_MOTION_TYPE)
            return;

        if (uiPointId == SINDRAGOSA_POINT_AIR_EAST)
        {
            m_creature->GetMotionMaster()->MovePoint(SINDRAGOSA_POINT_AIR_WEST, SindragosaPosition[9][0], SindragosaPosition[9][1], SindragosaPosition[9][2], false);
        }
        else if (uiPointId == SINDRAGOSA_POINT_AIR_WEST)
        {
            m_creature->GetMotionMaster()->MovePoint(SINDRAGOSA_POINT_AIR_EAST, SindragosaPosition[8][0], SindragosaPosition[8][1], SindragosaPosition[8][2], false);
        }
        else if (uiPointId == SINDRAGOSA_POINT_GROUND_CENTER)
        {
            // fly up
            if (m_uiPhase == SINDRAGOSA_PHASE_GROUND)
            {
                m_uiPhase = SINDRAGOSA_PHASE_FLYING_TO_AIR;
                SetLevitate(true);
                m_creature->GetMotionMaster()->MovePoint(SINDRAGOSA_POINT_AIR_CENTER, SindragosaPosition[1][0], SindragosaPosition[1][1], SindragosaPosition[1][2], false);
            }
            else // land and attack
            {
                if (m_uiPhase == SINDRAGOSA_PHASE_AGGRO)
                {
                    DoCastSpellIfCan(m_creature, SPELL_FROST_AURA, CAST_TRIGGERED);
                    DoCastSpellIfCan(m_creature, SPELL_PERMEATING_CHILL, CAST_TRIGGERED);
                }
                
                SetLevitate(false);
                SetCombatMovement(true);
                m_creature->GetMotionMaster()->Clear();
                m_uiPhase = SINDRAGOSA_PHASE_GROUND;

                if (Unit *pVictim = m_creature->getVictim())
                    m_creature->GetMotionMaster()->MoveChase(pVictim);                
            }
        }
        else if (uiPointId == SINDRAGOSA_POINT_AIR_PHASE_2)
        {
            m_uiPhase = SINDRAGOSA_PHASE_AIR;

            int max = m_bIs25Man ? 5 : 2;
            if (m_bIs25Man && m_bIsHeroic)
                max = 6;

            DoMark(max);

            // set timers
            m_uiIceTombTimer    = 5500;
            m_uiFrostBombTimer  = 12000;
            m_uiPhaseTimer      = 35000;
        }
        else if (uiPointId == SINDRAGOSA_POINT_AIR_CENTER)
        {
            if (m_uiPhase == SINDRAGOSA_PHASE_AGGRO || m_uiPhase == SINDRAGOSA_PHASE_FLYING_TO_GROUND)
            {
                // land
                m_creature->GetMotionMaster()->MovePoint(SINDRAGOSA_POINT_GROUND_CENTER, SindragosaPosition[0][0], SindragosaPosition[0][1], SindragosaPosition[0][2], false);
            }
            else if (m_uiPhase == SINDRAGOSA_PHASE_FLYING_TO_AIR)
            {
                // fly up (air phase)
                m_creature->GetMotionMaster()->MovePoint(SINDRAGOSA_POINT_AIR_PHASE_2, SindragosaPosition[2][0], SindragosaPosition[2][1], SindragosaPosition[2][2], false);
            }
        }
    }