-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRaidlist.lua
More file actions
47 lines (39 loc) · 1.52 KB
/
Raidlist.lua
File metadata and controls
47 lines (39 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
do
local players = {}
local function RaidRosterUpdate(self)
-- TODO: Disable when not in raid
-- TODO: Enable if in raid
wipe(players) -- Clear the raid roster
-- Loop through each raid member
for i = 1, MAX_RAID_MEMBERS, 1 do
local playerName = GetRaidRosterInfo(i)
-- Player exists for that raid spot and the player is a guild member
if type(playerName) == "string" then
playerName = playerName:lower()
if EPGPWaitlist.guildlist:IsGuildMember(playerName) then
-- Player is an alt, remove their main from waitlist and add their main to the raidRoster
if EPGPWaitlist.guildlist:IsAlt(playerName) then
players[EPGPWaitlist.guildlist:GetAltsMain(playerName)] = true
EPGPWaitlist.waitlist:RemovePlayer(EPGPWaitlist.guildlist:GetAltsMain(playerName))
else
players[playerName] = true
EPGPWaitlist.waitlist:RemovePlayer(playerName)
end
end
end
end
end
local function IsInRaid(self, name)
if players[name] ~= nill then
return true
end
return false
end
function EPGPWaitlist:Raidlist()
local obj = {
RaidRosterUpdate = RaidRosterUpdate,
IsInRaid = IsInRaid
}
return obj
end
end