mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
feat: boss for groups
This commit is contained in:
@@ -310,18 +310,23 @@ local function createCharacterTable(info)
|
||||
function self.addGroup(name, rank, isJob)
|
||||
local groupRank = tonumber(rank) or 1
|
||||
local groupInfo = Config.groups?[name]
|
||||
local bossRank = groupInfo and groupInfo.minimumBossRank
|
||||
|
||||
-- if not groupInfo then return end
|
||||
if isJob then
|
||||
for _, group in pairs(self.groups) do
|
||||
group.isJob = nil
|
||||
end
|
||||
end
|
||||
|
||||
self.groups[name] = {
|
||||
label = groupInfo and groupInfo.label or name,
|
||||
rankName = groupInfo and groupInfo.ranks[groupRank] or groupRank,
|
||||
rank = groupRank,
|
||||
isJob = isJob
|
||||
isJob = isJob,
|
||||
isBoss = bossRank and rank >= bossRank
|
||||
}
|
||||
|
||||
self.triggerEvent("ND:updateCharacter", removeCharacterFunctions(self))
|
||||
lib.addPrincipal(self.source, ("group.%s"):format(name))
|
||||
return self.groups[name]
|
||||
|
||||
Reference in New Issue
Block a user