Advertisement
Wetxius

Untitled

Feb 14th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. local T, C, L, _ = unpack(select(2, ...))
  2.  
  3. ----------------------------------------------------------------------------------------
  4. -- Temporary stuff
  5. ----------------------------------------------------------------------------------------
  6. local frame = CreateFrame("Frame")
  7. local function CallToArms(self, elapsed)
  8. self.elapsed = (self.elapsed or 0) + elapsed
  9. if self.elapsed >= 10 then
  10. local available = false
  11. local _, tankChecked, healerChecked, damageChecked = LFDQueueFrame_GetRoles()
  12.  
  13. -- Dungeons
  14. for i = 1, GetNumRandomDungeons() do
  15. local id, name = GetLFGRandomDungeonInfo(i)
  16. for x = 1, LFG_ROLE_NUM_SHORTAGE_TYPES do
  17. local eligible, forTank, forHealer, forDamage, itemCount = GetLFGRoleShortageRewards(id, x)
  18. if eligible then
  19. if forTank and itemCount > 0 and tankChecked then
  20. RaidNotice_AddMessage(RaidWarningFrame, name.." "..TANK, ChatTypeInfo["RAID_WARNING"])
  21. print("|cffffff00"..name.." "..TANK.."|r")
  22. available = true
  23. elseif forHealer and itemCount > 0 and healerChecked then
  24. RaidNotice_AddMessage(RaidWarningFrame, name.." "..HEALER, ChatTypeInfo["RAID_WARNING"])
  25. print("|cffffff00"..name.." "..HEALER.."|r")
  26. available = true
  27. elseif forDamage and itemCount > 0 and damageChecked then
  28. RaidNotice_AddMessage(RaidWarningFrame, name.." "..DAMAGER, ChatTypeInfo["RAID_WARNING"])
  29. print("|cffffff00"..name.." "..DAMAGER.."|r")
  30. available = true
  31. end
  32. end
  33. end
  34. end
  35.  
  36. -- LFR
  37. for i = 1, GetNumRFDungeons() do
  38. local id, name = GetRFDungeonInfo(i)
  39. for x = 1, LFG_ROLE_NUM_SHORTAGE_TYPES do
  40. local eligible, forTank, forHealer, forDamage, itemCount = GetLFGRoleShortageRewards(id, x)
  41. if eligible then
  42. if forTank and itemCount > 0 and tankChecked then
  43. RaidNotice_AddMessage(RaidWarningFrame, name.." "..TANK, ChatTypeInfo["RAID_WARNING"])
  44. print("|cffffff00"..name.." "..TANK.."|r")
  45. available = true
  46. elseif forHealer and itemCount > 0 and healerChecked then
  47. RaidNotice_AddMessage(RaidWarningFrame, name.." "..HEALER, ChatTypeInfo["RAID_WARNING"])
  48. print("|cffffff00"..name.." "..HEALER.."|r")
  49. available = true
  50. elseif forDamage and itemCount > 0 and damageChecked then
  51. RaidNotice_AddMessage(RaidWarningFrame, name.." "..DAMAGER, ChatTypeInfo["RAID_WARNING"])
  52. print("|cffffff00"..name.." "..DAMAGER.."|r")
  53. available = true
  54. end
  55. end
  56. end
  57.  
  58. end
  59.  
  60. if available then
  61. PlaySound("RaidWarning", "master")
  62. end
  63.  
  64. self.elapsed = 0
  65. end
  66. end
  67. frame:SetScript("OnUpdate", CallToArms)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement