(L, 4);
group->BroadcastPacket(data, ignorePlayersInBg, -1, ObjectGuid(ignore));
return 0;
}
/**
* Removes a member from this [Group] and returns 'true' if successful
*
*
* enum RemoveMethod
* {
* GROUP_REMOVEMETHOD_DEFAULT = 0,
* GROUP_REMOVEMETHOD_KICK = 1,
* GROUP_REMOVEMETHOD_LEAVE = 2,
* GROUP_REMOVEMETHOD_KICK_LFG = 3
* };
*
*
* @param [Player] player : the [Player] to remove
* @param [RemoveMethod] method : method used to remove the player
* @return bool removed
*/
int RemoveMember(lua_State* L, Group* group)
{
Player* player = Eluna::CHECKOBJ(L, 2);
uint32 method = Eluna::CHECKVAL(L, 3, 0);
#ifndef TRINITY
Eluna::Push(L, group->RemoveMember(player->GET_GUID(), method));
#else
Eluna::Push(L, group->RemoveMember(player->GET_GUID(), (RemoveMethod)method));
#endif
return 1;
}
/**
* Disbands this [Group]
*
*/
int Disband(lua_State* /*L*/, Group* group)
{
group->Disband();
return 0;
}
/**
* Converts this [Group] to a raid [Group]
*
*/
int ConvertToRaid(lua_State* /*L*/, Group* group)
{
group->ConvertToRaid();
return 0;
}
/**
* Sets the member's subGroup
*
* @param [Player] player : [Player] to move
* @param uint8 groupID : the subGroup's ID
*/
int SetMembersGroup(lua_State* L, Group* group)
{
Player* player = Eluna::CHECKOBJ(L, 2);
uint8 groupID = Eluna::CHECKVAL(L, 3);
group->ChangeMembersGroup(player->GET_GUID(), groupID);
return 0;
}
/**
* Sets the target icon of an object for the [Group]
*
* @param uint8 icon : the icon (Skull, Square, etc)
* @param uint64 target : GUID of the icon target, 0 is to clear the icon
* @param uint64 setter : GUID of the icon setter
*/
int SetTargetIcon(lua_State* L, Group* group)
{
uint8 icon = Eluna::CHECKVAL(L, 2);
uint64 target = Eluna::CHECKVAL(L, 3);
uint64 setter = Eluna::CHECKVAL(L, 4, 0);
if (icon >= TARGETICONCOUNT)
return luaL_argerror(L, 2, "valid target icon expected");
#if (defined(CLASSIC) || defined(TBC))
group->SetTargetIcon(icon, ObjectGuid(target));
#else
group->SetTargetIcon(icon, ObjectGuid(setter), ObjectGuid(target));
#endif
return 0;
}
/*int ConvertToLFG(lua_State* L, Group* group) // TODO: Implementation
{
group->ConvertToLFG();
return 0;
}*/
};
#endif