当前位置: 首页>>代码示例>>C++>>正文


C++ ObjectGuid::IsEmpty方法代码示例

本文整理汇总了C++中ObjectGuid::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectGuid::IsEmpty方法的具体用法?C++ ObjectGuid::IsEmpty怎么用?C++ ObjectGuid::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ObjectGuid的用法示例。


在下文中一共展示了ObjectGuid::IsEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CrystalHandlerDied

        void CrystalHandlerDied()
        {
            for (uint8 i = 0; i < 4; i++)
            {
                ObjectGuid guid = instance->GetGuidData(DATA_NOVOS_CRYSTAL_1 + i);
                if (!guid.IsEmpty())
                {
                    if (GameObject* crystal = ObjectAccessor::GetGameObject(*me, guid))
                    {
                        if (crystal->GetGoState() == GO_STATE_ACTIVE)
                        {
                            SetCrystalStatus(crystal, false);
                            break;
                        }
                    }
                }
            }

            ObjectGuid guid = instance->GetGuidData(DATA_NOVOS_SUMMONER_4);
            if (++_crystalHandlerCount >= 4)
            {
                Talk(SAY_ARCANE_FIELD);
                SetSummonerStatus(false);
                SetBubbled(false);
                events.ScheduleEvent(EVENT_ATTACK, 3000);
                if (IsHeroic())
                    events.ScheduleEvent(EVENT_SUMMON_MINIONS, 15000);
            }
            else if (!guid.IsEmpty())
                if (Creature* crystalChannelTarget = ObjectAccessor::GetCreature(*me, guid))
                    crystalChannelTarget->AI()->SetData(SPELL_SUMMON_CRYSTAL_HANDLER, 15000);
        }
开发者ID:Abrek,项目名称:My-WoDCore-6.x.x,代码行数:32,代码来源:boss_novos.cpp

示例2: BroadcastEvent

void Guild::BroadcastEvent(GuildEvents event, ObjectGuid guid, char const* str1 /*=NULL*/, char const* str2 /*=NULL*/, char const* str3 /*=NULL*/)
{
    uint8 strCount = !str1 ? 0 : (!str2 ? 1 : (!str3 ? 2 : 3));

    WorldPacket data(SMSG_GUILD_EVENT, 1 + 1 + 1 * strCount + (guid.IsEmpty() ? 0 : 8));
    data << uint8(event);
    data << uint8(strCount);

    if (str3)
    {
        data << str1;
        data << str2;
        data << str3;
    }
    else if (str2)
    {
        data << str1;
        data << str2;
    }
    else if (str1)
        { data << str1; }

    if (!guid.IsEmpty())
        { data << guid; }

    BroadcastPacket(&data);

    DEBUG_LOG("WORLD: Sent SMSG_GUILD_EVENT");
}
开发者ID:billy1arm,项目名称:MangosMC,代码行数:29,代码来源:Guild.cpp

示例3: SetData

 void SetData(uint32 type, uint32 data) override
 {
     switch (type)
     {
     case EVENT_STATE:
         if (!DefiasCannonGUID.IsEmpty() && !IronCladDoorGUID.IsEmpty())
             State = data;
         break;
     case EVENT_RHAHKZOR:
         if (data == DONE)
             if (GameObject* go = instance->GetGameObject(FactoryDoorGUID))
                 go->SetGoState(GO_STATE_ACTIVE);
         break;
     }
 }
开发者ID:Rastrian,项目名称:DeathCore_6.x-1,代码行数:15,代码来源:instance_deadmines.cpp

示例4: Load

void CreatureGroupsManager::Load()
{
    uint32 oldMSTime = WorldTimer::getMSTime();

    // Memory leak, but we cannot delete the loaded groups, since pointer may be present at loaded creatures
    _groups.clear();

    QueryResult* result = WorldDatabase.Query("SELECT leaderGUID, memberGUID, dist, angle, flags FROM creature_groups ORDER BY leaderGUID");

    if (!result)
    {
        sLog.outErrorDb(">>  Loaded 0 creature groups. DB table `creature_groups` is empty!");
        sLog.outString();
        return;
    }

    uint32 count = 0;
    Field *fields;
    CreatureGroup *currentGroup = NULL;

    do
    {
        fields = result->Fetch();

        //Load group member data
        ObjectGuid leaderGuid = ConvertDBGuid(fields[0].GetUInt32());
        ObjectGuid memberGuid = ConvertDBGuid(fields[1].GetUInt32());
        if (leaderGuid.IsEmpty())
            sLog.outErrorDb("CREATURE GROUPS: Bad leader guid %u", fields[0].GetUInt32());
        else if (memberGuid.IsEmpty())
            sLog.outErrorDb("CREATURE GROUPS: Bad member guid %u", fields[1].GetUInt32());
        else
        {
            if (!currentGroup || leaderGuid != currentGroup->GetLeaderGuid())
            {
                currentGroup = new CreatureGroup(leaderGuid);
                RegisterNewGroup(currentGroup);
            }
            currentGroup->AddMember(memberGuid, fields[2].GetFloat(), fields[3].GetFloat(), fields[4].GetUInt8());
            ++count;
        }
    }
    while (result->NextRow());
    delete result;

    sLog.outString(">> Loaded %u creature groups in %u ms", count, WorldTimer::getMSTime() - oldMSTime);
    sLog.outString();
}
开发者ID:Maduse,项目名称:server,代码行数:48,代码来源:CreatureGroups.cpp

示例5: UpdateAI

        void UpdateAI(uint32 diff) override
        {
            if (CheckTimer <= diff)
            {
                if (!AzgalorGUID.IsEmpty())
                {
                    Creature* boss = ObjectAccessor::GetCreature(*me, AzgalorGUID);
                    if (!boss || (boss && boss->isDead()))
                    {
                        me->setDeathState(JUST_DIED);
                        me->RemoveCorpse();
                        return;
                    }
                }
                CheckTimer = 5000;
            } else CheckTimer -= diff;

            //Return since we have no target
            if (!UpdateVictim())
                return;

            if (WarstompTimer <= diff)
            {
                DoCast(me, SPELL_WARSTOMP);
                WarstompTimer = 10000 + rand32() % 5000;
            } else WarstompTimer -= diff;

            if (CrippleTimer <= diff)
            {
                DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_CRIPPLE);
                CrippleTimer = 25000 + rand32() % 5000;
            } else CrippleTimer -= diff;

            DoMeleeAttackIfReady();
        }
开发者ID:beyourself,项目名称:DeathCore_6.x,代码行数:35,代码来源:boss_azgalor.cpp

示例6: SendToAll

void Channel::SendToAll(WorldPacket const* data, ObjectGuid const& guid)
{
    for (PlayerContainer::value_type const& i : _playersStore)
        if (Player* player = ObjectAccessor::FindConnectedPlayer(i.first))
            if (guid.IsEmpty() || !player->GetSocial()->HasIgnore(guid))
                player->SendDirectMessage(data);
}
开发者ID:Rastrian,项目名称:DeathCore_6.x-1,代码行数:7,代码来源:Channel.cpp

示例7: HandleDismissControlledVehicle

void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data)
{
    DEBUG_LOG("WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE");
    recv_data.hexlike();

    ObjectGuid guid;
    MovementInfo mi;

    recv_data >> guid.ReadAsPacked();
    recv_data >> mi;

    ObjectGuid vehicleGUID = _player->GetCharmGuid();

    if (vehicleGUID.IsEmpty())                              // something wrong here...
        return;

    _player->m_movementInfo = mi;

    // using charm guid, because we don't have vehicle guid...
    if(Vehicle *vehicle = _player->GetMap()->GetVehicle(vehicleGUID))
    {
        // Aura::HandleAuraControlVehicle will call Player::ExitVehicle
        vehicle->RemoveSpellsCausingAura(SPELL_AURA_CONTROL_VEHICLE);
    }
}
开发者ID:MgCore,项目名称:Mangos_Cataclysm,代码行数:25,代码来源:MovementHandler.cpp

示例8: HandleDismissControlledVehicle

void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data)
{
    DEBUG_LOG("WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE");
    recv_data.hexlike();

    ObjectGuid guid;
    MovementInfo mi;

    recv_data >> guid.ReadAsPacked();
    recv_data >> mi;

    ObjectGuid vehicleGUID = _player->GetVehicleGUID();

    if (vehicleGUID.IsEmpty())                              // something wrong here...
        return;

    _player->m_movementInfo = mi;

    if(Vehicle *vehicle = ObjectAccessor::GetVehicle(vehicleGUID))
    {
        if(vehicle->GetVehicleFlags() & VF_DESPAWN_AT_LEAVE)
            vehicle->Dismiss();
        else
            _player->ExitVehicle();
    }
}
开发者ID:newrage,项目名称:testv1,代码行数:26,代码来源:MovementHandler.cpp

示例9: SetGUID

 void SetGUID(ObjectGuid guid, int32 /*param*/) override
 {
     victimGUID = guid;
     if (me->m_spells[0] && !victimGUID.IsEmpty())
         if (Unit* victim = ObjectAccessor::GetUnit(*me, victimGUID))
             victim->CastSpell(victim, me->m_spells[0], true, NULL, NULL, me->GetGUID());
 }
开发者ID:Abrek,项目名称:My-WoDCore-6.x.x,代码行数:7,代码来源:boss_maexxna.cpp

示例10: UpdateAI

            void UpdateAI(uint32 diff) override
            {
                if (!UpdateVictim() || !me->GetVictim())
                {
                    if (!WarpGuid.IsEmpty() && check_Timer <= diff)
                    {
                        if (Unit* Warp = ObjectAccessor::GetUnit(*me, WarpGuid))
                        {
                            if (me->IsWithinMeleeRange(Warp))
                            {
                                int32 CurrentHP_Treant = (int32)me->GetHealth();
                                Warp->CastCustomSpell(Warp, SPELL_HEAL_FATHER, &CurrentHP_Treant, 0, 0, true, 0, 0, me->GetGUID());
                                me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
                                return;
                            }
                            me->GetMotionMaster()->MoveFollow(Warp, 0, 0);
                        }
                        check_Timer = 1000;
                    }
                    else
                        check_Timer -= diff;
                    return;
                }

                if (me->EnsureVictim()->GetGUID() != WarpGuid)
                    DoMeleeAttackIfReady();
            }
开发者ID:Jildor,项目名称:TrinityCore,代码行数:27,代码来源:boss_warp_splinter.cpp

示例11: JustSummoned

            void JustSummoned(Creature* summon) override
            {
                switch (summon->GetEntry())
                {
                    case NPC_FOCUSED_EYEBEAM:
                        summon->CastSpell(me, SPELL_FOCUSED_EYEBEAM_VISUAL_LEFT, true);
                        break;
                    case NPC_FOCUSED_EYEBEAM_RIGHT:
                        summon->CastSpell(me, SPELL_FOCUSED_EYEBEAM_VISUAL_RIGHT, true);
                        break;
                    case NPC_RUBBLE:
                        summons.Summon(summon);
                        // absence of break intended
                    default:
                        return;
                }

                summon->CastSpell(summon, SPELL_FOCUSED_EYEBEAM_PERIODIC, true);
                summon->CastSpell(summon, SPELL_FOCUSED_EYEBEAM_VISUAL, true);
                summon->SetReactState(REACT_PASSIVE);
                // One of the above spells is a channeled spell, we need to clear this unit state for MoveChase to work
                summon->ClearUnitState(UNIT_STATE_CASTING);

                // Victim gets 67351
                if (!eyebeamTarget.IsEmpty())
                {
                    if (Unit* target = ObjectAccessor::GetUnit(*summon, eyebeamTarget))
                    {
                        summon->Attack(target, false);
                        summon->GetMotionMaster()->MoveChase(target);
                    }
                }
            }
开发者ID:blitztech,项目名称:TrinityCore,代码行数:33,代码来源:boss_kologarn.cpp

示例12: OnInviteMember

void LFGGroupScript::OnInviteMember(Group* group, ObjectGuid guid)
{
    if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
        return;

    ObjectGuid gguid = group->GetGUID();
    ObjectGuid leader = group->GetLeaderGUID();
    TC_LOG_DEBUG("lfg", "LFGScripts::OnInviteMember [%s]: invite [%s] leader [%s]",
        gguid.ToString().c_str(), guid.ToString().c_str(), leader.ToString().c_str());

    // No gguid ==  new group being formed
    // No leader == after group creation first invite is new leader
    // leader and no gguid == first invite after leader is added to new group (this is the real invite)
    if (!leader.IsEmpty() && gguid.IsEmpty())
        sLFGMgr->LeaveLfg(leader);
}
开发者ID:Rastrian,项目名称:DeathCore_6.x-1,代码行数:16,代码来源:LFGScripts.cpp

示例13: BroadcastEvent

void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, ObjectGuid guid, uint8 strCount, std::string const& str1, std::string const& str2, std::string const& str3)
{
    WorldPacket data(SMSG_ARENA_TEAM_EVENT, 1+1+1);
    data << uint8(event);
    data << uint8(strCount);
    switch (strCount)
    {
    case 0:
        break;
    case 1:
        data << str1;
        break;
    case 2:
        data << str1 << str2;
        break;
    case 3:
        data << str1 << str2 << str3;
        break;
    default:
        TC_LOG_ERROR("bg.arena", "Unhandled strCount %u in ArenaTeam::BroadcastEvent", strCount);
        return;
    }

    if (!guid.IsEmpty())
        data << guid;

    BroadcastPacket(&data);

    TC_LOG_DEBUG("network", "WORLD: Sent SMSG_ARENA_TEAM_EVENT");
}
开发者ID:Rastrian,项目名称:My-WoDCore-6.x.x,代码行数:30,代码来源:ArenaTeam.cpp

示例14: GetUnit

Unit *Totem::GetOwner()
{
    ObjectGuid ownerGuid = GetOwnerGuid();
    if (ownerGuid.IsEmpty())
        return NULL;
    return ObjectAccessor::GetUnit(*this, ownerGuid);
}
开发者ID:Deffender,项目名称:mangos1,代码行数:7,代码来源:Totem.cpp

示例15: UpdateAI

        void UpdateAI(uint32 diff) override
        {
            if (CheckTimer <= diff)
            {
                if (!AnetheronGUID.IsEmpty())
                {
                    Creature* boss = ObjectAccessor::GetCreature(*me, AnetheronGUID);
                    if (!boss || boss->isDead())
                    {
                        me->setDeathState(JUST_DIED);
                        me->RemoveCorpse();
                        return;
                    }
                }
                CheckTimer = 5000;
            } else CheckTimer -= diff;

            //Return since we have no target
            if (!UpdateVictim())
                return;

            if (ImmolationTimer <= diff)
            {
                DoCast(me, SPELL_IMMOLATION);
                ImmolationTimer = 5000;
            } else ImmolationTimer -= diff;

            DoMeleeAttackIfReady();
        }
开发者ID:Diyvol,项目名称:TrinityCore,代码行数:29,代码来源:boss_anetheron.cpp


注:本文中的ObjectGuid::IsEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。