本文整理汇总了C++中GetObjectGuid函数的典型用法代码示例。如果您正苦于以下问题:C++ GetObjectGuid函数的具体用法?C++ GetObjectGuid怎么用?C++ GetObjectGuid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetObjectGuid函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DETAIL_FILTER_LOG
void Transport::Start()
{
DETAIL_FILTER_LOG(LOG_FILTER_TRANSPORT_MOVES, "Transport::StartMovement %s (%s) start moves, period %u/%u",
GetObjectGuid().GetString().c_str(),
GetName(),
m_pathTime,
GetPeriod()
);
SetActiveObjectState(true);
BuildStartMovePacket(GetMap());
}
示例2: GetMap
void DynamicObject::RemoveFromWorld()
{
///- Remove the dynamicObject from the accessor
if(IsInWorld())
{
GetMap()->GetObjectsStore().erase<DynamicObject>(GetObjectGuid(), (DynamicObject*)NULL);
GetViewPoint().Event_RemovedFromWorld();
}
Object::RemoveFromWorld();
}
示例3: GetUInt32Value
// Though the client has the information in the item's data field,
// we have to send SMSG_ITEM_TIME_UPDATE to display the remaining
// time.
void Item::SendTimeUpdate(Player* owner)
{
uint32 duration = GetUInt32Value(ITEM_FIELD_DURATION);
if (!duration)
return;
WorldPacket data(SMSG_ITEM_TIME_UPDATE, (8 + 4));
data << ObjectGuid(GetObjectGuid());
data << uint32(duration);
owner->GetSession()->SendPacket(&data);
}
示例4: DETAIL_FILTER_LOG
void MOTransport::Stop()
{
DETAIL_FILTER_LOG(LOG_FILTER_TRANSPORT_MOVES, "Transport::StartMovement %s (%s) stop moves, period %u/%u",
GetObjectGuid().GetString().c_str(),
GetName(),
m_pathTime,
GetPeriod()
);
SetActiveObjectState(false);
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
SetGoState(GO_STATE_READY);
SetLootState(GO_JUST_DEACTIVATED);
}
示例5: MANGOS_ASSERT
void Corpse::DeleteBonesFromWorld()
{
MANGOS_ASSERT(GetType() == CORPSE_BONES);
Corpse* corpse = GetMap()->GetCorpse(GetObjectGuid());
if (!corpse)
{
sLog.outError("Bones %u not found in world.", GetGUIDLow());
return;
}
AddObjectToRemoveList();
}
示例6: data
WorldPacket CPlayer::BuildNameQuery()
{
WorldPacket data(SMSG_NAME_QUERY_RESPONSE, (8 + 1 + 4 + 4 + 4 + 10));
data << GetObjectGuid(); // player guid
data << GetName(); // player name
data << uint8(0); // realm name
data << uint32(getRace()); // player race
data << uint32(getGender()); // player gender
data << uint32(getClass()); // player class
data << uint8(0); // is not declined
return data;
}
示例7: data
void Group::SendUpdate()
{
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
Player* player = sObjectMgr.GetPlayer(citr->guid);
if (!player || !player->GetSession() || player->GetGroup() != this)
continue;
// guess size
WorldPacket data(SMSG_GROUP_LIST, (1 + 1 + 1 + 1 + 8 + 4 + GetMembersCount() * 20));
data << uint8(m_groupType); // group type (flags in 3.3)
data << uint8(citr->group); // groupid
data << uint8(GetFlags(*citr)); // group flags
data << uint8(isBGGroup() ? 1 : 0); // 2.0.x, isBattleGroundGroup?
if (m_groupType & GROUPTYPE_LFD)
{
data << uint8(0);
data << uint32(0);
}
data << GetObjectGuid(); // group guid
data << uint32(0); // 3.3, this value increments every time SMSG_GROUP_LIST is sent
data << uint32(GetMembersCount() - 1);
for (member_citerator citr2 = m_memberSlots.begin(); citr2 != m_memberSlots.end(); ++citr2)
{
if (citr->guid == citr2->guid)
continue;
Player* member = sObjectMgr.GetPlayer(citr2->guid);
uint8 onlineState = (member && member->GetSession() && !member->GetSession()->PlayerLogout()) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE;
onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0);
data << citr2->name;
data << citr2->guid;
data << uint8(onlineState);
data << uint8(citr2->group); // groupid
data << uint8(GetFlags(*citr2)); // group flags
data << uint8(0); // 3.3, role?
}
ObjectGuid masterLootGuid = (m_lootMethod == MASTER_LOOT) ? m_masterLooterGuid : ObjectGuid();
data << m_leaderGuid; // leader guid
if (GetMembersCount() - 1)
{
data << uint8(m_lootMethod); // loot method
data << masterLootGuid; // master loot guid
data << uint8(m_lootThreshold); // loot threshold
data << uint8(m_dungeonDifficulty); // Dungeon Difficulty
data << uint8(m_raidDifficulty); // Raid Difficulty
data << uint8(0); // 3.3, dynamic difficulty?
}
player->GetSession()->SendPacket(&data);
}
}
示例8: MANGOS_ASSERT
void Bag::StoreItem(uint8 slot, Item* pItem, bool /*update*/)
{
MANGOS_ASSERT(slot < MAX_BAG_SIZE);
if (pItem)
{
m_bagslot[slot] = pItem;
SetGuidValue(CONTAINER_FIELD_SLOT_1 + (slot * 2), pItem->GetObjectGuid());
pItem->SetGuidValue(ITEM_FIELD_CONTAINED, GetObjectGuid());
pItem->SetGuidValue(ITEM_FIELD_OWNER, GetOwnerGuid());
pItem->SetContainer(this);
pItem->SetSlot(slot);
}
}
示例9: JoinBattleGround
void CPlayer::JoinBattleGround(BattleGround* bg)
{
if (bg->isArena())
return;
if (!NativeTeam())
{
m_FakedPlayers.push_back(GetObjectGuid());
SetByteValue(UNIT_FIELD_BYTES_0, 0, getFRace());
setFaction(getFFaction());
}
SetRecache();
FakeDisplayID();
}
示例10: data
void Group::SendUpdate()
{
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
Player* player = sObjectMgr.GetPlayer(citr->guid);
if (!player || !player->GetSession() || player->GetGroup() != this)
continue;
// guess size
WorldPacket data(SMSG_GROUP_LIST, (1 + 1 + 1 + 1 + 8 + 4 + GetMembersCount() * 20));
data << uint8(m_groupType); // group type
data << uint8(isBGGroup() ? 1 : 0); // 2.0.x, isBattleGroundGroup?
data << uint8(citr->group); // groupid
data << uint8(citr->assistant ? 0x01 : 0); // 0x2 main assist, 0x4 main tank
data << GetObjectGuid(); // group guid
data << uint32(GetMembersCount() - 1);
for (member_citerator citr2 = m_memberSlots.begin(); citr2 != m_memberSlots.end(); ++citr2)
{
if (citr->guid == citr2->guid)
continue;
Player* member = sObjectMgr.GetPlayer(citr2->guid);
uint8 onlineState = (member) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE;
onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0);
data << citr2->name;
data << citr2->guid;
// online-state
data << uint8(sObjectMgr.GetPlayer(citr2->guid) ? 1 : 0);
data << uint8(citr2->group); // groupid
data << uint8(citr2->assistant ? 0x01 : 0); // 0x2 main assist, 0x4 main tank
}
ObjectGuid masterLootGuid = (m_lootMethod == MASTER_LOOT) ? m_masterLooterGuid : ObjectGuid();
data << m_leaderGuid; // leader guid
if (GetMembersCount() - 1)
{
data << uint8(m_lootMethod); // loot method
data << masterLootGuid; // master loot guid
data << uint8(m_lootThreshold); // loot threshold
data << uint8(m_difficulty); // Heroic Mod Group
}
player->GetSession()->SendPacket(&data);
}
}
示例11: GetBattleGround
void CPlayer::RecachePlayersFromBG()
{
BattleGround* bg = GetBattleGround();
if (!bg)
return;
for (auto& itr : bg->GetPlayers())
{
if (Player* player = sObjectMgr.GetPlayer(itr.first))
{
if (!player->ToCPlayer()->NativeTeam())
{
// Erase bg players from source player cache
WorldPacket data(SMSG_INVALIDATE_PLAYER, 8);
data << player->GetObjectGuid();
GetSession()->SendPacket(&data);
// Send bg player data to source player
data = player->ToCPlayer()->BuildNameQuery();
GetSession()->SendPacket(&data);
}
if (!NativeTeam())
{
// Erase source player from bg players cache
WorldPacket data(SMSG_INVALIDATE_PLAYER, 8);
data << GetObjectGuid();
player->GetSession()->SendPacket(&data);
// Send new source data to bg players
data = BuildNameQuery();
player->GetSession()->SendPacket(&data);
}
}
else
{
// Couldn't find bgplayer, recache him for source player in case he logs in again.
WorldPacket data(SMSG_INVALIDATE_PLAYER, 8);
data << itr.first;
GetSession()->SendPacket(&data);
}
}
}
示例12: data
void Group::SendUpdate()
{
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
Player* player = sObjectMgr.GetPlayer(citr->guid);
if (!player || !player->GetSession() || player->GetGroup() != this)
continue;
// guess size
WorldPacket data(SMSG_GROUP_LIST, (1 + 1 + 1 + 1 + 8 + 4 + GetMembersCount() * 20));
data << uint8(m_groupType); // group type
data << uint8(isBattleGroup() ? 1 : 0); // 2.0.x, isBattleGroundGroup?
data << uint8(citr->group); // groupid
data << uint8(GetFlags(*citr)); // group flags
data << GetObjectGuid(); // group guid
data << uint32(GetMembersCount() - 1);
for (member_citerator citr2 = m_memberSlots.begin(); citr2 != m_memberSlots.end(); ++citr2)
{
if (citr->guid == citr2->guid)
continue;
data << citr2->name;
data << citr2->guid;
data << uint8(GetGroupMemberStatus(sObjectMgr.GetPlayer(citr2->guid)));
data << uint8(citr2->group); // groupid
data << uint8(GetFlags(*citr2)); // group flags
}
ObjectGuid masterLootGuid = (m_lootMethod == MASTER_LOOT) ? m_masterLooterGuid : ObjectGuid();
data << m_leaderGuid; // leader guid
if (GetMembersCount() - 1)
{
data << uint8(m_lootMethod); // loot method
data << masterLootGuid; // master loot guid
data << uint8(m_lootThreshold); // loot threshold
data << uint8(m_difficulty); // Heroic Mod Group
}
player->GetSession()->SendPacket(data);
}
}
示例13: ProcessEventId_event_test_of_endurance
bool ProcessEventId_event_test_of_endurance(uint32 eventId, Object* pSource, Object* pTarget, bool isStart)
{
auto pGO = pTarget->ToGameObject();
auto pPlayer = pSource->ToPlayer();
if (!pGO || !pPlayer)
return true;
if (pGO->FindNearestCreature(NPC_GRENKA, 100.0f))
return true;
if (auto pGrenka = pGO->SummonCreature(Harpies[4].entry,
Harpies[4].x,
Harpies[4].y,
Harpies[4].z,
Harpies[4].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, MINUTE*IN_MILLISECONDS))
{
if (auto pGrenkaAI = static_cast<npc_grenka_bloodscreechAI*>(pGrenka->AI()))
pGrenkaAI->m_PlayerGuid = pPlayer->GetObjectGuid();
}
return true;
}
示例14: CanBeTraded
bool Item::CanBeTraded() const
{
if (IsSoulBound())
return false;
if (IsBag() && (Player::IsBagPos(GetPos()) || !((Bag const*)this)->IsEmpty()))
return false;
if (Player* owner = GetOwner())
{
if (owner->CanUnequipItem(GetPos(), false) != EQUIP_ERR_OK)
return false;
if (owner->GetLootGuid() == GetObjectGuid())
return false;
}
if (HasGeneratedLoot())
return false;
if (IsBoundByEnchant())
return false;
return true;
}
示例15: SendObjectDeSpawnAnim
void Totem::UnSummon()
{
SendObjectDeSpawnAnim(GetObjectGuid());
CombatStop();
RemoveAurasDueToSpell(GetSpell());
if (Unit* owner = GetOwner())
{
owner->_RemoveTotem(this);
owner->RemoveAurasDueToSpell(GetSpell());
// remove aura all party members too
if (owner->GetTypeId() == TYPEID_PLAYER)
{
// Not only the player can summon the totem (scripted AI)
if (Group* pGroup = ((Player*)owner)->GetGroup())
{
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* Target = itr->getSource();
if (Target && pGroup->SameSubGroup((Player*)owner, Target))
Target->RemoveAurasDueToSpell(GetSpell());
}
}
}
if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
((Creature*)owner)->AI()->SummonedCreatureDespawn((Creature*)this);
}
// any totem unsummon look like as totem kill, req. for proper animation
if (isAlive())
SetDeathState(DEAD);
AddObjectToRemoveList();
}