(L, 4);
#ifdef CMANGOS
group->BroadcastPacket(*data, ignorePlayersInBg, -1, ignore);
#else
group->BroadcastPacket(data, ignorePlayersInBg, -1, ignore);
#endif
return 0;
}
/**
* Removes a [Player] 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 ObjectGuid guid : guid of the player to remove
* @param [RemoveMethod] method : method used to remove the player
* @return bool removed
*/
int RemoveMember(lua_State* L, Group* group)
{
ObjectGuid guid = Eluna::CHECKVAL(L, 2);
uint32 method = Eluna::CHECKVAL(L, 3, 0);
#if defined TRINITY || AZEROTHCORE
Eluna::Push(L, group->RemoveMember(guid, (RemoveMethod)method));
#else
Eluna::Push(L, group->RemoveMember(guid, 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 ObjectGuid guid : guid of the player to move
* @param uint8 groupID : the subGroup's ID
*/
int SetMembersGroup(lua_State* L, Group* group)
{
ObjectGuid guid = Eluna::CHECKVAL(L, 2);
uint8 subGroup = Eluna::CHECKVAL(L, 3);
if (subGroup >= MAX_RAID_SUBGROUPS)
{
luaL_argerror(L, 3, "valid subGroup ID expected");
return 0;
}
if (!group->HasFreeSlotSubGroup(subGroup))
return 0;
group->ChangeMembersGroup(guid, subGroup);
return 0;
}
/**
* Sets the target icon of an object for the [Group]
*
* @param uint8 icon : the icon (Skull, Square, etc)
* @param ObjectGuid target : GUID of the icon target, 0 is to clear the icon
* @param ObjectGuid setter : GUID of the icon setter
*/
int SetTargetIcon(lua_State* L, Group* group)
{
uint8 icon = Eluna::CHECKVAL(L, 2);
ObjectGuid target = Eluna::CHECKVAL(L, 3);
ObjectGuid setter = Eluna::CHECKVAL(L, 4, ObjectGuid());
if (icon >= TARGETICONCOUNT)
return luaL_argerror(L, 2, "valid target icon expected");
#if (defined(CLASSIC) || defined(TBC))
group->SetTargetIcon(icon, target);
#else
group->SetTargetIcon(icon, setter, target);
#endif
return 0;
}
/*int ConvertToLFG(lua_State* L, Group* group) // TODO: Implementation
{
group->ConvertToLFG();
return 0;
}*/
};
#endif