本文整理汇总了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);
}
示例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");
}
示例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;
}
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
}
示例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();
}
}
示例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());
}
示例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();
}
示例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);
}
}
}
示例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);
}
示例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");
}
示例14: GetUnit
Unit *Totem::GetOwner()
{
ObjectGuid ownerGuid = GetOwnerGuid();
if (ownerGuid.IsEmpty())
return NULL;
return ObjectAccessor::GetUnit(*this, ownerGuid);
}
示例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();
}