Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.74 KB | None | 0 0
  1. --[[
  2. ################################################################
  3. #
  4. # oUF_MosphetRaid by Mosphet @ Bloodfeather EU
  5. #
  6. ################################################################
  7. ]]
  8.  
  9. -- Gief addon name space
  10. local _, oUF_MosphetRaid = ...
  11.  
  12. local tags = oUF_MosphetRaid.tags
  13.  
  14. -- Create the UI frame to work in
  15. oUF_MosphetRaid.main = CreateFrame("Frame", nil, UIParent)
  16.  
  17. -- xD
  18. local main = oUF_MosphetRaid.main
  19.  
  20. -- Set the Media Path
  21. local mediapath = [=[Interface\AddOns\oUF_MosphetRaid\media\]=]
  22.  
  23. -- Mediaz nom nom nom
  24. local fontlol = mediapath..[=[fonts\font.ttf]=]
  25. local texture = mediapath..[=[textures\statusbar]=]
  26. local bgtexture = mediapath..[=[textures\bgtexture]=]
  27. local backdrop_edge = mediapath..[=[textures\backdrop_edge]=]
  28.  
  29. local raidiconcolor = { -- taken from GridStatusRaidIcons
  30. [1] = {r = 1.0, g = 0.92, b = 0, hex = "ffeb00"}, -- Yellow 4-point Star
  31. [2] = {r = 0.98, g = 0.57, b = 0, hex = "fa9100"}, -- Orange Circle
  32. [3] = {r = 0.83, g = 0.22, b = 0.9, hex = "d438e6"}, -- Purple Diamond
  33. [4] = {r = 0.04, g = 0.95, b = 0, hex = "0af200"}, -- Green Triangle
  34. [5] = {r = 0.7, g = 0.82, b = 0.875, hex = "b3d1df"}, -- White Crescent Moon
  35. [6] = {r = 0, g = 0.71, b = 1, hex = "00b5ff"}, -- Blue Square
  36. [7] = {r = 1.0, g = 0.24, b = 0.168, hex = "ff3d2b"}, -- Red 'X' Cross
  37. [8] = {r = 0.98, g = 0.98, b = 0.98, hex = "fafafa"} -- White Skull
  38. }
  39.  
  40. -- Cba writing this same piece over and over so heres a variable with it in.
  41. local backdrop = {
  42. bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=],
  43. insets = {top = 0, left = 0, bottom = 0, right = 0},
  44. }
  45.  
  46. -- Font stuff
  47. local SetFontString = function(parent, fontName, fontHeight, fontStyle)
  48. local fs = parent:CreateFontString(nil, "OVERLAY")
  49. fs:SetFont(fontName, fontHeight, fontStyle)
  50. fs:SetJustifyH("LEFT")
  51. fs:SetShadowColor(0, 0, 0)
  52. fs:SetShadowOffset(0.75, -0.75)
  53. return fs
  54. end
  55.  
  56. --[[
  57. ################################################################
  58. #
  59. # Functions
  60. #
  61. ################################################################
  62. ]]
  63.  
  64. -- Don't think we need this anymore but I'll leave it here anyway.
  65. --[[local updateRIcon = function(self, event)
  66. local index = GetRaidTargetIndex(self.unit)
  67. if(index) then
  68. self.RIcon:SetText(ICON_LIST[index].."10|t")
  69. else
  70. self.RIcon:SetText()
  71. end
  72. borderUpdate(self, event)
  73. end]]
  74.  
  75. local updateHealth = function(self, event, unit, bar)
  76. local r, g, b, t
  77. --[[
  78. if(UnitIsPlayer(unit)) then
  79. local _, class = UnitClass(unit)
  80. t = oUF.colors.class[class]
  81. else
  82. r, g, b = .1, .8, .3
  83. end
  84.  
  85. if(t) then
  86. r, g, b = t[1], t[2], t[3]
  87. end
  88. ]]
  89. bar:SetStatusBarColor(.08, .08, .08)
  90. if (UnitIsDead(unit) or UnitIsGhost(unit) or not UnitIsConnected(unit)) then
  91. bar:SetValue(0)
  92. end
  93. end
  94.  
  95. local function borderUpdate(self, event)
  96. if event == "OnEnter" then -- hover over frame
  97. self.Border:SetBackdropColor(1, 1, 1, 1)
  98. elseif(UnitInRaid"player" == 1 or UnitInParty"player") and UnitName("target") == UnitName(self.unit) then -- unit is target
  99. self.Border:SetBackdropColor(.6, .6, .6, 1)
  100. elseif(GetRaidTargetIndex(self.unit)) then -- color by raid icon
  101. local index = GetRaidTargetIndex(self.unit)
  102. self.Border:SetBackdropColor(raidiconcolor[index].r, raidiconcolor[index].g, raidiconcolor[index].b, 1)
  103. else -- default color
  104. self.Border:SetBackdropColor(.2, .2, .2, 1)
  105. end
  106. end
  107.  
  108. local updateRIcon = function(self, event)
  109. local index = GetRaidTargetIndex(self.unit)
  110. if(index) then
  111. self.RIcon:SetText(ICON_LIST[index].."10|t")
  112. else
  113. self.RIcon:SetText()
  114. end
  115. borderUpdate(self, event)
  116. end
  117.  
  118. local function OnEnter(self)
  119. UnitFrame_OnEnter(self)
  120. borderUpdate(self, "OnEnter")
  121. end
  122.  
  123. local function OnLeave(self)
  124. UnitFrame_OnLeave(self)
  125. borderUpdate(self, "OnLeave")
  126. end
  127.  
  128. -- Raid Debuffs and other stuff kk.
  129. local createAuraWatch = function(self, unit)
  130.  
  131. local auras = {}
  132. local spellIDs = {
  133.  
  134. -- Paladin
  135. 53563, -- Beacon Of Light
  136. --53601, -- Sacred Shield
  137.  
  138. -- Shaman
  139. 61295, -- riptide
  140. 974, -- earth shield
  141.  
  142. -- Any class
  143. 17, -- Power Word: Shield
  144. 6788, -- Weakened Soul
  145.  
  146. --70809, -- chain heal crit t10 (instead of valanyr)
  147. --64413, -- Protection of Ancient Kings (valanyr)
  148. --16237, -- Ancestral Fortitude (overlap with inspiration)
  149. --15359, -- Inspiration (overlap with ancestral fortitude)
  150.  
  151. --48161, -- Fortitude
  152.  
  153. }
  154.  
  155. auras.presentAlpha = 1
  156. auras.missingAlpha = .2
  157. auras.PostCreateIcon = function(self, icon, auraSpellID, auraName, unitFrame)
  158. -- do stuff
  159. if icon.icon then
  160. icon.icon:SetTexCoord(.1,.9,.1,.9)
  161. end
  162. end
  163. -- Set any other AuraWatch settings
  164. auras.icons = {}
  165. for i, sid in pairs(spellIDs) do
  166. local icon = CreateFrame("Frame", nil, self)
  167. icon:SetFrameStrata'HIGH'
  168. icon.spellID = sid
  169. -- set the dimensions and positions
  170. icon:SetWidth(8)
  171. icon:SetHeight(8)
  172. if i == 1 then
  173. icon:SetPoint("BOTTOMLEFT", self, "BOTTOMLEFT", 4, 2)
  174. icon.onlyShowPresent = true
  175. icon:SetWidth(8)
  176. icon:SetHeight(8)
  177. elseif i == 2 then
  178. icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -4, 2)
  179. icon.onlyShowPresent = true
  180. icon:SetWidth(8)
  181. icon:SetHeight(8)
  182. elseif i == 3 then
  183. icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -17, 2)
  184. icon.anyUnit = true
  185. icon.onlyShowPresent = true
  186. elseif i == 4 then
  187. icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -4, 2)
  188. icon.anyUnit = true
  189. icon.onlyShowPresent = true
  190. elseif i == 5 then
  191. icon:SetPoint("TOPLEFT", self, "TOPLEFT", 2, -2)
  192. icon.onlyShowPresent = true
  193. icon.hideCooldown = true
  194. icon:SetWidth(5)
  195. icon:SetHeight(5)
  196. elseif i == 6 then
  197. icon:SetPoint("TOPRIGHT", self, "TOPRIGHT", -2, -2)
  198. icon.anyUnit = true
  199. icon.onlyShowPresent = true
  200. icon.hideCooldown = true
  201. icon:SetWidth(5)
  202. icon:SetHeight(5)
  203. elseif i == 7 then
  204. icon:SetPoint("TOPRIGHT", self, "TOPRIGHT", -2, -2)
  205. icon.anyUnit = true
  206. icon.onlyShowPresent = true
  207. icon.hideCooldown = true
  208. icon:SetWidth(5)
  209. icon:SetHeight(5)
  210. elseif i == 8 then
  211. icon:SetPoint("LEFT", self, 2, 0)
  212. icon.anyUnit = true
  213. icon.onlyShowMissing = true
  214. --icon.hideCooldown = true
  215. icon:SetWidth(10)
  216. icon:SetHeight(10)
  217. else
  218. icon:SetPoint("BOTTOM", self, "BOTTOM", 12*i, 2)
  219. end
  220. auras.icons[sid] = icon
  221. -- Set any other AuraWatch icon settings
  222. end
  223. self.AuraWatch = auras
  224. end
  225.  
  226.  
  227. --[[
  228. ################################################################
  229. #
  230. # Raid Frames Creation
  231. #
  232. ################################################################
  233. ]]
  234.  
  235. local CreateRaidStyle = function(self, u)
  236.  
  237. self:SetBackdrop(backdrop)
  238. self:SetBackdropColor(0, 0, 0)
  239.  
  240. self:SetScript("OnEnter", OnEnter)
  241. self:SetScript("OnLeave", OnLeave)
  242.  
  243. self:RegisterForClicks"AnyDown"
  244. self:SetAttribute("*type2", "menu")
  245.  
  246. self.FrameBackdrop = CreateFrame("Frame", nil, self)
  247. self.FrameBackdrop:SetPoint("TOPLEFT", self, "TOPLEFT", -5, 5)
  248. self.FrameBackdrop:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 5, -5)
  249. self.FrameBackdrop:SetFrameStrata("LOW")
  250. self.FrameBackdrop:SetBackdrop {
  251. edgeFile = bgtexture, edgeSize = 5,
  252. insets = {left = 1, right = 1, top = 1, bottom = 1}
  253. }
  254. self.FrameBackdrop:SetBackdropColor(0, 0, 0, 0)
  255. self.FrameBackdrop:SetBackdropBorderColor(0, 0, 0)
  256.  
  257. self.FrameIBorderBackdrop = CreateFrame("Frame", nil, self)
  258. self.FrameIBorderBackdrop:SetPoint("TOPLEFT", self, "TOPLEFT", -1, 1)
  259. self.FrameIBorderBackdrop:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 1, -1)
  260. self.FrameIBorderBackdrop:SetFrameStrata("LOW")
  261. self.FrameIBorderBackdrop:SetFrameLevel(6)
  262. self.FrameIBorderBackdrop:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",
  263. insets = {left = 0,right = 0,top = 0,bottom = 0}});
  264. self.FrameIBorderBackdrop:SetBackdropColor(0, 0, 0, 1)
  265.  
  266. self.Border = CreateFrame("Frame", nil, self)
  267. self.Border:SetPoint("TOPLEFT", self, "TOPLEFT", -2, 2)
  268. self.Border:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 2, -2)
  269. self.Border:SetFrameStrata("LOW")
  270. self.Border:SetFrameLevel(5)
  271. self.Border:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",
  272. insets = {left = 0,right = 0,top = 0,bottom = 0}});
  273. self.Border:SetBackdropColor(0.2, 0.2, 0.2, 1)
  274.  
  275. --[[
  276. ################################################################
  277. #
  278. # Frame Styling
  279. #
  280. ################################################################
  281. ]]
  282.  
  283. self.Health = CreateFrame("StatusBar", nil, self)
  284. self.Health:SetAllPoints(self)
  285. self.Health:SetStatusBarTexture(texture)
  286. self.Health:SetStatusBarColor(0.1, 0.1, 0.1, 1)
  287. self.Health:SetFrameLevel(5)
  288. self.Health.frequentUpdates = true
  289.  
  290. self.Health.bg = CreateFrame("Frame", nil, self)
  291. self.Health.bg:SetFrameLevel(3)
  292. self.Health.bg:SetAllPoints(self)
  293. self.Health.bg.texture = self.Health.bg:CreateTexture(nil, "BACKGROUND")
  294. self.Health.bg.texture:SetAllPoints(self.Health)
  295. self.Health.bg.texture:SetTexture(texture)
  296. self.Health.bg.texture:SetVertexColor(.38,.38,.38)
  297.  
  298. self.Health.ForceUpdateHealth = updateHealth
  299.  
  300. -- oUF Smooth Support
  301. if(IsAddOnLoaded("oUF_Smooth")) then
  302. self.Health.Smooth = true
  303. end
  304.  
  305. -- No Longer need this.
  306. --[[
  307. -- Healcomm 4 Support
  308. if(IsAddOnLoaded("oUF_HealComm4")) then
  309. self.HealCommBar = CreateFrame("StatusBar", nil, self.Health)
  310. self.HealCommBar:SetHeight(0)
  311. self.HealCommBar:SetWidth(0)
  312. self.HealCommBar:SetFrameLevel(4)
  313. self.HealCommBar:SetStatusBarTexture(texture)
  314. self.HealCommBar:SetStatusBarColor(0, 0, 0, 0.5)
  315. self.HealCommBar:SetPoint('LEFT', self.Health, 'LEFT')
  316.  
  317. -- optional flag to show overhealing
  318. self.allowHealCommOverflow = false
  319.  
  320. -- limit to the next 3 seconds incoming heals
  321. self.HealCommTimeframe = 3
  322. end
  323. ]]
  324.  
  325. -- New Heal Prediction stuff :D
  326. self.mhpb = CreateFrame("StatusBar", nil, self.Health)
  327. self.mhpb:SetPoint('TOPLEFT', self.Health:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
  328. self.mhpb:SetPoint('BOTTOMLEFT', self.Health:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
  329. self.mhpb:SetWidth(87)
  330. self.mhpb:SetFrameLevel(4)
  331. self.mhpb:SetStatusBarTexture(texture)
  332. self.mhpb:SetStatusBarColor(0, 0, 0, 0.5)
  333.  
  334. self.ohpb = CreateFrame("StatusBar", nil, self.Health)
  335. self.ohpb:SetPoint('TOPLEFT', self.mhpb:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
  336. self.ohpb:SetPoint('BOTTOMLEFT', self.mhpb:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
  337. self.ohpb:SetWidth(87)
  338. self.ohpb:SetFrameLevel(4)
  339. self.ohpb:SetStatusBarTexture(texture)
  340. self.ohpb:SetStatusBarColor(0, 0, 0, 0.5)
  341.  
  342. -- Register Heal Prediction with oUF. Derp!
  343. self.HealPrediction = {
  344. myBar = self.mhpb,
  345. otherBar = self.ohpb,
  346. maxOverflow = 1,
  347. }
  348.  
  349. -- oUF Aura Watch Support
  350. if(IsAddOnLoaded("oUF_AuraWatch")) then
  351. createAuraWatch(self, unit)
  352. end
  353.  
  354. -- oUF Raid Debuffs Support
  355. if(IsAddOnLoaded("oUF_RaidDebuffs")) then
  356. self.RaidDebuffs = CreateFrame('Frame', nil, self)
  357. self.RaidDebuffs:SetHeight(11)
  358. self.RaidDebuffs:SetWidth(11)
  359. self.RaidDebuffs:SetPoint('CENTER', self, 0, -5)
  360. self.RaidDebuffs:SetFrameStrata'HIGH'
  361. self.RaidDebuffs:SetFrameLevel(1)
  362.  
  363. self.RaidDebuffs:SetBackdrop({
  364. bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=],
  365. insets = {top = -1, left = -1, bottom = -1, right = -1},
  366. })
  367.  
  368. self.RaidDebuffs.icon = self.RaidDebuffs:CreateTexture(nil, 'ARTWORK')
  369. self.RaidDebuffs.icon:SetTexCoord(.1,.9,.1,.9)
  370. self.RaidDebuffs.icon:SetAllPoints(self.RaidDebuffs)
  371.  
  372. self.RaidDebuffs.cd = CreateFrame('Cooldown', nil, self.RaidDebuffs)
  373. self.RaidDebuffs.cd:SetAllPoints(self.RaidDebuffs)
  374.  
  375. -- uncomment this if you are not using omnicc
  376. self.RaidDebuffs.time = self.RaidDebuffs:CreateFontString(nil, 'OVERLAY')
  377. self.RaidDebuffs.time:SetFont(fontlol, 8, 'OUTLINE')
  378. self.RaidDebuffs.time:SetPoint('CENTER', self.RaidDebuffs, 'CENTER', 0, 0)
  379. self.RaidDebuffs.time:SetTextColor(1, .9, 0)
  380.  
  381. self.RaidDebuffs.count = self.RaidDebuffs:CreateFontString(nil, 'OVERLAY')
  382. self.RaidDebuffs.count:SetFont(fontlol, 8, 'OUTLINE')
  383. self.RaidDebuffs.count:SetPoint('CENTER', self.RaidDebuffs, 'CENTER', 0, 0)
  384. self.RaidDebuffs.count:SetTextColor(1, .9, 0)
  385. end
  386.  
  387. -- ResComm Support
  388. if(IsAddOnLoaded("oUF_ResComm")) then
  389. --[[self.rcomm = self.Health:CreateTexture(nil, "OVERLAY")
  390. self.rcomm:SetTexture([=[Interface\Icons\Spell_Holy_Resurrection]=])
  391. self.rcomm:SetAllPoints(self.Health)
  392. self.rcomm:SetTexCoord(0.07, 0.93, 0.07, 0.93)
  393. self.rcomm:SetBlendMode("ADD")
  394. self.rcomm:SetAlpha(.25)]]
  395.  
  396. --[[self.rcomm = CreateFrame("StatusBar", nil, self.Health)
  397. self.rcomm:SetStatusBarTexture([=[Interface\Icons\Spell_Holy_Resurrection]=])
  398. self.rcomm:SetAllPoints(self.Health)
  399. self.rcomm:SetAlpha(.25)
  400.  
  401. self.texObject = self.rcomm:GetStatusBarTexture()
  402. self.texObject:SetTexCoord(0.07, 0.93, 0.07, 0.93)]]
  403.  
  404. -- Register with oUF kkthnx.
  405. --self.ResComm = self.rcomm
  406. end
  407.  
  408. self.healthtxt = self.Health:CreateFontString(nil, "OVERLAY")
  409. self.healthtxt:SetPoint("TOP", self.Health, 0, -4)
  410. self.healthtxt:SetFont(fontlol, 8)
  411. self.healthtxt:SetShadowOffset(1, -1)
  412. self.healthtxt:SetTextColor(1, 1, 1)
  413. self:Tag(self.healthtxt, "[MosphetRaidHP]")
  414.  
  415. self.infotxt = self.Health:CreateFontString(nil, "OVERLAY")
  416. self.infotxt:SetPoint("BOTTOM", self.Health, 0, 5)
  417. self.infotxt:SetFont(fontlol, 8)
  418. self.infotxt:SetShadowOffset(1, -1)
  419. self.infotxt:SetTextColor(1, 1, 1)
  420. self:Tag(self.infotxt, '[MosphetRaidInfo]')
  421.  
  422. self.ricon = self.Health:CreateFontString(nil, "OVERLAY")
  423. self.ricon:SetPoint("TOP", self.Health, "BOTTOM", 0 , 18)
  424. self.ricon:SetFont("Fonts\\FRIZQT__.ttf", 18)
  425. self.ricon:SetTextColor(1, 1, 1)
  426. self.RIcon = self.ricon
  427.  
  428. self.Range = {
  429. insideAlpha = 1,
  430. outsideAlpha = 0.3,
  431. }
  432.  
  433. -- Version 1.5.2 No Longer needs this
  434. --[[self:SetAttribute("initial-height", 30)
  435. self:SetAttribute("initial-width", 87)]]
  436. self:SetSize(87, 30)
  437.  
  438. -- Not sure but apparently this should be broken...?
  439. self:RegisterEvent("PLAYER_TARGET_CHANGED", borderUpdate)
  440. self:RegisterEvent("RAID_TARGET_UPDATE", updateRIcon)
  441. table.insert(self.__elements, updateRIcon)
  442. end
  443.  
  444. oUF:RegisterStyle("oUF_MosphetRaid", CreateRaidStyle)
  445.  
  446. oUF:Factory(function(self)
  447.  
  448. oUF:SetActiveStyle"oUF_MosphetRaid"
  449.  
  450. --[[local party = self:SpawnHeader("oUF_Party", nil, "custom [@raid6,exists] hide; show",
  451. "showParty", true,
  452. "showPlayer", true,
  453. "yOffset", -5,
  454. "oUF-initialConfigFunction", (self:SetWidth(87) self:SetHeight(30))
  455. )
  456. party:SetPoint("BOTTOM", UIParent, -43, 175)
  457.  
  458. local raid = {}
  459. CompactRaidFrameManager:UnregisterAllEvents()
  460. CompactRaidFrameManager:Hide()
  461. CompactRaidFrameContainer:UnregisterAllEvents()
  462. CompactRaidFrameContainer:Hide()
  463. for i = 1, NUM_RAID_GROUPS do
  464. local raidgroup = self:SpawnHeader("oUF_Raid"..i, nil, "custom [@raid6,exists] show; hide",
  465. "groupFilter", tostring(i),
  466. "showRaid", true,
  467. "maxColumns", 5,
  468. "yOffSet", -5,
  469. "oUF-initialConfigFunction", (self:SetWidth(87) self:SetHeight(30)
  470. )
  471. if i == 1 then
  472. raidgroup:SetPoint("BOTTOM", UIParent, -43, 175)
  473. else
  474. raidgroup:SetPoint("TOPLEFT", raid[i-1], "TOPRIGHT", 5, 0)
  475. end
  476. insert(raid, raidgroup)
  477. end]]
  478.  
  479. CompactRaidFrameManager:UnregisterAllEvents()
  480. CompactRaidFrameManager:Hide()
  481. CompactRaidFrameContainer:UnregisterAllEvents()
  482. CompactRaidFrameContainer:Hide()
  483.  
  484. local raid = self:SpawnHeader("oUF_Raid", nil, "custom [group:party,nogroup:raid25] show; hide",
  485. "showRaid", true,
  486. "showParty", true,
  487. "showPlayer", true,
  488. "groupFilter", "1,2,3,4,5,6,7,8",
  489. "groupingOrder", "1,2,3,4,5,6,7,8",
  490. "groupBy", "GROUP",
  491. "maxColumns", 5,
  492. "unitsPerColumn", 5,
  493. "column", 4,
  494. "columnAnchorPoint", "LEFT",
  495. "columnSpacing", 5,
  496. "yOffset", -5,
  497. "oUF-initialConfigFunction", ([[self:SetWidth(87) self:SetHeight(30)]])
  498. )
  499. raid:SetPoint("BOTTOM", UIParent, 143, 175)
  500.  
  501. -- Gonna update this later.
  502. --[[local boss = {}
  503. for i = 1, MAX_BOSS_FRAMES do
  504. boss[i] = self:Spawn("boss"..i, "oUF_Boss"..i)
  505.  
  506. if i == 1 then
  507. boss[i]:SetPoint("TOP", UIParent, 0, -15)
  508. else
  509. boss[i]:SetPoint("TOP", boss[i-1], "BOTTOM", 0, -26.5)
  510. end
  511. end
  512.  
  513. for i, v in ipairs(boss) do v:Show() end]]
  514.  
  515. -- Dont need this for now.
  516. --[[main:RegisterEvent("PLAYER_LOGIN")
  517. main:RegisterEvent("RAID_ROSTER_UPDATE")
  518. main:RegisterEvent("PARTY_LEADER_CHANGED")
  519. main:RegisterEvent("PARTY_MEMBERS_CHANGED")
  520. main:SetScript("OnEvent", function(self)
  521. if InCombatLockdown() then
  522. self:RegisterEvent("PLAYER_REGEN_ENABLED")
  523. else
  524. self:UnregisterEvent("PLAYER_REGEN_ENABLED")
  525. local numraid = GetNumRaidMembers()
  526. if numraid > 0 and (numraid > 5 or numraid ~= GetNumPartyMembers() + 1) then
  527. for i, v in ipairs(party) do v:Disable() end
  528. for i, v in ipairs(raid) do v:Show() end
  529. else
  530. for i, v in ipairs(party) do v:Enable() end
  531. for i, v in ipairs(raid) do v:Hide() end
  532. end
  533. end
  534. end)]]
  535.  
  536. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement