Esempio n. 1
0
    void JustDied(Unit* pKiller) override
    {
        if (Creature* grashna = GetClosestCreatureWithEntry(m_creature, NPC_DEFENDER_GRASHNA, 100.0f))
        {
            DoScriptText(SAY_DEFENDER_GRASHNA, grashna);

            std::list<Player*> playerList;
            GetPlayerListWithEntryInWorld(playerList, m_creature, 50.0f);
            for (auto& player : playerList)
                if (player->IsActiveQuest(QUEST_SKETTIS_OFFENSIVE))
                    player->GroupEventHappens(QUEST_SKETTIS_OFFENSIVE, m_creature);
        }
    }
Esempio n. 2
0
bool AttackPlayerWithQuest(Creature* creature)
{
    std::list<Player*> playerList;
    GetPlayerListWithEntryInWorld(playerList, creature, 50.0f);
    for (auto& player : playerList)
    {
        if (player->IsActiveQuest(10879))
        {
            creature->AI()->AttackStart(player);
            return true;
        }
    }
    return false;
}
Esempio n. 3
0
    uint8 playersInsideCircles()
    {
        uint32 tmpAuras[5] = {
            SPELL_VIMGOL_POP_TEST_A, SPELL_VIMGOL_POP_TEST_B, SPELL_VIMGOL_POP_TEST_C,
            SPELL_VIMGOL_POP_TEST_D, SPELL_VIMGOL_POP_TEST_E
        };
        uint8 tmpCounter = 0;

        if (m_uiBunnyGuids.size() < 5 && m_pMap)
        {
            m_uiBunnyGuids.clear();
            m_pMap->GetCreatureGuidVectorFromStorage(NPC_VIMGOL_VISUAL_BUNNY, m_uiBunnyGuids);
        }

        for (int i = 0; i < 5; i++)
            m_uiActiveCircles[i] = false;

        std::list<Player*> playerList;
        GetPlayerListWithEntryInWorld(playerList, m_creature, 30);
        for (auto itr = playerList.begin(); itr != playerList.end(); ++itr)
        {
            if (!(*itr)->HasAura(SPELL_VIMGOL_POP_TEST_A) && !(*itr)->HasAura(SPELL_VIMGOL_POP_TEST_B) && !(*itr)->HasAura(SPELL_VIMGOL_POP_TEST_C) &&
                !(*itr)->HasAura(SPELL_VIMGOL_POP_TEST_D) && !(*itr)->HasAura(SPELL_VIMGOL_POP_TEST_E))
                continue;

            for (auto it = m_uiBunnyGuids.begin(); it != m_uiBunnyGuids.end(); ++it)
            {
                for (int i = 0; i < 5; ++i)
                {
                    if (!(*itr)->GetAura(tmpAuras[i], SpellEffectIndex(0)))
                        continue;

                    if ((*it) != (*itr)->GetAura(tmpAuras[i], SpellEffectIndex(0))->GetCasterGuid())
                        continue;

                    m_uiActiveCircles[std::distance(m_uiBunnyGuids.begin(), it)] = true;
                }
            }
        }

        for (int i = 0; i < 5; i++)
            if (m_uiActiveCircles[i])
                ++tmpCounter;

        return tmpCounter;
    }