Esempio n. 1
0
    void SummonIntroCreatures(uint32 packId)
    {
        if (!m_pInstance)
            return;

        float fAngle = GetLocationAngle(packId + 1);

        float fX, fY, fZ;
        m_pInstance->GetChamberCenterCoords(fX, fY, fZ);

        fX += M_F_RANGE * cos(fAngle);
        fY += M_F_RANGE * sin(fAngle);
        fZ += M_F_HEIGHT;

        MaNGOS::NormalizeMapCoord(fX);
        MaNGOS::NormalizeMapCoord(fY);

        uint32 uiNpcEntry = NPC_SOUL_WEAVER;

        for (uint8 uiI = 0; uiI < 14; ++uiI)
        {
            if (uiI > 0)
            {
                if (uiI < 4)
                    uiNpcEntry = NPC_UNSTOPPABLE_ABOM;
                else
                    uiNpcEntry = NPC_SOLDIER_FROZEN;
            }

            float fNewX, fNewY, fNewZ;
            m_creature->GetRandomPoint(fX, fY, fZ, 12.0f, fNewX, fNewY, fNewZ);

            m_creature->SummonCreature(uiNpcEntry, fNewX, fNewY, fNewZ, fAngle + M_PI_F, TEMPSPAWN_CORPSE_DESPAWN, 5000);
        }
    }
Esempio n. 2
0
    void SummonMob(uint32 uiType)
    {
        if (!m_pInstance)
            return;

        float fAngle = GetLocationAngle(urand(1, 7));

        float fX, fY, fZ;
        m_pInstance->GetChamberCenterCoords(fX, fY, fZ);

        fX += M_F_RANGE * cos(fAngle);
        fY += M_F_RANGE * sin(fAngle);
        fZ += M_F_HEIGHT;

        MaNGOS::NormalizeMapCoord(fX);
        MaNGOS::NormalizeMapCoord(fY);

        m_creature->SummonCreature(uiType, fX, fY, fZ, 0.0f, TEMPSPAWN_CORPSE_DESPAWN, 5000);
    }
Esempio n. 3
0
    void JustSummoned(Creature* pSummoned) override
    {
        switch (pSummoned->GetEntry())
        {
            case NPC_GUARDIAN:
            {
                DoScriptText(EMOTE_GUARDIAN, m_creature);

                m_lAddsSet.insert(pSummoned->GetObjectGuid());
                ++m_uiGuardiansCount;

                pSummoned->SetInCombatWithZone();
                break;
            }
            case NPC_SOLDIER_FROZEN:
            case NPC_UNSTOPPABLE_ABOM:
            case NPC_SOUL_WEAVER:
            {
                if (m_uiIntroPackCount < 7)
                    m_lIntroMobsSet.insert(pSummoned->GetObjectGuid());
                else
                {
                    m_lAddsSet.insert(pSummoned->GetObjectGuid());

                    if (m_pInstance)
                    {
                        float fX, fY, fZ;
                        m_pInstance->GetChamberCenterCoords(fX, fY, fZ);
                        pSummoned->GetMotionMaster()->MovePoint(0, fX, fY, fZ);
                    }
                }

                break;
            }
        }
    }