diff --git a/README.md b/README.md index 0e26223..a751b5a 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ Eluna API for AC: ### Group - Added `Group:GetGroupType()`: https://github.com/azerothcore/mod-eluna/pull/82 +- Added `Group:SetMemberFlag()`: https://github.com/azerothcore/mod-eluna/pull/102 ### Unit - Added `Unit:ModifyThreatPct()`: https://github.com/azerothcore/mod-eluna/pull/25 diff --git a/src/LuaEngine/GroupMethods.h b/src/LuaEngine/GroupMethods.h index d6fc9d2..763c18a 100644 --- a/src/LuaEngine/GroupMethods.h +++ b/src/LuaEngine/GroupMethods.h @@ -428,6 +428,32 @@ namespace LuaGroup return 0; } + /** + * Sets or removes a flag for a [Group] member + * + *
+ * enum GroupMemberFlags
+ * {
+ * MEMBER_FLAG_ASSISTANT = 0x01,
+ * MEMBER_FLAG_MAINTANK = 0x02,
+ * MEMBER_FLAG_MAINASSIST = 0x04,
+ * };
+ *
+ *
+ * @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