Example #1
0
    void JustDied(Unit* /*pKiller*/) override
    {
        DoScriptText(SAY_DEATH, m_creature);

        if (m_pInstance)
            m_pInstance->SetData(TYPE_JEDOGA, DONE);
    }
Example #2
0
    void JustDied(Unit* pKiller)
    {
        DoScriptText(SAY_DEATH, m_creature);

        if (m_pInstance)
            m_pInstance->SetData(TYPE_NADOX, DONE);
    }
Example #3
0
    void Aggro(Unit* pWho)
    {
        DoScriptText(SAY_AGGRO, m_creature);

        if (m_pInstance)
            m_pInstance->SetData(TYPE_NADOX, IN_PROGRESS);
    }
Example #4
0
    void MovementInform(uint32 uiMoveType, uint32 uiPointId) override
    {
        if (uiMoveType != POINT_MOTION_TYPE)
            return;

        switch (uiPointId)
        {
                // Prepare for combat
            case POINT_ID_PREPARE:

                m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                m_creature->RemoveAurasDueToSpell(SPELL_LIGHTNING_VISUAL);
                m_creature->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
                m_creature->SetLevitate(false);
                break;

                // Prepare for sacrifice lift off
            case POINT_ID_SACRIFICE:
                DoCastSpellIfCan(m_creature, SPELL_HOVER_FALL);
                m_creature->SetLevitate(true);
                m_creature->GetMotionMaster()->MovePoint(POINT_ID_LEVITATE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 10.0f);
                break;

                // Call a volunteer to sacrifice
            case POINT_ID_LEVITATE:
                if (Creature* pVolunteer = m_creature->GetMap()->GetCreature(SelectRandomVolunteer()))
                {
                    DoScriptText(urand(0, 1) ? SAY_CALL_SACRIFICE1 : SAY_CALL_SACRIFICE2, m_creature);
                    DoScriptText(SAY_VOLUNTEER_CHOOSEN, pVolunteer);

                    pVolunteer->RemoveAurasDueToSpell(SPELL_VOLUNTEER_SPHERE);
                    pVolunteer->SetStandState(UNIT_STAND_STATE_STAND);
                    pVolunteer->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                    pVolunteer->CastSpell(pVolunteer, SPELL_PILLAR_LIGHTNING, false);
                    pVolunteer->SetWalk(true);
                    pVolunteer->GetMotionMaster()->MovePoint(POINT_ID_SACRIFICE, aJedogaLandingLoc[0], aJedogaLandingLoc[1], aJedogaLandingLoc[2]);
                }

                // Set visual aura
                if (m_pInstance)
                {
                    if (Creature* pTemp = m_creature->GetMap()->GetCreature(m_pInstance->SelectJedogaSacrificeControllerGuid()))
                        pTemp->CastSpell(pTemp, SPELL_SACRIFICE_VISUAL, false);
                }
                break;

                // Resume combat
            case POINT_ID_COMBAT:
                m_creature->RemoveAurasDueToSpell(SPELL_HOVER_FALL);
                m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);

                m_bIsSacrificing = false;
                SetCombatMovement(true);
                m_creature->SetLevitate(false);
                if (m_creature->getVictim())
                    m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
                break;
        }
    }
Example #5
0
    void Aggro(Unit* /*pWho*/) override
    {
        DoScriptText(SAY_AGGRO, m_creature);
        DoCallVolunteers();

        if (m_pInstance)
            m_pInstance->SetData(TYPE_JEDOGA, IN_PROGRESS);
    }
Example #6
0
    void SummonedCreatureJustDied(Creature* pSummoned) override
    {
        if (pSummoned->GetEntry() == NPC_TWILIGHT_VOLUNTEER)
        {
            m_lVolunteerGuidList.remove(pSummoned->GetObjectGuid());

            if (m_pInstance)
            {
                if (Creature* pTemp = m_creature->GetMap()->GetCreature(m_pInstance->SelectJedogaSacrificeControllerGuid()))
                    pTemp->RemoveAurasDueToSpell(SPELL_SACRIFICE_VISUAL);
            }

            m_creature->GetMotionMaster()->MovePoint(POINT_ID_COMBAT, aJedogaLandingLoc[0], aJedogaLandingLoc[1], aJedogaLandingLoc[2]);
        }
    }
Example #7
0
    void UpdateAI(const uint32 uiDiff) override
    {
        if (m_uiVisualTimer)
        {
            if (m_uiVisualTimer <= uiDiff)
            {
                GuidList lControllersList;
                if (m_pInstance)
                    m_pInstance->GetJedogaEventControllersList(lControllersList);

                for (GuidList::const_iterator itr = lControllersList.begin(); itr != lControllersList.end(); ++itr)
                {
                    if (Creature* pTemp = m_creature->GetMap()->GetCreature(*itr))
                        pTemp->CastSpell(m_creature, SPELL_BEAM_VISUAL, false);
                }

                if (DoCastSpellIfCan(m_creature, SPELL_LIGHTNING_VISUAL) == CAST_OK)
                    m_uiVisualTimer = 0;
            }
            else
                m_uiVisualTimer -= uiDiff;
        }

        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        // Don't use abilities while sacrificing
        if (m_bIsSacrificing)
            return;

        // Note: this was changed in 3.3.2 and now it does this only once
        if (m_creature->GetHealthPercent() < 50.0f && !m_bSacrifice)
        {
            SetCombatMovement(false);
            m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
            m_creature->GetMotionMaster()->MovePoint(POINT_ID_SACRIFICE, aJedogaLandingLoc[0], aJedogaLandingLoc[1], aJedogaLandingLoc[2]);
            m_bSacrifice = true;
            m_bIsSacrificing = true;
        }

        if (m_uiThundershockTimer < uiDiff)
        {
            if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
                DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_THUNDERSHOCK : SPELL_THUNDERSHOCK_H);

            m_uiThundershockTimer = 40000;
        }
        else
            m_uiThundershockTimer -= uiDiff;

        if (m_uiLightningBoltTimer < uiDiff)
        {
            if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
                DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_LIGHTNING_BOLT : SPELL_LIGHTNING_BOLT_H);

            m_uiLightningBoltTimer = 7000;
        }
        else
            m_uiLightningBoltTimer -= uiDiff;

        if (m_uiCycloneStrikeTimer < uiDiff)
        {
            DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_CYCLONE_STRIKE : SPELL_CYCLONE_STRIKE_H);
            m_uiCycloneStrikeTimer = 15000;
        }
        else
            m_uiCycloneStrikeTimer -= uiDiff;

        DoMeleeAttackIfReady();
    }
Example #8
0
 void JustReachedHome() override
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_JEDOGA, FAIL);
 }
Example #9
0
    void UpdateAI(const uint32 uiDiff)
    {
        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        if (!m_bGuardianSummoned && m_creature->GetHealthPercent() < 50.0f)
        {
            // guardian is summoned at 50% of boss HP
            if (m_pInstance)
            {
                if (Creature* pGuardianEgg = m_creature->GetMap()->GetCreature(m_pInstance->SelectRandomGuardianEggGuid()))
                    pGuardianEgg->CastSpell(pGuardianEgg, SPELL_SUMMON_SWARM_GUARDIAN, false);

                m_bGuardianSummoned = true;
            }
        }

        if (m_uiSummonTimer < uiDiff)
        {
            if (roll_chance_i(50))
                DoScriptText(urand(0, 1) ? SAY_SUMMON_EGG_1 : SAY_SUMMON_EGG_2, m_creature);

            if (m_pInstance)
            {
                // There are 2 Swarmers summoned at a timer
                if (Creature* pSwarmerEgg = m_creature->GetMap()->GetCreature(m_pInstance->SelectRandomSwarmerEggGuid()))
                {
                    for (uint8 i = 0; i < 2; ++i)
                        pSwarmerEgg->CastSpell(pSwarmerEgg, SPELL_SUMMON_SWARMERS, false);
                }
            }

            m_uiSummonTimer = urand(5000, 10000);
        }
        else
            m_uiSummonTimer -= uiDiff;

        if (m_uiBroodPlagueTimer < uiDiff)
        {
            if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
                DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_BROOD_PLAGUE : SPELL_BROOD_PLAGUE_H);

            m_uiBroodPlagueTimer = 20000;
        }
        else
            m_uiBroodPlagueTimer -= uiDiff;

        if (!m_bIsRegularMode)
        {
            if (m_uiBroodRageTimer < uiDiff)
            {
                if (DoCastSpellIfCan(m_creature, SPELL_BROOD_RAGE) == CAST_OK)
                    m_uiBroodRageTimer = 20000;
            }
            else
                m_uiBroodRageTimer -= uiDiff;
        }

        if (!m_bBerserk && m_creature->GetPositionZ() < 24.0)
        {
            if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK)
                m_bBerserk = true;
        }

        DoMeleeAttackIfReady();
    }
Example #10
0
 void JustReachedHome()
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_NADOX, FAIL);
 }