Ejemplo n.º 1
0
    void JustReachedHome() override
    {
        if (m_pInstance)
        {
            m_pInstance->SetData(TYPE_FESTERGUT, FAIL);

            // reset gas stalker and putricide
            if (Creature* pStalker = m_pInstance->GetSingleCreatureFromStorage(NPC_GAS_STALKER))
                pStalker->RemoveAllAurasOnEvade();

            if (Creature* pPutricide = m_pInstance->GetSingleCreatureFromStorage(NPC_PROFESSOR_PUTRICIDE))
                pPutricide->AI()->EnterEvadeMode();
        }

        DoCastSpellIfCan(m_creature, SPELL_REMOVE_INOCULENT, CAST_TRIGGERED);
    }
Ejemplo n.º 2
0
    void JustDied(Unit* /*pKiller*/) override
    {
        if (m_pInstance)
        {
            m_pInstance->SetData(TYPE_FESTERGUT, DONE);

            // reset gas stalker and putricide
            if (Creature* pStalker = m_pInstance->GetSingleCreatureFromStorage(NPC_GAS_STALKER))
                pStalker->RemoveAllAurasOnEvade();

            // ToDo: research if there is any event/yell happening on boss death
            if (Creature* pPutricide = m_pInstance->GetSingleCreatureFromStorage(NPC_PROFESSOR_PUTRICIDE))
                pPutricide->AI()->EnterEvadeMode();
        }

        DoScriptText(SAY_DEATH, m_creature);
        DoCastSpellIfCan(m_creature, SPELL_REMOVE_INOCULENT, CAST_TRIGGERED);
    }
Ejemplo n.º 3
0
    void JustSummoned(Creature* pSummoned) override
    {
        if (pSummoned->GetEntry() == NPC_MALLEABLE_OOZE_STALKER)
        {
            if (!m_pInstance)
                return;

            if (Creature* pPutricide = m_pInstance->GetSingleCreatureFromStorage(NPC_PROFESSOR_PUTRICIDE))
                pPutricide->CastSpell(pSummoned, SPELL_MALLEABLE_GOO, true);
        }
    }
Ejemplo n.º 4
0
    void JustDied(Unit* /*pKiller*/) override
    {
        if (!m_pInstance)
            return;

        Creature* pRimefang = m_pInstance->GetSingleCreatureFromStorage(NPC_RIMEFANG);
        if (!pRimefang || !pRimefang->isAlive())
        {
            if (Creature* pSindragosa = m_creature->SummonCreature(NPC_SINDRAGOSA, SindragosaPosition[7][0], SindragosaPosition[7][1], SindragosaPosition[7][2], 0.0f, TEMPSPAWN_MANUAL_DESPAWN, 0))
                pSindragosa->SetInCombatWithZone();
        }
    }
Ejemplo n.º 5
0
    void JustReachedHome() override
    {
        DoCastSpellIfCan(m_creature, SPELL_OOZE_FLOOD_REMOVE, CAST_TRIGGERED);

        if (m_pInstance)
        {
            m_pInstance->SetData(TYPE_ROTFACE, FAIL);

            // reset putricide
            if (Creature* pPutricide = m_pInstance->GetSingleCreatureFromStorage(NPC_PROFESSOR_PUTRICIDE))
                pPutricide->AI()->EnterEvadeMode();
        }
    }
Ejemplo n.º 6
0
    void UpdateAI(const uint32 uiDiff) override
    {
        // On evade, reset the blood orb on Valanar
        if (m_uiResetTimer)
        {
            if (m_uiResetTimer <= uiDiff)
            {
                if (m_pInstance)
                {
                    if (Creature* pOrb = m_pInstance->GetSingleCreatureFromStorage(NPC_BLOOD_ORB_CONTROL))
                        pOrb->CastSpell(pOrb, SPELL_INVOCATION_VALANAR, TRIGGERED_NONE);

                    m_uiResetTimer = 0;
                }
            }
            else
                m_uiResetTimer -= uiDiff;
        }

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

        // Invocation of Blood
        if (m_uiEmpowermentTimer)
        {
            if (m_uiEmpowermentTimer <= uiDiff)
            {
                m_creature->RemoveAurasDueToSpell(m_uiInvocationSpellEntry);
                m_creature->SetHealth(1);
                m_bIsSaidSpecial = false;
                m_uiEmpowermentTimer = 00;
            }
            else
                m_uiEmpowermentTimer -= uiDiff;
        }

        // Berserk
        if (m_uiBerserkTimer)
        {
            if (m_uiBerserkTimer <= uiDiff)
            {
                if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK)
                {
                    DoScriptText(m_iSayBerserkEntry, m_creature);
                    m_uiBerserkTimer = 0;
                }
            }
            else
                m_uiBerserkTimer -= uiDiff;
        }
    }
Ejemplo n.º 7
0
    void DamageTaken(Unit* /*pDealer*/, uint32& uiDamage) override
    {
        // Damage is shared by the Blood Orb Control npc
        if (!m_uiEmpowermentTimer)
            uiDamage = 0;

        // ##### Workaround for missing aura 300 - Remove when this is implemented in core #####
        if (!m_pInstance || !uiDamage)
            return;

        if (Creature* pOrb = m_pInstance->GetSingleCreatureFromStorage(NPC_BLOOD_ORB_CONTROL))
            pOrb->DealDamage(pOrb, uiDamage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
        // ##### End of workaround #####
    }
Ejemplo n.º 8
0
    void JustDied(Unit* /*pKiller*/) override
    {
        DoCastSpellIfCan(m_creature, SPELL_OOZE_FLOOD_REMOVE, CAST_TRIGGERED);

        if (m_pInstance)
        {
            m_pInstance->SetData(TYPE_ROTFACE, DONE);

            // reset putricide
            if (Creature* pPutricide = m_pInstance->GetSingleCreatureFromStorage(NPC_PROFESSOR_PUTRICIDE))
                pPutricide->AI()->EnterEvadeMode();
        }

        DoScriptText(SAY_DEATH, m_creature);
    }
Ejemplo n.º 9
0
    void UpdateAI(const uint32 uiDiff) override
    {
        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        // Slime Spray
        if (m_uiSlimeSprayTimer <= uiDiff)
        {
            if (DoCastSpellIfCan(m_creature, SPELL_SLIME_SPRAY) == CAST_OK)
            {
                DoScriptText(SAY_SLIME_SPRAY, m_creature);
                m_uiSlimeSprayTimer = urand(17000, 23000);
            }
        }
        else
            m_uiSlimeSprayTimer -= uiDiff;

        // Mutated Infection - faster with time
        // implemented this instead of phases
        if (m_uiInfectionsRate < MAX_MUTATE_INFACTION_STEPS)
        {
            if (m_uiMutatedInfectionTimer <= uiDiff)
            {
                if (DoCastSpellIfCan(m_creature, uiMutatedInfections[m_uiInfectionsRate], CAST_TRIGGERED) == CAST_OK)
                {
                    m_creature->RemoveAurasDueToSpell(uiMutatedInfections[m_uiInfectionsRate - 1]);
                    // every next 15 seconds faster
                    m_uiMutatedInfectionTimer = 60000 - m_uiInfectionsRate * 15000;
                    ++m_uiInfectionsRate;
                }
            }
            else
                m_uiMutatedInfectionTimer -= uiDiff;
        }

        // Slime Flow
        if (m_uiSlimeFlowTimer <= uiDiff)
        {
            if (Creature* pProfessor = m_pInstance->GetSingleCreatureFromStorage(NPC_PROFESSOR_PUTRICIDE))
                DoScriptText(urand(0, 1) ? SAY_SLIME_FLOW_1 : SAY_SLIME_FLOW_2, pProfessor);

            m_uiSlimeFlowTimer = 20000;
        }
        else
            m_uiSlimeFlowTimer -= uiDiff;

        DoMeleeAttackIfReady();
    }
Ejemplo n.º 10
0
    void Aggro(Unit* /*pWho*/) override
    {
        DoScriptText(SAY_AGGRO, m_creature);
        DoCastSpellIfCan(m_creature, SPELL_GASTRIC_BLOAT, CAST_TRIGGERED);

        // set encounter in progress and get professor to the balcony
        if (m_pInstance)
        {
            m_pInstance->SetData(TYPE_FESTERGUT, IN_PROGRESS);

            if (Creature* pPutricide = m_pInstance->GetSingleCreatureFromStorage(NPC_PROFESSOR_PUTRICIDE))
            {
                pPutricide->SetWalk(false);
                pPutricide->GetMotionMaster()->MovePoint(101, afBalconyLocation[0], afBalconyLocation[1], afBalconyLocation[2]);
            }
        }
    }
Ejemplo n.º 11
0
    void JustSummoned(Creature* pSummoned) override
    {
        if (pSummoned->GetEntry() == NPC_OOZE_SPRAY_STALKER)
        {
            DoScriptText(EMOTE_SLIME_SPRAY, m_creature);
            DoCastSpellIfCan(pSummoned, SPELL_SLIME_SPRAY, CAST_TRIGGERED);
            DoCastSpellIfCan(pSummoned, SPELL_FACE_SPRAY_STALKER, CAST_TRIGGERED);
        }
        else if (pSummoned->GetEntry() == NPC_VILE_GAS_STALKER)
        {
            if (!m_pInstance)
                return;

            if (Creature* pPutricide = m_pInstance->GetSingleCreatureFromStorage(NPC_PROFESSOR_PUTRICIDE))
                pPutricide->CastSpell(pSummoned, SPELL_VILE_GAS, TRIGGERED_OLD_TRIGGERED);
        }
    }
Ejemplo n.º 12
0
    void ReceiveAIEvent(AIEventType eventType, Creature* pSender, Unit* pInvoker, uint32 uiMiscValue) override
    {
        if (eventType == AI_EVENT_CUSTOM_A)
        {
            // prepare explosion; Rotface yells and achiev is failed
            if (DoCastSpellIfCan(m_creature, SPELL_UNSTABLE_EXPLOSION) == CAST_OK)
            {
                if (m_pInstance)
                {
                    if (Creature* pRotface = m_pInstance->GetSingleCreatureFromStorage(NPC_ROTFACE))
                        DoScriptText(SAY_OOZE_EXPLODE, pRotface);

                    m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_DANCES_OOZES, false);
                }

                m_uiUnstableExplosionTimer = 5000;
            }
        }
    }
Ejemplo n.º 13
0
    void UpdateAI(const uint32 uiDiff) override
    {
        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        // Unstable Ooze
        if (m_uiUnstableExplosionCheckTimer)
        {
            if (m_uiUnstableExplosionCheckTimer <= uiDiff)
            {
                m_uiUnstableExplosionCheckTimer = 1000;

                SpellAuraHolder* holder = m_creature->GetSpellAuraHolder(SPELL_UNSTABLE_OOZE);
                if (holder && holder->GetStackAmount() >= 5)
                {
                    if (DoCastSpellIfCan(m_creature, SPELL_UNSTABLE_EXPLOSION) == CAST_OK)
                    {
                        if (m_pInstance)
                        {
                            if (Creature* pRotface = m_pInstance->GetSingleCreatureFromStorage(NPC_ROTFACE))
                                DoScriptText(SAY_OOZE_EXPLODE, pRotface);
                        }
                    }
                }
            }
            else
                m_uiUnstableExplosionCheckTimer -= uiDiff;
        }

        // Sticky Ooze
        if (m_uiStickyOozeTimer <= uiDiff)
        {
            if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_STICKY_OOZE) == CAST_OK)
                m_uiStickyOozeTimer = urand(10000, 15000);
        }
        else
            m_uiStickyOozeTimer -= uiDiff;

        DoMeleeAttackIfReady();
    }
Ejemplo n.º 14
0
    void Aggro(Unit* /*pWho*/) override
    {
        if (m_pInstance)
        {
            m_pInstance->SetData(TYPE_ROTFACE, IN_PROGRESS);

            if (Creature* pPutricide = m_pInstance->GetSingleCreatureFromStorage(NPC_PROFESSOR_PUTRICIDE))
            {
                pPutricide->CastSpell(pPutricide, SPELL_OOZE_FLOOD_PERIODIC, TRIGGERED_OLD_TRIGGERED);
                pPutricide->SetWalk(false);
                pPutricide->GetMotionMaster()->MovePoint(102, afBalconyLocation[0], afBalconyLocation[1], afBalconyLocation[2]);

                // heroic aggro text
                if (m_pInstance->IsHeroicDifficulty() && m_pInstance->GetData(TYPE_FESTERGUT) == DONE)
                    DoScriptText(SAY_PUTRICIDE_AGGRO, pPutricide);
            }
        }

        DoScriptText(SAY_AGGRO, m_creature);

        DoCastSpellIfCan(m_creature, SPELL_MUTATED_INFECTION_1, CAST_TRIGGERED);
    }
Ejemplo n.º 15
0
 void UpdateAI(const uint32 uiDiff) override
 {
     // Frost Bomb (dmg)
     if (m_uiFrostBombTimer)
     {
         if (m_uiFrostBombTimer <= uiDiff)
         {
             if (m_pInstance)
             {
                 if (Creature* pSindragosa = m_pInstance->GetSingleCreatureFromStorage(NPC_SINDRAGOSA))
                 {
                     if (pSindragosa->AI()->DoCastSpellIfCan(m_creature, SPELL_FROST_BOMB_DMG) == CAST_OK)
                     {
                         m_creature->RemoveAurasDueToSpell(SPELL_FROST_BOMB_VISUAL);
                         m_creature->ForcedDespawn(2000);
                         m_uiFrostBombTimer = 0;
                     }
                 }
             }
         }
         else
             m_uiFrostBombTimer -= uiDiff;
     }
 }
Ejemplo n.º 16
0
    void UpdateAI(const uint32 uiDiff) override
    {
        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        if (!m_pInstance)
            return;

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

        if (m_uiGaseousBlightTimer)
        {
            if (m_uiGaseousBlightTimer <= uiDiff)
            {
                // two stage event; first trigger all the puddle stalkers around then set the room in gas
                switch (m_uiGaseousBlightStage)
                {
                    case 0:
                        if (Creature* pProfessor = m_pInstance->GetSingleCreatureFromStorage(NPC_PROFESSOR_PUTRICIDE))
                        {
                            pProfessor->HandleEmote(EMOTE_ONESHOT_TALK_NOSHEATHE);
                            pProfessor->CastSpell(pProfessor, SPELL_GASEOUS_BLIGHT_INIT, true);
                            DoScriptText((m_pInstance->GetData(TYPE_ROTFACE) == DONE && m_pInstance->IsHeroicDifficulty()) ? SAY_BLIGHT_ROTFACE_DEAD : SAY_BLIGHT, pProfessor);
                        }
                        m_uiGaseousBlightTimer = 1000;
                        break;
                    case 1:
                        if (DoCastSpellIfCan(m_creature, SPELL_GASEOUS_BLIGHT_1) == CAST_OK)
                            m_uiGaseousBlightTimer = 0;
                        break;
                }
                ++m_uiGaseousBlightStage;
            }
            else
                m_uiGaseousBlightTimer -= uiDiff;
        }

        // Inhale Blight and Pungent Blight
        if (m_uiInhaleBlightTimer < uiDiff)
        {
            SpellAuraHolder* pHolder = m_creature->GetSpellAuraHolder(m_pInstance->Is25ManDifficulty() ? SPELL_INHALED_BLIGHT_25 : SPELL_INHALED_BLIGHT_10);

            // inhale the gas or if already have 3 stacks - release it
            if (pHolder && pHolder->GetStackAmount() >= 3)
            {
                if (DoCastSpellIfCan(m_creature, SPELL_PUNGENT_BLIGHT) == CAST_OK)
                {
                    DoScriptText(SAY_PUNGUENT_BLIGHT, m_creature);
                    m_uiInhaleBlightTimer = 38000;
                }
            }
            else
            {
                if (DoCastSpellIfCan(m_creature, SPELL_INHALE_BLIGHT) == CAST_OK)
                    m_uiInhaleBlightTimer = 36000;
            }
        }
        else
            m_uiInhaleBlightTimer -= uiDiff;

        // Gas Spore
        if (m_uiGasSporeTimer < uiDiff)
        {
            if (DoCastSpellIfCan(m_creature, SPELL_GAS_SPORE) == CAST_OK)
            {
                DoScriptText(EMOTE_SPORES, m_creature);
                m_uiGasSporeTimer = 40000;
            }
        }
        else
            m_uiGasSporeTimer -= uiDiff;

        // Vile Gas
        if (m_uiVileGasTimer < uiDiff)
        {
            if (DoCastSpellIfCan(m_creature, SPELL_VILE_GAS) == CAST_OK)
                m_uiVileGasTimer = 30000;
        }
        else
            m_uiVileGasTimer -= uiDiff;

        // Heroic spells
        if (m_pInstance->IsHeroicDifficulty())
        {
            if (m_uiMalleableGooTimer < uiDiff)
            {
                if (DoCastSpellIfCan(m_creature, SPELL_MALLEABLE_GOO_SUMMON) == CAST_OK)
                    m_uiMalleableGooTimer = 15000;
            }
            else
                m_uiMalleableGooTimer -= uiDiff;
        }

        DoMeleeAttackIfReady();
    }
Ejemplo n.º 17
0
    void UpdateAI(const uint32 uiDiff) override
    {
        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 = 5 * MINUTE * IN_MILLISECONDS;
            }
        }
        else
            m_uiBerserkTimer -= uiDiff;

        // Inhale Blight and Pungent Blight
        if (m_uiInhaleBlightTimer <= uiDiff)
        {
            SpellAuraHolder* holder = m_creature->GetSpellAuraHolder(SPELL_INHALED_BLIGHT_10);

            if (!holder)
                holder = m_creature->GetSpellAuraHolder(SPELL_INHALED_BLIGHT_25);

            // inhale the gas or if already have 3 stacks - release it
            if (holder && holder->GetStackAmount() >= 3)
            {
                if (DoCastSpellIfCan(m_creature, SPELL_PUNGENT_BLIGHT) == CAST_OK)
                {
                    DoScriptText(SAY_PUNGUENT_BLIGHT_EMOTE, m_creature);
                    DoScriptText(SAY_PUNGUENT_BLIGHT, m_creature);
                    m_uiInhaleBlightTimer = 35000;
                }
            }
            else if (DoCastSpellIfCan(m_creature, SPELL_INHALE_BLIGHT) == CAST_OK)
            {
                if (m_pInstance)
                {
                    if (Creature* pProfessor = m_pInstance->GetSingleCreatureFromStorage(NPC_PROFESSOR_PUTRICIDE))
                        DoScriptText(SAY_BLIGHT, pProfessor);
                }
                m_uiInhaleBlightTimer = 30000;
            }
        }
        else
            m_uiInhaleBlightTimer -= uiDiff;

        // Gas Spore
        if (m_uiGasSporeTimer <= uiDiff)
        {
            if (DoCastSpellIfCan(m_creature, SPELL_GAS_SPORE) == CAST_OK)
            {
                DoScriptText(SAY_SPORE, m_creature);
                m_uiGasSporeTimer = 40000;
            }
        }
        else
            m_uiGasSporeTimer -= uiDiff;

        // Vile Gas
        if (m_uiVileGasTimer <= uiDiff)
        {
            if (DoCastSpellIfCan(m_creature, SPELL_VILE_GAS_SUMMON, CAST_TRIGGERED) == CAST_OK)
            {
                if (DoCastSpellIfCan(m_creature, SPELL_VILE_GAS) == CAST_OK)
                    m_uiVileGasTimer = 30000;
            }
        }
        else
            m_uiVileGasTimer -= uiDiff;

        DoMeleeAttackIfReady();
    }