コード例 #1
0
// Helper function, to process a slave list
void CreatureLinkingHolder::ProcessSlaveGuidList(CreatureLinkingEvent eventType, Creature* pSource, uint32 flag, uint16 searchRange, GuidList& slaveGuidList, Unit* pEnemy)
{
    if (!flag)
        return;

    for (GuidList::iterator slave_itr = slaveGuidList.begin(); slave_itr != slaveGuidList.end();)
    {
        Creature* pSlave = pSource->GetMap()->GetCreature(*slave_itr);
        if (!pSlave)
        {
            // Remove old guid first
            slaveGuidList.erase(slave_itr++);
            continue;
        }

        ++slave_itr;

        // Ignore Pets
        if (pSlave->IsPet())
            continue;

        // Handle single slave
        if (IsSlaveInRangeOfBoss(pSlave, pSource, searchRange))
            ProcessSlave(eventType, pSource, flag, pSlave, pEnemy);
    }
}
コード例 #2
0
 void SendAddsUpStairs(uint32 count)
 {
     //pop a add from list, send him up the stairs...
     for (uint32 addCount = 0; addCount<count && !addsAtBase.empty(); addCount++)
     {
         if (Creature* add = instance->GetCreature(*addsAtBase.begin()))
         {
             add->GetMotionMaster()->MovePath(PATH_ADDS, false);
             movedadds.push_back(add->GetGUID());
         }
         addsAtBase.erase(addsAtBase.begin());
     }
 }