Advertisement
Guest User

Untitled

a guest
Aug 27th, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.03 KB | None | 0 0
  1. local Shamans, Warriors = {}, {}    --two tables where the names of respective classes will be stored
  2. local s, w                          --two variables that will act as counters to place the names in the respective tables based on raidindex
  3. local NumberGroupMembers
  4.  
  5. local RCC = CreateFrame('FRAME', 'RaidCooldownCoordinationFrame', UIParent)
  6.     RCC:RegisterEvent('PLAYER_ENTERING_WORLD')
  7.     RCC:RegisterEvent('GROUP_ROSTER_UPDATE')
  8.     RCC:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
  9.     RCC:RegisterEvent('READY_CHECK')
  10.    
  11.     RCC:SetScript('OnEvent', function(self, event, timeStamp, eventcl, _, _, sourceName, _, _, _, destName, _, _, spellId)
  12.         if (event == 'PLAYER_ENTERING_WORLD' and GetNumGroupMembers() == 0) then --turn the combatlog parsing off outside of raids
  13.             RCC:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
  14.         elseif (event == 'GROUP_ROSTER_UPDATE' and GetNumGroupMembers() == 0) then --turn the combatlog parsing off if the group disbands
  15.             RCC:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
  16.         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
  17.             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
  18.             --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?
  19.             NumberGroupMembers = GetNumGroupMembers()
  20.             for i = 1, NumberGroupMembers do
  21.                 local Class = select(5, GetRaidRosterInfo(i))
  22.                 if Class == 'Shaman' then
  23.                     Shamans[s] = select(1, GetRaidRosterInfo(i))
  24.                     s = s+1
  25.                 elseif Class == 'Warrior' then
  26.                     Warriors[w] = select(1, GetRaidRosterInfo(i))
  27.                     w = w+1
  28.                 end
  29.             end
  30.         elseif event == ('COMBAT_LOG_EVENT_UNFILTERED') then
  31.             if (eventcl == 'SPELL_SUMMON' and spellId == 120668) then --stormlash totem dropped
  32.                 for i = 1, #Shamans do
  33.                     if (sourceName == Shamans[i] and i ~= #Shamans) then --dont whisper the person with a 5 min cd still
  34.                         SendChatMessage(sourceName..' just dropped their Stormlash Totem.  Drop yours in 10 seconds!', 'WHISPER', nil, Shamans[i+1])
  35.                         break
  36.                     end
  37.                 end
  38.             elseif (eventcl == 'UNIT_DESTROYED' and destName == 'Stormlash Totem') then --stormlash faded/recalled
  39.                 for i = 1, #Shamans do
  40.                     if (sourceName == Shamans[i] and i ~= #Shamans) then
  41.                         SendChatMessage('Drop your Stormlash Totem now!', 'WHISPER', nil, Shamans[i+1])
  42.                         break
  43.                     end
  44.                 end
  45.             elseif (eventcl == 'SPELL_SUMMON' and spellId == 114207) then --skull banner dropped
  46.                 for i = 1, #Warriors do
  47.                     if (sourceName == Warriors[i] and i ~= #Warriors) then
  48.                         SendChatMessage(sourceName..' just dropped their Skull Banner.  Drop yours in 10 seconds!', 'WHISPER', nil, Warriors[i+1])
  49.                         break
  50.                     end
  51.                 end
  52.             elseif (eventcl == 'UNIT_DESTROYED' and destName == 'Skull Banner') then --skull banner faded/clicked off
  53.                 for i = 1, #Shamans do
  54.                     if (sourceName == Shamans[i] and i ~= #Shamans) then
  55.                         SendChatMessage('Drop your Skull Banner now!', 'WHISPER', nil, Warriors[i+1])
  56.                         break
  57.                     end
  58.                 end
  59.             end
  60.         elseif event == 'READY_CHECK' then
  61.             for i = 1, #Shamans do
  62.                 if i == 1 then
  63.                     SendChatMessage('You will be dropping your Stormlash Totem first, do it when you think best.', 'WHISPER', nil, Shamans[1])
  64.                 else
  65.                     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])
  66.                 end
  67.             end
  68.            
  69.             for i = 1, #Warriors do
  70.                 if i == 1 then
  71.                     SendChatMessage('You will be dropping your Skull Banner first, do it when you think best.', 'WHISPER', nil, Warriors[1])
  72.                 else
  73.                     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])
  74.                 end
  75.             end
  76.         end
  77.     end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement