本文整理汇总了C++中Group::CountRollVote方法的典型用法代码示例。如果您正苦于以下问题:C++ Group::CountRollVote方法的具体用法?C++ Group::CountRollVote怎么用?C++ Group::CountRollVote使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Group
的用法示例。
在下文中一共展示了Group::CountRollVote方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleLootRoll
void WorldSession::HandleLootRoll(WorldPacket& recvData)
{
ObjectGuid guid;
uint32 itemSlot;
uint8 rollType;
recvData >> guid; // guid of the item rolled
recvData >> itemSlot;
recvData >> rollType; // 0: pass, 1: need, 2: greed
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
group->CountRollVote(GetPlayer()->GetGUID(), guid, rollType);
switch (rollType)
{
case ROLL_NEED:
GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, 1);
break;
case ROLL_GREED:
GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, 1);
break;
}
}
示例2: HandleLootRoll
void WorldSession::HandleLootRoll(WorldPacket &recv_data)
{
if (!GetPlayer()->GetGroup())
return;
uint64 Guid;
uint32 NumberOfPlayers;
uint8 rollType;
recv_data >> Guid; //guid of the item rolled
recv_data >> NumberOfPlayers;
recv_data >> rollType; //0: pass, 1: need, 2: greed
//sLog->outDebug("WORLD RECIEVE CMSG_LOOT_ROLL, From:%u, Numberofplayers:%u, Choise:%u", (uint32)Guid, NumberOfPlayers, Choise);
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
// everything's fine, do it
group->CountRollVote(GetPlayer()->GetGUID(), Guid, NumberOfPlayers, rollType);
switch (rollType)
{
case ROLL_NEED:
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, 1);
break;
case ROLL_GREED:
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, 1);
break;
}
}
示例3: HandleLootRoll
void WorldSession::HandleLootRoll(WorldPacket& recv_data)
{
ObjectGuid lootedTarget;
uint32 itemSlot;
uint8 rollType;
recv_data >> lootedTarget; //guid of the item rolled
recv_data >> itemSlot;
recv_data >> rollType;
//DEBUG_LOG("WORLD RECIEVE CMSG_LOOT_ROLL, From:%u, Numberofplayers:%u, rollType:%u", (uint32)Guid, NumberOfPlayers, rollType);
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
if (rollType >= MAX_ROLL_FROM_CLIENT)
return;
// everything is fine, do it, if false then some cheating problem found
if (!group->CountRollVote(GetPlayer(), lootedTarget, itemSlot, RollVote(rollType)))
return;
switch (rollType)
{
case ROLL_NEED:
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, 1);
break;
case ROLL_GREED:
case ROLL_DISENCHANT:
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, 1);
break;
}
}
示例4: HandleLootRoll
void WorldSession::HandleLootRoll(WorldPacket& recvData)
{
uint64 guid;
uint32 itemSlot;
uint8 rollType;
recvData >> guid; // guid of the item rolled
recvData >> itemSlot;
recvData >> rollType; // 0: pass, 1: need, 2: greed
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
group->CountRollVote(GetPlayer()->GetGUID(), guid, rollType);
}
示例5: HandleLootRoll
void WorldSession::HandleLootRoll(WorldPackets::Loot::LootRoll& packet)
{
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
group->CountRollVote(GetPlayer()->GetGUID(), packet.LootObj, packet.RollType);
switch (packet.RollType)
{
case ROLL_NEED:
GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, 1);
break;
case ROLL_GREED:
GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, 1);
break;
}
}
示例6: HandleLootRoll
void WorldSession::HandleLootRoll(WorldPacket& recv_data)
{
if (!GetPlayer()->GetGroup())
return;
uint64 Guid;
uint32 NumberOfPlayers;
uint8 Choise;
recv_data >> Guid; //guid of the item rolled
recv_data >> NumberOfPlayers;
recv_data >> Choise; //0: pass, 1: need, 2: greed
//sLog.outDebug("WORLD RECIEVE CMSG_LOOT_ROLL, From:%u, Numberofplayers:%u, Choise:%u", (uint32)Guid, NumberOfPlayers, Choise);
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
// everything is fine, do it
group->CountRollVote(GetPlayer()->GetGUID(), Guid, NumberOfPlayers, Choise);
}
示例7: HandleLootRoll
void WorldSession::HandleLootRoll(WorldPacket& recv_data)
{
ObjectGuid lootedTarget;
uint32 itemSlot;
uint8 rollType;
recv_data >> lootedTarget; // guid of the item rolled
recv_data >> itemSlot;
recv_data >> rollType;
// DEBUG_LOG("WORLD RECIEVE CMSG_LOOT_ROLL, From:%u, Numberofplayers:%u, rollType:%u", (uint32)Guid, NumberOfPlayers, rollType);
Group* group = GetPlayer()->GetGroup();
if (!group)
{ return; }
if (rollType >= MAX_ROLL_FROM_CLIENT)
{ return; }
// everything is fine, do it, if false then some cheating problem found (result not used in pre-3.0)
group->CountRollVote(GetPlayer(), lootedTarget, itemSlot, RollVote(rollType));
}
示例8: HandleMasterIncomingPacket
//.........这里部分代码省略.........
bot->GetSession()->HandleQuestgiverAcceptQuestOpcode(p);
bot->GetPlayerbotAI()->TellMaster("J'ai pris la quete.");
}
}
}
return;
}
case CMSG_LOOT_ROLL:
{
WorldPacket p(packet);
uint64 Guid;
uint32 NumberOfPlayers;
uint8 rollType;
p.rpos(0);
p >> Guid;
p >> NumberOfPlayers;
p >> rollType;
if (!m_master->GetGroup())
return;
for (GroupReference *itr = m_master->GetGroup()->GetFirstMember(); itr != NULL; itr = itr->next())
{
uint32 choice = urand(0,3);
Player* const bot = itr->getSource();
if(!bot)
return;
Group* group = bot->GetGroup();
if(!group)
return;
group->CountRollVote(bot, Guid, NumberOfPlayers, RollVote(choice));
switch (choice)
{
case ROLL_NEED:
bot->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, 1);
break;
case ROLL_GREED:
bot->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, 1);
break;
}
}
return;
}
case CMSG_REPAIR_ITEM:
{
WorldPacket p(packet);
uint64 npcGUID, itemGUID;
uint8 guildBank;
p.rpos(0);
p >> npcGUID;
p >> itemGUID;
p >> guildBank;
if (!m_master->GetGroup())
return;
for (GroupReference *itr = m_master->GetGroup()->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* const bot = itr->getSource();
if (!bot)
return;
示例9: HandleMasterIncomingPacket
//.........这里部分代码省略.........
Player* const bot = itr->getSource();
bot->GetPlayerbotAI()->TurnInQuests(pNpc);
}
return;
}
case CMSG_LOOT_ROLL:
{
WorldPacket p(packet); //WorldPacket packet for CMSG_LOOT_ROLL, (8+4+1)
uint64 Guid;
uint32 NumberOfPlayers;
uint8 rollType;
p.rpos(0); //reset packet pointer
p >> Guid; //guid of the item rolled
p >> NumberOfPlayers; //number of players invited to roll
p >> rollType; //need,greed or pass on roll
if (!m_master->GetGroup())
return;
for (GroupReference *itr = m_master->GetGroup()->GetFirstMember(); itr != NULL; itr = itr->next())
{
uint32 choice = urand(0, 3); //returns 0,1,2 or 3
Player* const bot = itr->getSource();
if(!bot)
return;
Group* group = bot->GetGroup();
if (!group)
return;
group->CountRollVote(bot, Guid, NumberOfPlayers, RollVote(choice));
switch (choice)
{
case ROLL_NEED:
bot->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, 1);
break;
case ROLL_GREED:
bot->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, 1);
break;
}
}
return;
}
case CMSG_REPAIR_ITEM:
{
WorldPacket p(packet); // WorldPacket packet for CMSG_REPAIR_ITEM, (8+8+1)
ObjectGuid npcGUID;
uint64 itemGUID;
uint8 guildBank;
p.rpos(0); //reset packet pointer
p >> npcGUID;
p >> itemGUID; // Not used for bot but necessary opcode data retrieval
p >> guildBank; // Flagged if guild repair selected
if (!m_master->GetGroup())
return;
for (GroupReference *itr = m_master->GetGroup()->GetFirstMember(); itr != NULL; itr = itr->next())
{
示例10: HandleMasterIncomingPacket
//.........这里部分代码省略.........
Player* const bot = it->second;
bot->GetPlayerbotAI()->TurnInQuests(pNpc);
}
return;
}
case CMSG_LOOT_ROLL:
{
WorldPacket p(packet); //WorldPacket packet for CMSG_LOOT_ROLL, (8+4+1)
ObjectGuid Guid;
uint32 NumberOfPlayers;
uint8 rollType;
p.rpos(0); //reset packet pointer
p >> Guid; //guid of the item rolled
p >> NumberOfPlayers; //number of players invited to roll
p >> rollType; //need,greed or pass on roll
for (PlayerBotMap::const_iterator it = GetPlayerBotsBegin(); it != GetPlayerBotsEnd(); ++it)
{
uint32 choice;
Player* const bot = it->second;
if (!bot)
return;
Group* group = bot->GetGroup();
if (!group)
return;
(bot->GetPlayerbotAI()->CanStore()) ? choice = urand(0, 3) : choice = 0; // pass = 0, need = 1, greed = 2, disenchant = 3
group->CountRollVote(bot, Guid, NumberOfPlayers, RollVote(choice));
switch (choice)
{
case ROLL_NEED:
bot->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, 1);
break;
case ROLL_GREED:
bot->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, 1);
break;
default:
break;
}
}
return;
}
// Handle GOSSIP activate actions, prior to GOSSIP select menu actions
case CMSG_GOSSIP_HELLO:
{
DEBUG_LOG ("[PlayerbotMgr]: HandleMasterIncomingPacket - Received CMSG_GOSSIP_HELLO");
WorldPacket p(packet); //WorldPacket packet for CMSG_GOSSIP_HELLO, (8)
ObjectGuid guid;
p.rpos(0); //reset packet pointer
p >> guid;
for (PlayerBotMap::const_iterator it = GetPlayerBotsBegin(); it != GetPlayerBotsEnd(); ++it)
{
Player* const bot = it->second;
if (!bot)
return;
Creature *pCreature = bot->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);