void AggroAllPlayers(Creature* pTemp)
        {
            Map::PlayerList const &PlList = me->GetMap()->GetPlayers();

            if (PlList.isEmpty())
                return;

            for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
            {
                if (Player* player = i->getSource())
                {
                    if (player->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && !player->isGameMaster())
                    {
                        Creature* pCreature = player->GetVehicleBase()->ToCreature();

                        if (pCreature)
                        {
                            pTemp->SetHomePosition(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation());
                            pTemp->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
                            pTemp->SetReactState(REACT_AGGRESSIVE);
                            pTemp->SetInCombatWith(pCreature);
                            player->SetInCombatWith(pTemp);
                            pCreature->SetInCombatWith(pTemp);
                            pTemp->AddThreat(pCreature, 0.0f);
                        }
                    } else if (player->isAlive() && !player->isGameMaster() )
                    {
                        pTemp->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
                        pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                        pTemp->SetReactState(REACT_AGGRESSIVE);
                        pTemp->SetInCombatWith(player);
                        player->SetInCombatWith(pTemp);
                        pTemp->AddThreat(player, 0.0f);
                    }

                    if (player->isGameMaster())
                        continue;
                }
            }
        }
// Function to process actions for linked NPCs
void CreatureLinkingHolder::DoCreatureLinkingEvent(CreatureLinkingEvent eventType, Creature* pSource, Unit* pEnemy /* = NULL*/)
{
    // This check will be needed in reload case
    if (!sCreatureLinkingMgr.IsLinkedEventTrigger(pSource))
        return;

    // Ignore atypic behaviour
    if (pSource->IsControlledByPlayer())
        return;

    if (eventType == LINKING_EVENT_AGGRO && !pEnemy)
        return;

    uint32 eventFlagFilter = 0;
    uint32 reverseEventFlagFilter = 0;

    switch (eventType)
    {
    case LINKING_EVENT_AGGRO:
        eventFlagFilter = EVENT_MASK_ON_AGGRO;
        reverseEventFlagFilter = FLAG_TO_AGGRO_ON_AGGRO;
        break;
    case LINKING_EVENT_EVADE:
        eventFlagFilter = EVENT_MASK_ON_EVADE;
        reverseEventFlagFilter = FLAG_TO_RESPAWN_ON_EVADE;
        break;
    case LINKING_EVENT_DIE:
        eventFlagFilter = EVENT_MASK_ON_DIE;
        reverseEventFlagFilter = 0;
        break;
    case LINKING_EVENT_RESPAWN:
        eventFlagFilter = EVENT_MASK_ON_RESPAWN;
        reverseEventFlagFilter = FLAG_FOLLOW;
        break;
    }

    // Process Slaves (by entry)
    HolderMapBounds bounds = m_holderMap.equal_range(pSource->GetEntry());
    for (HolderMap::iterator itr = bounds.first; itr != bounds.second; ++itr)
        ProcessSlaveGuidList(eventType, pSource, itr->second.linkingFlag & eventFlagFilter, itr->second.searchRange, itr->second.linkedGuids, pEnemy);

    // Process Slaves (by guid)
    bounds = m_holderGuidMap.equal_range(pSource->GetGUIDLow());
    for (HolderMap::iterator itr = bounds.first; itr != bounds.second; ++itr)
        ProcessSlaveGuidList(eventType, pSource, itr->second.linkingFlag & eventFlagFilter, itr->second.searchRange, itr->second.linkedGuids, pEnemy);

    // Process Master
    if (CreatureLinkingInfo const* pInfo = sCreatureLinkingMgr.GetLinkedTriggerInformation(pSource))
    {
        if (pInfo->linkingFlag & reverseEventFlagFilter)
        {
            Creature* pMaster = NULL;
            if (pInfo->mapId != INVALID_MAP_ID)             // entry case
            {
                BossGuidMapBounds finds = m_masterGuid.equal_range(pInfo->masterId);
                for (BossGuidMap::iterator itr = finds.first; itr != finds.second; ++itr)
                {
                    pMaster = pSource->GetMap()->GetCreature(itr->second);
                    if (pMaster && IsSlaveInRangeOfBoss(pSource, pMaster, pInfo->searchRange))
                        break;
                }
            }
            else                                            // guid case
            {
                CreatureData const* masterData = sObjectMgr.GetCreatureData(pInfo->masterDBGuid);
                CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(masterData->id);
                pMaster = pSource->GetMap()->GetCreature(ObjectGuid(cInfo->GetHighGuid(), cInfo->Entry, pInfo->masterDBGuid));
            }

            if (pMaster)
            {
                switch (eventType)
                {
                case LINKING_EVENT_AGGRO:
                    if (pMaster->IsControlledByPlayer())
                        return;

                    if (pMaster->isInCombat())
                        pMaster->SetInCombatWith(pEnemy);
                    else
                        pMaster->AI()->AttackStart(pEnemy);
                    break;
                case LINKING_EVENT_EVADE:
                    if (!pMaster->isAlive())
                        pMaster->Respawn();
                    break;
                case LINKING_EVENT_RESPAWN:
                    if (pMaster->isAlive())
                        SetFollowing(pSource, pMaster);
                }
            }
        }
    }
}