Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Shamans, Warriors = {}, {} --two tables where the names of respective classes will be stored
- local s, w --two variables that will act as counters to place the names in the respective tables based on raidindex
- local NumberGroupMembers
- local RCC = CreateFrame('FRAME', 'RaidCooldownCoordinationFrame', UIParent)
- RCC:RegisterEvent('PLAYER_ENTERING_WORLD')
- RCC:RegisterEvent('GROUP_ROSTER_UPDATE')
- RCC:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
- RCC:RegisterEvent('READY_CHECK')
- RCC:SetScript('OnEvent', function(self, event, timeStamp, eventcl, _, _, sourceName, _, _, _, destName, _, _, spellId)
- if (event == 'PLAYER_ENTERING_WORLD' and GetNumGroupMembers() == 0) then --turn the combatlog parsing off outside of raids
- RCC:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
- elseif (event == 'GROUP_ROSTER_UPDATE' and GetNumGroupMembers() == 0) then --turn the combatlog parsing off if the group disbands
- RCC:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
- elseif ((event == 'GROUP_ROSTER_UPDATE' or event == 'PLAYER_ENTERING_WORLD') and GetNumGroupMembers() > 0)then -- make new values for the tables as warriors/shamans join/leave or move groups
- s, w= 1, 1 --set counter of tables back to 1 in case someone got moved in the raid, or a shaman/warrior was gained/lost
- --could be annoying to some if order gets messed with, don't know of a simple way to keep the order the same, table recycle function?
- NumberGroupMembers = GetNumGroupMembers()
- for i = 1, NumberGroupMembers do
- local Class = select(5, GetRaidRosterInfo(i))
- if Class == 'Shaman' then
- Shamans[s] = select(1, GetRaidRosterInfo(i))
- s = s+1
- elseif Class == 'Warrior' then
- Warriors[w] = select(1, GetRaidRosterInfo(i))
- w = w+1
- end
- end
- elseif event == ('COMBAT_LOG_EVENT_UNFILTERED') then
- if (eventcl == 'SPELL_SUMMON' and spellId == 120668) then --stormlash totem dropped
- for i = 1, #Shamans do
- if (sourceName == Shamans[i] and i ~= #Shamans) then --dont whisper the person with a 5 min cd still
- SendChatMessage(sourceName..' just dropped their Stormlash Totem. Drop yours in 10 seconds!', 'WHISPER', nil, Shamans[i+1])
- break
- end
- end
- elseif (eventcl == 'UNIT_DESTROYED' and destName == 'Stormlash Totem') then --stormlash faded/recalled
- for i = 1, #Shamans do
- if (sourceName == Shamans[i] and i ~= #Shamans) then
- SendChatMessage('Drop your Stormlash Totem now!', 'WHISPER', nil, Shamans[i+1])
- break
- end
- end
- elseif (eventcl == 'SPELL_SUMMON' and spellId == 114207) then --skull banner dropped
- for i = 1, #Warriors do
- if (sourceName == Warriors[i] and i ~= #Warriors) then
- SendChatMessage(sourceName..' just dropped their Skull Banner. Drop yours in 10 seconds!', 'WHISPER', nil, Warriors[i+1])
- break
- end
- end
- elseif (eventcl == 'UNIT_DESTROYED' and destName == 'Skull Banner') then --skull banner faded/clicked off
- for i = 1, #Shamans do
- if (sourceName == Shamans[i] and i ~= #Shamans) then
- SendChatMessage('Drop your Skull Banner now!', 'WHISPER', nil, Warriors[i+1])
- break
- end
- end
- end
- elseif event == 'READY_CHECK' then
- for i = 1, #Shamans do
- if i == 1 then
- SendChatMessage('You will be dropping your Stormlash Totem first, do it when you think best.', 'WHISPER', nil, Shamans[1])
- else
- SendChatMessage('The Stormlash order is: ' .. for k, v in pairs(Shamans) do print(v) end .. '. You will get a 10s warning whisper, followed by a "Drop it now!" whisper when you are to drop Stormlash.', 'WHISPER', nil, Shamans[i])
- end
- end
- for i = 1, #Warriors do
- if i == 1 then
- SendChatMessage('You will be dropping your Skull Banner first, do it when you think best.', 'WHISPER', nil, Warriors[1])
- else
- SendChatMessage('The Skull Banner order is: ' .. Warriors .. '. You will get a 10s warning whisper, followed by a "Drop it now!" whisper when you are to drop Skull Banner.', 'WHISPER', nil, Warriors[i])
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement