void DamageTaken(Unit* /*pDoneBy*/, uint32& uiDamage) override
    {
        if (uiDamage < m_creature->GetHealth())
            return;

        if (!m_pInstance)
            return;

        // Don't allow any accident
        if (m_bEggsExploded)
        {
            uiDamage = 0;
            return;
        }

        // Boss explodes everything and resets - this happens if not all eggs are destroyed
        if (m_pInstance->GetData(TYPE_RAZORGORE) == IN_PROGRESS)
        {
            uiDamage = 0;
            m_bEggsExploded = true;
            m_pInstance->SetData(TYPE_RAZORGORE, FAIL);
            DoCastSpellIfCan(m_creature, SPELL_EXPLODE_ORB, CAST_TRIGGERED);
            m_creature->ForcedDespawn();
        }
    }
Example #2
0
    void DamageTaken(Unit* /*pDoneBy*/, uint32& uiDamage, DamageEffectType /*damagetype*/) override
    {
        if (uiDamage < m_creature->GetHealth())
            return;

        if (!m_pInstance)
            return;

        // Don't allow any accident
        if (m_bEggsExploded)
        {
            uiDamage = 0;
            return;
        }

        // Boss explodes everything and resets - this happens if not all eggs are destroyed
        if (m_pInstance->GetData(TYPE_RAZORGORE) == IN_PROGRESS)
        {
            uiDamage = 0;
            m_bEggsExploded = true;
            m_pInstance->SetData(TYPE_RAZORGORE, FAIL);
            DoScriptText(SAY_RAZORGORE_DEATH, m_creature);
            m_creature->CastSpell(m_creature, SPELL_FIREBALL, TRIGGERED_OLD_TRIGGERED);
            m_creature->ForcedDespawn(5000);
        }
    }
    void JustDied(Unit* /*pKiller*/) override
    {
        if (m_pInstance)
        {
            // Don't set instance data unless all eggs are destroyed
            if (m_pInstance->GetData(TYPE_RAZORGORE) != SPECIAL)
                return;

            m_pInstance->SetData(TYPE_RAZORGORE, DONE);
        }

        DoScriptText(SAY_DEATH, m_creature);
    }