static void RunOperators(const int64_t& num1, const int64_t& num2)
{
    CheckAdd(num1, num2);
    CheckSubtract(num1, num2);
    CheckNegate(num1);
    CheckCompare(num1, num2);
}
Example #2
0
    void SpawnAdds()
    {
        Creature *pCreature = NULL;

        if (FirstTime)
        {
            std::vector<uint32> AddList;

            for(uint8 i = 0; i < 6; ++i)
                AddList.push_back(Adds[i]);

            while(AddList.size() > 4)
                AddList.erase((AddList.begin())+(rand()%AddList.size()));

            uint8 i = 0;
            for(std::vector<uint32>::iterator itr = AddList.begin(); itr != AddList.end(); ++itr)
            {
                uint32 entry = *itr;

                pCreature = m_creature->SummonCreature(entry, Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
                if (pCreature)
                {
                    AddGUID[i] = pCreature->GetGUID();
                    AddId[i] = entry;
                }
                ++i;
            }

            FirstTime = false;
        }
        else
        {
            for(uint8 i = 0; i < 4; ++i)
            {
                switch(CheckAdd(AddGUID[i]))
                {
                    case 0:
                        pCreature = m_creature->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
                        if (pCreature)
                            AddGUID[i] = pCreature->GetGUID();
                        break;
                    case 1:
                        pCreature = ((Creature*)Unit::GetUnit((*m_creature), AddGUID[i]));
                        if (pCreature)
                        {
                            pCreature->Respawn();
                            pCreature->AI()->EnterEvadeMode();
                        }
                        break;
                    case 2:
                        pCreature = ((Creature*)Unit::GetUnit((*m_creature), AddGUID[i]));
                        if (!pCreature->IsInEvadeMode())
                            pCreature->AI()->EnterEvadeMode();
                        break;
                }
            }
        }
    }