feat: add Group:SetMemberFlag() (#102)
This commit is contained in:
@@ -97,6 +97,7 @@ Eluna API for AC:
|
|||||||
|
|
||||||
### Group
|
### Group
|
||||||
- Added `Group:GetGroupType()`: https://github.com/azerothcore/mod-eluna/pull/82
|
- Added `Group:GetGroupType()`: https://github.com/azerothcore/mod-eluna/pull/82
|
||||||
|
- Added `Group:SetMemberFlag()`: https://github.com/azerothcore/mod-eluna/pull/102
|
||||||
|
|
||||||
### Unit
|
### Unit
|
||||||
- Added `Unit:ModifyThreatPct()`: https://github.com/azerothcore/mod-eluna/pull/25
|
- Added `Unit:ModifyThreatPct()`: https://github.com/azerothcore/mod-eluna/pull/25
|
||||||
|
|||||||
@@ -428,6 +428,32 @@ namespace LuaGroup
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets or removes a flag for a [Group] member
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* enum GroupMemberFlags
|
||||||
|
* {
|
||||||
|
* MEMBER_FLAG_ASSISTANT = 0x01,
|
||||||
|
* MEMBER_FLAG_MAINTANK = 0x02,
|
||||||
|
* MEMBER_FLAG_MAINASSIST = 0x04,
|
||||||
|
* };
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @param ObjectGuid target : GUID of the target
|
||||||
|
* @param bool apply : add the `flag` if `true`, remove the `flag` otherwise
|
||||||
|
* @param [GroupMemberFlags] flag : the flag to set or unset
|
||||||
|
*/
|
||||||
|
int SetMemberFlag(lua_State* L, Group* group)
|
||||||
|
{
|
||||||
|
ObjectGuid target = Eluna::CHECKVAL<ObjectGuid>(L, 2);
|
||||||
|
bool apply = Eluna::CHECKVAL<bool>(L, 3);
|
||||||
|
GroupMemberFlags flag = static_cast<GroupMemberFlags>(Eluna::CHECKVAL<uint32>(L, 4));
|
||||||
|
|
||||||
|
group->SetGroupMemberFlag(target, apply, flag);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*int ConvertToLFG(lua_State* L, Group* group) // TODO: Implementation
|
/*int ConvertToLFG(lua_State* L, Group* group) // TODO: Implementation
|
||||||
{
|
{
|
||||||
group->ConvertToLFG();
|
group->ConvertToLFG();
|
||||||
|
|||||||
@@ -1112,6 +1112,7 @@ ElunaRegister<Group> GroupMethods[] =
|
|||||||
{ "SetLeader", &LuaGroup::SetLeader },
|
{ "SetLeader", &LuaGroup::SetLeader },
|
||||||
{ "SetMembersGroup", &LuaGroup::SetMembersGroup },
|
{ "SetMembersGroup", &LuaGroup::SetMembersGroup },
|
||||||
{ "SetTargetIcon", &LuaGroup::SetTargetIcon },
|
{ "SetTargetIcon", &LuaGroup::SetTargetIcon },
|
||||||
|
{ "SetMemberFlag", &LuaGroup::SetMemberFlag },
|
||||||
|
|
||||||
// Boolean
|
// Boolean
|
||||||
{ "IsLeader", &LuaGroup::IsLeader },
|
{ "IsLeader", &LuaGroup::IsLeader },
|
||||||
|
|||||||
Reference in New Issue
Block a user