本文整理汇总了C++中PlayerPointer::InGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerPointer::InGroup方法的具体用法?C++ PlayerPointer::InGroup怎么用?C++ PlayerPointer::InGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerPointer
的用法示例。
在下文中一共展示了PlayerPointer::InGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnActivate
void OnActivate(PlayerPointer pPlayer)
{
if(pPlayer->HasFinishedQuest(7761) && pPlayer->getLevel() >= 58 && pPlayer->InGroup() == true)
{
pPlayer->SafeTeleport(469, 0, -7672.939941f, -1107.307617f, 396.649994f, 0.616532f);
}
else if(pPlayer->getLevel() <= 57 || pPlayer->HasFinishedQuest(7761) == false)
{
pPlayer->BroadcastMessage("You need to be level 58 and have completed the quest : Blackhand's Command");
}
else if(pPlayer->HasFinishedQuest(7761) == true && pPlayer->getLevel() >= 58 && pPlayer->InGroup() == false)
{
pPlayer->BroadcastMessage("You need to be in a raid group to be able to enter this instance");
}
}
示例2: HandleGroupInviteOpcode
//////////////////////////////////////////////////////////////
/// This function handles CMSG_GROUP_INVITE
//////////////////////////////////////////////////////////////
void WorldSession::HandleGroupInviteOpcode( WorldPacket & recv_data )
{
if(!_player->IsInWorld())
return;
CHECK_PACKET_SIZE(recv_data, 1);
WorldPacket data(100);
std::string membername;
PlayerPointer player = NULLPLR;
Group *group = NULL;
recv_data >> membername;
if(_player->HasBeenInvited())return;
player = objmgr.GetPlayer(membername.c_str(), false);
if ( player == NULL)
{
SendPartyCommandResult(_player, 0, membername, ERR_PARTY_CANNOT_FIND);
return;
}
if (player == _player)
{
return;
}
if ( _player->InGroup() && (!_player->IsGroupLeader() || _player->GetGroup()->HasFlag(GROUP_FLAG_BATTLEGROUND_GROUP) ) )
{
SendPartyCommandResult(_player, 0, "", ERR_PARTY_YOU_ARE_NOT_LEADER);
return;
}
group = _player->GetGroup();
if ( group != NULL )
{
if (group->IsFull())
{
SendPartyCommandResult(_player, 0, "", ERR_PARTY_IS_FULL);
return;
}
}
if ( player->InGroup() )
{
SendPartyCommandResult(_player, player->GetGroup()->GetGroupType(), membername, ERR_PARTY_ALREADY_IN_GROUP);
data.SetOpcode(SMSG_GROUP_INVITE);
data << uint8(0);
data << GetPlayer()->GetName();
player->GetSession()->SendPacket(&data);
return;
}
if(player->GetTeam()!=_player->GetTeam() && _player->GetSession()->GetPermissionCount() == 0 && !sWorld.cross_faction_world)
{
SendPartyCommandResult(_player, 0, membername, ERR_PARTY_WRONG_FACTION);
return;
}
if ( player->HasBeenInvited() )
{
SendPartyCommandResult(_player, 0, membername, ERR_PARTY_ALREADY_IN_GROUP);
return;
}
if( player->Social_IsIgnoring( _player->GetLowGUID() ) )
{
SendPartyCommandResult(_player, 0, membername, ERR_PARTY_IS_IGNORING_YOU);
return;
}
if( player->bGMTagOn && !_player->GetSession()->HasPermissions())
{
SendPartyCommandResult(_player, 0, membername, ERR_PARTY_CANNOT_FIND);
return;
}
// 16/08/06 - change to guid to prevent very unlikely event of a crash in deny, etc
_player->SetInviter(_player->GetLowGUID());//bugfix if player invtied 2 people-> he can be in 2 parties
data.SetOpcode(SMSG_GROUP_INVITE);
data << uint8(1);
data << GetPlayer()->GetName();
player->GetSession()->SendPacket(&data);
uint32 gtype = 0;
if(group)
gtype = group->GetGroupType();
SendPartyCommandResult(_player, gtype, membername, ERR_PARTY_NO_ERROR);
// 16/08/06 - change to guid to prevent very unlikely event of a crash in deny, etc
player->SetInviter(_player->GetLowGUID());
}