本文整理汇总了C++中GUID_ENPART函数的典型用法代码示例。如果您正苦于以下问题:C++ GUID_ENPART函数的具体用法?C++ GUID_ENPART怎么用?C++ GUID_ENPART使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GUID_ENPART函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: uint32
void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
{
;//sLog->outDetail("CMSG_PET_SPELL_AUTOCAST");
uint64 guid;
uint32 spellid;
uint8 state; //1 for on, 0 for off
recvPacket >> guid >> spellid >> state;
if (!_player->GetGuardianPet() && !_player->GetCharm())
return;
if (IS_PLAYER_GUID(guid))
return;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellInfo)
return;
Creature* checkPet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
if (!checkPet || (checkPet != _player->GetGuardianPet() && checkPet != _player->GetCharm()))
{
sLog->outError("HandlePetSpellAutocastOpcode.Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)), GetPlayer()->GetName().c_str());
return;
}
Unit::ControlSet petsSet;
if (checkPet->GetEntry() != GUID_ENPART(guid))
petsSet.insert(checkPet);
else
petsSet = _player->m_Controlled;
// Xinef: loop all pets with same entry (fixes partial state change for feral spirits)
for (Unit::ControlSet::const_iterator itr = petsSet.begin(); itr != petsSet.end(); ++itr)
{
Unit* pet = *itr;
if (checkPet->GetEntry() == GUID_ENPART(guid) && pet->GetEntry() != GUID_ENPART(guid))
continue;
// do not add not learned spells/ passive spells
if (!pet->HasSpell(spellid) || !spellInfo->IsAutocastable())
continue;
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
sLog->outError("WorldSession::HandlePetSpellAutocastOpcod: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
continue;
}
if (pet->IsPet())
((Pet*)pet)->ToggleAutocast(spellInfo, state);
else
pet->GetCharmInfo()->ToggleCreatureAutocast(spellInfo, state);
charmInfo->SetSpellAutocast(spellInfo, state);
}
}
开发者ID:Cryostorm,项目名称:SunwellCore,代码行数:57,代码来源:PetHandler.cpp
示例2: UpdateAI
void UpdateAI(uint32 diff)
{
ScriptedAI::UpdateAI(diff);
_switchImageTimer += diff;
if (_switchImageTimer > MINUTE*IN_MILLISECONDS)
{
_switchImageTimer = 0;
QuestRelationBounds objectQR = sObjectMgr->GetCreatureQuestRelationBounds(me->GetEntry());
for (QuestRelations::const_iterator i = objectQR.first; i != objectQR.second; ++i)
{
uint32 questId = i->second;
Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
if (!quest || !quest->IsWeekly())
continue;
uint32 newEntry = GetImageEntry(questId);
if (GUID_ENPART(_summonGUID) != newEntry)
{
if (Creature* image = ObjectAccessor::GetCreature(*me, _summonGUID))
image->DespawnOrUnsummon();
float z = 653.622f;
if (newEntry == NPC_MALYGOS_IMAGE || newEntry == NPC_RAZORSCALE_IMAGE || newEntry == NPC_SARTHARION_IMAGE)
z += 3.0f;
me->SummonCreature(newEntry, 5703.077f, 583.9757f, z, 3.926991f);
}
}
}
}
开发者ID:Helias,项目名称:azerothcore-wotlk,代码行数:30,代码来源:zone_dalaran.cpp
示例3: GetPlayer
void TowerDefenseInstanceScript::TowerDefenseMapInstanceScript::SellGuard(uint64 guid)
{
if(!guid)
return;
Player* player = GetPlayer();
if(!player)
return;
Creature* creature = player->GetMap()->GetCreature(guid);
if(!creature)
return;
uint32 entry = GUID_ENPART(guid);
if (Guards.find(guid) != Guards.end())
{
GuardInfo* guard = Guards[guid];
if(QueryResult queryResult = CharacterDatabase.PQuery("SELECT creatureName, creatureEntry, creatureCost FROM custom_td_base_stats WHERE creatureEntry = '%u'", entry))
{
creature->CastSpell(creature, GetSpellIdByUniqueId(5),true);
uint32 SellPrice = guard->GetSellPrice(guard->GetLevel());
switch(GetEventMode())
{
case TD_EVENT_MODE_HARD:
SellPrice = SellPrice - (SellPrice/4);
break;
case TD_EVENT_MODE_EXTREME:
SellPrice = SellPrice - (SellPrice/2);
break;
}
UpdateResources(TD_EVENT_INC,SellPrice);
SendMessageToPlayer(TD_SYSTEM_MSG_SOLD_TOWER_FOR, creature->GetName(),SellPrice);
creature->DisappearAndDie();
Guards.erase(guid);
}
}
}
开发者ID:Adeer,项目名称:Patchs,代码行数:34,代码来源:TowerDefenseInstance.cpp
示例4: IC_LOG_DEBUG
void WorldSession::HandlePageQuerySkippedOpcode(WorldPacket& recvData)
{
IC_LOG_DEBUG("network", "WORLD: Received CMSG_PAGE_TEXT_QUERY");
uint32 itemid;
uint64 guid;
recvData >> itemid >> guid;
IC_LOG_INFO("network", "Packet Info: itemid: %u guidlow: %u guidentry: %u guidhigh: %u",
itemid, GUID_LOPART(guid), GUID_ENPART(guid), GUID_HIPART(guid));
}
开发者ID:aikon-com-cn,项目名称:Infinity-Core,代码行数:12,代码来源:ItemHandler.cpp
示例5: GUID_LOPART
void WorldSession::HandlePageQuerySkippedOpcode(WorldPacket& recvData)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY");
uint32 itemid;
uint64 guid;
recvData >> itemid >> guid;
sLog->outInfo(LOG_FILTER_NETWORKIO, "Packet Info: itemid: %u guidlow: %u guidentry: %u guidhigh: %u",
itemid, GUID_LOPART(guid), GUID_ENPART(guid), GUID_HIPART(guid));
}
开发者ID:Eclipsemints,项目名称:TrinityCore,代码行数:12,代码来源:ItemHandler.cpp
示例6: CHECK_PACKET_SIZE
void WorldSession::HandlePageQuerySkippedOpcode( WorldPacket & recv_data )
{
CHECK_PACKET_SIZE(recv_data,4+8);
sLog.outDebug( "WORLD: Received CMSG_PAGE_TEXT_QUERY" );
uint32 itemid;
uint64 guid;
recv_data >> itemid >> guid;
sLog.outDetail( "Packet Info: itemid: %u guidlow: %u guidentry: %u guidhigh: %u",
itemid, GUID_LOPART(guid), GUID_ENPART(guid), GUID_HIPART(guid));
}
开发者ID:Gweana,项目名称:mangos,代码行数:14,代码来源:ItemHandler.cpp
示例7: GetPlayer
void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data)
{
sLog->outDebug("WORLD: Recvd CMSG_SET_ACTIVE_MOVER");
uint64 guid;
recv_data >> guid;
// do not re-set the active mover if it didn't change
if (guid == _player->m_mover->GetGUID())
return;
// Anti-cheat check
if (guid != _player->GetCharmGUID() && guid != _player->GetGUID())
{
sLog->outError("Player %s is trying to change mover to an invalid value!", _player->GetName());
GetPlayer()->SetMover(GetPlayer());
return;
}
if (GetPlayer()->IsInWorld())
{
if (Unit *mover = ObjectAccessor::GetUnit(*GetPlayer(), guid))
{
GetPlayer()->SetMover(mover);
if (mover != GetPlayer() && mover->canFly())
{
WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12);
data.append(mover->GetPackGUID());
data << uint32(0);
SendPacket(&data);
}
}
else
{
sLog->outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " (%s - Entry: %u) and should be " UI64FMTD, guid, GetLogNameForGuid(guid), GUID_ENPART(guid), _player->m_mover->GetGUID());
GetPlayer()->SetMover(GetPlayer());
}
}
}
开发者ID:CarlosX,项目名称:VoragineCore,代码行数:38,代码来源:MovementHandler.cpp
示例8: uint64
void WorldSession::HandleSetActiveMoverOpcode(WorldPacket& recvPacket)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_SET_ACTIVE_MOVER");
ObjectGuid guid;
uint8 unk;
unk = recvPacket.ReadBit();
guid[6] = recvPacket.ReadBit();
guid[7] = recvPacket.ReadBit();
guid[3] = recvPacket.ReadBit();
guid[1] = recvPacket.ReadBit();
guid[2] = recvPacket.ReadBit();
guid[4] = recvPacket.ReadBit();
guid[5] = recvPacket.ReadBit();
guid[0] = recvPacket.ReadBit();
recvPacket.ReadByteSeq(guid[2]);
recvPacket.ReadByteSeq(guid[0]);
recvPacket.ReadByteSeq(guid[1]);
recvPacket.ReadByteSeq(guid[5]);
recvPacket.ReadByteSeq(guid[3]);
recvPacket.ReadByteSeq(guid[7]);
recvPacket.ReadByteSeq(guid[6]);
recvPacket.ReadByteSeq(guid[4]);
if (GetPlayer()->IsInWorld())
{
if (_player->m_mover->GetGUID() != guid)
sLog->outError(LOG_FILTER_NETWORKIO, "HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " (%s - Entry: %u) and should be " UI64FMTD, uint64(guid), GetLogNameForGuid(guid), GUID_ENPART(guid), _player->m_mover->GetGUID());
}
}
开发者ID:Adeer,项目名称:Patchs,代码行数:32,代码来源:MovementHandler.cpp
示例9: pet
void WorldSession::HandlePetSetAction(WorldPacket & recvData)
{
;//sLog->outDetail("HandlePetSetAction. CMSG_PET_SET_ACTION");
uint64 petguid;
uint8 count;
recvData >> petguid;
Unit* checkPet = ObjectAccessor::GetUnit(*_player, petguid);
if (!checkPet || checkPet != _player->GetFirstControlled())
{
sLog->outError("HandlePetSetAction: Unknown pet (GUID: %u) or pet owner (GUID: %u)", GUID_LOPART(petguid), _player->GetGUIDLow());
return;
}
count = (recvData.size() == 24) ? 2 : 1;
uint32 position[2];
uint32 data[2];
bool move_command = false;
for (uint8 i = 0; i < count; ++i)
{
recvData >> position[i];
recvData >> data[i];
uint8 act_state = UNIT_ACTION_BUTTON_TYPE(data[i]);
//ignore invalid position
if (position[i] >= MAX_UNIT_ACTION_BAR_INDEX)
return;
// in the normal case, command and reaction buttons can only be moved, not removed
// at moving count == 2, at removing count == 1
// ignore attempt to remove command|reaction buttons (not possible at normal case)
if (act_state == ACT_COMMAND || act_state == ACT_REACTION)
{
if (count == 1)
return;
move_command = true;
}
}
Unit::ControlSet petsSet;
if (checkPet->GetEntry() != GUID_ENPART(petguid))
petsSet.insert(checkPet);
else
petsSet = _player->m_Controlled;
// Xinef: loop all pets with same entry (fixes partial state change for feral spirits)
for (Unit::ControlSet::const_iterator itr = petsSet.begin(); itr != petsSet.end(); ++itr)
{
Unit* pet = *itr;
if (checkPet->GetEntry() == GUID_ENPART(petguid) && pet->GetEntry() != GUID_ENPART(petguid))
continue;
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
sLog->outError("WorldSession::HandlePetSetAction: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
continue;
}
// check swap (at command->spell swap client remove spell first in another packet, so check only command move correctness)
if (move_command)
{
uint8 act_state_0 = UNIT_ACTION_BUTTON_TYPE(data[0]);
if (act_state_0 == ACT_COMMAND || act_state_0 == ACT_REACTION)
{
uint32 spell_id_0 = UNIT_ACTION_BUTTON_ACTION(data[0]);
UnitActionBarEntry const* actionEntry_1 = charmInfo->GetActionBarEntry(position[1]);
if (!actionEntry_1 || spell_id_0 != actionEntry_1->GetAction() ||
act_state_0 != actionEntry_1->GetType())
continue;
}
uint8 act_state_1 = UNIT_ACTION_BUTTON_TYPE(data[1]);
if (act_state_1 == ACT_COMMAND || act_state_1 == ACT_REACTION)
{
uint32 spell_id_1 = UNIT_ACTION_BUTTON_ACTION(data[1]);
UnitActionBarEntry const* actionEntry_0 = charmInfo->GetActionBarEntry(position[0]);
if (!actionEntry_0 || spell_id_1 != actionEntry_0->GetAction() ||
act_state_1 != actionEntry_0->GetType())
continue;
}
}
for (uint8 i = 0; i < count; ++i)
{
uint32 spell_id = UNIT_ACTION_BUTTON_ACTION(data[i]);
uint8 act_state = UNIT_ACTION_BUTTON_TYPE(data[i]);
//if it's act for spell (en/disable/cast) and there is a spell given (0 = remove spell) which pet doesn't know, don't add
if (!((act_state == ACT_ENABLED || act_state == ACT_DISABLED || act_state == ACT_PASSIVE) && spell_id && !pet->HasSpell(spell_id)))
{
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id))
{
//sign for autocast
//.........这里部分代码省略.........
开发者ID:Cryostorm,项目名称:SunwellCore,代码行数:101,代码来源:PetHandler.cpp
示例10: GetLogNameForGuid
void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recvData)
{
;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_SET_ACTIVE_MOVER");
uint64 guid;
recvData >> guid;
if (GetPlayer()->IsInWorld() && _player->m_mover && _player->m_mover->IsInWorld())
{
if (_player->m_mover->GetGUID() != guid)
sLog->outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " (%s - Entry: %u) and should be " UI64FMTD, guid, GetLogNameForGuid(guid), GUID_ENPART(guid), _player->m_mover->GetGUID());
}
}
开发者ID:Keader,项目名称:Sunwell,代码行数:13,代码来源:MovementHandler.cpp
示例11: TC_LOG_DEBUG
void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recvData)
{
TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_SET_ACTIVE_MOVER");
uint64 guid;
recvData >> guid;
if (GetPlayer()->IsInWorld())
{
if (_player->m_mover->GetGUID() != guid)
TC_LOG_ERROR("network", "HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " (%s - Entry: %u) and should be " UI64FMTD, guid, GetLogNameForGuid(guid), GUID_ENPART(guid), _player->m_mover->GetGUID());
}
}
开发者ID:3306665,项目名称:trinitycore,代码行数:13,代码来源:MovementHandler.cpp
示例12: SendQuestGiverOfferReward
void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, bool canComplete, bool closeOnCancel) const
{
// We can always call to RequestItems, but this packet only goes out if there are actually
// items. Otherwise, we'll skip straight to the OfferReward
std::string questTitle = quest->GetTitle();
std::string requestItemsText = quest->GetRequestItemsText();
uint32 itemCount = quest->GetQuestObjectiveCountType(QUEST_OBJECTIVE_TYPE_ITEM);
uint32 currencyCount = quest->GetQuestObjectiveCountType(QUEST_OBJECTIVE_TYPE_CURRENCY);
uint32 moneyCount = quest->GetQuestObjectiveCountType(QUEST_OBJECTIVE_TYPE_MONEY);
if (!itemCount && !currencyCount && !moneyCount && canComplete)
{
SendQuestGiverOfferReward(quest, npcGUID, true);
return;
}
int32 locale = _session->GetSessionDbLocaleIndex();
if (locale >= 0)
{
if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(quest->GetQuestId()))
{
ObjectMgr::GetLocaleString(localeData->Title, locale, questTitle);
ObjectMgr::GetLocaleString(localeData->RequestItemsText, locale, requestItemsText);
}
}
uint32 requiredMoney = 0;
ByteBuffer currencyData, itemData;
for (const auto &questObjective : quest->m_questObjectives)
{
switch (questObjective->Type)
{
case QUEST_OBJECTIVE_TYPE_ITEM:
{
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(questObjective->ObjectId))
itemData << uint32(itemTemplate->DisplayInfoID);
else
itemData << uint32(0);
itemData << uint32(questObjective->Amount);
itemData << uint32(questObjective->ObjectId);
break;
}
case QUEST_OBJECTIVE_TYPE_CURRENCY:
{
currencyData << uint32(questObjective->Amount);
currencyData << uint32(questObjective->ObjectId);
break;
}
case QUEST_OBJECTIVE_TYPE_MONEY:
{
requiredMoney = questObjective->Amount;
break;
}
default:
break;
}
}
ObjectGuid guid = npcGUID;
WorldPacket data(SMSG_QUESTGIVER_REQUEST_ITEMS, 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 1 + 8 + 8 +
questTitle.size() + requestItemsText.size() + itemCount * (4 + 4 + 4) + currencyCount * (4 + 4));
data << uint32(0);
data << uint32(canComplete ? quest->GetCompleteEmote() : quest->GetIncompleteEmote());
data << uint32(quest->GetFlags());
data << uint32(quest->GetQuestId());
data << uint32(GUID_ENPART(npcGUID));
data << uint32(requiredMoney);
data << uint32(0);
data << uint32(canComplete ? 0x5F : 0x5B); // status flags
data << uint32(0);
data.WriteBit(closeOnCancel);
data.WriteBitSeq<5, 1, 0>(guid);
data.WriteBits(requestItemsText.size(), 12);
data.WriteBitSeq<4>(guid);
data.WriteBits(currencyCount, 21);
data.WriteBits(itemCount, 20);
data.WriteBitSeq<3, 2, 6, 7>(guid);
data.WriteBits(questTitle.size(), 9);
data.FlushBits();
data.WriteByteSeq<6>(guid);
data.append(itemData);
data.WriteString(questTitle);
data.append(currencyData);
data.WriteByteSeq<4>(guid);
data.WriteString(requestItemsText);
data.WriteByteSeq<0, 7, 2, 5, 1, 3>(guid);
_session->SendPacket(&data);
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId());
}
开发者ID:Exodius,项目名称:chuspi,代码行数:98,代码来源:GossipDef.cpp
示例13: TC_LOG_DEBUG
void WorldSession::HandleSetActiveMoverOpcode(WorldPacket& recvPacket)
{
TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_SET_ACTIVE_MOVER");
ObjectGuid guid;
guid[7] = recvPacket.ReadBit();
guid[2] = recvPacket.ReadBit();
guid[1] = recvPacket.ReadBit();
guid[0] = recvPacket.ReadBit();
guid[4] = recvPacket.ReadBit();
guid[5] = recvPacket.ReadBit();
guid[6] = recvPacket.ReadBit();
guid[3] = recvPacket.ReadBit();
recvPacket.ReadByteSeq(guid[3]);
recvPacket.ReadByteSeq(guid[2]);
recvPacket.ReadByteSeq(guid[4]);
recvPacket.ReadByteSeq(guid[0]);
recvPacket.ReadByteSeq(guid[5]);
recvPacket.ReadByteSeq(guid[1]);
recvPacket.ReadByteSeq(guid[6]);
recvPacket.ReadByteSeq(guid[7]);
if (GetPlayer()->IsInWorld())
{
if (_player->m_mover->GetGUID() != guid)
TC_LOG_ERROR("network", "HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " (%s - Entry: %u) and should be " UI64FMTD, uint64(guid), GetLogNameForGuid(guid), GUID_ENPART(guid), _player->m_mover->GetGUID());
}
}
开发者ID:Arkania,项目名称:ArkCORE-NG,代码行数:30,代码来源:MovementHandler.cpp
示例14: GetPlayer
void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_SET_ACTIVE_MOVER");
uint64 guid;
recv_data >> guid;
// do not reset the active mover if it didn't change
if (guid == _player->_mover->GetGUID())
return;
// Anti-cheat check
if (guid != _player->GetCharmGUID() && guid != _player->GetGUID())
{
sLog->outError("Player %s is trying to change mover to an invalid value!", _player->GetName());
GetPlayer()->SetMover(GetPlayer());
return;
}
if (GetPlayer()->IsInWorld())
{
if (_player->_mover->GetGUID() != guid)
{
sLog->outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " (%s - Entry: %u) and should be " UI64FMTD, guid, GetLogNameForGuid(guid), GUID_ENPART(guid), _player->_mover->GetGUID());
GetPlayer()->SetMover(GetPlayer());
}
}
}
开发者ID:AwkwardDev,项目名称:Darkcore-Rebase,代码行数:27,代码来源:MovementHandler.cpp
示例15: GetPlayer
void WorldSession::HandleGravityAckMessage(WorldPacket& recvData)
{
MovementInfo movementInfo;
GetPlayer()->ReadMovementInfo(recvData, &movementInfo);
if (movementInfo.guid != _player->m_mover->GetGUID())
TC_LOG_ERROR("network", "HandleGravityAckMessage: incorrect mover guid: mover is " UI64FMTD " (%s - Entry: %u) and should be " UI64FMTD, uint64(movementInfo.guid), GetLogNameForGuid(movementInfo.guid), GUID_ENPART(movementInfo.guid), _player->m_mover->GetGUID());
}
开发者ID:Arkania,项目名称:ArkCORE-NG,代码行数:8,代码来源:MovementHandler.cpp
注:本文中的GUID_ENPART函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论