Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 227.00 KB | None | 0 0
  1. local GlobalAddonName, ExRT = ...
  2.  
  3. local UnitAura, UnitIsDeadOrGhost, UnitIsConnected, UnitPower, UnitGUID, UnitName, UnitPosition, UnitInRange, UnitIsUnit, UnitClass = UnitAura, UnitIsDeadOrGhost, UnitIsConnected, UnitPower, UnitGUID, UnitName, UnitPosition, UnitInRange, UnitIsUnit, UnitClass
  4. local GetTime, tonumber, tostring, sort, wipe, PI, pairs, type = GetTime, tonumber, tostring, table.sort, table.wipe, PI, pairs, type
  5. local cos, sin, sqrt, acos, abs, floor, min, max, atan, GGetPlayerMapPosition, GetPlayerFacing, GetNumGroupMembers = math.cos, math.sin, math.sqrt, acos, math.abs, math.floor, math.min, math.max, atan, GetPlayerMapPosition, GetPlayerFacing, GetNumGroupMembers
  6. local ClassColorNum, SetMapToCurrentZone, GetCurrentMapAreaID, GetCurrentMapDungeonLevel, GetRaidRosterInfo, GetMobID, RAID_CLASS_COLORS, table_len, GetUnitTypeByGUID, delUnitNameServer = ExRT.F.classColorNum, SetMapToCurrentZone, GetCurrentMapAreaID, GetCurrentMapDungeonLevel, GetRaidRosterInfo, ExRT.F.GUIDtoID, RAID_CLASS_COLORS, ExRT.F.table_len, ExRT.F.GetUnitTypeByGUID, ExRT.F.delUnitNameServer
  7.  
  8. local VExRT = nil
  9.  
  10. local module = ExRT.mod:New("Bossmods",ExRT.L.bossmods,nil,true)
  11. local ELib,L = ExRT.lib,ExRT.L
  12.  
  13. module.A = {}
  14. -----------------------------------------
  15. -- functions
  16. -----------------------------------------
  17.  
  18. local function RaidRank()
  19. local n = UnitInRaid("player") or 0
  20. local name,rank = GetRaidRosterInfo(n)
  21. if name then
  22. return rank
  23. end
  24. return 0
  25. end
  26.  
  27. local GetPlayerMapPosition = nil
  28. do
  29. local currentMap = 0
  30. local currentMapLevel = 0
  31. function GetPlayerMapPosition(...)
  32. local nowMap = GetCurrentMapAreaID()
  33. local nowMapLevel = GetCurrentMapDungeonLevel()
  34. if currentMap ~= nowMap or currentMapLevel ~= nowMapLevel then
  35. SetMapToCurrentZone()
  36. currentMap = GetCurrentMapAreaID()
  37. currentMapLevel = GetCurrentMapDungeonLevel()
  38. end
  39. return GGetPlayerMapPosition(...)
  40. end
  41. end
  42.  
  43. -----------------------------------------
  44. -- Ра-ден
  45. -----------------------------------------
  46. local RaDen = {}
  47. module.A.RaDen = RaDen
  48.  
  49. RaDen.mainframe = nil
  50. RaDen.party = nil
  51. RaDen.unstableVita_id1 = 138308
  52. RaDen.unstableVita_id2 = 138297
  53. RaDen.vitaSensitivity_id = 138372
  54.  
  55. function RaDen:RefreshAll()
  56. local n = GetNumGroupMembers() or 0
  57. if n > 0 then
  58. local grps = {0,0,0,0}
  59. for j=1,n do
  60. local name,_,subgroup = GetRaidRosterInfo(j)
  61. if name and subgroup == 2 then
  62. grps[1] = grps[1] + 1
  63. RaDen.party[1][grps[1]] = name
  64. elseif name and subgroup == 4 then
  65. grps[2] = grps[2] + 1
  66. RaDen.party[2][grps[2]] = name
  67. elseif name and subgroup == 3 then
  68. grps[3] = grps[3] + 1
  69. RaDen.party[3][grps[3]] = name
  70. elseif name and subgroup == 5 then
  71. grps[4] = grps[4] + 1
  72. RaDen.party[4][grps[4]] = name
  73. end
  74. end
  75. for i=1,4 do
  76. for j=(grps[i]+1),5 do
  77. RaDen.party[i][j] = ""
  78. end
  79. sort(RaDen.party[i])
  80. for j=1,5 do
  81. RaDen.mainframe.names[(i-1)*5+j].text:SetText(RaDen.party[i][j])
  82. end
  83. end
  84. end
  85. end
  86.  
  87. function RaDen:timerfunc(elapsed)
  88. self.tmr = self.tmr + elapsed
  89. if self.tmr > 0.2 then
  90. self.tmr = 0
  91. for i=1,4 do
  92. for j=1,5 do
  93. if RaDen.party[i][j] and RaDen.party[i][j] ~= "" then
  94. local white = true
  95. for k=1,40 do
  96. local _,_,_,_,_,duration,expires,_,_,_,spellId = UnitAura(RaDen.party[i][j],k,"HARMFUL")
  97. if spellId == RaDen.unstableVita_id1 or spellId == RaDen.unstableVita_id2 then
  98. RaDen.mainframe.names[(i-1)*5+j].text:SetTextColor(0.5, 1, 0.5, 1)
  99. white = nil
  100. elseif spellId == RaDen.vitaSensitivity_id then
  101. RaDen.mainframe.names[(i-1)*5+j].text:SetTextColor(1, 0.5, 0.5, 1)
  102. white = nil
  103. elseif not spellId then
  104. break
  105. end
  106. end
  107. if white then
  108. RaDen.mainframe.names[(i-1)*5+j].text:SetTextColor(1, 1, 1, 1)
  109. end
  110. if UnitIsDeadOrGhost(RaDen.party[i][j]) or not UnitIsConnected(RaDen.party[i][j]) then
  111. RaDen.mainframe.names[(i-1)*5+j].text:SetTextColor(1, 0.5, 0.5, 1)
  112. end
  113. else
  114. RaDen.mainframe.names[(i-1)*5+j].text:SetTextColor(0.1, 0.1, 0.1, 1)
  115. end
  116. end
  117. end
  118. end
  119. end
  120.  
  121. function RaDen:EventHandler(event, ...)
  122. if event == "COMBAT_LOG_EVENT_UNFILTERED" then
  123. local _,event_n,_,_,_,_,_,_,_,_,_,spellId = ...
  124. if event_n == "SPELL_AURA_APPLIED" and (spellId == RaDen.unstableVita_id1 or spellId == RaDen.unstableVita_id2) then
  125. RaDen.mainframe.vitacooldown.cooldown:SetCooldown(GetTime(), 5)
  126. end
  127. elseif event == "GROUP_ROSTER_UPDATE" then
  128. RaDen:RefreshAll()
  129. end
  130. end
  131.  
  132. function RaDen:Load()
  133. if not RaDen.mainframe then
  134. RaDen.mainframe = CreateFrame("Frame","ExRTBossmodsRaden",UIParent)
  135. RaDen.mainframe:SetHeight(130)
  136. RaDen.mainframe:SetWidth(160)
  137. if VExRT.Bossmods.RaDenLeft and VExRT.Bossmods.RaDenTop then
  138. RaDen.mainframe:SetPoint("TOPLEFT",UIParent,"BOTTOMLEFT",VExRT.Bossmods.RaDenLeft,VExRT.Bossmods.RaDenTop)
  139. else
  140. RaDen.mainframe:SetPoint("TOP",UIParent, "TOP", 0, -50)
  141. end
  142. RaDen.mainframe:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",edgeFile = ExRT.F.defBorder,tile = false,edgeSize = 8})
  143. RaDen.mainframe:SetBackdropColor(0.05,0.05,0.05,0.85)
  144. RaDen.mainframe:SetBackdropBorderColor(0.2,0.2,0.2,0.4)
  145. RaDen.mainframe:EnableMouse(true)
  146. RaDen.mainframe:SetMovable(true)
  147. RaDen.mainframe:RegisterForDrag("LeftButton")
  148. RaDen.mainframe:SetScript("OnDragStart", function(self)
  149. if self:IsMovable() then
  150. self:StartMoving()
  151. end
  152. end)
  153. RaDen.mainframe:SetScript("OnDragStop", function(self)
  154. self:StopMovingOrSizing()
  155. VExRT.Bossmods.RaDenLeft = self:GetLeft()
  156. VExRT.Bossmods.RaDenTop = self:GetTop()
  157. end)
  158. if VExRT.Bossmods.Alpha then RaDen.mainframe:SetAlpha(VExRT.Bossmods.Alpha/100) end
  159. if VExRT.Bossmods.Scale then RaDen.mainframe:SetScale(VExRT.Bossmods.Scale/100) end
  160.  
  161. RaDen.mainframe.tmr = 0
  162.  
  163. RaDen.mainframe.names = {}
  164.  
  165. for i=1,20 do
  166. RaDen.mainframe.names[i]=CreateFrame("Frame",nil,RaDen.mainframe)
  167. RaDen.mainframe.names[i]:SetSize(80,12)
  168. RaDen.mainframe.names[i]:SetPoint("TOPLEFT", (math.floor((i-1)/10))*80, -(((i-1)%10)*12)-5)
  169. RaDen.mainframe.names[i].text = RaDen.mainframe.names[i]:CreateFontString(nil,"ARTWORK")
  170. RaDen.mainframe.names[i].text:SetJustifyH("CENTER")
  171. RaDen.mainframe.names[i].text:SetFont(ExRT.F.defFont, 12,"OUTLINE")
  172. local b = GetNumGuildMembers()
  173. local a
  174. if b == 0 then
  175. a = UnitName("player")
  176. else
  177. a = GetGuildRosterInfo(math.random(1,b))
  178. end
  179. RaDen.mainframe.names[i].text:SetText(a)
  180. if i%3==0 then RaDen.mainframe.names[i].text:SetTextColor(1, 0.5, 0.5, 1) end
  181. if i%3==1 then RaDen.mainframe.names[i].text:SetTextColor(0.5, 1, 0.5, 1) end
  182. if i%3==2 then RaDen.mainframe.names[i].text:SetTextColor(1, 1, 1, 1) end
  183. RaDen.mainframe.names[i].text:SetAllPoints()
  184. end
  185.  
  186. RaDen.mainframe.vitacooldown = CreateFrame("Frame",nil,RaDen.mainframe)
  187. RaDen.mainframe.vitacooldown:SetHeight(32)
  188. RaDen.mainframe.vitacooldown:SetWidth(32)
  189. RaDen.mainframe.vitacooldown:SetPoint("TOPLEFT", 0, -130)
  190. RaDen.mainframe.vitacooldown.tex = RaDen.mainframe.vitacooldown:CreateTexture(nil, "BACKGROUND")
  191. local tx = GetSpellTexture(RaDen.unstableVita_id2)
  192. RaDen.mainframe.vitacooldown.tex:SetTexture(tx)
  193. RaDen.mainframe.vitacooldown.tex:SetAllPoints()
  194. RaDen.mainframe.vitacooldown.cooldown = CreateFrame("Cooldown", nil, RaDen.mainframe.vitacooldown)
  195. RaDen.mainframe.vitacooldown.cooldown:SetAllPoints()
  196.  
  197. RaDen.party = {}
  198. for i=1,4 do RaDen.party[i]={} end
  199. RaDen:RefreshAll()
  200.  
  201. RaDen.mainframe:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  202. RaDen.mainframe:RegisterEvent("GROUP_ROSTER_UPDATE")
  203. RaDen.mainframe:SetScript("OnUpdate", RaDen.timerfunc)
  204. RaDen.mainframe:SetScript("OnEvent", RaDen.EventHandler)
  205.  
  206. print(L.bossmodsradenhelp)
  207. end
  208. end
  209.  
  210. -----------------------------------------
  211. -- Sha of Pride
  212. -----------------------------------------
  213. local ShaOfPride = {}
  214. module.A.ShaOfPride = ShaOfPride
  215.  
  216. ShaOfPride.mainframe = nil
  217. ShaOfPride.raid = {}
  218. ShaOfPride.norushen = nil
  219.  
  220. function ShaOfPride:SetTextColor(j,c_r,c_g,c_b,c_a)
  221. ShaOfPride.mainframe.names[j].text:SetTextColor(c_r, c_g, c_b, c_a)
  222. ShaOfPride.mainframe.names[j].textr:SetTextColor(c_r, c_g, c_b, c_a)
  223. end
  224.  
  225. function ShaOfPride.sortFunc(a,b)
  226. if(a[2]==b[2]) then
  227. return a[1] < b[1]
  228. else
  229. return a[2] > b[2]
  230. end
  231. end
  232.  
  233. function ShaOfPride:timerfunc(elapsed)
  234. self.tmr = self.tmr + elapsed
  235. if self.tmr > 0.3 then
  236. self.tmr = 0
  237. for j=1,#ShaOfPride.raid do
  238. ShaOfPride.raid[j][2] = UnitPower(ShaOfPride.raid[j][1],10) or 0
  239. end
  240. sort(ShaOfPride.raid,ShaOfPride.sortFunc)
  241. for j=1,#ShaOfPride.raid do
  242. ShaOfPride.mainframe.names[j].text:SetText(ShaOfPride.raid[j][1])
  243. ShaOfPride.mainframe.names[j].textr:SetText(ShaOfPride.raid[j][2])
  244. if ShaOfPride.norushen == 1 then
  245. if ShaOfPride.raid[j][2]>=100 then ShaOfPride:SetTextColor(j, 1, 0.3, 0.3, 1)
  246. elseif ShaOfPride.raid[j][2]>=75 then ShaOfPride:SetTextColor(j, 1, 1, 0.2, 1)
  247. else ShaOfPride:SetTextColor(j, 1, 1, 1, 1) end
  248. for i=1,40 do
  249. local _,_,_,_,_,_,_,_,_,_,spellId = UnitAura(ShaOfPride.raid[j][1], i,"HARMFUL")
  250. if spellId == 144851 or spellId == 144849 or spellId == 144850 then ShaOfPride:SetTextColor(j, 0.5, 1, 0.3, 1) break
  251. elseif not spellId then break end
  252. end
  253. elseif ShaOfPride.norushen == 2 then
  254. if ShaOfPride.raid[j][2]>=100 then ShaOfPride:SetTextColor(j, 0.8, 0.3, 0.8, 1)
  255. elseif ShaOfPride.raid[j][2]>=75 then ShaOfPride:SetTextColor(j, 0.5, 0.5, 1, 1)
  256. elseif ShaOfPride.raid[j][2]>=50 then ShaOfPride:SetTextColor(j, 1, 0.3, 0.3, 1)
  257. elseif ShaOfPride.raid[j][2]>=25 then ShaOfPride:SetTextColor(j, 1, 1, 0.2, 1)
  258. else ShaOfPride:SetTextColor(j, 1, 1, 1, 1) end
  259. else
  260. ShaOfPride:SetTextColor(j, 1, 1, 1, 1)
  261. end
  262. end
  263. end
  264. end
  265.  
  266. function ShaOfPride:RefreshAll()
  267. local n = GetNumGroupMembers() or 0
  268. local gMax = ExRT.F.GetRaidDiffMaxGroup()
  269. if n > 0 then
  270. wipe(ShaOfPride.raid)
  271. for j=1,n do
  272. local name,_,subgroup = GetRaidRosterInfo(j)
  273. if name and subgroup <= gMax then
  274. ShaOfPride.raid[#ShaOfPride.raid + 1] = {name,UnitPower(name,10)}
  275. end
  276. end
  277. sort(ShaOfPride.raid,ShaOfPride.sortFunc)
  278. for j=1,#ShaOfPride.raid do if j<=25 then
  279. ShaOfPride.mainframe.names[j].text:SetText(ShaOfPride.raid[j][1].." "..tostring(ShaOfPride.raid[j][2]))
  280. end end
  281. for j=(#ShaOfPride.raid+1),25 do
  282. ShaOfPride.mainframe.names[j].text:SetText("")
  283. ShaOfPride.mainframe.names[j].textr:SetText("")
  284. end
  285. else
  286. for j=1,gMax*5 do
  287. local b = GetNumGuildMembers()
  288. local a
  289. if b == 0 then
  290. a = UnitName("player")
  291. else
  292. a = GetGuildRosterInfo(math.random(1,b))
  293. end
  294. local c = math.random(0,20)*5
  295. local h = math.random(1,3)
  296. if h == 3 then a = a..a..a elseif h == 2 then a = a..a end
  297. ShaOfPride.mainframe.names[j].text:SetText(a)
  298. ShaOfPride.mainframe.names[j].text:SetTextColor(0.1, 0.1, 0.1, 1)
  299.  
  300. ShaOfPride.mainframe.names[j].textr:SetText(tostring(c))
  301. ShaOfPride.mainframe.names[j].textr:SetTextColor(0.1, 0.1, 0.1, 1)
  302. end
  303. end
  304. end
  305.  
  306. function ShaOfPride:EventHandler(event, ...)
  307. if event == "GROUP_ROSTER_UPDATE" then
  308. ShaOfPride:RefreshAll()
  309. elseif event == "INSTANCE_ENCOUNTER_ENGAGE_UNIT" then
  310. local bossGUID = UnitGUID("boss1")
  311. if not bossGUID then
  312. return
  313. end
  314. local bossMobID = ExRT.F.GUIDtoID(bossGUID)
  315. if bossMobID == 72276 then
  316. ShaOfPride.norushen = 1
  317. elseif bossMobID == 71734 then
  318. ShaOfPride.norushen = 2
  319. else
  320. ShaOfPride.norushen = nil
  321. end
  322. end
  323. end
  324.  
  325. function ShaOfPride:Load()
  326. if ShaOfPride.mainframe then
  327. return
  328. end
  329. ShaOfPride.mainframe = CreateFrame("Frame","ExRTBossmodsShaOfPride",UIParent)
  330. local gMax = ExRT.F.GetRaidDiffMaxGroup()
  331. ShaOfPride.mainframe:SetSize(100,gMax*5*12+8)
  332. if VExRT.Bossmods.ShaofprideLeft and VExRT.Bossmods.ShaofprideTop then
  333. ShaOfPride.mainframe:SetPoint("TOPLEFT",UIParent,"BOTTOMLEFT",VExRT.Bossmods.ShaofprideLeft,VExRT.Bossmods.ShaofprideTop)
  334. else
  335. ShaOfPride.mainframe:SetPoint("TOP",UIParent, "TOP", 0, -50)
  336. end
  337. ShaOfPride.mainframe:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",edgeFile = ExRT.F.defBorder,tile = false,edgeSize = 8})
  338. ShaOfPride.mainframe:SetBackdropColor(0.05,0.05,0.05,0.85)
  339. ShaOfPride.mainframe:SetBackdropBorderColor(0.2,0.2,0.2,0.4)
  340. ShaOfPride.mainframe:EnableMouse(true)
  341. ShaOfPride.mainframe:SetMovable(true)
  342. ShaOfPride.mainframe:RegisterForDrag("LeftButton")
  343. ShaOfPride.mainframe:SetScript("OnDragStart", function(self)
  344. if self:IsMovable() then
  345. self:StartMoving()
  346. end
  347. end)
  348. ShaOfPride.mainframe:SetScript("OnDragStop", function(self)
  349. self:StopMovingOrSizing()
  350. VExRT.Bossmods.ShaofprideLeft = self:GetLeft()
  351. VExRT.Bossmods.ShaofprideTop = self:GetTop()
  352. end)
  353. if VExRT.Bossmods.Alpha then ShaOfPride.mainframe:SetAlpha(VExRT.Bossmods.Alpha/100) end
  354. if VExRT.Bossmods.Scale then ShaOfPride.mainframe:SetScale(VExRT.Bossmods.Scale/100) end
  355.  
  356. ShaOfPride.mainframe.tmr = 0
  357.  
  358. ShaOfPride.mainframe.names = {}
  359.  
  360. for i=1,25 do
  361. local name = CreateFrame("Frame",nil,ShaOfPride.mainframe)
  362. ShaOfPride.mainframe.names[i] = name
  363. name:SetSize(100,12)
  364. name:SetPoint("TOPLEFT", 0, -((i-1)*12)-4)
  365.  
  366. name.text = ELib:Text(name):Size(71,12):Point(4,0):Top():Font(ExRT.F.defFont,12):Outline():Color(1,1,1)
  367. name.textr = ELib:Text(name):Size(50,12):Point("TOPRIGHT",-4,0):Top():Right():Font(ExRT.F.defFont,12):Outline():Color(1,1,1)
  368. end
  369.  
  370. ShaOfPride:RefreshAll()
  371. ShaOfPride.mainframe:RegisterEvent("GROUP_ROSTER_UPDATE")
  372. ShaOfPride.mainframe:RegisterEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT")
  373. ShaOfPride.mainframe:SetScript("OnUpdate", ShaOfPride.timerfunc)
  374. ShaOfPride.mainframe:SetScript("OnEvent", ShaOfPride.EventHandler)
  375. end
  376.  
  377. -----------------------------------------
  378. -- Malkorok
  379. -----------------------------------------
  380. local Malkorok = {}
  381. module.A.Malkorok = Malkorok
  382.  
  383. Malkorok.mainframe = nil
  384. Malkorok.tmr = 0
  385. Malkorok.main_coord_top_x = 0.36427
  386. Malkorok.main_coord_top_y = 0.34581
  387. Malkorok.main_coord_bot_x = 0.46707
  388. Malkorok.main_coord_bot_y = 0.50000
  389. Malkorok.unitid = 71454
  390. Malkorok.spell = 142842
  391. Malkorok.spell_baoe = 142861
  392. Malkorok.baoe_num = 0
  393. Malkorok.raid_marks_p = nil
  394. Malkorok.raid_marks_e = nil
  395. Malkorok.rotate = false
  396. Malkorok.center = 90
  397. Malkorok.pie_coord = {
  398. {{90,90},{90,-5},{0,36}}, --1
  399. {{90,90},{0,36},{-1,141}}, --2
  400. {{90,90},{-1,141},{90,185}}, --3
  401. {{90,90},{90,185},{182,144}}, --4
  402. {{90,90},{182,144},{185,38}}, --5
  403. {{90,90},{185,38},{90,-5}}, --6
  404. }
  405. Malkorok.pie_status = {0,0,0,0,0,0,0,0}
  406. Malkorok.def_angle = (PI/180)*8
  407. Malkorok.rotate_coords={tl={x=0,y=0},br={x=180/256,y=180/256}}
  408. Malkorok.rotate_origin={x=90/256,y=90/256}
  409. Malkorok.rotate_angle = 0
  410. Malkorok.maps = {
  411. --[map]={topX,topY,botX,botY},
  412. [0]={0.36427,0.34581,0.46707,0.500},
  413. [807]={0.5157,0.4745,0.5207,0.4853},
  414. --[807]={0.5168,0.4767,0.5201,0.4844},
  415. [811]={0.4284,0.4285,0.4426,0.4478},
  416. [891]={0.4337,0.4589,0.4559,0.5276},
  417. [492]={0.7361,0.2098,0.7473,0.2264},
  418. [953]={0.36427,0.34581,0.46707,0.50000},
  419. }
  420. Malkorok.maps_t = {
  421. --[map]={link,topX,botX,topY,botY},
  422. --[map]={[MapDungeonLevel]={...},[MapDungeonLevel]={...}},
  423. --[807]={"Interface\\AddOns\\ExRT\\media\\Bossmods_807",0.22,0.8799,0.2037,0.9167},
  424. [807]={"Interface\\AddOns\\ExRT\\media\\Bossmods_807"},
  425. [953]={[8]={"Interface\\AddOns\\ExRT\\media\\Bossmods_953_8",0.293,0.6875,0.293,0.6875}},
  426. }
  427.  
  428. Malkorok.maps_a = {}
  429.  
  430. function Malkorok:Danger(u)
  431. if u and not Malkorok.mainframe.Danger.shown then
  432. Malkorok.mainframe.Danger:Show()
  433. Malkorok.mainframe.Danger.shown = true
  434. Malkorok.mainframe:SetBackdropColor(0.5,0,0,0.7)
  435. Malkorok.mainframe:SetBackdropBorderColor(1,0.2,0.2,0.9)
  436. elseif not u and Malkorok.mainframe.Danger.shown then
  437. Malkorok.mainframe.Danger:Hide()
  438. Malkorok.mainframe.Danger.shown = nil
  439. Malkorok.mainframe:SetBackdropColor(0,0,0,0.5)
  440. Malkorok.mainframe:SetBackdropBorderColor(0.2,0.2,0.2,0.4)
  441. end
  442. end
  443.  
  444. function Malkorok:PShow()
  445. if not Malkorok.mainframe then return end
  446.  
  447. Malkorok.raid_marks_e = not Malkorok.raid_marks_e
  448. Malkorok.raid_marks_p = UnitName("player")
  449.  
  450. if not Malkorok.mainframe.raidMarks then
  451. Malkorok.mainframe.raidMarks = {}
  452. local mSize = 12
  453. for i=1,40 do
  454. Malkorok.mainframe.raidMarks[i] = CreateFrame("Frame",nil,Malkorok.mainframe.main)
  455. Malkorok.mainframe.raidMarks[i]:SetSize(mSize,mSize)
  456. Malkorok.mainframe.raidMarks[i]:SetPoint("TOPLEFT", 0, 0)
  457. Malkorok.mainframe.raidMarks[i]:SetBackdrop({bgFile = "Interface\\AddOns\\ExRT\\media\\blip.tga",tile = true,tileSize = mSize})
  458. Malkorok.mainframe.raidMarks[i]:SetBackdropColor(0,1,0,0.8)
  459. Malkorok.mainframe.raidMarks[i]:SetFrameStrata("HIGH")
  460. Malkorok.mainframe.raidMarks[i]:Hide()
  461. end
  462. end
  463. if not Malkorok.raid_marks_e then
  464. for i=1,40 do
  465. Malkorok.mainframe.raidMarks[i]:Hide()
  466. end
  467. end
  468. end
  469.  
  470. function Malkorok:MapNow()
  471. if not Malkorok.mainframe then return end
  472. local mapNow = GetCurrentMapAreaID()
  473. if not Malkorok.maps_t[mapNow] then return end
  474. local mp = Malkorok.maps_t[mapNow]
  475.  
  476. local mapNowLevel = GetCurrentMapDungeonLevel()
  477. if type(Malkorok.maps_t[mapNow][1]) ~= "string" then
  478. if not mapNowLevel or not Malkorok.maps_t[mapNow][mapNowLevel] then return end
  479. mp = nil
  480. mp = Malkorok.maps_t[mapNow][mapNowLevel]
  481. end
  482.  
  483. if not Malkorok.mainframe.main.t then
  484. Malkorok.mainframe.main.t = Malkorok.mainframe.main:CreateTexture(nil, "BACKGROUND")
  485. Malkorok.mainframe.main.t:SetAllPoints()
  486. end
  487.  
  488. Malkorok.mainframe.main.t:SetTexture(mp[1])
  489. Malkorok.mainframe.main.t.xT = mp[2] or 0
  490. Malkorok.mainframe.main.t.xB = mp[3] or 1
  491. Malkorok.mainframe.main.t.yT = mp[4] or 0
  492. Malkorok.mainframe.main.t.yB = mp[5] or 1
  493. Malkorok.mainframe.main.t.xC = (Malkorok.mainframe.main.t.xB - Malkorok.mainframe.main.t.xT) / 2 + Malkorok.mainframe.main.t.xT
  494. Malkorok.mainframe.main.t.yC = (Malkorok.mainframe.main.t.yB - Malkorok.mainframe.main.t.yT) / 2 + Malkorok.mainframe.main.t.yT
  495. Malkorok.mainframe.main.t.r = 1
  496.  
  497. for i=1,6 do
  498. Malkorok.mainframe.pie[i]:Hide()
  499. end
  500. Malkorok.def_angle = 0
  501. end
  502.  
  503. function Malkorok:Cursor()
  504. local x,y = GetCursorPosition()
  505.  
  506. local x1 = Malkorok.mainframe.main:GetLeft()
  507. local y1 = Malkorok.mainframe.main:GetTop()
  508.  
  509. Malkorok.mainframe_scale = Malkorok.mainframe:GetScale()
  510. local uiparent_scale = UIParent:GetScale()
  511. x1 = x1 * Malkorok.mainframe_scale*uiparent_scale
  512. y1 = y1 * Malkorok.mainframe_scale*uiparent_scale
  513.  
  514. x = x - x1
  515. y = -(y - y1)
  516.  
  517. x = x / (Malkorok.mainframe_scale * uiparent_scale)
  518. y = y / (Malkorok.mainframe_scale * uiparent_scale)
  519.  
  520. return x,y
  521. end
  522.  
  523. function Malkorok.RotateCoordPair(x,y,ox,oy,a,asp)
  524. y=y/asp
  525. oy=oy/asp
  526. return ox + (x-ox)*cos(a) - (y-oy)*sin(a),(oy + (y-oy)*cos(a) + (x-ox)*sin(a))*asp
  527. end
  528.  
  529. function Malkorok.RotateTexture(self,angle,xT,yT,xB,yB,xC,yC,userAspect)
  530. local aspect = userAspect or (xT-xB)/(yT-yB)
  531. local g1,g2 = Malkorok.RotateCoordPair(xT,yT,xC,yC,angle,aspect)
  532. local g3,g4 = Malkorok.RotateCoordPair(xT,yB,xC,yC,angle,aspect)
  533. local g5,g6 = Malkorok.RotateCoordPair(xB,yT,xC,yC,angle,aspect)
  534. local g7,g8 = Malkorok.RotateCoordPair(xB,yB,xC,yC,angle,aspect)
  535.  
  536. self:SetTexCoord(g1,g2,g3,g4,g5,g6,g7,g8)
  537. end
  538.  
  539. do
  540. if Malkorok.def_angle~=0 then
  541. for i=1,6 do
  542. for j=2,3 do
  543. Malkorok.pie_coord[i][j][1],Malkorok.pie_coord[i][j][2] = Malkorok.RotateCoordPair(Malkorok.pie_coord[i][j][1],Malkorok.pie_coord[i][j][2],Malkorok.pie_coord[i][1][1],Malkorok.pie_coord[i][1][2],-Malkorok.def_angle,1)
  544. end
  545. end
  546. end
  547. end
  548.  
  549. function Malkorok.def_angle_rotate()
  550. for i=1,6 do
  551. Malkorok.RotateTexture(Malkorok.mainframe.pie[i].tex,Malkorok.def_angle,Malkorok.rotate_coords.tl.x,Malkorok.rotate_coords.tl.y,Malkorok.rotate_coords.br.x,Malkorok.rotate_coords.br.y,Malkorok.rotate_origin.x,Malkorok.rotate_origin.y)
  552. end
  553. end
  554.  
  555. function Malkorok:findpie(x0,y0,pxy)
  556. for i=1,6 do
  557. local x1,y1 = Malkorok.pie_coord[i][1][1],Malkorok.pie_coord[i][1][2]
  558. local x2,y2 = Malkorok.pie_coord[i][2][1],Malkorok.pie_coord[i][2][2]
  559. local x3,y3 = Malkorok.pie_coord[i][3][1],Malkorok.pie_coord[i][3][2]
  560. if Malkorok.rotate and pxy == 1 then
  561. x2,y2= Malkorok.RotateCoordPair(x2,y2,Malkorok.center,Malkorok.center,-Malkorok.rotate_angle+Malkorok.def_angle,1)
  562. x3,y3= Malkorok.RotateCoordPair(x3,y3,Malkorok.center,Malkorok.center,-Malkorok.rotate_angle+Malkorok.def_angle,1)
  563. end
  564.  
  565. local r1 = (x1 - x0) * (y2 - y1) - (x2 - x1) * (y1 - y0)
  566. local r2 = (x2 - x0) * (y3 - y2) - (x3 - x2) * (y2 - y0)
  567. local r3 = (x3 - x0) * (y1 - y3) - (x1 - x3) * (y3 - y0)
  568.  
  569. if (r1>=0 and r2>=0 and r3>=0) or (r1<=0 and r2<=0 and r3<=0) then
  570. return i
  571. end
  572. end
  573. return 0
  574. end
  575.  
  576. do
  577. local timerElapsed = 0
  578. function Malkorok:timerfunc(elapsed)
  579. timerElapsed = timerElapsed + elapsed
  580. if timerElapsed > 0.05 then
  581. timerElapsed = 0
  582. local px, py = GetPlayerMapPosition("player")
  583. if px == 0 and py == 0 and not Malkorok.raid_marks_e then return end
  584. if px >= Malkorok.main_coord_top_x and px<=Malkorok.main_coord_bot_x and py>=Malkorok.main_coord_top_y and py<=Malkorok.main_coord_bot_y then
  585. if not Malkorok.mainframe.Player.shown then
  586. Malkorok.mainframe.Player.shown = 1
  587. Malkorok.mainframe.Player:Show()
  588. end
  589. local px1 = (px-Malkorok.main_coord_top_x)/(Malkorok.main_coord_bot_x-Malkorok.main_coord_top_x)*180
  590. local py1 = (py-Malkorok.main_coord_top_y)/(Malkorok.main_coord_bot_y-Malkorok.main_coord_top_y)*180
  591.  
  592. local numpie = Malkorok:findpie(px1,py1)
  593.  
  594. if not Malkorok.rotate then
  595. Malkorok.mainframe.Player:SetPoint("TOPLEFT", px1 / Malkorok.mainframe.Player.scale -15, -py1 / Malkorok.mainframe.Player.scale +20)
  596. Malkorok.RotateTexture(Malkorok.mainframe.Player.Texture,GetPlayerFacing(),0,0,1,1,15/32,20/32)
  597. if Malkorok.mainframe.main.t and Malkorok.mainframe.main.t.r then
  598. Malkorok.mainframe.main.t:SetTexCoord(Malkorok.mainframe.main.t.xT,Malkorok.mainframe.main.t.xB,Malkorok.mainframe.main.t.yT,Malkorok.mainframe.main.t.yB)
  599. Malkorok.mainframe.main.t.r = nil
  600. end
  601. else
  602. local h1,h2,h3 = sqrt( (Malkorok.center-px1)^2 + (180-py1)^2 ),sqrt( (Malkorok.center-Malkorok.center)^2 + (180-Malkorok.center)^2 ),sqrt( (Malkorok.center-px1)^2 + (Malkorok.center-py1)^2 )
  603. local h4 = (h2^2+h3^2-h1^2)/(2*h2*h3)
  604.  
  605. h4 = acos(h4)
  606. if px1<Malkorok.center then h4=360-h4 end
  607. h4 = -h4
  608. Malkorok.rotate_angle=PI/180*h4 + Malkorok.def_angle
  609.  
  610. Malkorok.RotateTexture(Malkorok.mainframe.Player.Texture,Malkorok.rotate_angle+GetPlayerFacing()-Malkorok.def_angle,0,0,1,1,15/32,20/32)
  611. Malkorok.mainframe.Player:SetPoint("TOPLEFT", Malkorok.center / Malkorok.mainframe.Player.scale - 15, (-Malkorok.center - h3)/ Malkorok.mainframe.Player.scale +20)
  612.  
  613. for i=1,6 do
  614. Malkorok.RotateTexture(Malkorok.mainframe.pie[i].tex,Malkorok.rotate_angle,Malkorok.rotate_coords.tl.x,Malkorok.rotate_coords.tl.y,Malkorok.rotate_coords.br.x,Malkorok.rotate_coords.br.y,Malkorok.rotate_origin.x,Malkorok.rotate_origin.y)
  615. end
  616.  
  617. if Malkorok.mainframe.main.t then
  618. Malkorok.RotateTexture(Malkorok.mainframe.main.t,Malkorok.rotate_angle,Malkorok.mainframe.main.t.xT,Malkorok.mainframe.main.t.yT,Malkorok.mainframe.main.t.xB,Malkorok.mainframe.main.t.yB,Malkorok.mainframe.main.t.xC,Malkorok.mainframe.main.t.yC,1)
  619. Malkorok.mainframe.main.t.r = 1
  620. end
  621. end
  622.  
  623. if not Malkorok.mainframe.main.t then
  624. if numpie>0 and Malkorok.pie_status[numpie] == 1 then
  625. Malkorok:Danger(1)
  626. elseif numpie==0 or Malkorok.pie_status[numpie] == 0 then
  627. Malkorok:Danger()
  628. end
  629. else
  630. if Malkorok.maps_a[floor(py1)+1] and Malkorok.maps_a[floor(py1)+1][floor(px1)+1] == 1 then Malkorok:Danger(1) else Malkorok:Danger() end
  631. end
  632. else
  633. if Malkorok.mainframe.Player.shown then
  634. Malkorok.mainframe.Player.shown = nil
  635. Malkorok.mainframe.Player:Hide()
  636. end
  637. if Malkorok.rotate then
  638. for i=1,6 do
  639. Malkorok.mainframe.pie[i].tex:SetTexCoord(0,180/256,0,180/256)
  640. end
  641. Malkorok.rotate_angle = 0
  642. if Malkorok.def_angle~=0 then Malkorok.def_angle_rotate() end
  643. end
  644. Malkorok:Danger()
  645. end
  646.  
  647. local n = GetNumGroupMembers() or 0
  648. if n > 0 and Malkorok.raid_marks_e then
  649. for j=1,n do
  650. local name,_,subgroup,_,_,class = GetRaidRosterInfo(j)
  651. if name and subgroup <= 5 and not UnitIsDeadOrGhost(name) and UnitIsConnected(name) and name ~= Malkorok.raid_marks_p then
  652. local px, py = GetPlayerMapPosition(name)
  653.  
  654. if px >= Malkorok.main_coord_top_x and px<=Malkorok.main_coord_bot_x and py>=Malkorok.main_coord_top_y and py<=Malkorok.main_coord_bot_y then
  655. local px1 = (px-Malkorok.main_coord_top_x)/(Malkorok.main_coord_bot_x-Malkorok.main_coord_top_x)*180
  656. local py1 = (py-Malkorok.main_coord_top_y)/(Malkorok.main_coord_bot_y-Malkorok.main_coord_top_y)*180
  657.  
  658. if Malkorok.rotate then
  659. px1,py1 = Malkorok.RotateCoordPair(px1,py1,Malkorok.center,Malkorok.center,-Malkorok.rotate_angle+Malkorok.def_angle,1)
  660. end
  661.  
  662. local cR,cG,cB = ClassColorNum(class)
  663. Malkorok.mainframe.raidMarks[j]:SetBackdropColor(cR,cG,cB,1)
  664. Malkorok.mainframe.raidMarks[j]:SetPoint("TOPLEFT", px1 - 8, -py1 + 8)
  665. Malkorok.mainframe.raidMarks[j]:Show()
  666. else
  667. Malkorok.mainframe.raidMarks[j]:Hide()
  668. end
  669. else
  670. if Malkorok.mainframe.raidMarks[j] then Malkorok.mainframe.raidMarks[j]:Hide() end
  671. end
  672. end
  673. end
  674. end
  675. end
  676. end
  677.  
  678. function Malkorok:EventHandler(event, ...)
  679. if event == "COMBAT_LOG_EVENT_UNFILTERED" then
  680. local _,event_n,_,_,_,_,_,destGUID,_,_,_,spellId = ...
  681. if event_n == "SPELL_CAST_SUCCESS" then
  682. if not (spellId == Malkorok.spell) then
  683. return
  684. end
  685. for i=1,6 do
  686. Malkorok.pie_status[i]=0
  687. Malkorok.mainframe.pie[i].tex:SetVertexColor(0,1,0,0.8)
  688. end
  689. if Malkorok.baoe_num == 0 then
  690. Malkorok.mainframe.aoecd.cooldown:SetCooldown(GetTime(), 60)
  691. Malkorok.baoe_num = 1
  692. else
  693. Malkorok.baoe_num = 0
  694. end
  695. elseif event_n == "SPELL_CAST_SUCCESS" then
  696. if not (spellId == Malkorok.spell_baoe) then
  697. return
  698. end
  699. Malkorok.baoe_num = 0
  700. Malkorok.mainframe.aoecd.cooldown:SetCooldown(GetTime(), 64)
  701. for i=1,6 do
  702. Malkorok.pie_status[i]=0
  703. Malkorok.mainframe.pie[i].tex:SetVertexColor(0,1,0,0.8)
  704. end
  705. end
  706. elseif event == "ZONE_CHANGED_NEW_AREA" then
  707. SetMapToCurrentZone()
  708. local cmap = GetCurrentMapAreaID()
  709. if not Malkorok.maps[cmap] then cmap = 0 end
  710. Malkorok.main_coord_top_x = Malkorok.maps[cmap][1]
  711. Malkorok.main_coord_top_y = Malkorok.maps[cmap][2]
  712. Malkorok.main_coord_bot_x = Malkorok.maps[cmap][3]
  713. Malkorok.main_coord_bot_y = Malkorok.maps[cmap][4]
  714. end
  715. end
  716.  
  717. function Malkorok:addonMessage(sender, prefix, ...)
  718. if not Malkorok.mainframe then return end
  719. if prefix == "malkorok" then
  720. local pienum,piecol = ...
  721. if not tonumber(pienum) or tonumber(pienum) == 0 then return end
  722. pienum = tonumber(pienum)
  723. if pienum > 6 then return end
  724. if Malkorok.pie_status[pienum] == 0 and piecol == "R" then
  725. Malkorok.pie_status[pienum]=1
  726. Malkorok.mainframe.pie[pienum].tex:SetVertexColor(1,0,0,0.8)
  727. elseif Malkorok.pie_status[pienum] == 1 and piecol == "G" then
  728. Malkorok.pie_status[pienum]=0
  729. Malkorok.mainframe.pie[pienum].tex:SetVertexColor(0,1,0,0.8)
  730. end
  731. end
  732. end
  733.  
  734. function Malkorok:Load()
  735. if Malkorok.mainframe then return end
  736. Malkorok.mainframe = CreateFrame("Frame","ExRTBossmodsMalkorok",UIParent)
  737. Malkorok.mainframe:SetSize(200,200)
  738. if VExRT.Bossmods.MalkorokLeft and VExRT.Bossmods.MalkorokTop then
  739. Malkorok.mainframe:SetPoint("TOPLEFT",UIParent,"BOTTOMLEFT",VExRT.Bossmods.MalkorokLeft,VExRT.Bossmods.MalkorokTop)
  740. else
  741. Malkorok.mainframe:SetPoint("TOP",UIParent, "TOP", 0, -50)
  742. end
  743. Malkorok.mainframe:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",edgeFile = ExRT.F.defBorder,tile = false,edgeSize = 8})
  744. Malkorok.mainframe:SetBackdropColor(0,0,0,0.5)
  745. Malkorok.mainframe:SetBackdropBorderColor(0.2,0.2,0.2,0.4)
  746. Malkorok.mainframe:EnableMouse(true)
  747. Malkorok.mainframe:SetMovable(true)
  748. Malkorok.mainframe:RegisterForDrag("LeftButton")
  749. Malkorok.mainframe:SetScript("OnDragStart", function(self)
  750. if self:IsMovable() then
  751. self:StartMoving()
  752. end
  753. end)
  754.  
  755. Malkorok.mainframe:SetScript("OnDragStop", function(self)
  756. self:StopMovingOrSizing()
  757. VExRT.Bossmods.MalkorokLeft = self:GetLeft()
  758. VExRT.Bossmods.MalkorokTop = self:GetTop()
  759. end)
  760. if VExRT.Bossmods.Alpha then Malkorok.mainframe:SetAlpha(VExRT.Bossmods.Alpha/100) end
  761. if VExRT.Bossmods.Scale then Malkorok.mainframe:SetScale(VExRT.Bossmods.Scale/100) end
  762.  
  763. Malkorok.mainframe.main = CreateFrame("Frame",nil,Malkorok.mainframe)
  764. Malkorok.mainframe.main:SetSize(180,180)
  765. Malkorok.mainframe.main:SetPoint("TOPLEFT",10, -10)
  766.  
  767. Malkorok.mainframe.pie = {}
  768. for i=1,6 do
  769. Malkorok.mainframe.pie[i] = CreateFrame("Frame",nil,Malkorok.mainframe.main)
  770. Malkorok.mainframe.pie[i]:SetSize(180,180)
  771. Malkorok.mainframe.pie[i]:SetPoint("TOPLEFT", 0, 0)
  772.  
  773. Malkorok.mainframe.pie[i].tex = Malkorok.mainframe.pie[i]:CreateTexture(nil, "BACKGROUND")
  774. Malkorok.mainframe.pie[i].tex:SetTexture("Interface\\AddOns\\ExRT\\media\\Pie"..i)
  775. Malkorok.mainframe.pie[i].tex:SetAllPoints()
  776. Malkorok.mainframe.pie[i].tex:SetTexCoord(0,180/256,0,180/256)
  777. Malkorok.mainframe.pie[i].tex:SetVertexColor(0,1,0,0.8)
  778. Malkorok.pie_status[i]=0
  779. end
  780.  
  781. Malkorok.mainframe:SetScript("OnMouseDown", function(self,button)
  782. local j1,j2 = Malkorok:Cursor()
  783.  
  784. if j1 < 6 and j2 < 6 then
  785. if not VExRT.Bossmods.MalkorokLock then
  786. Malkorok.mainframe.Lock.texture:SetTexture("Interface\\AddOns\\ExRT\\media\\lock.tga")
  787. Malkorok.mainframe:SetMovable(false)
  788. VExRT.Bossmods.MalkorokLock = true
  789. else
  790. Malkorok.mainframe.Lock.texture:SetTexture("Interface\\AddOns\\ExRT\\media\\un_lock.tga")
  791. Malkorok.mainframe:SetMovable(true)
  792. VExRT.Bossmods.MalkorokLock = nil
  793. end
  794. elseif j1 < 22 and j2 < 6 then
  795. if Malkorok.rotate then
  796. VExRT.Bossmods.MalkorokRotate = nil
  797. Malkorok.rotate = nil
  798. for i=1,6 do
  799. Malkorok.mainframe.pie[i].tex:SetTexCoord(0,180/256,0,180/256)
  800. end
  801. Malkorok.rotate_angle = 0
  802. if Malkorok.def_angle~=0 then Malkorok.def_angle_rotate() end
  803. else
  804. VExRT.Bossmods.MalkorokRotate = true
  805. Malkorok.rotate = true
  806. end
  807. elseif j1 < 8 and j2 > 170 then
  808. VExRT.Bossmods.MalkorokIconHide = not VExRT.Bossmods.MalkorokIconHide
  809. if VExRT.Bossmods.MalkorokIconHide then
  810. Malkorok.mainframe.aoecd:Hide()
  811. else
  812. Malkorok.mainframe.aoecd:Show()
  813. end
  814. end
  815.  
  816. local numpie = Malkorok:findpie(j1,j2,1)
  817. if numpie>0 then
  818. if button == "LeftButton" then
  819. Malkorok.pie_status[numpie]=1
  820. Malkorok.mainframe.pie[numpie].tex:SetVertexColor(1,0,0,0.8)
  821. elseif button == "RightButton" then
  822. Malkorok.pie_status[numpie]=0
  823. Malkorok.mainframe.pie[numpie].tex:SetVertexColor(0,1,0,0.8)
  824. end
  825. local col = "R"
  826. if button == "RightButton" then col = "G" end
  827. if RaidRank()>0 then
  828. ExRT.F.SendExMsg("malkorok",tostring(numpie).."\t"..col)
  829. ExRT.F.SendExMsg("malkorok",tostring(numpie).."\t"..col,nil,nil,"MHADD")
  830. end
  831. end
  832. end)
  833.  
  834. Malkorok.mainframe.Player = CreateFrame("Frame",nil,Malkorok.mainframe.main)
  835. Malkorok.mainframe.Player:SetSize(32,32)
  836. Malkorok.mainframe.Player.Texture =Malkorok.mainframe.Player:CreateTexture(nil, "ARTWORK")
  837. Malkorok.mainframe.Player.Texture:SetSize(32,32)
  838. Malkorok.mainframe.Player.Texture:SetPoint("TOPLEFT",0,0)
  839. Malkorok.mainframe.Player.Texture:SetTexture("Interface\\MINIMAP\\MinimapArrow")
  840. Malkorok.mainframe.Player.scale = 1
  841. Malkorok.mainframe.Player:SetScale(Malkorok.mainframe.Player.scale)
  842.  
  843. Malkorok.mainframe.Danger = ELib:Text(Malkorok.mainframe,L.bossmodsmalkorokdanger,18):Size(200,18):Point("TOP",0,15):Center():Top():Color(1,.2,.2):Outline()
  844. Malkorok.mainframe.Danger:Hide()
  845.  
  846. Malkorok.mainframe.Lock = ELib:Icon(Malkorok.mainframe,"Interface\\AddOns\\ExRT\\media\\un_lock.tga",14):Point(2,-1)
  847. if VExRT.Bossmods.MalkorokLock then
  848. Malkorok.mainframe.Lock.texture:SetTexture("Interface\\AddOns\\ExRT\\media\\lock.tga")
  849. Malkorok.mainframe:SetMovable(false)
  850. end
  851.  
  852. Malkorok.mainframe.Rotate = ELib:Icon(Malkorok.mainframe,"Interface\\AddOns\\ExRT\\media\\icon-config.tga",14):Point(18,-1)
  853. Malkorok.mainframe.Rotate.texture:SetVertexColor(0.6,0.6,0.6,0.8)
  854. if VExRT.Bossmods.MalkorokRotate then
  855. Malkorok.rotate = true
  856. else
  857. if Malkorok.def_angle~=0 then Malkorok.def_angle_rotate() end
  858. end
  859.  
  860. Malkorok.mainframe.aoecd = ELib:Icon(Malkorok.mainframe,"Interface\\Icons\\Spell_Shadow_Shadesofdarkness",32):Point("BOTTOMLEFT",2,1)
  861. Malkorok.mainframe.aoecd.cooldown = CreateFrame("Cooldown", nil, Malkorok.mainframe.aoecd)
  862. Malkorok.mainframe.aoecd.cooldown:SetAllPoints()
  863. if VExRT.Bossmods.MalkorokIconHide then
  864. Malkorok.mainframe.aoecd:Hide()
  865. end
  866.  
  867. Malkorok.mainframe:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  868. Malkorok.mainframe:RegisterEvent("ZONE_CHANGED_NEW_AREA")
  869. Malkorok.mainframe:SetScript("OnUpdate", Malkorok.timerfunc)
  870. Malkorok.mainframe:SetScript("OnEvent", Malkorok.EventHandler)
  871.  
  872. print(L.bossmodsmalkorokhelp)
  873.  
  874. SetMapToCurrentZone()
  875. local currentAreaID = GetCurrentMapAreaID()
  876. if Malkorok.maps[currentAreaID] then
  877. Malkorok.main_coord_top_x = Malkorok.maps[currentAreaID][1]
  878. Malkorok.main_coord_top_y = Malkorok.maps[currentAreaID][2]
  879. Malkorok.main_coord_bot_x = Malkorok.maps[currentAreaID][3]
  880. Malkorok.main_coord_bot_y = Malkorok.maps[currentAreaID][4]
  881. end
  882. end
  883.  
  884. -----------------------------------------
  885. -- Malkorok AI
  886. -----------------------------------------
  887. local MalkorokAI = {}
  888. module.A.MalkorokAI = MalkorokAI
  889.  
  890. MalkorokAI.mainframe = nil
  891. MalkorokAI.pie = {0,0,0,0,0,0}
  892. MalkorokAI.pie_raid = {}
  893. MalkorokAI.pie_yellow = 0
  894. MalkorokAI.tmr = 0
  895. MalkorokAI.tmr2 = 0
  896. MalkorokAI.spell_aoe = 143805
  897.  
  898. function MalkorokAI:timerfunc2(elapsed)
  899. MalkorokAI.tmr2 = MalkorokAI.tmr2 + elapsed
  900. if MalkorokAI.tmr2 > 5 then
  901. for i=1,6 do
  902. if MalkorokAI.pie[i] == 1 and Malkorok.pie_status[i]==1 then
  903. Malkorok.mainframe.pie[i].tex:SetVertexColor(1,0,0,0.8)
  904. end
  905. MalkorokAI.pie[i] = 0
  906. end
  907. MalkorokAI.mainframe:SetScript("OnUpdate", nil)
  908. MalkorokAI.tmr2 = 0
  909. end
  910. end
  911.  
  912. function MalkorokAI:timerfunc(elapsed)
  913. MalkorokAI.tmr = MalkorokAI.tmr + elapsed
  914. if MalkorokAI.tmr > 0.5 then
  915. for i=1,6 do
  916. if MalkorokAI.pie[i] == 1 then
  917. Malkorok.mainframe.pie[i].tex:SetVertexColor(1,0.8,0,0.8)
  918. end
  919. end
  920. MalkorokAI.mainframe:SetScript("OnUpdate", MalkorokAI.timerfunc2)
  921. MalkorokAI.tmr = 0
  922. end
  923. end
  924.  
  925. MalkorokAI.mainframe_2 = nil
  926. MalkorokAI.tmr_do = 0
  927. function MalkorokAI:timerfunc_do(elapsed)
  928. MalkorokAI.tmr_do = MalkorokAI.tmr_do + elapsed
  929. if MalkorokAI.tmr_do > 4.5 then
  930. local n = GetNumGroupMembers() or 0
  931. if n > 0 then
  932. local gMax = ExRT.F.GetRaidDiffMaxGroup()
  933. for i=1,6 do MalkorokAI.pie_raid[i]=0 end
  934. for j=1,n do
  935. local name, _,subgroup = GetRaidRosterInfo(j)
  936. if name and subgroup <= gMax and not UnitIsDeadOrGhost(name) then
  937. local px, py = GetPlayerMapPosition(name)
  938. if px >= Malkorok.main_coord_top_x and px<=Malkorok.main_coord_bot_x and py>=Malkorok.main_coord_top_y and py<=Malkorok.main_coord_bot_y then
  939. local px1 = (px-Malkorok.main_coord_top_x)/(Malkorok.main_coord_bot_x-Malkorok.main_coord_top_x)*180
  940. local py1 = (py-Malkorok.main_coord_top_y)/(Malkorok.main_coord_bot_y-Malkorok.main_coord_top_y)*180
  941.  
  942. local numpie = Malkorok:findpie(px1,py1)
  943.  
  944. for i_a=1,40 do
  945. local _,_,_,_,_,_,_,_,_,_,auraSpellId = UnitAura(name, i_a,"HELPFUL")
  946. if not auraSpellId then
  947. break
  948. elseif auraSpellId == 19263 or --Deterrence
  949. auraSpellId == 110696 or--Ice Block druid
  950. auraSpellId == 110700 or--Divine Shield druid
  951. auraSpellId == 45438 or --Ice Block
  952. auraSpellId == 47585 or --Dispersion
  953. auraSpellId == 113862 or--Greater Invisibility
  954. auraSpellId == 110960 or--Greater Invisibility
  955. auraSpellId == 1022 or --Hand of Protection
  956. auraSpellId == 642 then --Divine Shield
  957. numpie = 0
  958. end
  959. end
  960. if numpie > 0 then
  961. MalkorokAI.pie_raid[numpie] = MalkorokAI.pie_raid[numpie] + 1
  962. end
  963. end
  964. end
  965. end
  966. local minpieam = 40
  967. for i=1,6 do
  968. minpieam = min(minpieam,MalkorokAI.pie_raid[i])
  969. end
  970. for i=1,6 do
  971. if MalkorokAI.pie_raid[i]==minpieam then
  972. if RaidRank()>0 then
  973. ExRT.F.SendExMsg("malkorok",tostring(i).."\tR")
  974. ExRT.F.SendExMsg("malkorok",tostring(i).."\tR",nil,nil,"MHADD")
  975. end
  976. MalkorokAI.pie[i] = 1
  977. Malkorok.pie_status[i]=1
  978. end
  979. end
  980. MalkorokAI.mainframe:SetScript("OnUpdate", MalkorokAI.timerfunc)
  981. end
  982. MalkorokAI.tmr_do = 0
  983. self:SetScript("OnUpdate", nil)
  984. end
  985. end
  986.  
  987. function MalkorokAI:EventHandler(event,_,event_n,_,_,_,_,_,_,_,_,_,spellId)
  988. if event_n == "SPELL_CAST_SUCCESS" and spellId == MalkorokAI.spell_aoe then
  989. for i=1,6 do MalkorokAI.pie[i]=0 end
  990. MalkorokAI.tmr_do = 0
  991. MalkorokAI.mainframe_2:SetScript("OnUpdate", MalkorokAI.timerfunc_do)
  992. end
  993. end
  994.  
  995. function MalkorokAI:Load()
  996. if not Malkorok.mainframe then return end
  997. if MalkorokAI.mainframe then return end
  998.  
  999. MalkorokAI.mainframe = CreateFrame("Frame","ExRTBossmodsMalkorokAI",nil)
  1000. if not MalkorokAI.mainframe_2 then MalkorokAI.mainframe_2 = CreateFrame("Frame") end
  1001.  
  1002. MalkorokAI.mainframe:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  1003. MalkorokAI.mainframe:SetScript("OnEvent", MalkorokAI.EventHandler)
  1004.  
  1005. MalkorokAI.mainframe.text = CreateFrame("SimpleHTML", nil,Malkorok.mainframe)
  1006. MalkorokAI.mainframe.text:SetText("AI")
  1007. MalkorokAI.mainframe.text:SetFont(ExRT.F.defFont, 16,"OUTLINE")
  1008. MalkorokAI.mainframe.text:SetHeight(12)
  1009. MalkorokAI.mainframe.text:SetWidth(12)
  1010. MalkorokAI.mainframe.text:SetPoint("CENTER", Malkorok.mainframe,"BOTTOMRIGHT", -12,12)
  1011. MalkorokAI.mainframe.text:SetTextColor(1, 1, 1, 1)
  1012.  
  1013. print(L.bossmodsmalkorokaihelp)
  1014. end
  1015.  
  1016. -----------------------------------------
  1017. -- Spoils of Pandaria
  1018. -----------------------------------------
  1019. local SpoilsOfPandaria = {}
  1020. module.A.SpoilsOfPandaria = SpoilsOfPandaria
  1021.  
  1022. SpoilsOfPandaria.mainframe = nil
  1023. SpoilsOfPandaria.side1 = nil
  1024. SpoilsOfPandaria.side2 = nil
  1025. SpoilsOfPandaria.tmr = 0
  1026.  
  1027. SpoilsOfPandaria.tmp_point_b_x = 0.4153
  1028. SpoilsOfPandaria.tmp_point_b_y = 0.4013
  1029. SpoilsOfPandaria.tmp_point_t_x = 0.6516
  1030. SpoilsOfPandaria.tmp_point_t_y = 0.1602
  1031. SpoilsOfPandaria.tmp_point_tg = abs(( SpoilsOfPandaria.tmp_point_t_y-SpoilsOfPandaria.tmp_point_b_y ) / ( SpoilsOfPandaria.tmp_point_b_x-SpoilsOfPandaria.tmp_point_t_x ))
  1032.  
  1033. function SpoilsOfPandaria.findroom(px,py)
  1034. if px < SpoilsOfPandaria.tmp_point_b_x or px > SpoilsOfPandaria.tmp_point_t_x or py < SpoilsOfPandaria.tmp_point_t_y or py > SpoilsOfPandaria.tmp_point_b_y then return 0 end
  1035.  
  1036. local tg_1 = abs( SpoilsOfPandaria.tmp_point_b_x-px )
  1037. local tg_2 = SpoilsOfPandaria.tmp_point_tg * tg_1
  1038. local tg_y = SpoilsOfPandaria.tmp_point_b_y - tg_2
  1039.  
  1040. if tg_y > py then return 1 else return 2 end
  1041. end
  1042.  
  1043. SpoilsOfPandaria.point_subRoom_b_x = 0.5633
  1044. SpoilsOfPandaria.point_subRoom_b_y = 0.3701
  1045. SpoilsOfPandaria.point_subRoom_t_x = 0.4885
  1046. SpoilsOfPandaria.point_subRoom_t_y = 0.1993
  1047. function SpoilsOfPandaria.findroom2(x0,y0)
  1048. local side = (SpoilsOfPandaria.tmp_point_b_x - x0) * (SpoilsOfPandaria.tmp_point_t_y - SpoilsOfPandaria.tmp_point_b_y) - (SpoilsOfPandaria.tmp_point_t_x - SpoilsOfPandaria.tmp_point_b_x) * (SpoilsOfPandaria.tmp_point_b_y - y0)
  1049. if side < 0 then --TOP side
  1050. side = -1
  1051. else
  1052. side = 1
  1053. end
  1054. local subRoom = (SpoilsOfPandaria.point_subRoom_b_x - x0) * (SpoilsOfPandaria.point_subRoom_t_y - SpoilsOfPandaria.point_subRoom_b_y) - (SpoilsOfPandaria.point_subRoom_t_x - SpoilsOfPandaria.point_subRoom_b_x) * (SpoilsOfPandaria.point_subRoom_b_y - y0)
  1055. if subRoom < 0 then --LEFT room
  1056. subRoom = 1
  1057. else
  1058. subRoom = 2
  1059. end
  1060. local room = side * subRoom
  1061. if room < 0 then
  1062. return room + 3
  1063. else
  1064. return room + 2
  1065. end
  1066. -- 1: TOP Mogu
  1067. -- 2: TOP Klaxxi
  1068. -- 3: BOTTOM: Klaxxi
  1069. -- 4: BOTTOM: Mogu
  1070. end
  1071.  
  1072. function SpoilsOfPandaria:timerfunc(elapsed)
  1073. SpoilsOfPandaria.tmr = SpoilsOfPandaria.tmr + elapsed
  1074. if SpoilsOfPandaria.tmr > 1 then
  1075. SpoilsOfPandaria.tmr = 0
  1076. local o = {[1]=-1,[2]=-1,[0]=-1}
  1077. local n = GetNumGroupMembers() or 0
  1078. if n > 0 then
  1079. for j=1,n do
  1080. local name,_,subgroup = GetRaidRosterInfo(j)
  1081. if name and subgroup <= 5 and UnitIsDeadOrGhost(name) ~= 1 and UnitIsConnected(name) then
  1082. local px, py = GetPlayerMapPosition(name)
  1083. local pr = SpoilsOfPandaria.findroom(px,py)
  1084. if o[pr] < UnitPower(name,10) then
  1085. o[pr] = UnitPower(name,10)
  1086. end
  1087. end
  1088. end
  1089. for j=1,2 do
  1090. SpoilsOfPandaria.mainframe.side[j].pts = o[j]
  1091. if o[j]==-1 then
  1092. SpoilsOfPandaria.mainframe.side[j].text:SetText("?")
  1093. else
  1094. SpoilsOfPandaria.mainframe.side[j].text:SetText(SpoilsOfPandaria.mainframe.side[j].pts)
  1095. end
  1096. end
  1097. else
  1098. for j=1,2 do
  1099. SpoilsOfPandaria.mainframe.side[j].text:SetText("?")
  1100. SpoilsOfPandaria.mainframe.side[j].pts = 0
  1101. end
  1102. end
  1103. end
  1104. end
  1105.  
  1106. SpoilsOfPandaria.roomNames = {
  1107. L.BossmodsSpoilsofPandariaMogu,
  1108. L.BossmodsSpoilsofPandariaKlaxxi,
  1109. L.BossmodsSpoilsofPandariaKlaxxi,
  1110. L.BossmodsSpoilsofPandariaMogu,
  1111. }
  1112. function SpoilsOfPandaria:onEvent(event,unitID,_,_,_,spellID)
  1113. if unitID:find("^raid%d+$") and spellID == 144229 then
  1114. local name = ExRT.F.UnitCombatlogname(unitID)
  1115. if name then
  1116. local px, py = GetPlayerMapPosition(unitID)
  1117. local room = SpoilsOfPandaria.findroom2(px, py)
  1118. local color = ExRT.F.classColorByGUID(UnitGUID(unitID))
  1119. local ctime_ = ExRT.F.GetEncounterTime() or 0
  1120. print(format("%d:%02d",ctime_/60,ctime_%60).." |c"..color..name.."|r ".. L.BossmodsSpoilsofPandariaOpensBox .." "..SpoilsOfPandaria.roomNames[room])
  1121. end
  1122. end
  1123. end
  1124.  
  1125. function SpoilsOfPandaria:Load()
  1126. if SpoilsOfPandaria.mainframe then return end
  1127. SpoilsOfPandaria.mainframe = CreateFrame("Frame","ExRTBossmodsSpoilsOfPandaria",UIParent)
  1128. SpoilsOfPandaria.mainframe:SetSize(70,50)
  1129. if VExRT.Bossmods.SpoilsofPandariaLeft and VExRT.Bossmods.SpoilsofPandariaTop then
  1130. SpoilsOfPandaria.mainframe:SetPoint("TOPLEFT",UIParent,"BOTTOMLEFT",VExRT.Bossmods.SpoilsofPandariaLeft,VExRT.Bossmods.SpoilsofPandariaTop)
  1131. else
  1132. SpoilsOfPandaria.mainframe:SetPoint("TOP",UIParent, "TOP", 0, -50)
  1133. end
  1134. SpoilsOfPandaria.mainframe:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",edgeFile = ExRT.F.defBorder,tile = false,edgeSize = 8})
  1135. SpoilsOfPandaria.mainframe:SetBackdropColor(0.05,0.05,0.05,0.85)
  1136. SpoilsOfPandaria.mainframe:SetBackdropBorderColor(0.2,0.2,0.2,0.4)
  1137. SpoilsOfPandaria.mainframe:EnableMouse(true)
  1138. SpoilsOfPandaria.mainframe:SetMovable(true)
  1139. SpoilsOfPandaria.mainframe:RegisterForDrag("LeftButton")
  1140. SpoilsOfPandaria.mainframe:SetScript("OnDragStart", function(self)
  1141. if self:IsMovable() then
  1142. self:StartMoving()
  1143. end
  1144. end)
  1145. SpoilsOfPandaria.mainframe:SetScript("OnDragStop", function(self)
  1146. self:StopMovingOrSizing()
  1147. VExRT.Bossmods.SpoilsofPandariaLeft = self:GetLeft()
  1148. VExRT.Bossmods.SpoilsofPandariaTop = self:GetTop()
  1149. end)
  1150. if VExRT.Bossmods.Alpha then SpoilsOfPandaria.mainframe:SetAlpha(VExRT.Bossmods.Alpha/100) end
  1151. if VExRT.Bossmods.Scale then SpoilsOfPandaria.mainframe:SetScale(VExRT.Bossmods.Scale/100) end
  1152.  
  1153.  
  1154. SpoilsOfPandaria.mainframe.side = {}
  1155. for i=1,2 do
  1156. SpoilsOfPandaria.mainframe.side[i] = CreateFrame("Frame",nil,SpoilsOfPandaria.mainframe)
  1157. SpoilsOfPandaria.mainframe.side[i]:SetSize(70,20)
  1158. SpoilsOfPandaria.mainframe.side[i].text = SpoilsOfPandaria.mainframe.side[i]:CreateFontString(nil,"ARTWORK")
  1159. SpoilsOfPandaria.mainframe.side[i].text:SetJustifyH("CENTER")
  1160. SpoilsOfPandaria.mainframe.side[i].text:SetFont(ExRT.F.defFont, 20,"OUTLINE")
  1161. SpoilsOfPandaria.mainframe.side[i].text:SetText("100")
  1162. SpoilsOfPandaria.mainframe.side[i].text:SetTextColor(1, 1, 1, 1)
  1163. SpoilsOfPandaria.mainframe.side[i].text:SetAllPoints()
  1164. SpoilsOfPandaria.mainframe.side[i].pts = 0
  1165. end
  1166. SpoilsOfPandaria.mainframe.side[1]:SetPoint("TOPLEFT", 0, -5)
  1167. SpoilsOfPandaria.mainframe.side[2]:SetPoint("TOPLEFT", 0, -25)
  1168.  
  1169. SpoilsOfPandaria.mainframe:RegisterEvent('UNIT_SPELLCAST_SUCCEEDED')
  1170. SpoilsOfPandaria.mainframe:SetScript("OnUpdate", SpoilsOfPandaria.timerfunc)
  1171. SpoilsOfPandaria.mainframe:SetScript("OnEvent", SpoilsOfPandaria.onEvent)
  1172. end
  1173.  
  1174. -----------------------------------------
  1175. -- Kromog
  1176. -----------------------------------------
  1177. local Kromog = {}
  1178. module.A.Kromog = Kromog
  1179.  
  1180. Kromog.runes = {
  1181. {3673.47,329.81},
  1182. {3669.83,320.84},
  1183. {3667.69,309.80},
  1184. {3663.56,334.03},
  1185. {3661.87,325.15},
  1186. {3660.95,315.54},
  1187. {3659.29,303.60},
  1188. {3652.30,324.41},
  1189. {3650.33,315.57},
  1190. {3649.88,332.94},
  1191. {3649.72,306.76},
  1192. {3642.71,324.18},
  1193. {3641.32,315.93},
  1194. {3640.92,308.55},
  1195. {3636.36,331.65},
  1196. {3633.00,304.03},
  1197. {3632.95,317.41},
  1198. {3631.94,310.38},
  1199. {3630.81,325.00},
  1200. {3624.18,317.63},
  1201. {3623.51,306.16},
  1202. {3623.30,330.92},
  1203. {3617.37,312.64},
  1204. {3615.52,323.41},
  1205. {3612.18,306.78},
  1206. {3611.77,333.36},
  1207. {3605.63,318.56},
  1208. {3604.92,328.65},
  1209. {3603.65,308.19},
  1210. {3597.34,336.12},
  1211. {3596.64,325.87},
  1212. {3594.69,315.58},
  1213. {3594.69,306.78},--Добавлена вручную
  1214. {3587.57,323.10},
  1215. {3587.45,333.16},
  1216. }
  1217. Kromog.map = {3938.75,611.333,3001,-13.833} --xT,yT,xB,yB
  1218. Kromog.image = {190/772,199/515,322/772,271/515} -- KromogMap.tga 512Ñ…291
  1219. --Kromog.image = {0,0,1,1}
  1220. Kromog.width = 1024 --712
  1221. Kromog.image_avg = 291 / 512
  1222.  
  1223. Kromog.hidePlayers = true
  1224. function Kromog:UpdateSelectRoster()
  1225. local setup = {}
  1226. for i=1,#Kromog.runes do
  1227. local name = VExRT.Bossmods.Kromog[i]
  1228. if name then
  1229. setup[name] = true
  1230. end
  1231. end
  1232. local raidData = {{},{},{},{},{},{}}
  1233. for i=1,40 do
  1234. local name,_,subgroup,_,_,class = GetRaidRosterInfo(i)
  1235. if name and subgroup <= 6 then
  1236. raidData[subgroup][ #raidData[subgroup]+1 ] = {name,class}
  1237. end
  1238. end
  1239. for i=1,6 do
  1240. for j=1,5 do
  1241. local pos = (i-1)*5+j
  1242. local data = raidData[i][j]
  1243. if Kromog.raidRoster.buttons[pos] and data then
  1244. Kromog.raidRoster.buttons[pos]._name = data[1]
  1245. if Kromog.hidePlayers then
  1246. if setup[ data[1] ] then
  1247. Kromog.raidRoster.buttons[pos]:SetAlpha(.2)
  1248. else
  1249. Kromog.raidRoster.buttons[pos]:SetAlpha(1)
  1250. end
  1251. else
  1252. Kromog.raidRoster.buttons[pos]:SetAlpha(1)
  1253. end
  1254. Kromog.raidRoster.buttons[pos].name:SetText("|c"..ExRT.F.classColor(data[2])..data[1])
  1255. Kromog.raidRoster.buttons[pos]:Show()
  1256. elseif Kromog.raidRoster.buttons[pos] then
  1257. Kromog.raidRoster.buttons[pos]:Hide()
  1258. end
  1259. end
  1260. end
  1261. end
  1262.  
  1263. function Kromog:ReRoster()
  1264. local playerName = UnitName('player')
  1265. for i=1,#Kromog.runes do
  1266. local name = VExRT.Bossmods.Kromog[i]
  1267. if name then
  1268. local shortName = ExRT.F.delUnitNameServer(name)
  1269. local class = select(2,UnitClass(shortName))
  1270. if class then
  1271. class = "|c"..ExRT.F.classColor(class)
  1272. else
  1273. class = ""
  1274. end
  1275. if shortName == playerName then
  1276. Kromog.setupFrame.pings[i].icon:SetVertexColor(1,0.3,0.3,1)
  1277. else
  1278. Kromog.setupFrame.pings[i].icon:SetVertexColor(1,1,1,1)
  1279. end
  1280. Kromog.setupFrame.pings[i].name:SetText(class..name)
  1281. else
  1282. Kromog.setupFrame.pings[i].name:SetText("")
  1283. Kromog.setupFrame.pings[i].icon:SetVertexColor(.3,1,.3,1)
  1284. end
  1285. end
  1286. end
  1287.  
  1288. function Kromog:Load()
  1289. if Kromog.setupFrame then
  1290. Kromog:ReRoster()
  1291. Kromog.setupFrame:Show()
  1292. if not VExRT.Bossmods.Kromog.DisableArrow then
  1293. Kromog.setupFrame:RegisterEvent("CHAT_MSG_RAID_BOSS_EMOTE")
  1294. end
  1295. if InterfaceOptionsFrame:IsShown() then
  1296. InterfaceOptionsFrame:Hide()
  1297. end
  1298. if ExRT.Options.Frame:IsShown() then
  1299. ExRT.Options.Frame:Hide()
  1300. end
  1301. Kromog.setupFrame.isEnabled = true
  1302. return
  1303. end
  1304. Kromog.setupFrame = ELib:Popup("Kromog",0):Size(Kromog.width + 8,Kromog.image_avg * Kromog.width + 35)
  1305. Kromog.setupFrame.map = Kromog.setupFrame:CreateTexture()
  1306. Kromog.setupFrame.map:SetTexture("Interface\\AddOns\\ExRT\\media\\KromogMap.tga")
  1307. Kromog.setupFrame.map:SetPoint("TOP",Kromog.setupFrame,"TOP",0,-30)
  1308. Kromog.setupFrame.map:SetSize(Kromog.width,Kromog.image_avg * Kromog.width)
  1309. Kromog.setupFrame.map:SetTexCoord(0,1,0,291 / 512)
  1310. Kromog.setupFrame:SetFrameStrata("HIGH")
  1311.  
  1312. Kromog.setupFrame.isEnabled = true
  1313.  
  1314. local function DisableSync()
  1315. VExRT.Bossmods.Kromog.sync = nil
  1316. if VExRT.Bossmods.Kromog.name and VExRT.Bossmods.Kromog.time then
  1317. Kromog.setupFrame.lastUpdate:SetText(L.BossmodsKromogLastUpdate..": "..VExRT.Bossmods.Kromog.name.." ("..date("%H:%M:%S %d.%m.%Y",VExRT.Bossmods.Kromog.time)..")"..(not VExRT.Bossmods.Kromog.sync and " *" or ""))
  1318. else
  1319. Kromog.setupFrame.lastUpdate:SetText("")
  1320. end
  1321. end
  1322.  
  1323. local function KromogFrameOnEvent(self,event,unitID,spell,_,lineID,spellID)
  1324. if --(event == "UNIT_SPELLCAST_SUCCEEDED" and (spellID == 20473 or spellID == 774)) or
  1325. (event == "CHAT_MSG_RAID_BOSS_EMOTE" and unitID:find("spell:157059")) then
  1326. local playerName = UnitName('player')
  1327. for i=1,#Kromog.runes do
  1328. local name = VExRT.Bossmods.Kromog[i]
  1329. if name and ExRT.F.delUnitNameServer(name) == playerName then
  1330. ExRT.F.Arrow:ShowRunTo(Kromog.runes[i][1],Kromog.runes[i][2],2,10,true,true)
  1331. return
  1332. end
  1333. end
  1334.  
  1335. end
  1336. end
  1337.  
  1338. Kromog.setupFrame.pings = {}
  1339. local function SetupFramePingsOnEnter(self)
  1340. self.colors = {self.icon:GetVertexColor()}
  1341. self.icon:SetVertexColor(1,.3,1,1)
  1342. end
  1343. local function SetupFramePingsOnLeave(self)
  1344. self.icon:SetVertexColor(unpack(self.colors))
  1345. end
  1346. local function SetupFramePingsOnClick(self,button)
  1347. if button == "RightButton" then
  1348. self.colors = {.3,1,.3,1}
  1349. VExRT.Bossmods.Kromog[self._i] = nil
  1350. Kromog:ReRoster()
  1351.  
  1352. DisableSync()
  1353. return
  1354. end
  1355. Kromog.raidRoster.pos = self._i
  1356. Kromog.raidRoster.title:SetText(L.BossmodsKromogSelectPlayer..self._i)
  1357. Kromog.raidRoster:Show()
  1358. end
  1359. for i=1,#Kromog.runes do
  1360. local x = (abs(Kromog.runes[i][1]-Kromog.map[1])) / (abs(Kromog.map[3] - Kromog.map[1]))
  1361. local y = (abs(Kromog.runes[i][2]-Kromog.map[2])) / (abs(Kromog.map[4] - Kromog.map[2]))
  1362. Kromog.setupFrame.pings[i] = CreateFrame('Button',nil,Kromog.setupFrame)
  1363. Kromog.setupFrame.pings[i]:SetSize(32,32)
  1364. Kromog.setupFrame.pings[i].icon = Kromog.setupFrame.pings[i]:CreateTexture(nil,"ARTWORK")
  1365. Kromog.setupFrame.pings[i].icon:SetAllPoints()
  1366. Kromog.setupFrame.pings[i].icon:SetTexture("Interface\\AddOns\\ExRT\\media\\KromogRune.tga")
  1367. Kromog.setupFrame.pings[i].num = ELib:Text(Kromog.setupFrame.pings[i],i,12):Size(30,15):Point(0,0):Top():Color(1,1,1):Outline()
  1368. Kromog.setupFrame.pings[i].name = ELib:Text(Kromog.setupFrame.pings[i],"Player"..i,11):Size(75,15):Point(0,-12):Top():Color(1,1,1):Outline()
  1369.  
  1370. Kromog.setupFrame.pings[i]:SetScript("OnEnter",SetupFramePingsOnEnter)
  1371. Kromog.setupFrame.pings[i]:SetScript("OnLeave",SetupFramePingsOnLeave)
  1372. Kromog.setupFrame.pings[i]:RegisterForClicks("RightButtonDown","LeftButtonDown")
  1373. Kromog.setupFrame.pings[i]._i = i
  1374. Kromog.setupFrame.pings[i]:SetScript("OnClick",SetupFramePingsOnClick)
  1375.  
  1376. if x >= Kromog.image[1] and x <= Kromog.image[3] and y >= Kromog.image[2] and y <= Kromog.image[4] then
  1377. Kromog.setupFrame.pings[i]:SetPoint("CENTER",Kromog.setupFrame.map,"TOPLEFT", (x - Kromog.image[1])/(Kromog.image[3]-Kromog.image[1])*Kromog.width,-(y - Kromog.image[2])/(Kromog.image[4]-Kromog.image[2])*(Kromog.image_avg * Kromog.width))
  1378. end
  1379. end
  1380.  
  1381. local function KromogClearConfirm()
  1382. for i=1,#Kromog.runes do
  1383. VExRT.Bossmods.Kromog[i] = nil
  1384. end
  1385. Kromog:ReRoster()
  1386.  
  1387. DisableSync()
  1388. end
  1389.  
  1390. Kromog.setupFrame.clearButton = ELib:Button(Kromog.setupFrame,L.BossmodsKromogClear,0):Size(120,22):Point("BOTTOMRIGHT",Kromog.setupFrame,-15,10):OnClick(function (self)
  1391. StaticPopupDialogs["EXRT_BOSSMODS_KROMOG_CLEAR"] = {
  1392. text = L.BossmodsKromogClear,
  1393. button1 = YES,
  1394. button2 = NO,
  1395. OnAccept = KromogClearConfirm,
  1396. timeout = 0,
  1397. whileDead = true,
  1398. hideOnEscape = true,
  1399. preferredIndex = 3,
  1400. }
  1401. StaticPopup_Show("EXRT_BOSSMODS_KROMOG_CLEAR")
  1402. end)
  1403.  
  1404. Kromog.setupFrame.byName = ELib:Button(Kromog.setupFrame,L.BossmodsKromogSort,0):Size(120,22):Point("BOTTOMRIGHT",Kromog.setupFrame.clearButton,"TOPRIGHT",0,0):OnClick(function (self)
  1405. local raid = {}
  1406. for i=1,30 do
  1407. local name = GetRaidRosterInfo(i)
  1408. if name then
  1409. raid[#raid+1] = name
  1410. end
  1411. end
  1412. sort(raid)
  1413. for i=1,max(#raid,#Kromog.runes) do
  1414. VExRT.Bossmods.Kromog[i] = raid[i]
  1415. end
  1416. for i=#raid+1,#Kromog.runes do
  1417. VExRT.Bossmods.Kromog[i] = nil
  1418. end
  1419. Kromog:ReRoster()
  1420.  
  1421. DisableSync()
  1422. end)
  1423.  
  1424. local function SetupsDropDown_Load(_,arg)
  1425. for i=1,#Kromog.runes do
  1426. VExRT.Bossmods.Kromog[i] = VExRT.Bossmods.KromogSetups[arg][i]
  1427. end
  1428. Kromog:ReRoster()
  1429. DisableSync()
  1430. CloseDropDownMenus()
  1431. end
  1432. local function SetupsDropDown_Clear(_,arg)
  1433. for i=1,#Kromog.runes do
  1434. VExRT.Bossmods.KromogSetups[arg][i] = nil
  1435. end
  1436. VExRT.Bossmods.KromogSetups[arg].date = nil
  1437. CloseDropDownMenus()
  1438. end
  1439. local function SetupsDropDown_Save(_,arg)
  1440. for i=1,#Kromog.runes do
  1441. VExRT.Bossmods.KromogSetups[arg][i] = VExRT.Bossmods.Kromog[i]
  1442. end
  1443. VExRT.Bossmods.KromogSetups[arg].date = time()
  1444. CloseDropDownMenus()
  1445. end
  1446. local function SetupsDropDown_Close()
  1447. CloseDropDownMenus()
  1448. end
  1449.  
  1450. local setupsDropDown = CreateFrame("Frame", "ExRT_Kromog_SetupsDropDown", nil, "UIDropDownMenuTemplate")
  1451. Kromog.setupFrame.setupsButton = ELib:Button(Kromog.setupFrame,L.BossmodsKromogSetups,0):Size(120,22):Point("BOTTOMRIGHT",Kromog.setupFrame.byName,"TOPRIGHT",0,0):OnClick(function (self)
  1452. VExRT.Bossmods.KromogSetups = VExRT.Bossmods.KromogSetups or {}
  1453.  
  1454. local dropDown = {
  1455. { text = L.BossmodsKromogSetups, isTitle = true, notCheckable = true, notClickable = true},
  1456. }
  1457. for i=1,5 do
  1458. VExRT.Bossmods.KromogSetups[i] = VExRT.Bossmods.KromogSetups[i] or {}
  1459.  
  1460. local subMenu = nil
  1461. local saveMenu = { text = L.BossmodsKromogSetupsSave, func = SetupsDropDown_Save, arg1 = i, notCheckable = true }
  1462. local loadMenu = { text = L.BossmodsKromogSetupsLoad, func = SetupsDropDown_Load, arg1 = i, notCheckable = true }
  1463. local clearMenu = { text = L.BossmodsKromogSetupsClear, func = SetupsDropDown_Clear, arg1 = i, notCheckable = true }
  1464.  
  1465. local isExists = VExRT.Bossmods.KromogSetups[i].date
  1466. local dateText = ""
  1467. if isExists then
  1468. subMenu = {loadMenu,saveMenu,clearMenu}
  1469. dateText = ". "..date("%H:%M:%S %d.%m.%Y",isExists)
  1470. else
  1471. subMenu = {saveMenu}
  1472. end
  1473.  
  1474. dropDown[i+1] = {
  1475. text = i..dateText, hasArrow = true, menuList = subMenu, notCheckable = true
  1476. }
  1477. end
  1478. dropDown[7] = { text = L.BossmodsKromogSetupsClose, func = SetupsDropDown_Close, notCheckable = true }
  1479. EasyMenu(dropDown, setupsDropDown, "cursor", 10 , -15, "MENU")
  1480. end)
  1481.  
  1482. Kromog.setupFrame.sendButton = ELib:Button(Kromog.setupFrame,L.BossmodsKromogSend,0):Size(120,22):Point("BOTTOMRIGHT",Kromog.setupFrame.setupsButton,"TOPRIGHT",0,0):OnClick(function (self)
  1483. local line = ""
  1484. for i=1,#Kromog.runes do
  1485. line = line .. i.."\t"..(VExRT.Bossmods.Kromog[i] or "-").."\t"
  1486. if i%3 == 0 then
  1487. ExRT.F.SendExMsg("kromog",line)
  1488. line = ""
  1489. end
  1490. end
  1491. if line ~= "" then
  1492. ExRT.F.SendExMsg("kromog",line)
  1493. end
  1494. end)
  1495.  
  1496. Kromog.setupFrame.testButton = ELib:Button(Kromog.setupFrame,L.BossmodsKromogTest,0):Size(120,22):Point("RIGHT",Kromog.setupFrame.clearButton,"LEFT",0,0):OnClick(function (self)
  1497. KromogFrameOnEvent(Kromog.setupFrame,"CHAT_MSG_RAID_BOSS_EMOTE","spell:157059")
  1498. end)
  1499.  
  1500. Kromog.setupFrame.disableArrowChk = ELib:Check(Kromog.setupFrame,L.BossmodsKromogDisableArrow,VExRT.Bossmods.Kromog.DisableArrow,0):Point("BOTTOMLEFT",Kromog.setupFrame.sendButton,"TOPLEFT",-3,0):Scale(.9):OnClick(function (self)
  1501. if self:GetChecked() then
  1502. VExRT.Bossmods.Kromog.DisableArrow = true
  1503. Kromog.setupFrame:UnregisterAllEvents()
  1504. else
  1505. VExRT.Bossmods.Kromog.DisableArrow = nil
  1506. Kromog.setupFrame:RegisterEvent("CHAT_MSG_RAID_BOSS_EMOTE")
  1507. end
  1508. end)
  1509.  
  1510. Kromog.setupFrame.onlyTrustedChk = ELib:Check(Kromog.setupFrame,L.BossmodsKromogOnlyTrusted,not VExRT.Bossmods.Kromog.UpdatesFromAll,0):Point("BOTTOMLEFT",Kromog.setupFrame.disableArrowChk,"TOPLEFT",0,-7):Scale(.9):Tooltip(L.BossmodsKromogOnlyTrustedTooltip):OnClick(function (self)
  1511. if self:GetChecked() then
  1512. VExRT.Bossmods.Kromog.UpdatesFromAll = nil
  1513. else
  1514. VExRT.Bossmods.Kromog.UpdatesFromAll = true
  1515. end
  1516. end)
  1517.  
  1518. Kromog.setupFrame.lastUpdate = ELib:Text(Kromog.setupFrame,"",12):Size(500,20):Point("BOTTOMLEFT",Kromog.setupFrame,"BOTTOMLEFT",15,13):Bottom():Color(1,1,1):Outline()
  1519.  
  1520. Kromog.raidRoster = ELib:Popup(L.BossmodsKromogSelectPlayer,0):Size(80*6+25,113+14)
  1521. Kromog.raidRoster:SetScript("OnShow",function (self)
  1522. Kromog:UpdateSelectRoster()
  1523. end)
  1524. Kromog.raidRoster.buttons = {}
  1525. local function RaidRosterButtonOnEnter(self)
  1526. self.hl:Show()
  1527. end
  1528. local function RaidRosterButtonOnLeave(self)
  1529. self.hl:Hide()
  1530. end
  1531. local function RaidRosterButtonOnClick(self)
  1532. for i=1,#Kromog.runes do
  1533. if VExRT.Bossmods.Kromog[i] == self._name then
  1534. VExRT.Bossmods.Kromog[i] = nil
  1535. end
  1536. end
  1537. VExRT.Bossmods.Kromog[Kromog.raidRoster.pos] = self._name
  1538. Kromog:ReRoster()
  1539. Kromog.raidRoster:Hide()
  1540.  
  1541. DisableSync()
  1542. end
  1543. for i=1,6 do
  1544. for j=1,5 do
  1545. local pos = (i-1)*5+j
  1546. Kromog.raidRoster.buttons[pos] = CreateFrame('Button',nil,Kromog.raidRoster)
  1547. Kromog.raidRoster.buttons[pos]:SetPoint("TOPLEFT",15+(i-1)*80,-30-(j-1)*14)
  1548. Kromog.raidRoster.buttons[pos]:SetSize(80,14)
  1549. ExRT.lib.CreateHoverHighlight(Kromog.raidRoster.buttons[pos])
  1550. Kromog.raidRoster.buttons[pos]:SetScript("OnEnter",RaidRosterButtonOnEnter)
  1551. Kromog.raidRoster.buttons[pos]:SetScript("OnLeave",RaidRosterButtonOnLeave)
  1552. Kromog.raidRoster.buttons[pos].name = ELib:Text(Kromog.raidRoster.buttons[pos],"",12):Size(80,14):Point(0,0):Color(1,1,1):Shadow()
  1553. Kromog.raidRoster.buttons[pos]._name = nil
  1554. Kromog.raidRoster.buttons[pos]:SetScript("OnClick",RaidRosterButtonOnClick)
  1555. end
  1556. end
  1557. Kromog.raidRoster.clearButton = CreateFrame('Button',nil,Kromog.raidRoster)
  1558. Kromog.raidRoster.clearButton:SetPoint("BOTTOMRIGHT",Kromog.raidRoster,"BOTTOMRIGHT",-11,12)
  1559. Kromog.raidRoster.clearButton:SetSize(80,14)
  1560. ExRT.lib.CreateHoverHighlight(Kromog.raidRoster.clearButton)
  1561. Kromog.raidRoster.clearButton:SetScript("OnEnter",function(self)
  1562. self.hl:Show()
  1563. end)
  1564. Kromog.raidRoster.clearButton:SetScript("OnLeave",function(self)
  1565. self.hl:Hide()
  1566. end)
  1567. Kromog.raidRoster.clearButton.name = ELib:Text(Kromog.raidRoster.clearButton,L.BossmodsKromogClear,12):Size(80,14):Point(0,0):Right():Color(1,1,1):Shadow()
  1568. Kromog.raidRoster.clearButton:SetScript("OnClick",function(self)
  1569. VExRT.Bossmods.Kromog[Kromog.raidRoster.pos] = nil
  1570. Kromog:ReRoster()
  1571. Kromog.raidRoster:Hide()
  1572.  
  1573. DisableSync()
  1574. end)
  1575.  
  1576. Kromog.raidRoster.hideChk = ELib:Check(Kromog.raidRoster,L.BossmodsKromogHidePlayers,true,0):Point("BOTTOMLEFT",10,7):Scale(.8):OnClick(function (self)
  1577. Kromog.hidePlayers = self:GetChecked()
  1578. Kromog:UpdateSelectRoster()
  1579. end)
  1580.  
  1581. if not VExRT.Bossmods.Kromog.DisableArrow then
  1582. --Kromog.setupFrame:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
  1583. Kromog.setupFrame:RegisterEvent("CHAT_MSG_RAID_BOSS_EMOTE")
  1584. end
  1585. Kromog.setupFrame:SetScript("OnEvent",KromogFrameOnEvent)
  1586. Kromog.setupFrame:SetScript("OnShow",function (self)
  1587. local isAlpha = false
  1588. if IsInRaid() then
  1589. if ExRT.F.IsPlayerRLorOfficer(UnitName('player')) then
  1590. isAlpha = false
  1591. else
  1592. isAlpha = true
  1593. end
  1594. end
  1595. if isAlpha then
  1596. self.clearButton:SetAlpha(.2)
  1597. self.byName:SetAlpha(.2)
  1598. self.sendButton:SetAlpha(.2)
  1599. self.setupsButton:SetAlpha(.2)
  1600. else
  1601. self.clearButton:SetAlpha(1)
  1602. self.byName:SetAlpha(1)
  1603. self.sendButton:SetAlpha(1)
  1604. self.setupsButton:SetAlpha(1)
  1605. end
  1606. end)
  1607.  
  1608. if not VExRT.Bossmods.Kromog.name or not VExRT.Bossmods.Kromog.time then
  1609. Kromog.setupFrame.lastUpdate:SetText("")
  1610. else
  1611. Kromog.setupFrame.lastUpdate:SetText(L.BossmodsKromogLastUpdate..": "..VExRT.Bossmods.Kromog.name.." ("..date("%H:%M:%S %d.%m.%Y",VExRT.Bossmods.Kromog.time)..")"..(not VExRT.Bossmods.Kromog.sync and " *" or ""))
  1612. end
  1613. Kromog:ReRoster()
  1614. Kromog.setupFrame:Show()
  1615. if InterfaceOptionsFrame:IsShown() then
  1616. InterfaceOptionsFrame:Hide()
  1617. end
  1618. if ExRT.Options.Frame:IsShown() then
  1619. ExRT.Options.Frame:Hide()
  1620. end
  1621. end
  1622.  
  1623. function Kromog:addonMessage(sender, prefix, ...)
  1624. if prefix == "kromog" then
  1625. if IsInRaid() and not VExRT.Bossmods.Kromog.UpdatesFromAll and not ExRT.F.IsPlayerRLorOfficer(sender) then
  1626. return
  1627. end
  1628.  
  1629. local pos1,name1,pos2,name2,pos3,name3 = ...
  1630. VExRT.Bossmods.Kromog.time = time()
  1631. VExRT.Bossmods.Kromog.name = sender
  1632. VExRT.Bossmods.Kromog.sync = true
  1633. if pos1 and name1 then
  1634. pos1 = tonumber(pos1)
  1635. if name1 == "-" then
  1636. name1 = nil
  1637. end
  1638. VExRT.Bossmods.Kromog[pos1] = name1
  1639. end
  1640. if pos2 and name2 then
  1641. pos2 = tonumber(pos2)
  1642. if name2 == "-" then
  1643. name2 = nil
  1644. end
  1645. VExRT.Bossmods.Kromog[pos2] = name2
  1646. end
  1647. if pos3 and name3 then
  1648. pos3 = tonumber(pos3)
  1649. if name3 == "-" then
  1650. name3 = nil
  1651. end
  1652. VExRT.Bossmods.Kromog[pos3] = name3
  1653. end
  1654.  
  1655. if Kromog.setupFrame then
  1656. Kromog.setupFrame.lastUpdate:SetText(L.BossmodsKromogLastUpdate..": "..VExRT.Bossmods.Kromog.name.." ("..date("%H:%M:%S %d.%m.%Y",VExRT.Bossmods.Kromog.time)..")")
  1657. Kromog:ReRoster()
  1658. end
  1659. end
  1660. end
  1661.  
  1662. -----------------------------------------
  1663. -- Thogar
  1664. -----------------------------------------
  1665.  
  1666. local Thogar = {}
  1667. module.A.Thogar = Thogar
  1668.  
  1669. Thogar.data = {
  1670. --{время с пула;колия;тип:1 - проезд,2-прибытие,3-отправка} 1 - самая дальняя от входа колия
  1671. {18,4,1},
  1672. {28,2,1},
  1673. {33,1,2},
  1674. {46,1,3},
  1675. {48,3,1},
  1676. {53,4,2},
  1677. {78,4,3},
  1678. {78,2,1},
  1679. {85,3,2},
  1680. {94,3,3},
  1681. {108,1,1},
  1682. {124,2,2},
  1683. {124,3,2},
  1684. {153,2,3},
  1685. {153,3,3},
  1686. {163,4,1},
  1687. {163,1,1},
  1688. {173,1,2},
  1689. {183,2,1},
  1690. {198,2,1},
  1691. {198,4,2},
  1692. {216,1,3},
  1693. {219,3,1},
  1694. {226,4,3},
  1695. {228,2,1},
  1696. {238,1,1},
  1697. {254,2,2},
  1698. {254,4,2},
  1699. {265,2,3},
  1700. {273,1,1},
  1701. {278,3,1},
  1702. {298,4,3},
  1703. {308,4,2},
  1704. {308,1,2},
  1705. {318,2,1},
  1706. {343,2,1},
  1707. {373,2,2},
  1708. {373,3,2},
  1709. {393,3,3},
  1710. {408,2,3},
  1711. {408,1,1},
  1712. {428,1,2},
  1713. {428,4,2},
  1714. }
  1715. Thogar.statusText = {
  1716. L.BossmodsThogarTransit,
  1717. L.BossmodsThogarIn,
  1718. L.BossmodsThogarOut,
  1719. }
  1720. Thogar.marksIcons = {
  1721. "Interface\\TargetingFrame\\UI-RaidTargetingIcon_6",
  1722. "Interface\\TargetingFrame\\UI-RaidTargetingIcon_4",
  1723. "Interface\\TargetingFrame\\UI-RaidTargetingIcon_3",
  1724. "Interface\\TargetingFrame\\UI-RaidTargetingIcon_7",
  1725. }
  1726.  
  1727. function Thogar:Load()
  1728. if Thogar.mainframe then
  1729. return
  1730. end
  1731. Thogar.mainframe = CreateFrame("Frame","ExRTBossmodsThogar",UIParent)
  1732. Thogar.mainframe:SetSize(180,90)
  1733. if VExRT.Bossmods.ThogarLeft and VExRT.Bossmods.ThogarTop then
  1734. Thogar.mainframe:SetPoint("TOPLEFT",UIParent,"BOTTOMLEFT",VExRT.Bossmods.ThogarLeft,VExRT.Bossmods.ThogarTop)
  1735. else
  1736. Thogar.mainframe:SetPoint("TOP",UIParent, "TOP", 0, -50)
  1737. end
  1738. --Thogar.mainframe:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",edgeFile = ExRT.F.defBorder,tile = false,edgeSize = 8})
  1739. Thogar.mainframe:SetBackdrop({edgeFile = ExRT.F.defBorder,tile = false,edgeSize = 8})
  1740. --Thogar.mainframe:SetBackdropColor(0.05,0.05,0.05,0.85)
  1741. Thogar.mainframe:SetBackdropBorderColor(0.2,0.2,0.2,0.4)
  1742. Thogar.mainframe:EnableMouse(true)
  1743. Thogar.mainframe:SetMovable(true)
  1744. Thogar.mainframe:RegisterForDrag("LeftButton")
  1745. Thogar.mainframe:SetScript("OnDragStart", function(self)
  1746. if self:IsMovable() then
  1747. self:StartMoving()
  1748. end
  1749. end)
  1750. Thogar.mainframe:SetScript("OnDragStop", function(self)
  1751. self:StopMovingOrSizing()
  1752. VExRT.Bossmods.ThogarLeft = self:GetLeft()
  1753. VExRT.Bossmods.ThogarTop = self:GetTop()
  1754. end)
  1755. if VExRT.Bossmods.Alpha then Thogar.mainframe:SetAlpha(VExRT.Bossmods.Alpha/100) end
  1756. if VExRT.Bossmods.Scale then Thogar.mainframe:SetScale(VExRT.Bossmods.Scale/100) end
  1757.  
  1758. Thogar.mainframe.Background = Thogar.mainframe:CreateTexture(nil, "BACKGROUND")
  1759. --Thogar.mainframe.Background:SetTexture(.4,.4,.4,.7)
  1760. Thogar.mainframe.Background:SetTexture(1,1,1,1)
  1761. Thogar.mainframe.Background:SetAllPoints()
  1762. Thogar.mainframe.Background:SetGradientAlpha("VERTICAL", 53/255, 53/255, 53/255, .8, 26/255, 26/255, 26/255, .8)
  1763. --Thogar.mainframe.Background:SetGradientAlpha("VERTICAL", 0/255, 0/255, 0/255, .7, 63/255, 63/255, 63/255, .7)
  1764.  
  1765. Thogar.mainframe.lines = {}
  1766. for i=1,4 do
  1767. Thogar.mainframe.lines[i] = CreateFrame("Frame",nil,Thogar.mainframe)
  1768. Thogar.mainframe.lines[i]:SetPoint("TOPLEFT",0,-5-(i-1)*20)
  1769. Thogar.mainframe.lines[i]:SetSize(180,20)
  1770. Thogar.mainframe.lines[i].col = ELib:Text(Thogar.mainframe.lines[i],i):Size(30,20):Point(10,0):Font("Interface\\AddOns\\ExRT\\media\\Glametrix.otf",18):Color(1,1,1):Shadow()
  1771. Thogar.mainframe.lines[i].status = ELib:Text(Thogar.mainframe.lines[i]):Size(100,20):Point(25,0):Font("Interface\\AddOns\\ExRT\\media\\Glametrix.otf",18):Color(1,1,1):Shadow()
  1772. Thogar.mainframe.lines[i].time = ELib:Text(Thogar.mainframe.lines[i]):Size(50,20):Point(135,0):Font("Interface\\AddOns\\ExRT\\media\\Glametrix.otf",18):Color(1,1,1):Shadow()
  1773.  
  1774. Thogar.mainframe.lines[i].g = Thogar.mainframe.lines[i]:CreateTexture(nil, "BACKGROUND")
  1775. Thogar.mainframe.lines[i].g:SetTexture(1,1,1,1)
  1776. Thogar.mainframe.lines[i].g:SetAllPoints()
  1777. Thogar.mainframe.lines[i].g:SetGradientAlpha("HORIZONTAL", 255/255, 55/255, 55/255, .8, 255/255, 55/255, 55/255, 0)
  1778. Thogar.mainframe.lines[i].g:Hide()
  1779.  
  1780. Thogar.mainframe.lines[i].mark = Thogar.mainframe.lines[i]:CreateTexture(nil, "BACKGROUND")
  1781. Thogar.mainframe.lines[i].mark:SetTexture(Thogar.marksIcons[i])
  1782. Thogar.mainframe.lines[i].mark:SetSize(14,14)
  1783. Thogar.mainframe.lines[i].mark:SetPoint("RIGHT",Thogar.mainframe.lines[i].time,"LEFT",-10,0)
  1784. end
  1785.  
  1786. local maxTime = 0
  1787. for j,data in ipairs(Thogar.data) do
  1788. maxTime = max(data[1],maxTime)
  1789. end
  1790.  
  1791. local tmr = 0
  1792. local pullTime = 0
  1793. local function ThogarUpdate(self,elapsed)
  1794. tmr = tmr + elapsed
  1795. if tmr > 0.05 then
  1796. pullTime = pullTime + tmr
  1797. --DInfo(pullTime)
  1798. tmr = 0
  1799. local nextTime = maxTime
  1800. for i=1,4 do
  1801. local line = self.lines[i]
  1802. local isLineSet = false
  1803. local isLineFull = false
  1804. line.status:SetText("")
  1805. line.time:SetText("")
  1806. line.g:Hide()
  1807. line.diffNow = nil
  1808. for j,data in ipairs(Thogar.data) do
  1809. if data[2] == i and pullTime > data[1] and data[3] == 1 and (pullTime - data[1]) < 3 then
  1810. line.status:SetText(Thogar.statusText[ data[3] ])
  1811. line.time:SetText("")
  1812. line.diffNow = -1
  1813. break
  1814. elseif data[2] == i and data[1] > pullTime and not isLineSet then
  1815. line.status:SetText(Thogar.statusText[ data[3] ])
  1816. local diff = data[1] - pullTime
  1817. local timeColor = ""
  1818. line.time:SetText( date("%M:%S",diff) )
  1819.  
  1820. --break
  1821. isLineSet = true
  1822. isLineFull = data[3] == 3
  1823. if not isLineFull then
  1824. line.diffNow = diff
  1825. else
  1826. line.diffNow = -1
  1827. end
  1828. end
  1829. end
  1830. if line.diffNow then
  1831. if line.diffNow >= 0 then
  1832. nextTime = min(nextTime,line.diffNow)
  1833. end
  1834. if line.diffNow <= 5 then
  1835. line.g:SetGradientAlpha("HORIZONTAL", 255/255, 55/255, 55/255, .8, 255/255, 55/255, 55/255, 0)
  1836. line.g:Show()
  1837. elseif line.diffNow <= 10 then
  1838. line.g:SetGradientAlpha("HORIZONTAL", 255/255, 255/255, 55/255, .65, 255/255, 255/255, 55/255, 0)
  1839. line.g:Show()
  1840. end
  1841. end
  1842. end
  1843. if nextTime > 10 then
  1844. for i=1,4 do
  1845. local line = self.lines[i]
  1846. if line.diffNow and line.diffNow == nextTime then
  1847. line.g:SetGradientAlpha("HORIZONTAL", 55/255, 255/255, 55/255, .5, 55/255, 255/255, 55/255, 0)
  1848. line.g:Show()
  1849. end
  1850. end
  1851. end
  1852. if pullTime > maxTime then
  1853. self:SetScript("OnUpdate",nil)
  1854. end
  1855. end
  1856. end
  1857.  
  1858. --Thogar.mainframe:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
  1859. Thogar.mainframe:RegisterEvent("ENCOUNTER_START")
  1860. Thogar.mainframe:RegisterEvent("ENCOUNTER_END")
  1861. Thogar.mainframe:SetScript("OnEvent",function (self,event,unitID,spell,_,lineID,spellID)
  1862. if (event == "UNIT_SPELLCAST_SUCCEEDED" and (spellID == 20473 or spellID == 774)) then
  1863. pullTime = 0
  1864. self:SetScript("OnUpdate",ThogarUpdate)
  1865. elseif event == "ENCOUNTER_START" and unitID == 1692 then
  1866. pullTime = 0
  1867. self:SetScript("OnUpdate",ThogarUpdate)
  1868. elseif event == "ENCOUNTER_END" then
  1869. self:SetScript("OnUpdate",nil)
  1870. end
  1871. end)
  1872.  
  1873. end
  1874.  
  1875. --ExRT.F.ScheduleTimer(Thogar.Load, 2)
  1876.  
  1877. -----------------------------------------
  1878. -- Imperator Mar'gok
  1879. -----------------------------------------
  1880.  
  1881. local Margok = {}
  1882. module.A.Margok = Margok
  1883.  
  1884. Margok.spellIDs = {
  1885. [156225]=true, --Phase 1
  1886. [164004]=true, --Phase 2
  1887. [164005]=true, --Phase 3
  1888. [164006]=true, --Phase 4
  1889. }
  1890. Margok.mapData = {}
  1891. Margok.Roster = {}
  1892. Margok.lastRange = nil
  1893. Margok.Range = 200
  1894.  
  1895. do
  1896. local tmr = 0
  1897. function Margok:OnTimer(elapsed)
  1898. tmr = tmr + elapsed
  1899. if tmr > 0.3 then
  1900. tmr = 0
  1901. local mainY,mainX,mainY2,mainX2 = nil
  1902. if not self.Debuff and not self.Debuff2 then
  1903. return
  1904. end
  1905. if self.Debuff then
  1906. mainY,mainX = UnitPosition(self.Debuff)
  1907. end
  1908. if self.Debuff2 then
  1909. mainY2,mainX2 = UnitPosition(self.Debuff2)
  1910. end
  1911. local diff,diffName,diff2,diffName2 = nil
  1912. for name,_ in pairs(Margok.Roster) do
  1913. if not UnitIsDeadOrGhost(name) then
  1914. local y,x = UnitPosition(name)
  1915.  
  1916. if name ~= self.Debuff then
  1917. local dX = (x - mainX)
  1918. local dY = (y - mainY)
  1919. local diffNow = sqrt(dX * dX + dY * dY)
  1920. if not diff or diffNow < diff then
  1921. diff = diffNow
  1922. diffName = name
  1923. end
  1924. end
  1925. if name ~= self.Debuff2 then
  1926. local dX = (x - mainX)
  1927. local dY = (y - mainY)
  1928. local diffNow = sqrt(dX * dX + dY * dY)
  1929. if not diff2 or diffNow < diff2 then
  1930. diff2 = diffNow
  1931. diffName2 = name
  1932. end
  1933. end
  1934. end
  1935. end
  1936.  
  1937. if diffName and diff <= Margok.Range then
  1938. self.name:SetText("|c"..ExRT.F.classColor(select(2,UnitClass(diffName)))..diffName)
  1939. if diffName ~= Margok.lastRange then
  1940. --[[
  1941. if GetRaidTargetIndex(diffName) ~= 7 then
  1942. SetRaidTargetIcon(diffName, 7)
  1943. end
  1944. ]]
  1945. Margok.lastRange = diffName
  1946. end
  1947. else
  1948. self.name:SetText("")
  1949. Margok.lastRange = nil
  1950. end
  1951. if diffName2 and diff2 <= Margok.Range and diffName2 ~= diffName then
  1952. if diffName2 ~= Margok.lastRange2 then
  1953. --[[
  1954. if GetRaidTargetIndex(diffName2) ~= 3 then
  1955. SetRaidTargetIcon(diffName2, 3)
  1956. end
  1957. ]]
  1958. Margok.lastRange2 = diffName2
  1959. end
  1960. else
  1961. Margok.lastRange2 = nil
  1962. end
  1963. end
  1964. end
  1965. end
  1966. do
  1967. local resetRange = nil
  1968. local function ResetRange()
  1969. resetRange = nil
  1970. Margok.Range = 200
  1971. end
  1972. function Margok:OnEvent(_,_,event,_,_,_,_,_,destGUID,destName,_,_,spellID)
  1973. if spellID and Margok.spellIDs[spellID] then
  1974. if event == "SPELL_AURA_APPLIED" then
  1975. if not self.Debuff then
  1976. self.Debuff = destName
  1977. --[[
  1978. if GetRaidTargetIndex(destName) ~= 8 then
  1979. SetRaidTargetIcon(destName, 8)
  1980. end
  1981. ]]
  1982. --ExRT.F.CancelTimer(resetRange)
  1983. else
  1984. self.Debuff2 = destName
  1985. --[[
  1986. if GetRaidTargetIndex(destName) ~= 2 then
  1987. SetRaidTargetIcon(destName, 2)
  1988. end
  1989. ]]
  1990. end
  1991. elseif event == "SPELL_AURA_REMOVED" then
  1992. if self.Debuff2 and self.Debuff2 == destName then
  1993. self.Debuff2 = nil
  1994. if Margok.lastRange2 then
  1995. --SetRaidTargetIcon(Margok.lastRange2, 0)
  1996. Margok.lastRange2 = nil
  1997. end
  1998. else
  1999. self.Debuff = nil
  2000. if Margok.lastRange then
  2001. --SetRaidTargetIcon(Margok.lastRange, 0)
  2002. Margok.lastRange = nil
  2003. end
  2004. end
  2005. --[[
  2006. if spellID == 164005 then
  2007. Margok.Range = Margok.Range * 0.75
  2008. else
  2009. Margok.Range = Margok.Range * 0.5
  2010. end
  2011. resetRange = ExRT.F.ScheduleTimer(ResetRange, 1.5)
  2012. ]]
  2013. end
  2014. end
  2015. end
  2016. end
  2017. function Margok:OnRosterUpdate()
  2018. wipe(Margok.Roster)
  2019. local n = GetNumGroupMembers() or 0
  2020. if n > 0 then
  2021. local gMax = ExRT.F.GetRaidDiffMaxGroup()
  2022. for j=1,n do
  2023. local name, _,subgroup = GetRaidRosterInfo(j)
  2024. if name and subgroup <= gMax then
  2025. Margok.Roster[ name ] = true
  2026. end
  2027. end
  2028. end
  2029. end
  2030.  
  2031. function Margok:Load()
  2032. if Margok.mainframe then
  2033. return
  2034. end
  2035. Margok.mainframe = CreateFrame("Frame",nil,UIParent)
  2036. Margok.mainframe:SetSize(80,30)
  2037.  
  2038. if VExRT.Bossmods.MargokLeft and VExRT.Bossmods.MargokTop then
  2039. Margok.mainframe:SetPoint("TOPLEFT",UIParent,"BOTTOMLEFT",VExRT.Bossmods.MargokLeft,VExRT.Bossmods.MargokTop)
  2040. else
  2041. Margok.mainframe:SetPoint("TOP",UIParent, "TOP", 0, -50)
  2042. end
  2043. Margok.mainframe:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",edgeFile = ExRT.F.defBorder,tile = false,edgeSize = 8})
  2044. --Margok.mainframe:SetBackdrop({edgeFile = ExRT.F.defBorder,tile = false,edgeSize = 8})
  2045. Margok.mainframe:SetBackdropColor(0.05,0.05,0.05,0.85)
  2046. Margok.mainframe:SetBackdropBorderColor(0.2,0.2,0.2,0.4)
  2047. Margok.mainframe:EnableMouse(true)
  2048. Margok.mainframe:SetMovable(true)
  2049. Margok.mainframe:RegisterForDrag("LeftButton")
  2050. Margok.mainframe:SetScript("OnDragStart", function(self)
  2051. if self:IsMovable() then
  2052. self:StartMoving()
  2053. end
  2054. end)
  2055. Margok.mainframe:SetScript("OnDragStop", function(self)
  2056. self:StopMovingOrSizing()
  2057. VExRT.Bossmods.MargokLeft = self:GetLeft()
  2058. VExRT.Bossmods.MargokTop = self:GetTop()
  2059. end)
  2060. if VExRT.Bossmods.Alpha then Margok.mainframe:SetAlpha(VExRT.Bossmods.Alpha/100) end
  2061. if VExRT.Bossmods.Scale then Margok.mainframe:SetScale(VExRT.Bossmods.Scale/100) end
  2062.  
  2063. Margok.mainframe.name = ELib:Text(Margok.mainframe,UnitName("player"),nil):Size(75,30):Point("CENTER",0,0):Center():Color(1,1,1):Shadow()
  2064.  
  2065. Margok.mainframe:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  2066. Margok.mainframe:SetScript("OnUpdate", Margok.OnTimer)
  2067. Margok.mainframe:SetScript("OnEvent", Margok.OnEvent)
  2068.  
  2069. Margok.rosterFrame = CreateFrame("Frame")
  2070. Margok.rosterFrame:RegisterEvent("GROUP_ROSTER_UPDATE")
  2071. Margok.rosterFrame:SetScript("OnEvent", Margok.OnRosterUpdate)
  2072. Margok:OnRosterUpdate()
  2073. end
  2074.  
  2075. -----------------------------------------
  2076. -- Ko'ragh
  2077. -----------------------------------------
  2078.  
  2079. local Koragh = {}
  2080. module.A.Koragh = Koragh
  2081.  
  2082. function Koragh:OnEvent(_,_,event,_,_,_,_,_,destGUID,destName,_,_,spellID)
  2083. if event == "SPELL_AURA_APPLIED" and spellID == 172895 and Koragh.playerGUID == destGUID then
  2084. local x,y = GetPlayerMapPosition("player")
  2085. ExRT.F.Arrow:ShowRunTo(x,y,1,12,false,true)
  2086. end
  2087. end
  2088.  
  2089. function Koragh:Load()
  2090. if Koragh.mainframe then
  2091. return
  2092. end
  2093. Koragh.playerGUID = UnitGUID("player")
  2094.  
  2095. Koragh.mainframe = CreateFrame('Frame')
  2096. Koragh.mainframe:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  2097. Koragh.mainframe:SetScript("OnEvent", Koragh.OnEvent)
  2098. end
  2099.  
  2100. -----------------------------------------
  2101. -- Shadow-Lord Iskar
  2102. -----------------------------------------
  2103.  
  2104. local Iskar = {}
  2105. module.A.Iskar = Iskar
  2106.  
  2107. function Iskar:Load()
  2108. if Iskar.mainframe then
  2109. return
  2110. end
  2111. if InCombatLockdown() then
  2112. print("Combat error")
  2113. return
  2114. end
  2115. ExRT.Options.Frame:Hide()
  2116.  
  2117. local frame = CreateFrame('Frame',nil,UIParent)
  2118. Iskar.mainframe = frame
  2119. frame:SetSize(170,202)
  2120.  
  2121. if VExRT.Bossmods.IskarLeft and VExRT.Bossmods.IskarTop then
  2122. frame:SetPoint("TOPLEFT",UIParent,"BOTTOMLEFT",VExRT.Bossmods.IskarLeft,VExRT.Bossmods.IskarTop)
  2123. else
  2124. frame:SetPoint("TOP",UIParent, "TOP", 0, -50)
  2125. end
  2126. frame.back = frame:CreateTexture(nil, "BACKGROUND",nil,-7)
  2127. frame.back:SetAllPoints()
  2128. frame.back:SetTexture(0,0,0,.6)
  2129.  
  2130. frame:EnableMouse(true)
  2131. frame:SetMovable(true)
  2132. frame:RegisterForDrag("LeftButton")
  2133. frame:SetScript("OnDragStart", function(self)
  2134. if self:IsMovable() then
  2135. self:StartMoving()
  2136. end
  2137. end)
  2138. frame:SetScript("OnDragStop", function(self)
  2139. self:StopMovingOrSizing()
  2140. VExRT.Bossmods.IskarLeft = self:GetLeft()
  2141. VExRT.Bossmods.IskarTop = self:GetTop()
  2142. end)
  2143. if VExRT.Bossmods.Alpha then frame:SetAlpha(VExRT.Bossmods.Alpha/100) end
  2144. --if VExRT.Bossmods.Scale then frame:SetScale(VExRT.Bossmods.Scale/100) end
  2145.  
  2146. local RosterUpdate = nil
  2147. local IsFelBombActive = nil
  2148. local IsShadowRiposte = nil
  2149. local IsFelConduit = nil
  2150. local IsPhantasmalCorruption = nil
  2151.  
  2152. local debuffName_wind = GetSpellInfo(181957) or "unk" --Phantasmal Winds
  2153. local debuffName_radiance = GetSpellInfo(185239) or "unk" --Radiance of Anzu
  2154. local buffName_eyeOfAnzu = GetSpellInfo(179202) or "unk" --Eye Of Anzu
  2155. local debuffName_darkBindings = GetSpellInfo(185510) or "unk" --Dark Bindings
  2156. local castName_felConduit = GetSpellInfo(181827) or "unk" --Fel Conduit
  2157. local castName_felChainLightning = GetSpellInfo(181832) or "unk" --Fel Chain Lightning
  2158. local debuffName_corruption = GetSpellInfo(181824) or "unk" --Phantasmal Corruption
  2159.  
  2160. local function OnAuraEvent(self,_,unit)
  2161. local name = self.unitID
  2162. if not name or not UnitIsUnit(name,unit or "?") then
  2163. return
  2164. end
  2165. local isRadiance,_,_,radianceCount = UnitAura(name,debuffName_radiance,nil,"HARMFUL")
  2166. if isRadiance then
  2167. self.stacks:SetText(radianceCount or 1)
  2168. else
  2169. self.stacks:SetText("")
  2170. end
  2171. if IsShadowRiposte then
  2172. local eyeOfAnzu = UnitAura(name,buffName_eyeOfAnzu)
  2173. if eyeOfAnzu then
  2174. if self.state ~= 20 then
  2175. self.back:SetTexture(.5,.1,.5,.9)
  2176. self.state = 20
  2177. end
  2178. return
  2179. end
  2180. local isWindDebuff = UnitAura(name,debuffName_wind,nil,"HARMFUL")
  2181. if isWindDebuff then
  2182. if self.state ~= 30 then
  2183. self.back:SetTexture(1,1,.5,.9)
  2184. self.state = 30
  2185. end
  2186. return
  2187. end
  2188. if self.state ~= 10 then
  2189. self.back:SetTexture(.5,1,.5,.9)
  2190. self.state = 10
  2191. end
  2192. return
  2193. end
  2194. if IsFelBombActive then
  2195. local eyeOfAnzu = UnitAura(name,buffName_eyeOfAnzu)
  2196. if eyeOfAnzu then
  2197. if self.state ~= 20 then
  2198. self.back:SetTexture(.5,.1,.5,.9)
  2199. self.state = 20
  2200. end
  2201. return
  2202. end
  2203. if self.isHealer then
  2204. if self.state ~= 10 then
  2205. self.back:SetTexture(.5,1,.5,.9)
  2206. self.state = 10
  2207. end
  2208. else
  2209. if self.state ~= 0 then
  2210. self.back:SetTexture(0,0,0,.5)
  2211. self.state = 0
  2212. end
  2213. end
  2214. return
  2215. end
  2216. if IsFelConduit then
  2217. local eyeOfAnzu = UnitAura(name,buffName_eyeOfAnzu)
  2218. if eyeOfAnzu then
  2219. if self.state ~= 20 then
  2220. self.back:SetTexture(.5,.1,.5,.9)
  2221. self.state = 20
  2222. end
  2223. return
  2224. end
  2225. if not self.isHealer then
  2226. if self.state ~= 10 then
  2227. self.back:SetTexture(.5,1,.5,.9)
  2228. self.state = 10
  2229. end
  2230. else
  2231. if self.state ~= 0 then
  2232. self.back:SetTexture(0,0,0,.5)
  2233. self.state = 0
  2234. end
  2235. end
  2236. return
  2237. end
  2238. if IsPhantasmalCorruption then
  2239. local eyeOfAnzu = UnitAura(name,buffName_eyeOfAnzu)
  2240. if eyeOfAnzu then
  2241. if self.state ~= 20 then
  2242. self.back:SetTexture(.5,.1,.5,.9)
  2243. self.state = 20
  2244. end
  2245. return
  2246. end
  2247. local isCorrupted = false
  2248. for i=1,10 do
  2249. local _,_,_,_,_,_,_,_,_,_,spellID = UnitAura(name,i,"HARMFUL")
  2250. if spellID == 181824 then
  2251. isCorrupted = true
  2252. break
  2253. elseif not spellID then
  2254. break
  2255. end
  2256. end
  2257. if isCorrupted then
  2258. if self.state ~= 10 then
  2259. self.back:SetTexture(.5,1,.5,.9)
  2260. self.state = 10
  2261. end
  2262. else
  2263. if self.state ~= 0 then
  2264. self.back:SetTexture(0,0,0,.5)
  2265. self.state = 0
  2266. end
  2267. end
  2268. return
  2269. end
  2270. local isWindDebuff = UnitAura(name,debuffName_wind,nil,"HARMFUL")
  2271. if isWindDebuff then
  2272. if self.state ~= 10 then
  2273. self.back:SetTexture(.5,1,.5,.9)
  2274. self.state = 10
  2275. end
  2276. return
  2277. end
  2278. local eyeOfAnzu = UnitAura(name,buffName_eyeOfAnzu)
  2279. if eyeOfAnzu then
  2280. if self.state ~= 20 then
  2281. self.back:SetTexture(.5,.1,.5,.9)
  2282. self.state = 20
  2283. end
  2284. return
  2285. end
  2286. local darkBindings = UnitAura(name,debuffName_darkBindings,nil,"HARMFUL")
  2287. if darkBindings then
  2288. if self.state ~= 30 then
  2289. self.back:SetTexture(1,1,.5,.9)
  2290. self.state = 30
  2291. end
  2292. return
  2293. end
  2294. if self.state ~= 0 then
  2295. self.back:SetTexture(0,0,0,.5)
  2296. self.state = 0
  2297. end
  2298. end
  2299.  
  2300. local function OnEnterEvent(self)
  2301. if not self.unitID or not IsAltKeyDown() then
  2302. return
  2303. end
  2304. GameTooltip_SetDefaultAnchor(GameTooltip, self)
  2305. GameTooltip:SetUnit(self.unitID)
  2306. self.UpdateTooltip = OnEnterEvent
  2307. end
  2308. local function OnLeaveEvent(self)
  2309. self.UpdateTooltip = nil
  2310. GameTooltip_Hide()
  2311. end
  2312.  
  2313. local OnLoadMarkersData = {1,2,3,4,5,6,7,8}
  2314.  
  2315. local classNames = ExRT.GDB.ClassList
  2316. frame.units = {}
  2317. for i=1,6 do
  2318. for j=1,5 do
  2319. local unitFrame = CreateFrame('Button',nil,frame,"SecureActionButtonTemplate")
  2320. frame.units[(i-1)*5+j] = unitFrame
  2321. unitFrame:SetSize(30,30)
  2322. unitFrame:SetPoint("TOPLEFT",5+(j-1)*32,-5-(i-1)*32)
  2323.  
  2324. unitFrame.ID = (i-1)*5+j
  2325.  
  2326. unitFrame:RegisterForClicks("AnyDown")
  2327. unitFrame:SetAttribute("type", "macro")
  2328. --unitFrame:SetAttribute("macrotext", "/say test"..((i-1)*5+j))
  2329.  
  2330. unitFrame:SetScript("OnEvent",OnAuraEvent)
  2331. unitFrame:SetScript("OnEnter",OnEnterEvent)
  2332. unitFrame:SetScript("OnLeave",OnLeaveEvent)
  2333.  
  2334. local borderSize = 3
  2335.  
  2336. unitFrame.bt = unitFrame:CreateTexture(nil, "BACKGROUND")
  2337. unitFrame.bt:SetPoint("TOPLEFT",0,0)
  2338. unitFrame.bt:SetPoint("BOTTOMRIGHT",unitFrame,"TOPRIGHT",0,-borderSize)
  2339.  
  2340. unitFrame.bb = unitFrame:CreateTexture(nil, "BACKGROUND")
  2341. unitFrame.bb:SetPoint("BOTTOMLEFT",0,0)
  2342. unitFrame.bb:SetPoint("TOPRIGHT",unitFrame,"BOTTOMRIGHT",0,borderSize)
  2343.  
  2344. unitFrame.bl = unitFrame:CreateTexture(nil, "BACKGROUND")
  2345. unitFrame.bl:SetPoint("TOPLEFT",0,-borderSize)
  2346. unitFrame.bl:SetPoint("BOTTOMRIGHT",unitFrame,"BOTTOMLEFT",borderSize,borderSize)
  2347.  
  2348. unitFrame.br = unitFrame:CreateTexture(nil, "BACKGROUND")
  2349. unitFrame.br:SetPoint("TOPRIGHT",0,-borderSize)
  2350. unitFrame.br:SetPoint("BOTTOMLEFT",unitFrame,"BOTTOMRIGHT",-borderSize,borderSize)
  2351.  
  2352. local cR,cG,cB = ExRT.F.classColorNum(classNames[fastrandom(1,11)])
  2353. unitFrame.bt:SetTexture(cR,cG,cB,.3)
  2354. unitFrame.bl:SetTexture(cR,cG,cB,.3)
  2355. unitFrame.bb:SetTexture(cR,cG,cB,.3)
  2356. unitFrame.br:SetTexture(cR,cG,cB,.3)
  2357.  
  2358. unitFrame.back = unitFrame:CreateTexture(nil, "BACKGROUND")
  2359. unitFrame.back:SetPoint("TOPLEFT",borderSize,-borderSize)
  2360. unitFrame.back:SetPoint("BOTTOMRIGHT",-borderSize,borderSize)
  2361. unitFrame.back:SetTexture(0,0,0,.5)
  2362.  
  2363. unitFrame.marker = unitFrame:CreateTexture(nil, "ARTWORK")
  2364. unitFrame.marker:SetSize(12,12)
  2365. unitFrame.marker:SetPoint("CENTER",unitFrame,"TOP",0,-3)
  2366. if VExRT.Bossmods.IskarShowMarks and #OnLoadMarkersData > 0 and fastrandom(100) > 49 then
  2367. local m = fastrandom(1,#OnLoadMarkersData)
  2368. unitFrame.marker:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcon_"..OnLoadMarkersData[m])
  2369. tremove(OnLoadMarkersData,m)
  2370. end
  2371.  
  2372. unitFrame.name = ELib:Text(unitFrame,"Аф",10):Size(27,27):Point("CENTER",-1,-2):Center():Color(1,1,1)
  2373.  
  2374. unitFrame.stacks = ELib:Text(unitFrame,fastrandom(1,5),10):Size(27,27):Point("TOPRIGHT",-3,-3):Right():Top():Color(1,1,1)
  2375.  
  2376. if fastrandom(1,100) > 89 then
  2377. unitFrame.back:SetTexture(.5,1,.5,.9)
  2378. end
  2379.  
  2380. if fastrandom(1,100) > 69 then
  2381. unitFrame:SetAlpha(.2)
  2382. end
  2383. end
  2384. end
  2385. frame.units[fastrandom(1,30)].back:SetTexture(.5,.1,.5,.9)
  2386.  
  2387. local function Lock(self,isLoad)
  2388. local parent = self:GetParent()
  2389. local var = VExRT.Bossmods.IskarLock
  2390. if isLoad == 1 then
  2391. var = not var
  2392. end
  2393. if var then
  2394. VExRT.Bossmods.IskarLock = nil
  2395. self.texture:SetTexture("Interface\\AddOns\\ExRT\\media\\un_lock.tga")
  2396. parent:SetMovable(true)
  2397. parent:EnableMouse(true)
  2398. parent.back:SetTexture(0,0,0,.6)
  2399. else
  2400. VExRT.Bossmods.IskarLock = true
  2401. self.texture:SetTexture("Interface\\AddOns\\ExRT\\media\\lock.tga")
  2402. parent:SetMovable(false)
  2403. parent:EnableMouse(false)
  2404. parent.back:SetTexture(0,0,0,0)
  2405. end
  2406. end
  2407.  
  2408. frame.lock = ELib:Icon(frame,"Interface\\AddOns\\ExRT\\media\\un_lock.tga",14,true):Point(2,14):OnClick(Lock)
  2409.  
  2410. frame.optionsDropDown = CreateFrame("Frame", "ExRTBossmodsIskarOptionsDropDown", nil, "UIDropDownMenuTemplate")
  2411.  
  2412. frame.options = ELib:Icon(frame,[[Interface\AddOns\ExRT\media\DiesalGUIcons16x256x128.tga]],14,true):Point("TOPRIGHT",-2,14):OnClick(function()
  2413. if InCombatLockdown() then
  2414. print("Error: Disabled in combat")
  2415. return
  2416. end
  2417. EasyMenu({
  2418. {
  2419. text = L.BossmodsIskarDisableClassColor,
  2420. checked = VExRT.Bossmods.IskarDisableClassColors,
  2421. func = function()
  2422. VExRT.Bossmods.IskarDisableClassColors = not VExRT.Bossmods.IskarDisableClassColors
  2423. RosterUpdate()
  2424. end,
  2425. },
  2426. {
  2427. text = L.BossmodsIskarHideStacks,
  2428. checked = VExRT.Bossmods.IskarHideStacks,
  2429. func = function()
  2430. VExRT.Bossmods.IskarHideStacks = not VExRT.Bossmods.IskarHideStacks
  2431. RosterUpdate()
  2432. end,
  2433. },
  2434. {
  2435. text = L.BossmodsIskarDisableRed,
  2436. checked = VExRT.Bossmods.IskarDisableRedBackground,
  2437. func = function()
  2438. VExRT.Bossmods.IskarDisableRedBackground = not VExRT.Bossmods.IskarDisableRedBackground
  2439. end,
  2440. },
  2441. --[[
  2442. {
  2443. text = "Disable Fel Bomb & Fel Conduit helper",
  2444. checked = VExRT.Bossmods.IskarDisableFelBomb,
  2445. func = function()
  2446. VExRT.Bossmods.IskarDisableFelBomb = not VExRT.Bossmods.IskarDisableFelBomb
  2447. if VExRT.Bossmods.IskarDisableFelBomb then
  2448. frame:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
  2449. end
  2450. end,
  2451. },
  2452. ]]
  2453. {
  2454. text = L.BossmodsIskarShowNames,
  2455. checked = VExRT.Bossmods.IskarShowNames,
  2456. func = function()
  2457. VExRT.Bossmods.IskarShowNames = not VExRT.Bossmods.IskarShowNames
  2458. RosterUpdate()
  2459. end,
  2460. },
  2461. {
  2462. text = L.BossmodsArchimondeDisableMarking,
  2463. checked = not VExRT.Bossmods.IskarShowMarks,
  2464. func = function()
  2465. VExRT.Bossmods.IskarShowMarks = not VExRT.Bossmods.IskarShowMarks
  2466. RosterUpdate()
  2467. end,
  2468. },
  2469. {
  2470. text = L.bossmodsscale,
  2471. notCheckable = true,
  2472. func = function()
  2473. frame.scale:SetShown(not frame.scale:IsShown())
  2474. end,
  2475. },
  2476. {
  2477. text = L.bossmodsclose,
  2478. notCheckable = true,
  2479. func = function()
  2480. ExRT.F:ExBossmodsCloseAll()
  2481. CloseDropDownMenus()
  2482. end,
  2483. },
  2484. {
  2485. text = L.BossWatcherSelectFightClose,
  2486. notCheckable = true,
  2487. func = function()
  2488. CloseDropDownMenus()
  2489. end,
  2490. },
  2491. }, frame.optionsDropDown, "cursor", 10 , -15, "MENU")
  2492. end)
  2493. frame.options.texture:SetTexCoord(0.26,0.3025,0.51,0.615)
  2494.  
  2495. if VExRT.Bossmods.IskarScale and tonumber(VExRT.Bossmods.IskarScale) then
  2496. frame:SetScale(VExRT.Bossmods.IskarScale)
  2497. end
  2498. frame.scale = ELib:Slider(frame):_Size(70,8):Point("BOTTOMRIGHT",frame,"TOPRIGHT",-25,2):Range(50,200,true):SetTo((VExRT.Bossmods.IskarScale or 1)*100):Scale(1 / (VExRT.Bossmods.IskarScale or 1)):OnChange(function(self,event)
  2499. event = ExRT.F.Round(event)
  2500. VExRT.Bossmods.IskarScale = event / 100
  2501. ExRT.F.SetScaleFixTR(frame,VExRT.Bossmods.IskarScale)
  2502. self:SetScale(1 / VExRT.Bossmods.IskarScale)
  2503. self.tooltipText = event
  2504. self:tooltipReload(self)
  2505. end)
  2506. frame.scale:SetScript("OnMouseUp",function(self,button)
  2507. if button == "RightButton" then
  2508. self:SetValue(100)
  2509. end
  2510. end)
  2511. frame.scale:Hide()
  2512.  
  2513.  
  2514. local function sortRoster(a,b) return a[1]<b[1] end
  2515.  
  2516. function RosterUpdate()
  2517. if InCombatLockdown() then
  2518. C_Timer.NewTimer(5,RosterUpdate)
  2519. return
  2520. end
  2521.  
  2522. local n = GetNumGroupMembers()
  2523. if n == 0 then
  2524. local OnLoadMarkersData = {1,2,3,4,5,6,7,8}
  2525. for i=1,6 do
  2526. for j=1,5 do
  2527. local unitFrame = frame.units[(i-1)*5+j]
  2528.  
  2529. local cR,cG,cB = ExRT.F.classColorNum(classNames[fastrandom(1,11)])
  2530. if VExRT.Bossmods.IskarDisableClassColors then
  2531. cR,cG,cB = .1,.1,.1
  2532. end
  2533. unitFrame.bt:SetTexture(cR,cG,cB,.3)
  2534. unitFrame.bl:SetTexture(cR,cG,cB,.3)
  2535. unitFrame.bb:SetTexture(cR,cG,cB,.3)
  2536. unitFrame.br:SetTexture(cR,cG,cB,.3)
  2537.  
  2538. local stacks = fastrandom(0,5)
  2539. unitFrame.stacks:SetText(stacks ~= 0 and stacks or "")
  2540.  
  2541. unitFrame.back:SetTexture(0,0,0,.5)
  2542. if fastrandom(1,100) > 89 then
  2543. unitFrame.back:SetTexture(.5,1,.5,.9)
  2544. end
  2545.  
  2546. if fastrandom(1,100) > 69 then
  2547. unitFrame:SetAlpha(.2)
  2548. else
  2549. unitFrame:SetAlpha(1)
  2550. end
  2551.  
  2552. if VExRT.Bossmods.IskarHideStacks then
  2553. unitFrame.stacks:Hide()
  2554. else
  2555. unitFrame.stacks:Show()
  2556. end
  2557.  
  2558. if VExRT.Bossmods.IskarShowNames then
  2559. unitFrame.name:SetText(ExRT.F:utf8sub(UnitName'player', 1, 2))
  2560. else
  2561. unitFrame.name:SetText("")
  2562. end
  2563.  
  2564. if VExRT.Bossmods.IskarShowMarks then
  2565. if #OnLoadMarkersData > 0 and fastrandom(100) > 49 then
  2566. local m = fastrandom(1,#OnLoadMarkersData)
  2567. unitFrame.marker:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcon_"..OnLoadMarkersData[m])
  2568. tremove(OnLoadMarkersData,m)
  2569. end
  2570. else
  2571. unitFrame.marker:SetTexture("")
  2572. end
  2573.  
  2574. unitFrame.unitID = nil
  2575. unitFrame:UnregisterAllEvents()
  2576. end
  2577. end
  2578. frame.units[fastrandom(1,30)].back:SetTexture(.5,.1,.5,.9)
  2579. return
  2580. end
  2581. local gMax = ExRT.F.GetRaidDiffMaxGroup()
  2582. local roster = {}
  2583. for i=1,n do
  2584. local name,_,subgroup,_,_,class,_,_,_,_,_,role = GetRaidRosterInfo(i)
  2585. if name and subgroup <= gMax then
  2586. roster[subgroup] = roster[subgroup] or {}
  2587. roster[subgroup][ #roster[subgroup] + 1 ] = {name,class,role,'raid'..i}
  2588. end
  2589. end
  2590. for i=1,gMax do
  2591. roster[i] = roster[i] or {}
  2592. sort(roster[i],sortRoster)
  2593.  
  2594. for j=1,5 do
  2595. local name = roster[i][j]
  2596. local unitFrame = frame.units[(i-1)*5+j]
  2597. if unitFrame then
  2598. if name then
  2599. unitFrame.unitID = name[1]
  2600. unitFrame:UnregisterAllEvents()
  2601. --unitFrame:RegisterUnitEvent("UNIT_AURA",name[4])
  2602. local cR,cG,cB = ExRT.F.classColorNum(name[2])
  2603. if VExRT.Bossmods.IskarDisableClassColors then
  2604. cR,cG,cB = .1,.1,.1
  2605. end
  2606. unitFrame.bt:SetTexture(cR,cG,cB,.3)
  2607. unitFrame.bl:SetTexture(cR,cG,cB,.3)
  2608. unitFrame.bb:SetTexture(cR,cG,cB,.3)
  2609. unitFrame.br:SetTexture(cR,cG,cB,.3)
  2610. OnAuraEvent(unitFrame,nil,name[1])
  2611. unitFrame:SetAttribute("macrotext", "/target "..ExRT.F.delUnitNameServer(name[1]).."\n/click ExtraActionButton1\n/targetlasttarget")
  2612. --unitFrame:SetAttribute("macrotext", "/target "..ExRT.F.delUnitNameServer(name[1]).."\n/cast [@target] Восстановление\n/targetlasttarget")
  2613.  
  2614. if VExRT.Bossmods.IskarHideStacks then
  2615. unitFrame.stacks:Hide()
  2616. else
  2617. unitFrame.stacks:Show()
  2618. end
  2619.  
  2620. if VExRT.Bossmods.IskarShowNames then
  2621. unitFrame.name:SetText(ExRT.F:utf8sub(name[1], 1, 2))
  2622. else
  2623. unitFrame.name:SetText("")
  2624. end
  2625.  
  2626. unitFrame.isHealer = name[3] == "HEALER"
  2627.  
  2628. local inRange, checkedRange = UnitInRange(name[1])
  2629. if inRange or not checkedRange then
  2630. unitFrame:SetAlpha(1)
  2631. else
  2632. unitFrame:SetAlpha(.2)
  2633. end
  2634.  
  2635. if VExRT.Bossmods.IskarShowMarks then
  2636. local mark = GetRaidTargetIndex(name[1])
  2637. if mark then
  2638. unitFrame.marker:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcon_"..mark)
  2639. else
  2640. unitFrame.marker:SetTexture("")
  2641. end
  2642. else
  2643. unitFrame.marker:SetTexture("")
  2644. end
  2645.  
  2646. unitFrame:Show()
  2647. else
  2648. unitFrame.unitID = nil
  2649. unitFrame:UnregisterAllEvents()
  2650. unitFrame:Hide()
  2651. end
  2652. end
  2653. end
  2654. end
  2655. for i=(gMax+1),6 do
  2656. for j=1,5 do
  2657. local unitFrame = frame.units[(i-1)*5+j]
  2658. if unitFrame then
  2659. unitFrame.unitID = nil
  2660. unitFrame:UnregisterAllEvents()
  2661. unitFrame:Hide()
  2662. end
  2663. end
  2664. end
  2665. end
  2666.  
  2667. Lock(frame.lock,1)
  2668.  
  2669. local function UpdateFrames()
  2670. for i=1,30 do
  2671. local unitFrame = frame.units[i]
  2672. if unitFrame.unitID then
  2673. OnAuraEvent(unitFrame,nil,unitFrame.unitID)
  2674. end
  2675. end
  2676. end
  2677.  
  2678. local AutoRemoveFelBombTimer = nil
  2679. local function AutoRemoveFelBomb()
  2680. AutoRemoveFelBombTimer = nil
  2681. IsFelBombActive = nil
  2682. UpdateFrames()
  2683. end
  2684. local function AutoRemoveShadowRiposte()
  2685. IsShadowRiposte = nil
  2686. UpdateFrames()
  2687. end
  2688.  
  2689. local IsFelBombCasting = nil
  2690. local function IsFelBombCasting_Reset() IsFelBombCasting = nil end
  2691.  
  2692. local updateSch = nil
  2693.  
  2694. frame:SetScript("OnEvent",function(self,event,...)
  2695. if event == "COMBAT_LOG_EVENT_UNFILTERED" then
  2696. local _,cleu_event,_,_,_,_,_,destGUID,_,_,_,spellID = ...
  2697. if cleu_event == "SPELL_CAST_START" then
  2698. if spellID == 179218 then --Fel Bomb
  2699. IsFelBombActive = true
  2700. UpdateFrames()
  2701. if AutoRemoveFelBombTimer then
  2702. AutoRemoveFelBombTimer:Cancel()
  2703. end
  2704. AutoRemoveFelBombTimer = C_Timer.NewTimer(3.5, AutoRemoveFelBomb)
  2705. IsFelBombCasting = C_Timer.NewTimer(3, IsFelBombCasting_Reset)
  2706. elseif spellID == 185345 then --Shadow Riposte
  2707. local _,_,diff = GetInstanceInfo()
  2708. if diff == 16 then
  2709. IsShadowRiposte = true
  2710. UpdateFrames()
  2711. C_Timer.NewTimer(2, AutoRemoveShadowRiposte)
  2712. end
  2713.  
  2714. end
  2715. elseif cleu_event == "SPELL_CAST_SUCCESS" then
  2716. if spellID == 179218 then --Fel Bomb
  2717. if AutoRemoveFelBombTimer then
  2718. AutoRemoveFelBombTimer:Cancel()
  2719. end
  2720. IsFelBombActive = true
  2721. UpdateFrames()
  2722. AutoRemoveFelBombTimer = C_Timer.NewTimer(6, AutoRemoveFelBomb)
  2723. IsFelBombCasting = nil
  2724. end
  2725. elseif cleu_event == "SPELL_AURA_APPLIED" then
  2726. if spellID == 181753 then
  2727. IsFelBombActive = true
  2728. UpdateFrames()
  2729. if AutoRemoveFelBombTimer then
  2730. AutoRemoveFelBombTimer:Cancel()
  2731. end
  2732. AutoRemoveFelBombTimer = C_Timer.NewTimer(6, AutoRemoveFelBomb)
  2733. elseif spellID == 181824 then
  2734. IsPhantasmalCorruption = true
  2735. UpdateFrames()
  2736. elseif spellID == 185239 or spellID == 181957 or spellID == 181824 or spellID == 185510 or spellID == 179219 or spellID == 181753 or spellID == 179202 then --NEW
  2737. if not updateSch then
  2738. updateSch = C_Timer.NewTimer(0.05,function()
  2739. updateSch = nil
  2740. UpdateFrames()
  2741. end)
  2742. end
  2743. end
  2744. elseif cleu_event == "SPELL_AURA_REMOVED" then
  2745. if spellID == 181753 then
  2746. IsFelBombActive = nil
  2747. UpdateFrames()
  2748. if AutoRemoveFelBombTimer then
  2749. AutoRemoveFelBombTimer:Cancel()
  2750. AutoRemoveFelBombTimer = nil
  2751. end
  2752. elseif spellID == 181824 then
  2753. IsPhantasmalCorruption = nil
  2754. UpdateFrames()
  2755. elseif spellID == 185239 or spellID == 181957 or spellID == 181824 or spellID == 185510 or spellID == 179219 or spellID == 181753 or spellID == 179202 then --NEW
  2756. if not updateSch then
  2757. updateSch = C_Timer.NewTimer(0.05,function()
  2758. updateSch = nil
  2759. UpdateFrames()
  2760. end)
  2761. end
  2762. end
  2763. elseif cleu_event == "SPELL_AURA_APPLIED_DOSE" then
  2764. if spellID == 185239 then --NEW
  2765. UpdateFrames()
  2766. end
  2767. elseif cleu_event == "SPELL_AURA_REMOVED_DOSE" then
  2768. if spellID == 185239 then --NEW
  2769. UpdateFrames()
  2770. end
  2771. elseif cleu_event == "UNIT_DIED" then
  2772. if GetMobID(destGUID) == 93985 and IsFelBombCasting then
  2773. IsFelBombActive = nil
  2774. UpdateFrames()
  2775. if AutoRemoveFelBombTimer then
  2776. AutoRemoveFelBombTimer:Cancel()
  2777. AutoRemoveFelBombTimer = nil
  2778. end
  2779. end
  2780. end
  2781. elseif event == "RAID_TARGET_UPDATE" then
  2782. if not VExRT.Bossmods.IskarShowMarks then
  2783. return
  2784. end
  2785. for i=1,6 do
  2786. for j=1,5 do
  2787. local unitFrame = frame.units[(i-1)*5+j]
  2788. if unitFrame then
  2789. local unit = unitFrame.unitID
  2790. if unit then
  2791. local mark = GetRaidTargetIndex(unit)
  2792. if mark then
  2793. unitFrame.marker:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcon_"..mark)
  2794. else
  2795. unitFrame.marker:SetTexture("")
  2796. end
  2797. end
  2798. end
  2799. end
  2800. end
  2801. elseif event == "GROUP_ROSTER_UPDATE" then
  2802. RosterUpdate()
  2803. elseif event == "ENCOUNTER_START" or event == "ENCOUNTER_END" then
  2804. IsFelBombActive = nil
  2805. IsShadowRiposte = nil
  2806. IsPhantasmalCorruption = nil
  2807. UpdateFrames()
  2808. end
  2809. end)
  2810. frame:RegisterEvent('GROUP_ROSTER_UPDATE')
  2811. if not VExRT.Bossmods.IskarDisableFelBomb then
  2812. frame:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
  2813. end
  2814. frame:RegisterEvent('ENCOUNTER_START')
  2815. frame:RegisterEvent('ENCOUNTER_END')
  2816. frame:RegisterEvent('RAID_TARGET_UPDATE')
  2817.  
  2818. local bossFrames = {"boss1","boss2","boss3","boss4","boss5"}
  2819. local frame_tmr = 0
  2820. local exbf_shown = false
  2821. frame:SetScript("OnUpdate",function(self,elapsed)
  2822. frame_tmr = frame_tmr + elapsed
  2823. if frame_tmr > 0.1 then
  2824. frame_tmr = 0
  2825. --DraenorZoneAbilityFrame ExtraActionBarFrame
  2826. local eyeOfAnzu = UnitAura("player",buffName_eyeOfAnzu)
  2827. if eyeOfAnzu and not exbf_shown then
  2828. exbf_shown = true
  2829. if not VExRT.Bossmods.IskarDisableRedBackground then
  2830. self.back:SetTexture(1,.1,.1,.4)
  2831. end
  2832. elseif not eyeOfAnzu and exbf_shown then
  2833. exbf_shown = false
  2834. if VExRT.Bossmods.IskarLock then
  2835. self.back:SetTexture(0,0,0,0)
  2836. else
  2837. self.back:SetTexture(0,0,0,.6)
  2838. end
  2839. end
  2840.  
  2841. for i=1,30 do
  2842. local unitFrame = self.units[i]
  2843. if unitFrame.unitID then
  2844. local alpha = 1
  2845. local inRange, checkedRange = UnitInRange(unitFrame.unitID)
  2846. if not (inRange or not checkedRange) then
  2847. alpha = 0.2
  2848. end
  2849. local isDead = UnitIsDeadOrGhost(unitFrame.unitID)
  2850. if isDead then
  2851. alpha = 0.2
  2852. end
  2853. unitFrame:SetAlpha(alpha)
  2854. end
  2855. end
  2856.  
  2857. local lastFelConduit = IsFelConduit
  2858. IsFelConduit = nil
  2859. for i=1,5 do
  2860. local unit = bossFrames[i]
  2861.  
  2862. local name = UnitCastingInfo(unit)
  2863. if name == castName_felConduit then
  2864. IsFelConduit = true
  2865. break
  2866. elseif not name then
  2867. name = UnitChannelInfo(unit)
  2868. if name == castName_felChainLightning then
  2869. IsFelConduit = true
  2870. break
  2871. end
  2872. end
  2873. end
  2874. if IsFelConduit ~= lastFelConduit then
  2875. UpdateFrames()
  2876. end
  2877. end
  2878. end)
  2879.  
  2880. RosterUpdate()
  2881.  
  2882. frame.Close = function(self)
  2883. for i=1,#self.units do
  2884. self.units[i].unitID = nil
  2885. self.units[i]:UnregisterAllEvents()
  2886. end
  2887. end
  2888.  
  2889. return true
  2890. end
  2891.  
  2892. function Iskar:AutoLoad()
  2893. if Iskar.IsAutoloadedThisSession then
  2894. return
  2895. end
  2896. Iskar.IsAutoloadedThisSession = Iskar:Load()
  2897. end
  2898.  
  2899. -----------------------------------------
  2900. -- Kormrok
  2901. -----------------------------------------
  2902. local Kormrok = {}
  2903. module.A.Kormrok = Kormrok
  2904.  
  2905. Kormrok.runes = {
  2906. {-388.10,4209.00}, --1
  2907. {-354.50,4208.60}, --2
  2908. {-339.80,4210.80}, --3
  2909. {-321.50,4210.20}, --4
  2910. {-396.90,4227.70}, --5
  2911. {-380.00,4223.90}, --6
  2912. {-365.50,4224.90}, --7
  2913. {-345.40,4223.80}, --8
  2914. {-331.50,4220.00}, --9
  2915. {-388.60,4241.30}, --10
  2916. {-367.80,4241.80}, --11
  2917. {-354.90,4238.60}, --12
  2918. {-338.40,4243.40}, --13
  2919. {-321.70,4243.10}, --14
  2920. {-394.80,4258.40}, --15
  2921. {-384.40,4253.80}, --16
  2922. {-363.00,4258.30}, --17
  2923. {-347.70,4253.60}, --18
  2924. {-328.10,4252.60}, --19
  2925. {-308.90,4253.00}, --20
  2926. {-389.80,4269.90}, --21
  2927. {-372.70,4271.60}, --22
  2928. {-356.70,4270.40}, --23
  2929. {-336.10,4270.40}, --24
  2930. {-318.90,4271.40}, --25
  2931. {-302.50,4271.00}, --26
  2932. {-362.50,4283.60}, --27
  2933. {-345.30,4283.00}, --28
  2934. {-329.70,4287.20}, --29
  2935. {-355.60,4301.30}, --30
  2936. {-336.30,4299.70}, --31
  2937. {-320.60,4303.30}, --32
  2938. {-304.10,4301.50}, --33
  2939. {-300.10,4240.10}, --34
  2940. {-294.10,4255.20}, --35
  2941. {-311.10,4281.70}, --36
  2942. {-295.40,4285.90}, --37
  2943. {-284.20,4270.00}, --38
  2944. {-343.30,4316.10}, --39
  2945. {-328.00,4318.30}, --40
  2946. {-310.80,4318.40}, --41
  2947. {-294.40,4316.50}, --42
  2948. {-273.20,4315.90}, --43
  2949. {-259.50,4317.70}, --44
  2950. {-241.50,4315.60}, --45
  2951. {-332.80,4329.70}, --46
  2952. {-318.50,4332.70}, --47
  2953. {-301.50,4333.20}, --48
  2954. {-286.20,4329.10}, --49
  2955. {-268.70,4329.80}, --50
  2956. {-313.60,4344.40}, --51
  2957. {-292.10,4344.00}, --52
  2958. {-360.50,4318.30}, --53
  2959. {-354.60,4329.70}, --54
  2960. {-326.80,4343.50}, --55
  2961. {-274.10,4345.40}, --56
  2962. {-248.40,4329.20}, --57
  2963. {-235.10,4332.30}, --58
  2964. {-285.10,4299.00}, --59
  2965. {-265.20,4299.00}, --60
  2966. {-249.50,4303.40}, --61
  2967. {-230.90,4297.20}, --62
  2968. {-275.00,4288.40}, --63
  2969. {-259.00,4283.00}, --64
  2970. {-240.50,4284.10}, --65
  2971. {-222.50,4286.70}, --66
  2972. {-269.60,4272.00}, --67
  2973. {-249.50,4269.60}, --68
  2974. {-231.50,4267.30}, --69
  2975. {-257.30,4253.20}, --70
  2976. {-240.20,4253.80}, --71
  2977. {-278.90,4255.20}, --72
  2978. }
  2979. Kormrok.map = {-217.50,4359.10,-415.90,4203.40} --xT,yT,xB,yB
  2980. Kormrok.image = {0,0,1,1} -- KormrokMap.tga 512Ñ…401
  2981. Kormrok.width = 1024
  2982. Kormrok.image_avg = 401 / 512
  2983.  
  2984. Kormrok.hidePlayers = true
  2985. function Kormrok:UpdateSelectRoster(phase)
  2986. local setup = {}
  2987. local fI = (phase - 1) * 100
  2988. for i=fI+1,fI+100 do
  2989. local name = VExRT.Bossmods.Kormrok[i]
  2990. if name then
  2991. setup[name] = true
  2992. end
  2993. end
  2994. local raidData = {{},{},{},{}}
  2995. for i=1,40 do
  2996. local name,_,subgroup,_,_,class = GetRaidRosterInfo(i)
  2997. if name and subgroup <= 4 then
  2998. raidData[subgroup][ #raidData[subgroup]+1 ] = {name,class}
  2999. end
  3000. end
  3001. for i=1,4 do
  3002. for j=1,5 do
  3003. local pos = (i-1)*5+j
  3004. local data = raidData[i][j]
  3005. if Kormrok.raidRoster.buttons[pos] and data then
  3006. Kormrok.raidRoster.buttons[pos]._name = data[1]
  3007. if Kormrok.hidePlayers then
  3008. if setup[ data[1] ] then
  3009. Kormrok.raidRoster.buttons[pos]:SetAlpha(.2)
  3010. else
  3011. Kormrok.raidRoster.buttons[pos]:SetAlpha(1)
  3012. end
  3013. else
  3014. Kormrok.raidRoster.buttons[pos]:SetAlpha(1)
  3015. end
  3016. Kormrok.raidRoster.buttons[pos].name:SetText("|c"..ExRT.F.classColor(data[2])..data[1])
  3017. Kormrok.raidRoster.buttons[pos]:Show()
  3018. elseif Kormrok.raidRoster.buttons[pos] then
  3019. Kormrok.raidRoster.buttons[pos]:Hide()
  3020. end
  3021. end
  3022. end
  3023. end
  3024.  
  3025. function Kormrok:ReRoster(phase)
  3026. local playerName = UnitName('player')
  3027. phase = ((phase or 1) - 1) * 100
  3028. for i=1,#Kormrok.runes do
  3029. local name = VExRT.Bossmods.Kormrok[phase + i]
  3030. if name then
  3031. local shortName = ExRT.F.delUnitNameServer(name)
  3032. local class = select(2,UnitClass(shortName))
  3033. local desaturated = false
  3034. if class then
  3035. class = "|c"..ExRT.F.classColor(class)
  3036. else
  3037. class = ""
  3038. desaturated = true
  3039. end
  3040. if not desaturated and ExRT.F.GetPlayerParty(name) > 4 then
  3041. desaturated = true
  3042. end
  3043. if shortName == playerName then
  3044. Kormrok.setupFrame.pings[i].icon:SetVertexColor(1,0.3,0.3,1)
  3045. else
  3046. --Kormrok.setupFrame.pings[i].icon:SetVertexColor(1,1,1,1)
  3047. Kormrok.setupFrame.pings[i].icon:SetVertexColor(.4,.2,1,1)
  3048. end
  3049. Kormrok.setupFrame.pings[i].name:SetText(class..name)
  3050. Kormrok.setupFrame.pings[i].icon:SetDesaturated(desaturated)
  3051. if desaturated then
  3052. Kormrok.setupFrame.pings[i].icon:SetVertexColor(1,1,1,.7)
  3053. end
  3054. else
  3055. Kormrok.setupFrame.pings[i].name:SetText("")
  3056. Kormrok.setupFrame.pings[i].icon:SetVertexColor(.3,1,.3,1)
  3057. Kormrok.setupFrame.pings[i].icon:SetDesaturated(false)
  3058. end
  3059. end
  3060. end
  3061.  
  3062. function Kormrok:Load()
  3063. if Kormrok.setupFrame then
  3064. --Kormrok:ReRoster(1)
  3065. Kormrok.setupFrame.phaseOrange:Click()
  3066. Kormrok.setupFrame:Show()
  3067. Kormrok:RegisterEvents()
  3068. if InterfaceOptionsFrame:IsShown() then
  3069. InterfaceOptionsFrame:Hide()
  3070. end
  3071. if ExRT.Options.Frame:IsShown() then
  3072. ExRT.Options.Frame:Hide()
  3073. end
  3074. Kormrok.setupFrame.isEnabled = true
  3075. return
  3076. end
  3077. Kormrok.setupFrame = ELib:Popup("Kormrok"):Size(Kormrok.width,Kormrok.image_avg * Kormrok.width)
  3078. Kormrok.setupFrame.map = Kormrok.setupFrame:CreateTexture(nil,"BACKGROUND",nil,1)
  3079. Kormrok.setupFrame.map:SetTexture("Interface\\AddOns\\ExRT\\media\\KormrokMap.tga")
  3080. Kormrok.setupFrame.map:SetPoint("TOP",Kormrok.setupFrame,"TOP",0,0)
  3081. Kormrok.setupFrame.map:SetSize(Kormrok.width,Kormrok.image_avg * Kormrok.width)
  3082. Kormrok.setupFrame.map:SetTexCoord(0,1,0,401 / 512)
  3083. Kormrok.setupFrame:SetFrameStrata("HIGH")
  3084. Kormrok.setupFrame:SetClampedToScreen(false)
  3085.  
  3086. if VExRT.Bossmods.KormrokScale and tonumber(VExRT.Bossmods.KormrokScale) then
  3087. Kormrok.setupFrame:SetScale(VExRT.Bossmods.KormrokScale)
  3088. end
  3089.  
  3090. Kormrok.setupFrame.isEnabled = true
  3091. local phaseNow = 1
  3092. function Kormrok:GetCurrentPhase()
  3093. return phaseNow
  3094. end
  3095.  
  3096. local function DisableSync()
  3097. VExRT.Bossmods.Kormrok.sync = nil
  3098. if VExRT.Bossmods.Kormrok.name and VExRT.Bossmods.Kormrok.time then
  3099. Kormrok.setupFrame.lastUpdate:SetText(L.BossmodsKromogLastUpdate..": "..VExRT.Bossmods.Kormrok.name.." ("..date("%H:%M:%S %d.%m.%Y",VExRT.Bossmods.Kormrok.time)..")"..(not VExRT.Bossmods.Kormrok.sync and " *" or ""))
  3100. else
  3101. Kormrok.setupFrame.lastUpdate:SetText("")
  3102. end
  3103. end
  3104.  
  3105. local function KormrokFrameOnEvent(self,event,msg,spell,_,lineID,spellID)
  3106. if event == "RAID_BOSS_EMOTE" then
  3107. local fI,tI = nil
  3108. if msg:find("spell:181293") and msg:find("INV_Bijou_Purple") then
  3109. fI,tI = 201,300
  3110. elseif msg:find("spell:181297") and msg:find("INV_Bijou_Orange") then
  3111. fI,tI = 1,100
  3112. elseif msg:find("spell:181300") and msg:find("INV_Bijou_Green") then
  3113. fI,tI = 101,200
  3114. end
  3115. if fI and tI then
  3116. local playerName = UnitName('player')
  3117. for i=fI,tI do
  3118. local name = VExRT.Bossmods.Kormrok[i]
  3119. if name and ExRT.F.delUnitNameServer(name) == playerName then
  3120. local pos = i % 100
  3121. ExRT.F.Arrow:ShowRunTo(Kormrok.runes[pos][1],Kormrok.runes[pos][2],2,6,true,true)
  3122. return
  3123. end
  3124. end
  3125. end
  3126. elseif event == "GROUP_ROSTER_UPDATE" then
  3127. if Kormrok.setupFrame:IsShown() then
  3128. Kormrok:ReRoster(phaseNow)
  3129. end
  3130. end
  3131. end
  3132.  
  3133. Kormrok.setupFrame.scale = ELib:Slider(Kormrok.setupFrame):_Size(70,8):Point("TOPRIGHT",-30,-5):Range(50,100,true):SetTo((VExRT.Bossmods.KormrokScale or 1)*100):Scale(1 / (VExRT.Bossmods.KormrokScale or 1)):OnChange(function(self,event)
  3134. event = ExRT.F.Round(event)
  3135. VExRT.Bossmods.KormrokScale = event / 100
  3136. ExRT.F.SetScaleFixTR(Kormrok.setupFrame,VExRT.Bossmods.KormrokScale)
  3137. self:SetScale(1 / VExRT.Bossmods.KormrokScale)
  3138. self.tooltipText = event
  3139. self:tooltipReload(self)
  3140. end)
  3141.  
  3142. Kormrok.setupFrame.pings = {}
  3143. local function SetupFramePingsOnEnter(self)
  3144. self.colors = {self.icon:GetVertexColor()}
  3145. self.icon:SetVertexColor(1,.3,1,1)
  3146. end
  3147. local function SetupFramePingsOnLeave(self)
  3148. self.icon:SetVertexColor(unpack(self.colors))
  3149. end
  3150. local function SetupFramePingsOnClick(self,button)
  3151. if button == "RightButton" then
  3152. self.colors = {.3,1,.3,1}
  3153. VExRT.Bossmods.Kormrok[ (phaseNow-1)*100 + self._i] = nil
  3154. Kormrok:ReRoster(phaseNow)
  3155.  
  3156. DisableSync()
  3157. return
  3158. end
  3159. Kormrok.raidRoster.pos = self._i
  3160. Kormrok.raidRoster.title:SetText(L.BossmodsKromogSelectPlayer..self._i)
  3161. Kormrok.raidRoster:Show()
  3162. end
  3163. for i=1,#Kormrok.runes do
  3164. local x = (abs(Kormrok.runes[i][1]-Kormrok.map[1])) / (abs(Kormrok.map[3] - Kormrok.map[1]))
  3165. local y = (abs(Kormrok.runes[i][2]-Kormrok.map[2])) / (abs(Kormrok.map[4] - Kormrok.map[2]))
  3166. local currPing = CreateFrame('Button',nil,Kormrok.setupFrame)
  3167. Kormrok.setupFrame.pings[i] = currPing
  3168. currPing:SetSize(32,32)
  3169. currPing.icon = currPing:CreateTexture(nil,"ARTWORK")
  3170. currPing.icon:SetAllPoints()
  3171. currPing.icon:SetTexture("Interface\\AddOns\\ExRT\\media\\KormrokRune.tga")
  3172. currPing.num = ELib:Text(currPing,i,12):Size(30,15):Point(0,0):Top():Color():Outline()
  3173. currPing.name = ELib:Text(currPing,"Player"..i,11):Size(75,15):Point(0,-12):Top():Color():Outline()
  3174.  
  3175. currPing:SetScript("OnEnter",SetupFramePingsOnEnter)
  3176. currPing:SetScript("OnLeave",SetupFramePingsOnLeave)
  3177. currPing:RegisterForClicks("RightButtonDown","LeftButtonDown")
  3178. currPing._i = i
  3179. currPing:SetScript("OnClick",SetupFramePingsOnClick)
  3180.  
  3181. if x >= Kormrok.image[1] and x <= Kormrok.image[3] and y >= Kormrok.image[2] and y <= Kormrok.image[4] then
  3182. currPing:SetPoint("CENTER",Kormrok.setupFrame.map,"TOPLEFT", (x - Kormrok.image[1])/(Kormrok.image[3]-Kormrok.image[1])*Kormrok.width,-(y - Kormrok.image[2])/(Kormrok.image[4]-Kormrok.image[2])*(Kormrok.image_avg * Kormrok.width))
  3183. end
  3184. end
  3185.  
  3186. local function KormrokClearConfirm()
  3187. for i=1,300 do
  3188. VExRT.Bossmods.Kormrok[i] = nil
  3189. end
  3190. Kormrok:ReRoster(phaseNow)
  3191.  
  3192. DisableSync()
  3193. end
  3194.  
  3195. Kormrok.setupFrame.clearButton = ELib:Button(Kormrok.setupFrame,L.BossmodsKromogClear):Size(120,20):Point("BOTTOMLEFT",7,22):OnClick(function (self)
  3196. StaticPopupDialogs["EXRT_BOSSMODS_KORMROK_CLEAR"] = {
  3197. text = L.BossmodsKromogClear,
  3198. button1 = YES,
  3199. button2 = NO,
  3200. OnAccept = KormrokClearConfirm,
  3201. timeout = 0,
  3202. whileDead = true,
  3203. hideOnEscape = true,
  3204. preferredIndex = 3,
  3205. }
  3206. StaticPopup_Show("EXRT_BOSSMODS_KORMROK_CLEAR")
  3207. end)
  3208.  
  3209. Kormrok.setupFrame.testButton = ELib:Button(Kormrok.setupFrame,L.BossmodsKromogTest):Size(120,20):Point("BOTTOMRIGHT",Kormrok.setupFrame.clearButton,"TOPRIGHT",0,2):OnClick(function (self)
  3210. KormrokFrameOnEvent(Kormrok.setupFrame,"RAID_BOSS_EMOTE",
  3211. phaseNow == 1 and "INV_Bijou_Orange spell:181297" or
  3212. phaseNow == 1 and "INV_Bijou_Green spell:181300" or
  3213. "INV_Bijou_Purple spell:181293"
  3214. )
  3215. Kormrok.setupFrame:Hide()
  3216. C_Timer.NewTimer(6,function() Kormrok.setupFrame:Show() end)
  3217. end)
  3218.  
  3219. VExRT.Bossmods.KormrokSetups = VExRT.Bossmods.KormrokSetups or {}
  3220. local function SetupsDropDown_Load(_,arg)
  3221. for i=1,300 do
  3222. VExRT.Bossmods.Kormrok[i] = VExRT.Bossmods.KormrokSetups[arg][i]
  3223. end
  3224. Kormrok:ReRoster(phaseNow)
  3225. DisableSync()
  3226. CloseDropDownMenus()
  3227. end
  3228. local function SetupsDropDown_Clear(_,arg)
  3229. for i=1,300 do
  3230. VExRT.Bossmods.KormrokSetups[arg][i] = nil
  3231. end
  3232. VExRT.Bossmods.KormrokSetups[arg].date = nil
  3233. CloseDropDownMenus()
  3234. end
  3235. local function SetupsDropDown_Save(_,arg)
  3236. for i=1,300 do
  3237. VExRT.Bossmods.KormrokSetups[arg][i] = VExRT.Bossmods.Kormrok[i]
  3238. end
  3239. VExRT.Bossmods.KormrokSetups[arg].date = time()
  3240. CloseDropDownMenus()
  3241. end
  3242. local function SetupsDropDown_Close()
  3243. CloseDropDownMenus()
  3244. end
  3245.  
  3246. local setupsDropDown = CreateFrame("Frame", "ExRT_Kormrok_SetupsDropDown", nil, "UIDropDownMenuTemplate")
  3247. Kormrok.setupFrame.setupsButton = ELib:Button(Kormrok.setupFrame,L.BossmodsKromogSetups):Size(120,20):Point("BOTTOMRIGHT",Kormrok.setupFrame.testButton,"TOPRIGHT",0,2):OnClick(function (self)
  3248. VExRT.Bossmods.KormrokSetups = VExRT.Bossmods.KormrokSetups or {}
  3249.  
  3250. local dropDown = {
  3251. { text = L.BossmodsKromogSetups, isTitle = true, notCheckable = true, notClickable = true},
  3252. }
  3253. for i=1,5 do
  3254. VExRT.Bossmods.KormrokSetups[i] = VExRT.Bossmods.KormrokSetups[i] or {}
  3255.  
  3256. local subMenu = nil
  3257. local saveMenu = { text = L.BossmodsKromogSetupsSave, func = SetupsDropDown_Save, arg1 = i, notCheckable = true }
  3258. local loadMenu = { text = L.BossmodsKromogSetupsLoad, func = SetupsDropDown_Load, arg1 = i, notCheckable = true }
  3259. local clearMenu = { text = L.BossmodsKromogSetupsClear, func = SetupsDropDown_Clear, arg1 = i, notCheckable = true }
  3260.  
  3261. local isExists = VExRT.Bossmods.KormrokSetups[i].date
  3262. local dateText = ""
  3263. if isExists then
  3264. subMenu = {loadMenu,saveMenu,clearMenu}
  3265. dateText = ". "..date("%H:%M:%S %d.%m.%Y",isExists)
  3266. else
  3267. subMenu = {saveMenu}
  3268. end
  3269.  
  3270. dropDown[i+1] = {
  3271. text = i..dateText, hasArrow = true, menuList = subMenu, notCheckable = true
  3272. }
  3273. end
  3274. dropDown[7] = { text = L.BossmodsKromogSetupsClose, func = SetupsDropDown_Close, notCheckable = true }
  3275. EasyMenu(dropDown, setupsDropDown, "cursor", 10 , -15, "MENU")
  3276. end)
  3277.  
  3278. Kormrok.setupFrame.sendButton = ELib:Button(Kormrok.setupFrame,L.BossmodsKromogSend):Size(120,20):Point("BOTTOMRIGHT",Kormrok.setupFrame.setupsButton,"TOPRIGHT",0,2):OnClick(function (self)
  3279. local line = ""
  3280. local counter = 0
  3281. ExRT.F.SendExMsg("kormrok","clear")
  3282. for i=1,300 do
  3283. if VExRT.Bossmods.Kormrok[i] then
  3284. line = line .. i.."\t"..VExRT.Bossmods.Kormrok[i].."\t"
  3285. counter = counter + 1
  3286. if counter > 2 then
  3287. ExRT.F.SendExMsg("kormrok",line)
  3288. counter = 0
  3289. line = ""
  3290. end
  3291. end
  3292. end
  3293. if line ~= "" then
  3294. ExRT.F.SendExMsg("kormrok",line)
  3295. end
  3296. end)
  3297.  
  3298. Kormrok.setupFrame.onlyTrustedChk = ELib:Check(Kormrok.setupFrame,L.BossmodsKromogOnlyTrusted,not VExRT.Bossmods.Kormrok.UpdatesFromAll):Point("BOTTOMLEFT",Kormrok.setupFrame.sendButton,"TOPLEFT",0,2):Scale(.9):Tooltip(L.BossmodsKromogOnlyTrustedTooltip):OnClick(function (self)
  3299. if self:GetChecked() then
  3300. VExRT.Bossmods.Kormrok.UpdatesFromAll = nil
  3301. else
  3302. VExRT.Bossmods.Kormrok.UpdatesFromAll = true
  3303. end
  3304. end)
  3305.  
  3306. Kormrok.setupFrame.lastUpdate = ELib:Text(Kormrok.setupFrame,"",12):Size(500,20):Point("BOTTOMLEFT",Kormrok.setupFrame,"BOTTOMLEFT",7,5):Bottom():Color(1,1,1):Outline()
  3307.  
  3308. local phaseBackground = Kormrok.setupFrame:CreateTexture(nil, "BACKGROUND",nil,2)
  3309. phaseBackground:SetPoint("TOPLEFT",0,0)
  3310. phaseBackground:SetPoint("BOTTOMRIGHT",Kormrok.setupFrame,"TOPRIGHT",0,-50)
  3311. phaseBackground:SetTexture( 1, 1, 1, 1)
  3312.  
  3313. local phaseOrange = ELib:Icon(Kormrok.setupFrame,"Interface\\Icons\\INV_Bijou_Orange.blp",72,true):Point("CENTER",Kormrok.setupFrame,"BOTTOMLEFT",224,94)
  3314. phaseOrange.phase = 1
  3315.  
  3316. phaseOrange.copy = ELib:Button(Kormrok.setupFrame,L.BossmodsKormrokCopy):Size(65,14):Point("CENTER",phaseOrange,0,-50)
  3317. phaseOrange.copy.phase = 1
  3318. phaseOrange.copy.icon = "Interface\\Icons\\INV_Bijou_Orange.blp"
  3319.  
  3320. phaseOrange.clear = ELib:Button(Kormrok.setupFrame,L.BossmodsKromogSetupsClear):Size(65,14):Point("CENTER",phaseOrange,0,-50)
  3321. phaseOrange.clear.phase = 1
  3322.  
  3323. local phaseGreen = ELib:Icon(Kormrok.setupFrame,"Interface\\Icons\\INV_Bijou_Green.blp",48,true):Point("CENTER",Kormrok.setupFrame,"BOTTOMLEFT",294,94)
  3324. phaseGreen.phase = 2
  3325.  
  3326. phaseGreen.copy = ELib:Button(Kormrok.setupFrame,L.BossmodsKormrokCopy):Size(65,14):Point("CENTER",phaseGreen,0,-50)
  3327. phaseGreen.copy.phase = 2
  3328. phaseGreen.copy.icon = "Interface\\Icons\\INV_Bijou_Green.blp"
  3329.  
  3330. phaseGreen.clear = ELib:Button(Kormrok.setupFrame,L.BossmodsKromogSetupsClear):Size(65,14):Point("CENTER",phaseGreen,0,-50)
  3331. phaseGreen.clear.phase = 2
  3332.  
  3333. local phasePurple = ELib:Icon(Kormrok.setupFrame,"Interface\\Icons\\INV_Bijou_Purple.blp",48,true):Point("CENTER",Kormrok.setupFrame,"BOTTOMLEFT",364,94)
  3334. phasePurple.phase = 3
  3335.  
  3336. phasePurple.copy = ELib:Button(Kormrok.setupFrame,L.BossmodsKormrokCopy):Size(65,14):Point("CENTER",phasePurple,0,-50)
  3337. phasePurple.copy.phase = 3
  3338. phasePurple.copy.icon = "Interface\\Icons\\INV_Bijou_Purple.blp"
  3339.  
  3340. phasePurple.clear = ELib:Button(Kormrok.setupFrame,L.BossmodsKromogSetupsClear):Size(65,14):Point("CENTER",phasePurple,0,-50)
  3341. phasePurple.clear.phase = 1
  3342.  
  3343. local phaseBackgroundColors = {
  3344. {r = 1, g = 190/255, b = 82/255},
  3345. {r = 65/255, g = 239/255, b = 85/255},
  3346. {r = 146/255, g = 6/255, b = 185/255},
  3347. }
  3348. local function SetPhaseButton(self)
  3349. phaseNow = self.phase
  3350.  
  3351. phaseOrange:SetSize(phaseNow == 1 and 72 or 48,phaseNow == 1 and 72 or 48)
  3352. phaseGreen:SetSize(phaseNow == 2 and 72 or 48,phaseNow == 2 and 72 or 48)
  3353. phasePurple:SetSize(phaseNow == 3 and 72 or 48,phaseNow == 3 and 72 or 48)
  3354.  
  3355. phaseOrange.copy:SetShown(phaseNow ~= 1)
  3356. phaseGreen.copy:SetShown(phaseNow ~= 2)
  3357. phasePurple.copy:SetShown(phaseNow ~= 3)
  3358.  
  3359. phaseOrange.clear:SetShown(phaseNow == 1)
  3360. phaseGreen.clear:SetShown(phaseNow == 2)
  3361. phasePurple.clear:SetShown(phaseNow == 3)
  3362.  
  3363. phaseBackground:SetGradientAlpha("VERTICAL",
  3364. phaseBackgroundColors[phaseNow].r,phaseBackgroundColors[phaseNow].g,phaseBackgroundColors[phaseNow].b, 0,
  3365. phaseBackgroundColors[phaseNow].r,phaseBackgroundColors[phaseNow].g,phaseBackgroundColors[phaseNow].b, 0.5
  3366. )
  3367.  
  3368. Kormrok:ReRoster(phaseNow)
  3369. end
  3370. local function SetPhaseCopyButton(self)
  3371. StaticPopupDialogs["EXRT_BOSSMODS_KORMROK_COPY"] = {
  3372. text = L.BossmodsKormrokCopy .. " |T" ..self.icon..":24|t?",
  3373. button1 = YES,
  3374. button2 = NO,
  3375. OnAccept = function()
  3376. for i=1,100 do
  3377. VExRT.Bossmods.Kormrok[ (phaseNow-1)*100 + i ] = VExRT.Bossmods.Kormrok[ (self.phase-1)*100 + i ]
  3378. end
  3379. Kormrok:ReRoster(phaseNow)
  3380. end,
  3381. timeout = 0,
  3382. whileDead = true,
  3383. hideOnEscape = true,
  3384. preferredIndex = 3,
  3385. }
  3386. StaticPopup_Show("EXRT_BOSSMODS_KORMROK_COPY")
  3387. end
  3388.  
  3389. local function SetPhaseClearButton(self)
  3390. StaticPopupDialogs["EXRT_BOSSMODS_KORMROK_CLEAR"] = {
  3391. text = L.BossmodsKromogClear,
  3392. button1 = YES,
  3393. button2 = NO,
  3394. OnAccept = function()
  3395. for i=1,100 do
  3396. VExRT.Bossmods.Kormrok[ (phaseNow-1)*100 + i ] = nil
  3397. end
  3398. Kormrok:ReRoster(phaseNow)
  3399. end,
  3400. timeout = 0,
  3401. whileDead = true,
  3402. hideOnEscape = true,
  3403. preferredIndex = 3,
  3404. }
  3405. StaticPopup_Show("EXRT_BOSSMODS_KORMROK_CLEAR")
  3406. end
  3407.  
  3408. phaseOrange:SetScript("OnClick",SetPhaseButton)
  3409. phaseGreen:SetScript("OnClick",SetPhaseButton)
  3410. phasePurple:SetScript("OnClick",SetPhaseButton)
  3411.  
  3412. phaseOrange.copy:SetScript("OnClick",SetPhaseCopyButton)
  3413. phaseGreen.copy:SetScript("OnClick",SetPhaseCopyButton)
  3414. phasePurple.copy:SetScript("OnClick",SetPhaseCopyButton)
  3415.  
  3416. phaseOrange.clear:SetScript("OnClick",SetPhaseClearButton)
  3417. phaseGreen.clear:SetScript("OnClick",SetPhaseClearButton)
  3418. phasePurple.clear:SetScript("OnClick",SetPhaseClearButton)
  3419.  
  3420.  
  3421. phaseOrange:Click()
  3422. Kormrok.setupFrame.phaseOrange = phaseOrange
  3423.  
  3424. Kormrok.raidRoster = ELib:Popup(L.BossmodsKromogSelectPlayer):Size(80*4+25,113+14)
  3425. Kormrok.raidRoster:SetScript("OnShow",function (self)
  3426. Kormrok:UpdateSelectRoster(phaseNow)
  3427. end)
  3428. Kormrok.raidRoster.buttons = {}
  3429. local function RaidRosterButtonOnEnter(self)
  3430. self.hl:Show()
  3431. end
  3432. local function RaidRosterButtonOnLeave(self)
  3433. self.hl:Hide()
  3434. end
  3435. local function RaidRosterButtonOnClick(self)
  3436. local fI = (phaseNow - 1) * 100
  3437. for i=fI+1,fI+100 do
  3438. if VExRT.Bossmods.Kormrok[i] == self._name then
  3439. VExRT.Bossmods.Kormrok[i] = nil
  3440. end
  3441. end
  3442. VExRT.Bossmods.Kormrok[fI + Kormrok.raidRoster.pos] = self._name
  3443. Kormrok:ReRoster(phaseNow)
  3444. Kormrok.raidRoster:Hide()
  3445.  
  3446. DisableSync()
  3447. end
  3448. for i=1,4 do
  3449. for j=1,5 do
  3450. local pos = (i-1)*5+j
  3451. Kormrok.raidRoster.buttons[pos] = CreateFrame('Button',nil,Kormrok.raidRoster)
  3452. Kormrok.raidRoster.buttons[pos]:SetPoint("TOPLEFT",15+(i-1)*80,-25-(j-1)*14)
  3453. Kormrok.raidRoster.buttons[pos]:SetSize(80,14)
  3454. ExRT.lib.CreateHoverHighlight(Kormrok.raidRoster.buttons[pos])
  3455. Kormrok.raidRoster.buttons[pos]:SetScript("OnEnter",RaidRosterButtonOnEnter)
  3456. Kormrok.raidRoster.buttons[pos]:SetScript("OnLeave",RaidRosterButtonOnLeave)
  3457. Kormrok.raidRoster.buttons[pos].name = ELib:Text(Kormrok.raidRoster.buttons[pos],"",12):Size(80,14):Point(0,0):Color(1,1,1):Shadow()
  3458. Kormrok.raidRoster.buttons[pos]._name = nil
  3459. Kormrok.raidRoster.buttons[pos]:SetScript("OnClick",RaidRosterButtonOnClick)
  3460. end
  3461. end
  3462. Kormrok.raidRoster.clearButton = CreateFrame('Button',nil,Kormrok.raidRoster)
  3463. Kormrok.raidRoster.clearButton:SetPoint("BOTTOMRIGHT",Kormrok.raidRoster,"BOTTOMRIGHT",-11,12)
  3464. Kormrok.raidRoster.clearButton:SetSize(80,14)
  3465. ExRT.lib.CreateHoverHighlight(Kormrok.raidRoster.clearButton)
  3466. Kormrok.raidRoster.clearButton:SetScript("OnEnter",function(self)
  3467. self.hl:Show()
  3468. end)
  3469. Kormrok.raidRoster.clearButton:SetScript("OnLeave",function(self)
  3470. self.hl:Hide()
  3471. end)
  3472.  
  3473. Kormrok.raidRoster.clearButton.name = ELib:Text(Kormrok.raidRoster.clearButton,L.BossmodsKromogClear,12):Size(80,14):Point(0,0):Right():Middle():Color(1,1,1):Shadow()
  3474. Kormrok.raidRoster.clearButton:SetScript("OnClick",function(self)
  3475. VExRT.Bossmods.Kormrok[Kormrok.raidRoster.pos] = nil
  3476. Kormrok:ReRoster(phaseNow)
  3477. Kormrok.raidRoster:Hide()
  3478.  
  3479. DisableSync()
  3480. end)
  3481.  
  3482. Kormrok.raidRoster.hideChk = ELib:Check(Kormrok.raidRoster,L.BossmodsKromogHidePlayers,true):Point("BOTTOMLEFT",10,7):Scale(.8):OnClick(function (self)
  3483. Kormrok.hidePlayers = self:GetChecked()
  3484. Kormrok:UpdateSelectRoster(phaseNow)
  3485. end)
  3486.  
  3487. function Kormrok:RegisterEvents()
  3488. Kormrok.setupFrame:UnregisterAllEvents()
  3489. Kormrok.setupFrame:RegisterEvent("RAID_BOSS_EMOTE")
  3490. Kormrok.setupFrame:RegisterEvent("GROUP_ROSTER_UPDATE")
  3491. if not VExRT.Bossmods.Kormrok.AlwaysArrow then
  3492. --Kormrok.setupFrame:RegisterEvent("ENCOUNTER_START")
  3493. --Kormrok.setupFrame:RegisterEvent("ENCOUNTER_END")
  3494. end
  3495. end
  3496. Kormrok:RegisterEvents()
  3497.  
  3498. Kormrok.setupFrame:SetScript("OnEvent",KormrokFrameOnEvent)
  3499. Kormrok.setupFrame:SetScript("OnShow",function (self)
  3500. local isAlpha = false
  3501. if IsInRaid() then
  3502. if ExRT.F.IsPlayerRLorOfficer(UnitName('player')) then
  3503. isAlpha = false
  3504. else
  3505. isAlpha = true
  3506. end
  3507. end
  3508. if isAlpha then
  3509. self.clearButton:SetAlpha(.2)
  3510. self.sendButton:SetAlpha(.2)
  3511. self.setupsButton:SetAlpha(.2)
  3512. else
  3513. self.clearButton:SetAlpha(1)
  3514. self.sendButton:SetAlpha(1)
  3515. self.setupsButton:SetAlpha(1)
  3516. end
  3517. end)
  3518.  
  3519. if not VExRT.Bossmods.Kormrok.name or not VExRT.Bossmods.Kormrok.time then
  3520. Kormrok.setupFrame.lastUpdate:SetText("")
  3521. else
  3522. Kormrok.setupFrame.lastUpdate:SetText(L.BossmodsKromogLastUpdate..": "..VExRT.Bossmods.Kormrok.name.." ("..date("%H:%M:%S %d.%m.%Y",VExRT.Bossmods.Kormrok.time)..")"..(not VExRT.Bossmods.Kormrok.sync and " *" or ""))
  3523. end
  3524. Kormrok:ReRoster(1)
  3525. Kormrok.setupFrame:Show()
  3526. if InterfaceOptionsFrame:IsShown() then
  3527. InterfaceOptionsFrame:Hide()
  3528. end
  3529. if ExRT.Options.Frame:IsShown() then
  3530. ExRT.Options.Frame:Hide()
  3531. end
  3532. end
  3533.  
  3534. function Kormrok:addonMessage(sender, prefix, ...)
  3535. if prefix == "kormrok" then
  3536. if IsInRaid() and not VExRT.Bossmods.Kormrok.UpdatesFromAll and not ExRT.F.IsPlayerRLorOfficer(sender) then
  3537. return
  3538. end
  3539.  
  3540. local pos1,name1,pos2,name2,pos3,name3 = ...
  3541. VExRT.Bossmods.Kormrok.time = time()
  3542. VExRT.Bossmods.Kormrok.name = sender
  3543. VExRT.Bossmods.Kormrok.sync = true
  3544. if pos1 == "clear" then
  3545. for i=1,300 do
  3546. VExRT.Bossmods.Kormrok[i] = nil
  3547. end
  3548. return
  3549. end
  3550.  
  3551. if pos1 and name1 then
  3552. pos1 = tonumber(pos1)
  3553. if name1 == "-" then
  3554. name1 = nil
  3555. end
  3556. VExRT.Bossmods.Kormrok[pos1] = name1
  3557. end
  3558. if pos2 and name2 then
  3559. pos2 = tonumber(pos2)
  3560. if name2 == "-" then
  3561. name2 = nil
  3562. end
  3563. VExRT.Bossmods.Kormrok[pos2] = name2
  3564. end
  3565. if pos3 and name3 then
  3566. pos3 = tonumber(pos3)
  3567. if name3 == "-" then
  3568. name3 = nil
  3569. end
  3570. VExRT.Bossmods.Kormrok[pos3] = name3
  3571. end
  3572.  
  3573. if Kormrok.setupFrame then
  3574. Kormrok.setupFrame.lastUpdate:SetText(L.BossmodsKromogLastUpdate..": "..VExRT.Bossmods.Kormrok.name.." ("..date("%H:%M:%S %d.%m.%Y",VExRT.Bossmods.Kormrok.time)..")")
  3575. Kormrok:ReRoster( Kormrok:GetCurrentPhase() )
  3576. end
  3577. end
  3578. end
  3579.  
  3580. -----------------------------------------
  3581. -- Mannoroth
  3582. -----------------------------------------
  3583. local Mannoroth = {}
  3584. module.A.Mannoroth = Mannoroth
  3585.  
  3586. function Mannoroth:Load()
  3587. local mainFrame = Mannoroth.setupFrame
  3588. if mainFrame then
  3589. mainFrame:Show()
  3590. mainFrame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  3591. mainFrame:RegisterEvent("GROUP_ROSTER_UPDATE")
  3592. if ExRT.Options.Frame:IsShown() then
  3593. ExRT.Options.Frame:Hide()
  3594. end
  3595. mainFrame.isEnabled = true
  3596. return
  3597. end
  3598.  
  3599. mainFrame = ELib:Popup("Mannoroth"):Size(600,400)
  3600. Mannoroth.setupFrame = mainFrame
  3601. mainFrame:SetFrameStrata("HIGH")
  3602. mainFrame:Show()
  3603.  
  3604. VExRT.Bossmods.Mannoroth.Section = VExRT.Bossmods.Mannoroth.Section or {}
  3605.  
  3606. local function removeButtonOnClick(self)
  3607. for i=self._i2,10 do
  3608. VExRT.Bossmods.Mannoroth.Section[ self._i1 ][i] = VExRT.Bossmods.Mannoroth.Section[ self._i1 ][i+1]
  3609. end
  3610. mainFrame:UpdateSections()
  3611. end
  3612.  
  3613. mainFrame.markSection = {}
  3614. mainFrame.sectionSelected = 1
  3615. for i=1,3 do
  3616. local frame = CreateFrame("Button",nil,mainFrame)
  3617. mainFrame.markSection[i] = frame
  3618.  
  3619. frame:SetSize(170,220)
  3620. frame:SetPoint("TOP",-195 + (i-1)*195,-30)
  3621.  
  3622. frame.shadow = ELib:Shadow(frame,25)
  3623. frame.shadow:SetBackdropBorderColor(1,1,1,.45)
  3624.  
  3625. if i==1 then
  3626. frame.shadow:SetBackdropBorderColor(0,1,0,.45)
  3627. end
  3628.  
  3629. local icon = ELib:Icon(frame,"Interface\\TargetingFrame\\UI-RaidTargetingIcon_"..i,32):Point("TOP",0,-10)
  3630.  
  3631. frame._i = i
  3632. frame:SetScript("OnClick",function(self)
  3633. mainFrame.sectionSelected = self._i
  3634. for j=1,3 do
  3635. if j ~= self._i then
  3636. mainFrame.markSection[j].shadow:SetBackdropBorderColor(1,1,1,.45)
  3637. else
  3638. mainFrame.markSection[j].shadow:SetBackdropBorderColor(0,1,0,.45)
  3639. end
  3640. end
  3641. end)
  3642.  
  3643. frame.names = {}
  3644. for j=1,10 do
  3645. local line = CreateFrame("Frame",nil,frame)
  3646. frame.names[j] = line
  3647. line:SetPoint("TOP",0,-40-j*14)
  3648. line:SetSize(170,14)
  3649.  
  3650. line.name = ELib:Text(line,UnitName'player',12):Size(145,12):Point("LEFT",20,0):Color(1,1,1):Shadow()
  3651.  
  3652. local remove = CreateFrame("Button",nil,line)
  3653. line.remove = remove
  3654. remove:SetPoint("LEFT",2,0)
  3655. remove:SetSize(14,14)
  3656.  
  3657. remove.texture = remove:CreateTexture(nil,"ARTWORK")
  3658. remove.texture:SetAllPoints()
  3659. remove.texture:SetTexture("Interface\\AddOns\\ExRT\\media\\DiesalGUIcons16x256x128")
  3660. remove.texture:SetTexCoord(0.5,0.5625,0.5,0.625)
  3661. remove.texture:SetVertexColor(1,1,1,.7)
  3662. remove.texture:Hide()
  3663. remove:SetNormalTexture(remove.texture)
  3664.  
  3665. remove.hover = remove:CreateTexture(nil,"ARTWORK")
  3666. remove.hover:SetAllPoints()
  3667. remove.hover:SetTexture("Interface\\AddOns\\ExRT\\media\\DiesalGUIcons16x256x128")
  3668. remove.hover:SetTexCoord(0.5,0.5625,0.5,0.625)
  3669. remove.hover:SetVertexColor(0.7,0,0,1)
  3670. remove.hover:Hide()
  3671. remove:SetHighlightTexture(remove.hover)
  3672.  
  3673. remove:SetScript("OnClick",removeButtonOnClick)
  3674. remove._i1 = i
  3675. remove._i2 = j
  3676. end
  3677.  
  3678.  
  3679. VExRT.Bossmods.Mannoroth.Section[i] = VExRT.Bossmods.Mannoroth.Section[i] or {}
  3680. end
  3681.  
  3682. local function raidNamesOnEnter(self)
  3683. self.name:SetShadowColor(0.2, 0.2, 0.2, 1)
  3684. end
  3685. local function raidNamesOnLeave(self)
  3686. self.name:SetShadowColor(0, 0, 0, 1)
  3687. end
  3688. local function raidNamesOnClick(self)
  3689. local list = VExRT.Bossmods.Mannoroth.Section[ mainFrame.sectionSelected ]
  3690. if #list >= 10 then
  3691. return
  3692. end
  3693. list[#list + 1] = self._name
  3694. mainFrame:UpdateSections()
  3695. end
  3696.  
  3697. mainFrame.raidRoster = {}
  3698. for i=1,6 do
  3699. for j=1,5 do
  3700. local line = CreateFrame("Button",nil,mainFrame)
  3701. mainFrame.raidRoster[(i-1)*5+j] = line
  3702. line:SetPoint("TOPLEFT",mainFrame.markSection[1],"BOTTOMLEFT",(i-1)*94,-5-j*14)
  3703. line:SetSize(90,14)
  3704.  
  3705. line.name = ELib:Text(line,UnitName'player',12):Size(90,12):Point("LEFT",0,0):Color(1,1,1):Shadow()
  3706. line._name = (UnitName'player') .. ((i-1)*5+j)
  3707.  
  3708. line:SetScript("OnClick", raidNamesOnClick)
  3709. line:SetScript("OnEnter", raidNamesOnEnter)
  3710. line:SetScript("OnLeave", raidNamesOnLeave)
  3711. end
  3712. end
  3713.  
  3714. function mainFrame:UpdateRoster()
  3715. local raidData = {{},{},{},{},{},{}}
  3716. for i=1,40 do
  3717. local name,_,subgroup,_,_,class = GetRaidRosterInfo(i)
  3718. if name and subgroup <= 6 then
  3719. raidData[subgroup][ #raidData[subgroup]+1 ] = {name,class}
  3720. end
  3721. end
  3722. for i=1,6 do
  3723. for j=1,5 do
  3724. local pos = (i-1)*5+j
  3725. local data = raidData[i][j]
  3726. local line = mainFrame.raidRoster[pos]
  3727. if line and data then
  3728. line._name = data[1]
  3729. line.name:SetText("|c"..ExRT.F.classColor(data[2])..data[1])
  3730. line:Show()
  3731. elseif line then
  3732. line:Hide()
  3733. end
  3734. end
  3735. end
  3736. end
  3737.  
  3738. function mainFrame:UpdateSections()
  3739. local selectedRoster = {}
  3740. for i=1,3 do
  3741. local list = VExRT.Bossmods.Mannoroth.Section[i]
  3742. for j=1,10 do
  3743. local line = mainFrame.markSection[i].names[j]
  3744. if list[j] then
  3745. line.name:SetText( list[j] )
  3746. line:Show()
  3747.  
  3748. selectedRoster[ list[j] ] = true
  3749. else
  3750. line:Hide()
  3751. end
  3752. end
  3753. end
  3754. for i=1,6 do
  3755. for j=1,5 do
  3756. local line = mainFrame.raidRoster[(i-1)*5+j]
  3757. local name = line._name
  3758. if name then
  3759. if selectedRoster[ name ] then
  3760. line:SetAlpha(.2)
  3761. else
  3762. line:SetAlpha(1)
  3763. end
  3764. end
  3765. end
  3766. end
  3767. end
  3768.  
  3769. mainFrame:UpdateRoster()
  3770. mainFrame:UpdateSections()
  3771.  
  3772. mainFrame.lastUpdate = ELib:Text(mainFrame,"",12):Size(430,20):Point("BOTTOMLEFT",10,10):Bottom():Color():Outline()
  3773.  
  3774. if not VExRT.Bossmods.Mannoroth.name or not VExRT.Bossmods.Mannoroth.time then
  3775. mainFrame.lastUpdate:SetText("")
  3776. else
  3777. mainFrame.lastUpdate:SetText(L.BossmodsKromogLastUpdate..": "..ExRT.F.delUnitNameServer(VExRT.Bossmods.Mannoroth.name).." ("..date("%H:%M:%S %d.%m.%Y",VExRT.Bossmods.Mannoroth.time)..")")
  3778. end
  3779.  
  3780. mainFrame.sendButton = ELib:Button(mainFrame,L.BossmodsKromogSend):Size(120,20):Point("BOTTOMRIGHT",-10,10):OnClick(function (self)
  3781. local line = ""
  3782. local counter = 0
  3783. ExRT.F.SendExMsg("mannoroth","num\t"..(VExRT.Bossmods.Mannoroth.number or 3))
  3784. for i=1,3 do
  3785. for j=1,10 do
  3786. local name = VExRT.Bossmods.Mannoroth.Section[i][j] or "-"
  3787. line = line .. (i*10+j) .. "\t" .. name .. "\t"
  3788. counter = counter + 1
  3789. if counter > 2 then
  3790. ExRT.F.SendExMsg("mannoroth",line)
  3791. line = ""
  3792. counter = 0
  3793. end
  3794. end
  3795. end
  3796. if line ~= "" then
  3797. ExRT.F.SendExMsg("mannoroth",line)
  3798. end
  3799. end)
  3800.  
  3801. local tableBuilder = {}
  3802. local myName = UnitName("player")
  3803. local markIDtoSelection = {
  3804. [8] = 1,
  3805. [7] = 2,
  3806. [6] = 3,
  3807. }
  3808.  
  3809. local function ShowArrow(isEmpowered)
  3810. ExRT.F.Arrow:Hide()
  3811. local blackList = {}
  3812. for i=8,6,-1 do
  3813. if tableBuilder[i] then
  3814. blackList[ ExRT.F.delUnitNameServer(tableBuilder[i]) ] = true
  3815. end
  3816. end
  3817. for i=8,6,-1 do
  3818. if tableBuilder[i] then
  3819. local counter = 1
  3820. for j=1,10 do
  3821. local name = VExRT.Bossmods.Mannoroth.Section[ markIDtoSelection[i] ][j]
  3822. if name and not blackList[ ExRT.F.delUnitNameServer(name) ] then
  3823. counter = counter + 1
  3824. if ExRT.F.delUnitNameServer(name) == myName then
  3825. ExRT.F.Arrow:ShowToPlayer(tableBuilder[i],nil,nil,4,nil,true)
  3826. end
  3827. --print( name,tableBuilder[i] )
  3828. if counter > (VExRT.Bossmods.Mannoroth.number or 3) and isEmpowered then
  3829. break
  3830. end
  3831. end
  3832. end
  3833. end
  3834. end
  3835. end
  3836.  
  3837. local markNow = 8
  3838.  
  3839. mainFrame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  3840. mainFrame:RegisterEvent("GROUP_ROSTER_UPDATE")
  3841. mainFrame:SetScript("OnEvent",function(_,event,timestamp,cleu_event,hideCaster,sourceGUID,sourceName,sourceFlags,_,destGUID,destName,destFlags,_,spellID,spellName,school,auraType,amount)
  3842. if event == "COMBAT_LOG_EVENT_UNFILTERED" then
  3843. if cleu_event == "SPELL_AURA_APPLIED" and (spellID == 182006 or spellID == 181597) then
  3844. if markNow == 8 then
  3845. wipe(tableBuilder)
  3846. end
  3847. local markFixed = markIDtoSelection[markNow]
  3848. if markFixed and ExRT.F.table_len(VExRT.Bossmods.Mannoroth.Section[markFixed]) > 0 then
  3849. SetRaidTarget(destName, markFixed)
  3850. end
  3851. tableBuilder[markNow] = destName
  3852. ShowArrow(spellID == 182006)
  3853. markNow = markNow - 1
  3854. C_Timer.NewTimer(3,function() markNow = 8 end)
  3855. elseif cleu_event == "SPELL_AURA_REMOVED" and (spellID == 182006 or spellID == 181597) then
  3856. SetRaidTarget(destName, 0)
  3857. end
  3858. elseif event == "GROUP_ROSTER_UPDATE" then
  3859. mainFrame:UpdateRoster()
  3860. mainFrame:UpdateSections()
  3861. end
  3862. end)
  3863.  
  3864. mainFrame.isEnabled = true
  3865. end
  3866.  
  3867. function Mannoroth:addonMessage(sender, prefix, ...)
  3868. if prefix == "mannoroth" then
  3869. if IsInRaid() and not ExRT.F.IsPlayerRLorOfficer(sender) then
  3870. return
  3871. end
  3872.  
  3873. VExRT.Bossmods.Mannoroth = VExRT.Bossmods.Mannoroth or {}
  3874. VExRT.Bossmods.Mannoroth.Section = VExRT.Bossmods.Mannoroth.Section or {}
  3875. for i=1,3 do VExRT.Bossmods.Mannoroth.Section[i] = VExRT.Bossmods.Mannoroth.Section[i] or {} end
  3876.  
  3877. local pos1,name1,pos2,name2,pos3,name3 = ...
  3878. VExRT.Bossmods.Mannoroth.time = time()
  3879. VExRT.Bossmods.Mannoroth.name = sender
  3880. VExRT.Bossmods.Mannoroth.sync = true
  3881. if pos1 == "num" then
  3882. VExRT.Bossmods.Mannoroth.number = tonumber(name1)
  3883. return
  3884. end
  3885.  
  3886. if pos1 and name1 then
  3887. pos1 = tonumber(pos1)
  3888. if name1 == "-" then
  3889. name1 = nil
  3890. end
  3891. local col = floor((pos1 - 1) / 10)
  3892. local pos = pos1 % 10
  3893. if pos == 0 then pos = 10 end
  3894. VExRT.Bossmods.Mannoroth.Section[col][pos] = name1
  3895. end
  3896. if pos2 and name2 then
  3897. pos2 = tonumber(pos2)
  3898. if name2 == "-" then
  3899. name2 = nil
  3900. end
  3901. local col = floor((pos2 - 1) / 10)
  3902. local pos = pos2 % 10
  3903. if pos == 0 then pos = 10 end
  3904. VExRT.Bossmods.Mannoroth.Section[col][pos] = name2
  3905. end
  3906. if pos3 and name3 then
  3907. pos3 = tonumber(pos3)
  3908. if name3 == "-" then
  3909. name3 = nil
  3910. end
  3911. local col = floor((pos3 - 1) / 10)
  3912. local pos = pos3 % 10
  3913. if pos == 0 then pos = 10 end
  3914. VExRT.Bossmods.Mannoroth.Section[col][pos] = name3
  3915. end
  3916.  
  3917. if Mannoroth.setupFrame then
  3918. Mannoroth.setupFrame.lastUpdate:SetText(L.BossmodsKromogLastUpdate..": "..ExRT.F.delUnitNameServer(VExRT.Bossmods.Mannoroth.name).." ("..date("%H:%M:%S %d.%m.%Y",VExRT.Bossmods.Mannoroth.time)..")")
  3919. Mannoroth.setupFrame:UpdateSections()
  3920.  
  3921. Mannoroth.setupFrame:UpdateRoster()
  3922. Mannoroth.setupFrame:UpdateSections()
  3923. end
  3924. end
  3925. end
  3926.  
  3927. -----------------------------------------
  3928. -- Archimonde
  3929. -----------------------------------------
  3930. local Archimonde = {}
  3931. module.A.Archimonde = Archimonde
  3932.  
  3933. --[[
  3934.  
  3935. VExRT.Bossmods.ArchimondeRadius - Radar Radius
  3936. VExRT.Bossmods.ArchimondeLineSize - Line Size (2,4,6,8,10,12)
  3937. VExRT.Bossmods.ArchimondeDisableText - Disable Text
  3938.  
  3939. ]]
  3940.  
  3941. function Archimonde:Load()
  3942. ExRT.Options.Frame:Hide()
  3943.  
  3944. local frame = Archimonde.mainframe
  3945. if frame then
  3946. frame:Show()
  3947. frame:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
  3948. frame:RegisterEvent('ENCOUNTER_START')
  3949. frame:RegisterEvent('ENCOUNTER_END')
  3950. frame.isEnabled = true
  3951. return
  3952. end
  3953. local BLIP_TEX_COORDS = {
  3954. ["WARRIOR"] = { 0, 0.125, 0, 0.25 },
  3955. ["PALADIN"] = { 0.125, 0.25, 0, 0.25 },
  3956. ["HUNTER"] = { 0.25, 0.375, 0, 0.25 },
  3957. ["ROGUE"] = { 0.375, 0.5, 0, 0.25 },
  3958. ["PRIEST"] = { 0.5, 0.625, 0, 0.25 },
  3959. ["DEATHKNIGHT"] = { 0.625, 0.75, 0, 0.25 },
  3960. ["SHAMAN"] = { 0.75, 0.875, 0, 0.25 },
  3961. ["MAGE"] = { 0.875, 1, 0, 0.25 },
  3962. ["WARLOCK"] = { 0, 0.125, 0.25, 0.5 },
  3963. ["DRUID"] = { 0.25, 0.375, 0.25, 0.5 },
  3964. ["MONK"] = { 0.125, 0.25, 0.25, 0.5 },
  3965. ["DEMONHUNTER"] = { 0.375, 0.5, 0.25, 0.5 },
  3966. }
  3967. local FRAME_SIZE = 200
  3968. local VECTOR_LENGTH = 300
  3969. local VECTOR_DEPTH = 1.5
  3970. local VIEW_DISTANCE = VExRT.Bossmods.ArchimondeRadius or 20
  3971. local VIEW_DISTANCE2 = VIEW_DISTANCE * 2
  3972. local LINES_COLORS = {
  3973. [1] = {r = 0.6, g = 1, b = 0.6, a = 1}, -- light green
  3974. [2] = {r = 0, g = 0, b = 1, a = 1}, -- blue (Febreez)
  3975. [3] = {r = 1, g = 0.6, b = 0.6, a = 1}, -- light red
  3976. [4] = {r = 0.1, g = 0.4, b = 0.9, a = 1}, -- light blue
  3977. --[5] = {r = 1, g = 0, b = 0, a = 1}, -- red
  3978. }
  3979.  
  3980. frame = CreateFrame("Frame",nil,UIParent)
  3981. Archimonde.mainframe = frame
  3982. frame:SetSize(FRAME_SIZE,FRAME_SIZE)
  3983. frame:EnableMouse(true)
  3984. frame:SetMovable(true)
  3985. frame:RegisterForDrag("LeftButton")
  3986. frame:SetScript("OnDragStart", function(self)
  3987. if self:IsMovable() then
  3988. self:StartMoving()
  3989. end
  3990. end)
  3991. frame:SetScript("OnDragStop", function(self)
  3992. self:StopMovingOrSizing()
  3993. VExRT.Bossmods.ArchimondeLeft = self:GetLeft()
  3994. VExRT.Bossmods.ArchimondeTop = self:GetTop()
  3995. end)
  3996. if VExRT.Bossmods.ArchimondeLeft and VExRT.Bossmods.ArchimondeTop then
  3997. frame:SetPoint("TOPLEFT",UIParent,"BOTTOMLEFT",VExRT.Bossmods.ArchimondeLeft,VExRT.Bossmods.ArchimondeTop)
  3998. else
  3999. frame:SetPoint("CENTER",-200,0)
  4000. end
  4001.  
  4002. if VExRT.Bossmods.Alpha then frame:SetAlpha(VExRT.Bossmods.Alpha/100) end
  4003. --if VExRT.Bossmods.Scale then frame:SetScale(VExRT.Bossmods.Scale/100) end
  4004.  
  4005. frame.isEnabled = true
  4006.  
  4007. frame.back = frame:CreateTexture(nil, "BACKGROUND")
  4008. frame.back:SetTexture(.7,.7,.7,.4)
  4009. frame.back:SetAllPoints()
  4010.  
  4011. frame.player = frame:CreateTexture(nil, "OVERLAY")
  4012. frame.player:SetSize(32,32)
  4013. frame.player:SetPoint("CENTER",0,0)
  4014. frame.player:SetDrawLayer("OVERLAY", 1)
  4015. frame.player:SetTexture("Interface\\MINIMAP\\MinimapArrow")
  4016. --frame.player:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Gold-Dragon")
  4017. ELib:Shadow(frame,15,20)
  4018.  
  4019. frame.close = ELib:Icon(frame,[[Interface\AddOns\ExRT\media\DiesalGUIcons16x256x128.tga]],16,true):Point("TOPRIGHT",2,18)
  4020. frame.close.texture:SetTexCoord(0.5,0.5625,0.5,0.625)
  4021. frame.close:SetScript("OnClick",function(self)
  4022. self:GetParent():Hide()
  4023. end)
  4024. frame.close:SetScript("OnEnter",function(self)
  4025. self.texture:SetVertexColor(1,0,.7,1)
  4026. end)
  4027. frame.close:SetScript("OnLeave",function(self)
  4028. self.texture:SetVertexColor(1,1,1,1)
  4029. end)
  4030.  
  4031. frame.lines = {}
  4032. local SetLine,RotateTexture,RotateCoordPair
  4033. do
  4034. local cos, sin = math.cos, math.sin
  4035. function RotateCoordPair(x,y,ox,oy,a,asp)
  4036. y=y/asp
  4037. oy=oy/asp
  4038. return ox + (x-ox)*cos(a) - (y-oy)*sin(a),(oy + (y-oy)*cos(a) + (x-ox)*sin(a))*asp
  4039. end
  4040. function RotateTexture(self,angle,xT,yT,xB,yB,xC,yC,userAspect)
  4041. local aspect = userAspect or (xT-xB)/(yT-yB)
  4042. local g1,g2 = RotateCoordPair(xT,yT,xC,yC,angle,aspect)
  4043. local g3,g4 = RotateCoordPair(xT,yB,xC,yC,angle,aspect)
  4044. local g5,g6 = RotateCoordPair(xB,yT,xC,yC,angle,aspect)
  4045. local g7,g8 = RotateCoordPair(xB,yB,xC,yC,angle,aspect)
  4046.  
  4047. self:SetTexCoord(g1,g2,g3,g4,g5,g6,g7,g8)
  4048. end
  4049. function SetLine(i,fX,fY,tX,tY,c)
  4050. local line = frame.lines[i]
  4051. if not line then
  4052. line = frame:CreateTexture(nil, "ARTWORK")
  4053. frame.lines[i] = line
  4054. line:SetTexture("Interface\\AddOns\\ExRT\\media\\line"..(VExRT.Bossmods.ArchimondeLineSize or 12).."px")
  4055. line:SetSize(256,256)
  4056. line:SetVertexColor(0.6, 1, 0.6, 1)
  4057. end
  4058. local toDown = tY < fY
  4059. if toDown then
  4060. tY,fY = fY,tY
  4061. end
  4062. local size = max(tX-fX,tY-fY)
  4063. local changeSize = (1 - (size / 256)) / 2
  4064. local min,max = changeSize,1 - changeSize
  4065. local angle
  4066. if tX-fX == 0 then
  4067. angle = 90
  4068. else
  4069. angle = atan( (tY-fY)/(tX-fX) )
  4070. end
  4071. if toDown then
  4072. angle = -angle
  4073. end
  4074. line:SetSize(size,size)
  4075. RotateTexture(line,(PI/180)*angle,min,min,max,max,.5,.5)
  4076.  
  4077. line:SetPoint("CENTER",frame,"BOTTOMLEFT",fX + (tX - fX)/2, fY + (tY - fY)/2)
  4078. c = c or 1
  4079. local color_list = LINES_COLORS[c]
  4080. if c == 3 then
  4081. line:SetVertexColor(1,0, 0,0.9)
  4082. else
  4083. line:SetVertexColor(color_list.r, color_list.g, color_list.b, color_list.a)
  4084. end
  4085. line:Show()
  4086. end
  4087. end
  4088.  
  4089. local function UpdateLinesBold(size)
  4090. VExRT.Bossmods.ArchimondeLineSize = size
  4091. size = size or 12
  4092. for i=1,#frame.lines do
  4093. frame.lines[i]:SetTexture("Interface\\AddOns\\ExRT\\media\\line"..size.."px")
  4094. end
  4095. end
  4096.  
  4097.  
  4098. frame.players = {}
  4099. local function SetPlayer(i,pX,pY,class)
  4100. if VExRT.Bossmods.ArchimondeDisableText then
  4101. return
  4102. end
  4103.  
  4104. -- CUSTOM
  4105. local text = frame.players[i]
  4106. if not text then
  4107. text = frame:CreateTexture(nil, "OVERLAY")
  4108. frame.players[i] = text
  4109. end
  4110. text:SetTexture("Interface\\Minimap\\PartyRaidBlips")
  4111. text:SetTexCoord(BLIP_TEX_COORDS[class][1], BLIP_TEX_COORDS[class][2], BLIP_TEX_COORDS[class][3], BLIP_TEX_COORDS[class][4])
  4112. local size = 35 - .4 * VIEW_DISTANCE
  4113. text:SetSize(size, size)
  4114. text:SetPoint("CENTER",frame,"BOTTOMLEFT",pX,pY)
  4115. -- CUSTOM
  4116.  
  4117. text:Show()
  4118. end
  4119.  
  4120. frame.circles = {}
  4121. frame.circlesNum = {}
  4122. local function SetCircle(i,pX,pY,c, collisions, showText, isChains)
  4123. local circle = frame.circles[i]
  4124. local circleText = frame.circlesNum[i]
  4125. if not circle then
  4126. circle = frame:CreateTexture(nil, "BACKGROUND")
  4127. circle:SetDrawLayer("BACKGROUND", 1)
  4128. frame.circles[i] = circle
  4129. circle:SetTexture("Interface\\AddOns\\ExRT\\media\\circle256")
  4130. end
  4131. if not circleText then
  4132. circleText = frame:CreateFontString(nil,"BACKGROUND")
  4133. circleText:SetDrawLayer("BACKGROUND", 2)
  4134. frame.circlesNum[i] = circleText
  4135. local rad = (VExRT.Bossmods.ArchimondeRadius or 20) > 30
  4136. circleText:SetFont(ExRT.F.defFont, rad and 10 or 12, "OUTLINE")
  4137. end
  4138. circleText:SetPoint("CENTER",frame,"BOTTOMLEFT",pX,pY)
  4139. circleText:SetText(collisions)
  4140. if showText then
  4141. circleText:Show()
  4142. end
  4143.  
  4144. local isPlayer = c == 4
  4145. local half_size = FRAME_SIZE / VIEW_DISTANCE2 * (isPlayer and 30 or 25)
  4146. local size = half_size * 2
  4147.  
  4148. local width,height = size,size
  4149.  
  4150. local npX,npY = pX - half_size,pY - half_size
  4151.  
  4152. local L,R,T,B = 0,1,0,1
  4153. local left = pX - half_size
  4154. local right = pX + half_size
  4155. if left < 0 then
  4156. L = -left / size
  4157. width = width - L * size
  4158.  
  4159. npX = 0
  4160. end
  4161. if right > FRAME_SIZE then
  4162. R = (right - FRAME_SIZE) / size
  4163. width = width - R * size
  4164. R = 1 - R
  4165. end
  4166.  
  4167. local bottom = pY - half_size
  4168. local top = pY + half_size
  4169. if bottom < 0 then
  4170. B = -bottom / size
  4171. height = height - B * size
  4172. B = 1 - B
  4173.  
  4174. npY = 0
  4175. end
  4176. if top > FRAME_SIZE then
  4177. T = (top - FRAME_SIZE) / size
  4178. height = height - T * size
  4179. end
  4180. if L == R or T == B then
  4181. return
  4182. end
  4183.  
  4184. circle:SetTexCoord(L,R,T,B)
  4185.  
  4186. circle:SetPoint("BOTTOMLEFT",frame,"BOTTOMLEFT",npX,npY)
  4187. circle:SetSize(width,height)
  4188. if isChains and collisions > 0 then
  4189. c = 3 -- red
  4190. elseif isChains and collisions == 0 then
  4191. c = 1 -- green
  4192. end
  4193. local color_list = LINES_COLORS[c or 1]
  4194.  
  4195. local alpha = .5
  4196. if isPlayer then
  4197. alpha = .25
  4198. end
  4199. circle:SetVertexColor(color_list.r, color_list.g, color_list.b, alpha)
  4200. circle:Show()
  4201. end
  4202.  
  4203. local function GetContactPosition(x1,x2,x3,x4,y1,y2,y3,y4)
  4204. local d = (x1-x2)*(y4-y3) - (y1-y2)*(x4-x3)
  4205. local da= (x1-x3)*(y4-y3) - (y1-y3)*(x4-x3)
  4206. local db= (x1-x2)*(y1-y3) - (y1-y2)*(x1-x3)
  4207.  
  4208. local ta,tb=da/d,db/d
  4209.  
  4210. if ta >= 0 and ta <= 1 and tb >=0 and tb <= 1 then
  4211. local x=x1 + ta *(x2 - x1)
  4212. local y=y1 + ta *(y2 - y1)
  4213.  
  4214. return x,y
  4215. end
  4216. end
  4217.  
  4218. local function IsDotIn(pX,pY,point1x,point2x,point3x,point4x,point1y,point2y,point3y,point4y)
  4219. local D1 = (pX - point1x) * (point2y - point1y) - (pY - point1y) * (point2x - point1x) --1,2
  4220. local D2 = (pX - point2x) * (point3y - point2y) - (pY - point2y) * (point3x - point2x) --2,3
  4221. local D3 = (pX - point3x) * (point4y - point3y) - (pY - point3y) * (point4x - point3x) --3,4
  4222. local D4 = (pX - point4x) * (point1y - point4y) - (pY - point4y) * (point1x - point4x) --4,1
  4223.  
  4224. return (D1 < 0 and D2 < 0 and D3 < 0 and D4 < 0) or (D1 > 0 and D2 > 0 and D3 > 0 and D4 > 0)
  4225. end
  4226.  
  4227. local function dist(x1,y1,x2,y2)
  4228. local dX = (x1 - x2)
  4229. local dY = (y1 - y2)
  4230. return sqrt(dX * dX + dY * dY)
  4231. end
  4232. local function dist_dot(x0,y0,x1,y1,x2,y2)
  4233. local r1 = dist(x0,y0,x1,y1)
  4234. local r2 = dist(x0,y0,x2,y2)
  4235. local r12 = dist(x1,y1,x2,y2)
  4236.  
  4237. local a = y2 - y1
  4238. local b = x1 - x2
  4239. local c = - x1 * (y2 - y1) + y1 * (x2 - x1)
  4240.  
  4241. local t = dist(a,b,0,0)
  4242. if c > 0 then
  4243. a = -a
  4244. b = -b
  4245. c = -c
  4246. end
  4247. return (a*x0+b*y0+c)/t
  4248. end
  4249.  
  4250. function contains(arr, value)
  4251. if value == nil then
  4252. return false
  4253. end
  4254. if arr == nil then
  4255. return false
  4256. end
  4257. for k, v in pairs(arr) do
  4258. if k == value then
  4259. return true
  4260. end
  4261. end
  4262. return false
  4263. end
  4264.  
  4265. local function IsCircleIn(xC,yC,R,x1,y1,x2,y2)
  4266. x1 = x1 - xC
  4267. y1 = y1 - yC
  4268. x2 = x2 - xC
  4269. y2 = y2 - yC
  4270.  
  4271. local dx = x2 - x1
  4272. local dy = y2 - y1
  4273.  
  4274. local a = dx*dx + dy*dy
  4275. local b = 2 * (x1 * dx + y1 * dy)
  4276. local c = x1 * x1 + y1*y1 - R*R
  4277.  
  4278. if -b < 0 then
  4279. return c < 0
  4280. elseif -b < (2*a) then
  4281. return (4*a*c - b*b) < 0
  4282. else
  4283. return (a+b+c) < 0
  4284. end
  4285. end
  4286.  
  4287. local chainsList,chainsWipe = {},0
  4288. local scheduleWipeChains = nil
  4289. local function scheduleWipeChains_Func()
  4290. scheduleWipeChains = nil
  4291. wipe(chainsList)
  4292. frame:Visibility()
  4293. end
  4294.  
  4295. local shackledList,shackledLast = {},0
  4296. local function AddTestSchackled()
  4297. local y,x = UnitPosition('player')
  4298. shackledList[#shackledList + 1] = {x=x,y=y}
  4299. end
  4300.  
  4301. frame.Visibility = function(self)
  4302. local chainsCount = table_len(chainsList)
  4303. local shackledCount = table_len(shackledList)
  4304. if chainsCount == 0 and shackledCount == 0 then
  4305. self:Hide()
  4306. end
  4307. end
  4308.  
  4309. frame:SetScript("OnEvent",function(self,mainEvent,timestamp,event,hideCaster,sourceGUID,sourceName,sourceFlags,sourceFlags2,destGUID,destName,destFlags,destFlags2,spellID,...)
  4310. if mainEvent == 'COMBAT_LOG_EVENT_UNFILTERED' then
  4311. if event == "SPELL_AURA_APPLIED" then
  4312. if spellID == 185014 then
  4313. if scheduleWipeChains then
  4314. scheduleWipeChains:Cancel()
  4315. scheduleWipeChains = nil
  4316. end
  4317. scheduleWipeChains = C_Timer.NewTimer(7,scheduleWipeChains_Func)
  4318.  
  4319. local currTime = GetTime()
  4320. if (currTime - chainsWipe) > 4 then
  4321. wipe(chainsList)
  4322. end
  4323. chainsWipe = currTime
  4324.  
  4325. chainsList[sourceName] = destName
  4326.  
  4327. frame:Show()
  4328. elseif spellID == 184964 then
  4329. local _,_,difficulty = GetInstanceInfo()
  4330. if VExRT.Bossmods.ArchimondeDisableShackled or difficulty ~= 16 then
  4331. return
  4332. end
  4333. local currTime = GetTime()
  4334. if (currTime - shackledLast) > 25 then
  4335. wipe(shackledList)
  4336. end
  4337. shackledLast = currTime
  4338. local y,x = UnitPosition(destName)
  4339. if not x or y == 0 then
  4340. return
  4341. end
  4342. shackledList[destName] = {x=x,y=y}
  4343.  
  4344. frame:Show()
  4345. end
  4346. elseif event == "SPELL_AURA_REMOVED" then
  4347. if spellID == 185014 then
  4348. chainsList[sourceName] = nil
  4349.  
  4350. --if ExRT.F.table_len(chainsList) == 0 then frame:Hide() end
  4351. frame:Visibility()
  4352. elseif spellID == 184964 then
  4353. shackledList[destName] = nil
  4354.  
  4355. frame:Visibility()
  4356. end
  4357. end
  4358. elseif mainEvent == 'ENCOUNTER_START' or mainEvent == 'ENCOUNTER_END' then
  4359. wipe(shackledList)
  4360. wipe(chainsList)
  4361.  
  4362. frame:Visibility()
  4363. end
  4364. end)
  4365. frame:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
  4366. frame:RegisterEvent('ENCOUNTER_START')
  4367. frame:RegisterEvent('ENCOUNTER_END')
  4368.  
  4369. local DEBUG_POS = {
  4370. [1] = {y=5623.8002929688,x=4531.8999023438},
  4371. [2] = {y=5654,x=4520},
  4372. [3] = {y=5645.3002929688,x=4547.1000976563},
  4373. [4] = {y=5648.5,x=4513.5},
  4374. [5] = {y=5656.8999023438,x=4538.7001953125},
  4375. }
  4376.  
  4377. local function ARCHI_ADD(s,t,w)
  4378. if w then
  4379. wipe(chainsList)
  4380. end
  4381. chainsList[s] = t
  4382. end
  4383. local function ARCHI_WIPE()
  4384. wipe(chainsList)
  4385. wipe(shackledList)
  4386. end
  4387. local function ARCHI_TEST()
  4388. wipe(chainsList)
  4389. wipe(shackledList)
  4390. local list = {}
  4391.  
  4392. local groupSize = GetNumGroupMembers()
  4393.  
  4394. for i=1,groupSize do
  4395. local name = GetRaidRosterInfo(i)
  4396. if name then
  4397. list[#list + 1] = name
  4398. end
  4399. end
  4400.  
  4401. if groupSize == 0 then
  4402. local y,x = UnitPosition('player')
  4403. wipe(DEBUG_POS)
  4404. DEBUG_POS[1] = {x = x + 15, y = y + 15}
  4405. DEBUG_POS[2] = {x = x - 15, y = y + 15}
  4406. DEBUG_POS[3] = {x = x - 15, y = y - 15}
  4407. DEBUG_POS[4] = {x = x + 15, y = y - 15}
  4408. DEBUG_POS[5] = {x = x, y = y + 25}
  4409. for i=1,5 do
  4410. list[#list + 1] = i
  4411. end
  4412. list[#list + 1] = UnitName'player'
  4413.  
  4414. if not VExRT.Bossmods.ArchimondeDisableShackled then
  4415. local i = math.random(1,#list)
  4416. local name1 = list[i]
  4417. local x = DEBUG_POS[i].x
  4418. local y = DEBUG_POS[i].y
  4419. if x then
  4420. shackledList[name1] = {x = x, y = y}
  4421. end
  4422.  
  4423. local name2 = 'player'
  4424. if name2 ~= name1 then
  4425. y,x = UnitPosition(name2)
  4426. if x then
  4427. shackledList[name2] = {x = x, y = y}
  4428. end
  4429. end
  4430. end
  4431. else
  4432. if not VExRT.Bossmods.ArchimondeDisableShackled then
  4433. local name1 = list[math.random(1,#list)]
  4434. local y,x = UnitPosition(name1)
  4435. if x then
  4436. shackledList[name1] = {x = x, y = y}
  4437. end
  4438.  
  4439. local name2 = 'player'
  4440. if name2 ~= name1 then
  4441. y,x = UnitPosition(name2)
  4442. if x then
  4443. shackledList[name2] = {x = x, y = y}
  4444. end
  4445. end
  4446. end
  4447. end
  4448.  
  4449.  
  4450. --print('Archi TEST')
  4451. while #list > 1 do
  4452. local first = math.random(1,#list)
  4453. local name = list[first]
  4454. tremove(list,first)
  4455.  
  4456. local second = math.random(1,#list)
  4457. local name2 = list[second]
  4458. tremove(list,second)
  4459.  
  4460. chainsList[name] = name2
  4461.  
  4462. --print(name,'>',name2)
  4463. end
  4464.  
  4465. if IsShiftKeyDown() then
  4466. wipe(chainsList)
  4467. end
  4468. end
  4469.  
  4470. frame.optionsDropDown = CreateFrame("Frame", "ExRTBossmodsArchimondeOptionsDropDown", nil, "UIDropDownMenuTemplate")
  4471.  
  4472. frame.options = ELib:Icon(frame,[[Interface\AddOns\ExRT\media\DiesalGUIcons16x256x128.tga]],14,true):Point("TOPLEFT",2,16)
  4473. frame.options.texture:SetTexCoord(0.26,0.3025,0.51,0.615)
  4474. frame.options:SetScript("OnClick",function()
  4475. EasyMenu({
  4476. {
  4477. text = L.BossmodsKromogTest,
  4478. notCheckable = true,
  4479. func = function()
  4480. if ExRT.F.table_len(chainsList) > 0 then
  4481. wipe(chainsList)
  4482. wipe(shackledList)
  4483. else
  4484. ARCHI_TEST()
  4485. end
  4486. end,
  4487. },
  4488. {
  4489. text = L.BossmodsArchimondeDisableShackled,
  4490. checked = VExRT.Bossmods.ArchimondeDisableShackled,
  4491. func = function()
  4492. VExRT.Bossmods.ArchimondeDisableShackled = not VExRT.Bossmods.ArchimondeDisableShackled
  4493. wipe(shackledList)
  4494. end,
  4495. },
  4496. {
  4497. text = L.BossmodsArchimondeDisableText,
  4498. checked = VExRT.Bossmods.ArchimondeDisableText,
  4499. func = function()
  4500. VExRT.Bossmods.ArchimondeDisableText = not VExRT.Bossmods.ArchimondeDisableText
  4501. end,
  4502. },
  4503. {
  4504. text = L.BossmodsArchimondeDistance,
  4505. hasArrow = true,
  4506. notCheckable = true,
  4507. menuList = {
  4508. {text = "20y",func = function() VExRT.Bossmods.ArchimondeRadius = nil VIEW_DISTANCE = 20 VIEW_DISTANCE2 = VIEW_DISTANCE * 2 UpdateLinesBold() CloseDropDownMenus() end,checked = VExRT.Bossmods.ArchimondeRadius == 20 or not VExRT.Bossmods.ArchimondeRadius,},
  4509. {text = "25y",func = function() VExRT.Bossmods.ArchimondeRadius = 25 VIEW_DISTANCE = VExRT.Bossmods.ArchimondeRadius VIEW_DISTANCE2 = VIEW_DISTANCE * 2 UpdateLinesBold() CloseDropDownMenus() end,checked = VExRT.Bossmods.ArchimondeRadius == 25,},
  4510. {text = "30y",func = function() VExRT.Bossmods.ArchimondeRadius = 30 VIEW_DISTANCE = VExRT.Bossmods.ArchimondeRadius VIEW_DISTANCE2 = VIEW_DISTANCE * 2 UpdateLinesBold(10) CloseDropDownMenus() end,checked = VExRT.Bossmods.ArchimondeRadius == 30,},
  4511. {text = "35y",func = function() VExRT.Bossmods.ArchimondeRadius = 35 VIEW_DISTANCE = VExRT.Bossmods.ArchimondeRadius VIEW_DISTANCE2 = VIEW_DISTANCE * 2 UpdateLinesBold(8) CloseDropDownMenus() end,checked = VExRT.Bossmods.ArchimondeRadius == 35,},
  4512. {text = "40y",func = function() VExRT.Bossmods.ArchimondeRadius = 40 VIEW_DISTANCE = VExRT.Bossmods.ArchimondeRadius VIEW_DISTANCE2 = VIEW_DISTANCE * 2 UpdateLinesBold(6) CloseDropDownMenus() end,checked = VExRT.Bossmods.ArchimondeRadius == 40,},
  4513. {text = "50y",func = function() VExRT.Bossmods.ArchimondeRadius = 50 VIEW_DISTANCE = VExRT.Bossmods.ArchimondeRadius VIEW_DISTANCE2 = VIEW_DISTANCE * 2 UpdateLinesBold(4) CloseDropDownMenus() end,checked = VExRT.Bossmods.ArchimondeRadius == 50,},
  4514. {text = "60y",func = function() VExRT.Bossmods.ArchimondeRadius = 60 VIEW_DISTANCE = VExRT.Bossmods.ArchimondeRadius VIEW_DISTANCE2 = VIEW_DISTANCE * 2 UpdateLinesBold(4) CloseDropDownMenus() end,checked = VExRT.Bossmods.ArchimondeRadius == 60,},
  4515. },
  4516. },
  4517. {
  4518. text = L.bossmodsscale,
  4519. notCheckable = true,
  4520. func = function()
  4521. frame.scale:SetShown(not frame.scale:IsShown())
  4522. end,
  4523. },
  4524. {
  4525. text = L.bossmodsclose,
  4526. notCheckable = true,
  4527. func = function()
  4528. ExRT.F:ExBossmodsCloseAll()
  4529. CloseDropDownMenus()
  4530. end,
  4531. },
  4532. {
  4533. text = L.BossWatcherSelectFightClose,
  4534. notCheckable = true,
  4535. func = function()
  4536. CloseDropDownMenus()
  4537. end,
  4538. },
  4539. }, frame.optionsDropDown, "cursor", 10 , -15, "MENU")
  4540. end)
  4541.  
  4542. local function Lock(self,isLoad)
  4543. local parent = self:GetParent()
  4544. local var = VExRT.Bossmods.ArchimondeLock
  4545. if isLoad == 1 then
  4546. var = not var
  4547. end
  4548. if var then
  4549. VExRT.Bossmods.ArchimondeLock = nil
  4550. self.texture:SetTexture("Interface\\AddOns\\ExRT\\media\\un_lock.tga")
  4551. frame:SetMovable(true)
  4552. frame:EnableMouse(true)
  4553. else
  4554. VExRT.Bossmods.ArchimondeLock = true
  4555. self.texture:SetTexture("Interface\\AddOns\\ExRT\\media\\lock.tga")
  4556. frame:SetMovable(false)
  4557. frame:EnableMouse(false)
  4558. end
  4559. end
  4560.  
  4561. frame.lock = ELib:Icon(frame,"Interface\\AddOns\\ExRT\\media\\un_lock.tga",14,true):Point("TOPLEFT",18,16):OnClick(Lock)
  4562. Lock(frame.lock,1)
  4563.  
  4564. if VExRT.Bossmods.ArchimondeScale and tonumber(VExRT.Bossmods.ArchimondeScale) then
  4565. frame:SetScale(VExRT.Bossmods.ArchimondeScale)
  4566. end
  4567. frame.scale = ELib:Slider(frame):_Size(70,8):Point("BOTTOMRIGHT",frame,"TOPRIGHT",-25,5):Range(50,200,true):SetTo((VExRT.Bossmods.ArchimondeScale or 1)*100):Scale(1 / (VExRT.Bossmods.ArchimondeScale or 1)):OnChange(function(self,event)
  4568. event = ExRT.F.Round(event)
  4569. VExRT.Bossmods.ArchimondeScale = event / 100
  4570. ExRT.F.SetScaleFixTR(frame,VExRT.Bossmods.ArchimondeScale)
  4571. self:SetScale(1 / VExRT.Bossmods.ArchimondeScale)
  4572. self.tooltipText = event
  4573. self:tooltipReload(self)
  4574. end)
  4575. frame.scale:SetScript("OnMouseUp",function(self,button)
  4576. if button == "RightButton" then
  4577. self:SetValue(100)
  4578. end
  4579. end)
  4580. frame.scale:Hide()
  4581.  
  4582. local trottle = 0
  4583. frame:SetScript("OnUpdate",function(self,elapsed)
  4584. trottle = trottle + elapsed
  4585. if trottle > 0.02 then
  4586. trottle = 0
  4587. local playerY,playerX = UnitPosition('player')
  4588.  
  4589. local tLx,tLy,tRx,tRy,bRx,bRy,bLx,bLy = playerX + VIEW_DISTANCE,playerY + VIEW_DISTANCE,playerX - VIEW_DISTANCE,playerY + VIEW_DISTANCE,playerX - VIEW_DISTANCE, playerY - VIEW_DISTANCE,playerX + VIEW_DISTANCE,playerY - VIEW_DISTANCE
  4590.  
  4591. local angle = -GetPlayerFacing()
  4592. tLx,tLy = RotateCoordPair(tLx,tLy,playerX,playerY,angle,1)
  4593. tRx,tRy = RotateCoordPair(tRx,tRy,playerX,playerY,angle,1)
  4594. bRx,bRy = RotateCoordPair(bRx,bRy,playerX,playerY,angle,1)
  4595. bLx,bLy = RotateCoordPair(bLx,bLy,playerX,playerY,angle,1)
  4596.  
  4597. local size = 35 - .25 * VIEW_DISTANCE
  4598. frame.player:SetSize(size,size)
  4599.  
  4600. for i=1,#self.lines do
  4601. frame.lines[i]:Hide()
  4602. end
  4603. for i=1, 40 do
  4604. if frame.players[i] then
  4605. frame.players[i]:Hide()
  4606. end
  4607. end
  4608. for i=1,#self.circles do
  4609. frame.circles[i]:Hide()
  4610. frame.circlesNum[i]:Hide()
  4611. end
  4612.  
  4613. local count = 0
  4614. local countText = 0
  4615. local isRed = false
  4616. local onLines = 0
  4617. self.back:SetTexture(.7,.7,.7,.4)
  4618.  
  4619. for chainFrom,chainTo in pairs(chainsList) do
  4620.  
  4621. local sourceY,sourceX = UnitPosition(chainFrom)
  4622. local targetY,targetX = UnitPosition(chainTo)
  4623. if type(chainFrom) == 'number' then sourceY,sourceX = DEBUG_POS[chainFrom].y,DEBUG_POS[chainFrom].x end
  4624. if type(chainTo) == 'number' then targetY,targetX = DEBUG_POS[chainTo].y,DEBUG_POS[chainTo].x end
  4625. if not (sourceX == targetX and sourceY == targetY) and sourceX and targetX then
  4626.  
  4627. local dX = (sourceX - targetX)
  4628. local dY = (sourceY - targetY)
  4629. local dist = sqrt(dX * dX + dY * dY)
  4630.  
  4631. local t_cos = (targetX-sourceX) / dist
  4632. local newX = VECTOR_LENGTH * t_cos + targetX
  4633.  
  4634. local t_sin = (targetY-sourceY) / dist
  4635. local newY = VECTOR_LENGTH * t_sin + targetY
  4636.  
  4637. local radiusX,radiusY = VECTOR_DEPTH * t_sin, VECTOR_DEPTH * t_cos
  4638.  
  4639. local point1x = sourceX + radiusX
  4640. local point1y = sourceY - radiusY
  4641.  
  4642. local point2x = sourceX - radiusX
  4643. local point2y = sourceY + radiusY
  4644.  
  4645. local point3x = newX + radiusX
  4646. local point3y = newY - radiusY
  4647.  
  4648. local point4x = newX - radiusX
  4649. local point4y = newY + radiusY
  4650.  
  4651.  
  4652. local xS,yS,xE,yE = sourceX,sourceY,newX,newY
  4653.  
  4654. local x1,y1,x2,y2 = nil
  4655.  
  4656. local cx1,cy1 = GetContactPosition(xS,xE,tLx,tRx,yS,yE,tLy,tRy)
  4657. local cx2,cy2 = GetContactPosition(xS,xE,tRx,bRx,yS,yE,tRy,bRy)
  4658. local cx3,cy3 = GetContactPosition(xS,xE,bLx,bRx,yS,yE,bLy,bRy)
  4659. local cx4,cy4 = GetContactPosition(xS,xE,tLx,bLx,yS,yE,tLy,bLy)
  4660.  
  4661. if cx1 then
  4662. x1,y1 = cx1,cy1
  4663. end
  4664. if cx2 then
  4665. if x1 then
  4666. x2,y2 = cx2,cy2
  4667. else
  4668. x1,y1 = cx2,cy2
  4669. end
  4670. end
  4671. if cx3 then
  4672. if x1 then
  4673. x2,y2 = cx3,cy3
  4674. else
  4675. x1,y1 = cx3,cy3
  4676. end
  4677. end
  4678. if cx4 then
  4679. if x1 then
  4680. x2,y2 = cx4,cy4
  4681. else
  4682. x1,y1 = cx4,cy4
  4683. end
  4684. end
  4685.  
  4686. if IsDotIn(xS,yS,tLx,tRx,bRx,bLx,tLy,tRy,bRy,bLy) then
  4687. if not x1 then
  4688. x1,y1 = xS,yS
  4689. else
  4690. x2,y2 = xS,yS
  4691. end
  4692. end
  4693.  
  4694. if IsDotIn(xE,yE,tLx,tRx,bRx,bLx,tLy,tRy,bRy,bLy) then
  4695. if not x1 then
  4696. x1,y1 = xE,yE
  4697. else
  4698. x2,y2 = xE,yE
  4699. end
  4700. end
  4701.  
  4702. local isFromPlayer = UnitIsUnit('player',chainFrom)
  4703. local isToPlayer = UnitIsUnit('player',chainTo)
  4704. local isPlayer = isFromPlayer or isToPlayer
  4705.  
  4706. local isOnLine = IsDotIn(playerX,playerY,point1x,point2x,point4x,point3x,point1y,point2y,point4y,point3y)
  4707. if isOnLine and not isPlayer then
  4708. onLines = onLines + 1
  4709. if onLines > 0 then
  4710. isRed = true
  4711. self.back:SetTexture(1,.7,.7,.4)
  4712. end
  4713. end
  4714.  
  4715. if x1 and x2 then
  4716. count = count + 1
  4717.  
  4718. local aX = abs(dist_dot( x1,y1,tLx,tLy,bLx,bLy ) / VIEW_DISTANCE2 * FRAME_SIZE)
  4719. local aY = abs(dist_dot( x1,y1,bLx,bLy,bRx,bRy ) / VIEW_DISTANCE2 * FRAME_SIZE)
  4720. local bX = abs(dist_dot( x2,y2,tLx,tLy,bLx,bLy ) / VIEW_DISTANCE2 * FRAME_SIZE)
  4721. local bY = abs(dist_dot( x2,y2,bLx,bLy,bRx,bRy ) / VIEW_DISTANCE2 * FRAME_SIZE)
  4722.  
  4723. if aX > bX then aX,bX=bX,aX aY,bY=bY,aY end
  4724.  
  4725. SetLine(count,aX,aY,bX,bY,(isPlayer and 2) or (isOnLine and 3) or 1)
  4726. end
  4727. end
  4728. end
  4729.  
  4730. local circles_count = 0
  4731. for shackledTarget,shackledData in pairs(shackledList) do
  4732. local x,y = shackledData.x,shackledData.y
  4733.  
  4734. local isPlayer = UnitIsUnit('player',shackledTarget)
  4735. if isPlayer and (
  4736. IsCircleIn(x,y,30,tLx,tLy,tRx,tRy) or
  4737. IsCircleIn(x,y,30,tRx,tRy,bRx,bRy) or
  4738. IsCircleIn(x,y,30,bRx,bRy,bLx,bLy) or
  4739. IsCircleIn(x,y,30,bLx,bLy,tLx,tLy) or
  4740. IsDotIn(x,y,tLx,tRx,bRx,bLx,tLy,tRy,bRy,bLy)) then
  4741. circles_count = circles_count + 1
  4742.  
  4743. local aX = abs(dist_dot( x,y,tLx,tLy,bLx,bLy ) / VIEW_DISTANCE2 * FRAME_SIZE)
  4744. local aY = abs(dist_dot( x,y,bLx,bLy,bRx,bRy ) / VIEW_DISTANCE2 * FRAME_SIZE)
  4745.  
  4746. local side_x = (bLx - x) * (tLy - bLy) - (tLx - bLx) * (bLy - y)
  4747. if side_x < 0 then
  4748. aX = -aX
  4749. end
  4750.  
  4751. local side_y = (bRx - x) * (bLy - bRy) - (bLx - bRx) * (bRy - y)
  4752. if side_y < 0 then
  4753. aY = -aY
  4754. end
  4755.  
  4756. local collisions = 0 -- collisions don't matter for outline
  4757. local showText = false
  4758. SetCircle(circles_count,aX,aY,4,collisions,showText, false) -- for blue outline
  4759. end
  4760.  
  4761. if IsCircleIn(x,y,25,tLx,tLy,tRx,tRy) or
  4762. IsCircleIn(x,y,25,tRx,tRy,bRx,bRy) or
  4763. IsCircleIn(x,y,25,bRx,bRy,bLx,bLy) or
  4764. IsCircleIn(x,y,25,bLx,bLy,tLx,tLy) or
  4765. IsDotIn(x,y,tLx,tRx,bRx,bLx,tLy,tRy,bRy,bLy) then
  4766. circles_count = circles_count + 1
  4767.  
  4768. local aX = abs(dist_dot( x,y,tLx,tLy,bLx,bLy ) / VIEW_DISTANCE2 * FRAME_SIZE)
  4769. local aY = abs(dist_dot( x,y,bLx,bLy,bRx,bRy ) / VIEW_DISTANCE2 * FRAME_SIZE)
  4770.  
  4771. local side_x = (bLx - x) * (tLy - bLy) - (tLx - bLx) * (bLy - y)
  4772. if side_x < 0 then
  4773. aX = -aX
  4774. end
  4775.  
  4776. local side_y = (bRx - x) * (bLy - bRy) - (bLx - bRx) * (bRy - y)
  4777. if side_y < 0 then
  4778. aY = -aY
  4779. end
  4780.  
  4781. local isInCircle = ((playerX - x) * (playerX - x) + (playerY - y) * (playerY - y)) <= (25 *25)
  4782.  
  4783. local collisions = 0
  4784. local groupSize = GetNumGroupMembers()
  4785. for i=1,groupSize do
  4786. local name = GetRaidRosterInfo(i)
  4787. if name and not UnitIsDeadOrGhost(name) and name ~= UnitName('player') then
  4788. local sourceY,sourceX = UnitPosition(name)
  4789. if (((sourceX - x)^2 + (sourceY - y)^2) <= (25*25))and not contains(shackledList, name) then
  4790. collisions = collisions + 1
  4791. end
  4792. end
  4793. end
  4794. if groupSize == 0 then
  4795. for i=1,5 do
  4796. local name,_ = shackledList[i]
  4797. local sourceX = DEBUG_POS[i].x
  4798. local sourceY = DEBUG_POS[i].y
  4799. if (((sourceX - x)^2 + (sourceY - y)^2) <= (25*25)) and not contains(shackledList, name) then
  4800. collisions = collisions + 1
  4801. end
  4802. end
  4803. end
  4804. local showText = IsDotIn(x,y,tLx,tRx,bRx,bLx,tLy,tRy,bRy,bLy)
  4805. SetCircle(circles_count,aX,aY,isInCircle and 3 or 1,collisions, showText, isPlayer or false)
  4806.  
  4807. if isPlayer and collisions == 0 and frame.back:GetTexture() == 'Color-b3b3b366' then
  4808. frame.back:SetTexture(.4,1,.4,.4)
  4809. end
  4810. end
  4811.  
  4812. end
  4813.  
  4814. local groupSize = GetNumGroupMembers()
  4815. for i=1,groupSize do
  4816. local name = GetRaidRosterInfo(i)
  4817. if name and name ~= UnitName('player') and not UnitIsDeadOrGhost(name) then
  4818. local sourceY,sourceX = UnitPosition(name)
  4819. local _,class = UnitClass(name)
  4820. if not class then
  4821. class = "MAGE"
  4822. end
  4823. if IsDotIn(sourceX,sourceY,tLx,tRx,bRx,bLx,tLy,tRy,bRy,bLy) then
  4824. local aX = abs(dist_dot( sourceX,sourceY,tLx,tLy,bLx,bLy ) / VIEW_DISTANCE2 * FRAME_SIZE)
  4825. local aY = abs(dist_dot( sourceX,sourceY,bLx,bLy,bRx,bRy ) / VIEW_DISTANCE2 * FRAME_SIZE)
  4826. SetPlayer(i,aX,aY, class)
  4827. end
  4828. end
  4829. end
  4830. if groupSize == 0 then
  4831. local _,class = UnitClass('player')
  4832. if not class then
  4833. class = "MAGE"
  4834. end
  4835.  
  4836. for i=1,5 do
  4837. if IsDotIn(DEBUG_POS[i].x,DEBUG_POS[i].y,tLx,tRx,bRx,bLx,tLy,tRy,bRy,bLy) then
  4838. local aX = abs(dist_dot( DEBUG_POS[i].x,DEBUG_POS[i].y,tLx,tLy,bLx,bLy ) / VIEW_DISTANCE2 * FRAME_SIZE)
  4839. local aY = abs(dist_dot( DEBUG_POS[i].x,DEBUG_POS[i].y,bLx,bLy,bRx,bRy ) / VIEW_DISTANCE2 * FRAME_SIZE)
  4840. SetPlayer(i,aX,aY, class)
  4841. end
  4842. end
  4843. end
  4844. end
  4845. end)
  4846. end
  4847.  
  4848. -----------------------------------------
  4849. -- Archimonde Infernals
  4850. -----------------------------------------
  4851. local ArchimondeInfernals = {}
  4852. module.A.ArchimondeInfernals = ArchimondeInfernals
  4853.  
  4854. function ArchimondeInfernals:Load()
  4855. ExRT.Options.Frame:Hide()
  4856.  
  4857. local frame = ArchimondeInfernals.mainframe
  4858. if frame then
  4859. frame:RegisterEvent('ENCOUNTER_START')
  4860. frame:RegisterEvent('ENCOUNTER_END')
  4861. if not InCombatLockdown() then
  4862. frame:Test()
  4863. end
  4864. frame.isEnabled = true
  4865. return
  4866. end
  4867.  
  4868. local infernalMaxHP = 2893432
  4869. local infernalHellfireCD = 15
  4870.  
  4871. local SIZE_WIDTH,SIZE_HEIGHT = 220,36 --250,40
  4872.  
  4873. local infernalFrames = {}
  4874. local function HideAllFrames()
  4875. for i=1,#infernalFrames do
  4876. infernalFrames[i]:Hide()
  4877. end
  4878. end
  4879.  
  4880. local function SetHP(self,hp)
  4881. if hp <= 0 then
  4882. self.hp:Hide()
  4883. self.hpText:SetText("DEAD")
  4884.  
  4885. self.isAlive = false
  4886.  
  4887. local isAllDead = true
  4888. for j=1,#infernalFrames do
  4889. if infernalFrames[j].isAlive then
  4890. isAllDead = false
  4891. break
  4892. end
  4893. end
  4894. if isAllDead then
  4895. HideAllFrames()
  4896. end
  4897. else
  4898. local hp_per = hp / infernalMaxHP
  4899. self.hp:SetWidth(SIZE_WIDTH * hp_per)
  4900. self.hp:Show()
  4901. self.hpText:SetFormattedText("%.1f%%",hp_per * 100)
  4902.  
  4903. self.isAlive = true
  4904. end
  4905. end
  4906.  
  4907. local function AddFrame(i)
  4908. local frame = infernalFrames[i]
  4909. if not frame then
  4910. frame = CreateFrame('Frame',nil,UIParent)
  4911. infernalFrames[i] = frame
  4912. frame:SetSize(SIZE_WIDTH,SIZE_HEIGHT)
  4913. if i==1 then
  4914. if VExRT.Bossmods.ArchimondeInfernalPosX and VExRT.Bossmods.ArchimondeInfernalPosY then
  4915. frame:SetPoint("TOPLEFT",UIParent,"BOTTOMLEFT",VExRT.Bossmods.ArchimondeInfernalPosX,VExRT.Bossmods.ArchimondeInfernalPosY)
  4916. else
  4917. frame:SetPoint("TOP",UIParent,"CENTER",-350,200)
  4918. end
  4919. frame:EnableMouse(true)
  4920. frame:SetMovable(true)
  4921. else
  4922. frame:SetPoint("TOP",infernalFrames[i-1],"BOTTOM",0,-3)
  4923. end
  4924. frame:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",edgeFile = ExRT.F.defBorder,tile = false,edgeSize = 4})
  4925. frame:SetBackdropBorderColor(0.2,0.2,0.2,0.8)
  4926. --frame:SetBackdropColor(.2,.2,.2,1)
  4927. frame:SetBackdropColor(.2,.2,.2,0)
  4928.  
  4929. --if VExRT.Bossmods.Scale then
  4930. -- frame:SetScale(VExRT.Bossmods.Scale / 100)
  4931. --end
  4932. if VExRT.Bossmods.ArchimondeInfernalsScale then
  4933. frame:SetScale(VExRT.Bossmods.ArchimondeInfernalsScale)
  4934. end
  4935. if VExRT.Bossmods.Alpha then
  4936. frame:SetAlpha(VExRT.Bossmods.Alpha / 100)
  4937. end
  4938.  
  4939. if i == 1 then
  4940. frame.close = ELib:Icon(frame,[[Interface\AddOns\ExRT\media\DiesalGUIcons16x256x128.tga]],16,true):Point("TOPRIGHT",2,18)
  4941. frame.close.texture:SetTexCoord(0.5,0.5625,0.5,0.625)
  4942. frame.close:SetScript("OnClick",function(self)
  4943. HideAllFrames()
  4944. end)
  4945. frame.close:SetScript("OnEnter",function(self)
  4946. self.texture:SetVertexColor(1,0,.7,1)
  4947. end)
  4948. frame.close:SetScript("OnLeave",function(self)
  4949. self.texture:SetVertexColor(1,1,1,1)
  4950. end)
  4951.  
  4952. frame.optionsDropDown = CreateFrame("Frame", "ExRTBossmodsArchimondeInfernalsOptionsDropDown", nil, "UIDropDownMenuTemplate")
  4953.  
  4954. frame.options = ELib:Icon(frame,[[Interface\AddOns\ExRT\media\DiesalGUIcons16x256x128.tga]],16,true):Point("TOPRIGHT",-14,18)
  4955. frame.options.texture:SetTexCoord(0.26,0.3025,0.51,0.615)
  4956. frame.options:SetScript("OnClick",function()
  4957. EasyMenu({
  4958. {
  4959. text = L.BossmodsArchimondeDisableMarking,
  4960. checked = VExRT.Bossmods.ArchimondeDisableMarking,
  4961. func = function()
  4962. VExRT.Bossmods.ArchimondeDisableMarking = not VExRT.Bossmods.ArchimondeDisableMarking
  4963. end,
  4964. },
  4965. {
  4966. text = L.bossmodsscale,
  4967. notCheckable = true,
  4968. func = function()
  4969. frame.scale:SetShown(not frame.scale:IsShown())
  4970. end,
  4971. },
  4972. {
  4973. text = L.bossmodsclose,
  4974. notCheckable = true,
  4975. func = function()
  4976. ExRT.F:ExBossmodsCloseAll()
  4977. CloseDropDownMenus()
  4978. end,
  4979. },
  4980. {
  4981. text = L.BossWatcherSelectFightClose,
  4982. notCheckable = true,
  4983. func = function()
  4984. CloseDropDownMenus()
  4985. end,
  4986. },
  4987. }, frame.optionsDropDown, "cursor", 10 , -15, "MENU")
  4988. end)
  4989. end
  4990.  
  4991. frame:RegisterForDrag("LeftButton")
  4992. frame:SetScript("OnDragStart", function(self)
  4993. if self:IsMovable() then
  4994. self:StartMoving()
  4995. end
  4996. end)
  4997. frame:SetScript("OnDragStop", function(self)
  4998. self:StopMovingOrSizing()
  4999.  
  5000. VExRT.Bossmods.ArchimondeInfernalPosX = self:GetLeft()
  5001. VExRT.Bossmods.ArchimondeInfernalPosY = self:GetTop()
  5002. end)
  5003.  
  5004. frame.hp = frame:CreateTexture(nil, "BACKGROUND")
  5005. frame.hp:SetTexture(ExRT.F.barImg)
  5006. frame.hp:SetPoint("LEFT",0,0)
  5007. frame.hp:SetHeight(SIZE_HEIGHT)
  5008. frame.hp:SetVertexColor(1,.5,.5,1)
  5009.  
  5010. frame.back = frame:CreateTexture(nil, "BACKGROUND",nil,-7)
  5011. frame.back:SetTexture(ExRT.F.barImg)
  5012. frame.back:SetAllPoints()
  5013. frame.back:SetVertexColor(.2,.2,.2,.5)
  5014.  
  5015. frame.hpText = frame:CreateFontString(nil,"ARTWORK")
  5016. frame.hpText:SetPoint("LEFT", 32, 0)
  5017. frame.hpText:SetFont(ExRT.F.defFont, 16)
  5018. frame.hpText:SetShadowOffset(1,-1)
  5019.  
  5020. frame.icon = frame:CreateTexture(nil, "ARTWORK")
  5021. frame.icon:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcon_"..i)
  5022. frame.icon:SetPoint("LEFT",5,0)
  5023. frame.icon:SetSize(24,24)
  5024.  
  5025. frame.cdIcon = frame:CreateTexture(nil, "ARTWORK")
  5026. frame.cdIcon:SetTexture(GetSpellTexture(187078))
  5027. frame.cdIcon:SetPoint("RIGHT",frame,"LEFT",0,0)
  5028. frame.cdIcon:SetSize(SIZE_HEIGHT,SIZE_HEIGHT)
  5029.  
  5030. frame.cd = CreateFrame("Cooldown", nil, frame, "CooldownFrameTemplate")
  5031. frame.cd:SetDrawEdge(false)
  5032. frame.cd:SetAllPoints(frame.cdIcon)
  5033.  
  5034. frame.SetHP = SetHP
  5035. end
  5036.  
  5037. frame.isAlive = true
  5038. frame.cd:SetCooldown(GetTime(),infernalHellfireCD)
  5039. frame:SetHP(infernalMaxHP)
  5040. frame:Show()
  5041. for j=1,(i-1) do
  5042. infernalFrames[j]:Show()
  5043. end
  5044. end
  5045.  
  5046. local function ARCHI_INF_TEST()
  5047. AddFrame(1)
  5048. AddFrame(2)
  5049. AddFrame(3)
  5050. AddFrame(4)
  5051. AddFrame(5)
  5052.  
  5053. infernalFrames[1]:SetHP(2893432*0.9)
  5054. infernalFrames[2]:SetHP(2893432*0.5)
  5055. infernalFrames[3]:SetHP(-1)
  5056. infernalFrames[4]:SetHP(2893432*0.1)
  5057. infernalFrames[5]:SetHP(1)
  5058. end
  5059. ARCHI_INF_TEST()
  5060.  
  5061. local lastSummon = 0
  5062. local summonCount = 0
  5063. local infernalsHP = {}
  5064. local guidToFrame = {}
  5065.  
  5066. local frame = CreateFrame'Frame'
  5067. ArchimondeInfernals.mainframe = frame
  5068. frame:RegisterEvent('ENCOUNTER_START')
  5069. frame:RegisterEvent('ENCOUNTER_END')
  5070. frame.isEnabled = true
  5071. local function Engage()
  5072. wipe(infernalsHP)
  5073. wipe(guidToFrame)
  5074. HideAllFrames()
  5075. for i=1,#infernalFrames do
  5076. infernalFrames[i].isAlive = false
  5077. end
  5078. frame:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
  5079. frame:RegisterEvent('UNIT_TARGET')
  5080. frame:RegisterEvent('UPDATE_MOUSEOVER_UNIT')
  5081.  
  5082. local _,instanceType,difficultyID,difficultyName,maxPlayers,dynamicDifficulty,isDynamic,instanceMapID,instanceGroupSize = GetInstanceInfo()
  5083. if not instanceGroupSize or not tonumber(instanceGroupSize) then
  5084. instanceGroupSize = 10
  5085. else
  5086. instanceGroupSize = max(10,instanceGroupSize)
  5087. end
  5088.  
  5089. if difficultyID == 16 then
  5090. infernalMaxHP = 2893432
  5091. infernalHellfireCD = 15
  5092. elseif difficultyID == 15 then
  5093. --[[
  5094. 10: 904735
  5095. 14: 1284759
  5096. 15: 1379756
  5097. 16: 1474762
  5098. 30: 2804760
  5099.  
  5100. 95005
  5101. ]]
  5102.  
  5103. infernalMaxHP = 904735 + 95005 * (instanceGroupSize - 10)
  5104. infernalHellfireCD = 31
  5105. elseif difficultyID == 14 then
  5106. --[[
  5107. 10: 723811
  5108. 30: 2243808
  5109.  
  5110. 76000
  5111. ]]
  5112.  
  5113. infernalMaxHP = 723811 + 76000 * (instanceGroupSize - 10)
  5114. infernalHellfireCD = 31
  5115. elseif difficultyID == 7 then
  5116. --LFR, 16:23 26.08.2015, too hard for idiots, nerfs inc?
  5117. infernalMaxHP = 1397855
  5118. infernalHellfireCD = 46
  5119. end
  5120. end
  5121. frame.Engage = Engage
  5122. frame.Close = function(self)
  5123. self:UnregisterAllEvents()
  5124. self.isEnabled = false
  5125. HideAllFrames()
  5126. end
  5127. frame.SetAlpha = function(self,val)
  5128. for i=1,#infernalFrames do
  5129. infernalFrames[i]:SetAlpha(val)
  5130. end
  5131. end
  5132. frame.SetScale = function(self,val)
  5133. if infernalFrames[1] then
  5134. ExRT.F.SetScaleFix(infernalFrames[1],val)
  5135. end
  5136. for i=2,#infernalFrames do
  5137. infernalFrames[i]:SetScale(val)
  5138. end
  5139. end
  5140. frame.ClearAllPoints = function(self)
  5141. if infernalFrames[1] then
  5142. infernalFrames[1]:SetPoint("TOP",UIParent,"CENTER",-350,200)
  5143. end
  5144. end
  5145. frame.Test = ARCHI_INF_TEST
  5146.  
  5147. if infernalFrames[1] then
  5148. infernalFrames[1].scale = ELib:Slider(infernalFrames[1]):_Size(70,8):Point("BOTTOMRIGHT",infernalFrames[1],"TOPRIGHT",-70,6):Range(50,200,true):SetTo((VExRT.Bossmods.ArchimondeInfernalsScale or 1)*100):Scale(1 / (VExRT.Bossmods.ArchimondeInfernalsScale or 1)):OnChange(function(self,event)
  5149. event = ExRT.F.Round(event)
  5150. VExRT.Bossmods.ArchimondeInfernalsScale = event / 100
  5151. if infernalFrames[1] then
  5152. ExRT.F.SetScaleFixTR(infernalFrames[1],VExRT.Bossmods.ArchimondeInfernalsScale)
  5153. end
  5154. for i=2,#infernalFrames do
  5155. infernalFrames[i]:SetScale(VExRT.Bossmods.ArchimondeInfernalsScale)
  5156. end
  5157. self:SetScale(1 / VExRT.Bossmods.ArchimondeInfernalsScale)
  5158. self.tooltipText = event
  5159. self:tooltipReload(self)
  5160. end)
  5161. infernalFrames[1].scale:SetScript("OnMouseUp",function(self,button)
  5162. if button == "RightButton" then
  5163. self:SetValue(100)
  5164. end
  5165. end)
  5166. infernalFrames[1].scale:Hide()
  5167. end
  5168.  
  5169. local function Infernals_OnEvent(self,event,...)
  5170. if event == 'COMBAT_LOG_EVENT_UNFILTERED' then
  5171. local timestamp,event,hideCaster,sourceGUID,sourceName,sourceFlags,sourceFlags2,destGUID,destName,destFlags,destFlags2,spellID,swingOverkill,_,amount,overkill = ...
  5172. if event == "SPELL_SUMMON" then
  5173. if GetMobID(destGUID) == 94412 then
  5174. local currTime = GetTime()
  5175. if (currTime - lastSummon) > 20 then
  5176. HideAllFrames()
  5177. summonCount = 0
  5178. lastSummon = currTime
  5179. end
  5180. summonCount = summonCount + 1
  5181. infernalsHP[destGUID] = infernalMaxHP
  5182. guidToFrame[destGUID] = summonCount
  5183. AddFrame(summonCount)
  5184. end
  5185. elseif event == "SPELL_DAMAGE" or event == "RANGE_DAMAGE" or event == "SPELL_PERIODIC_DAMAGE" then
  5186. local target = destGUID and guidToFrame[destGUID]
  5187. if target then
  5188. local newHP = infernalsHP[destGUID] - amount - overkill
  5189. infernalsHP[destGUID] = newHP
  5190. infernalFrames[target]:SetHP(newHP)
  5191. end
  5192. elseif event == "SWING_DAMAGE" then
  5193. local target = destGUID and guidToFrame[destGUID]
  5194. if target then
  5195. local newHP = infernalsHP[destGUID] - spellID - swingOverkill
  5196. infernalsHP[destGUID] = newHP
  5197. infernalFrames[target]:SetHP(newHP)
  5198. end
  5199. elseif event == "UNIT_DIED" then
  5200. if GetMobID(destGUID) == 94412 then
  5201. local target = destGUID and guidToFrame[destGUID]
  5202. if target then
  5203. infernalsHP[destGUID] = -1
  5204. infernalFrames[target]:SetHP(-1)
  5205. end
  5206. end
  5207. elseif event == "SPELL_HEAL" or event == "SPELL_PERIODIC_HEAL" then
  5208. local target = destGUID and guidToFrame[destGUID]
  5209. if target then
  5210. local newHP = infernalsHP[destGUID] + amount - overkill
  5211. if newHP > infernalMaxHP then
  5212. newHP = infernalMaxHP
  5213. end
  5214. infernalsHP[destGUID] = newHP
  5215. infernalFrames[target]:SetHP(newHP)
  5216. end
  5217. end
  5218. elseif event == "UNIT_TARGET" or event == "UPDATE_MOUSEOVER_UNIT" then
  5219. if VExRT.Bossmods.ArchimondeDisableMarking then
  5220. return
  5221. end
  5222. local unit = ...
  5223. local targetUnit = event == "UNIT_TARGET" and (unit or "").."target" or "mouseover"
  5224. local targetGUID = UnitGUID(targetUnit)
  5225. if not targetGUID then return end
  5226. local targetMark = guidToFrame[ targetGUID ]
  5227. if targetMark and GetRaidTargetIndex(targetUnit) ~= targetMark then
  5228. SetRaidTarget(targetUnit, targetMark)
  5229. end
  5230. elseif event == 'ENCOUNTER_START' then
  5231. local eID = ...
  5232. if eID == 1799 then
  5233. Engage()
  5234. end
  5235. elseif event == 'ENCOUNTER_END' then
  5236. self:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
  5237. self:UnregisterEvent('UNIT_TARGET')
  5238. self:UnregisterEvent('UPDATE_MOUSEOVER_UNIT')
  5239. HideAllFrames()
  5240. end
  5241.  
  5242. end
  5243.  
  5244. frame:SetScript("OnEvent",Infernals_OnEvent)
  5245. end
  5246.  
  5247. -----------------------------------------
  5248. -- Gorefiend
  5249. -----------------------------------------
  5250. local Gorefiend = {}
  5251. module.A.Gorefiend = Gorefiend
  5252.  
  5253. function Gorefiend:Load()
  5254. ExRT.Options.Frame:Hide()
  5255.  
  5256. local frame = Gorefiend.mainframe
  5257. if frame then
  5258. frame:RegisterEvent('ENCOUNTER_START')
  5259. frame:RegisterEvent('ENCOUNTER_END')
  5260. if not InCombatLockdown() then
  5261. frame:Test()
  5262. end
  5263. frame.isEnabled = true
  5264. return
  5265. end
  5266.  
  5267. local SIZE_WIDTH,SIZE_HEIGHT = 170,24
  5268.  
  5269. local soulMaxHP = 1047180
  5270.  
  5271. local soulsFrames = {}
  5272. local function HideAllFrames()
  5273. for i=1,#soulsFrames do
  5274. soulsFrames[i]:Hide()
  5275. end
  5276. end
  5277.  
  5278. local function UpdateFrame(self,name,hp,cd)
  5279. if name then
  5280. if hp < 0 then hp = 0 end
  5281. local hp_per = hp / soulMaxHP
  5282. self.hp:SetWidth(SIZE_WIDTH * hp_per)
  5283. self.hpText:SetFormattedText("%dk / %.1f%%",hp / 1000,hp_per * 100)
  5284. self.nameText:SetText(name)
  5285. local isOnCD = (GetTime() - cd) < 36
  5286. if isOnCD then
  5287. self.cd:SetCooldown(cd,36)
  5288. self.cd_settedToZero = nil
  5289. elseif not self.cd_settedToZero then
  5290. self.cd:SetCooldown(cd,36)
  5291. self.cd_settedToZero = true
  5292. end
  5293. self.CD_TIMER = cd + 36
  5294. self:Show()
  5295. else
  5296. self:Hide()
  5297. self.CD_TIMER = nil
  5298. end
  5299. end
  5300.  
  5301. local function UpdateTimerText(self)
  5302. if self.CD_TIMER then
  5303. local curr = GetTime()
  5304. if self.CD_TIMER - curr > 0 then
  5305. self.cdText:SetFormattedText("%d",self.CD_TIMER - curr)
  5306. else
  5307. self.cdText:SetText("")
  5308. end
  5309. else
  5310. self.cdText:SetText("")
  5311. end
  5312. end
  5313.  
  5314. local function AddFrame(i)
  5315. local frame = soulsFrames[i]
  5316. if not frame then
  5317. frame = CreateFrame('Frame',nil,UIParent)
  5318. soulsFrames[i] = frame
  5319. frame:SetSize(SIZE_WIDTH,SIZE_HEIGHT)
  5320. if i==1 then
  5321. if VExRT.Bossmods.GorefiendPosX and VExRT.Bossmods.GorefiendPosY then
  5322. frame:SetPoint("TOPLEFT",UIParent,"BOTTOMLEFT",VExRT.Bossmods.GorefiendPosX,VExRT.Bossmods.GorefiendPosY)
  5323. else
  5324. frame:SetPoint("TOP",UIParent,"CENTER",-350,200)
  5325. end
  5326. frame:EnableMouse(true)
  5327. frame:SetMovable(true)
  5328. else
  5329. frame:SetPoint("TOP",soulsFrames[i-1],"BOTTOM",0,-3)
  5330. end
  5331. frame:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",edgeFile = ExRT.F.defBorder,tile = false,edgeSize = 4})
  5332. frame:SetBackdropBorderColor(0.2,0.2,0.2,0.8)
  5333. frame:SetBackdropColor(.2,.2,.2,0)
  5334.  
  5335. if VExRT.Bossmods.GorefiendScale then
  5336. frame:SetScale(VExRT.Bossmods.GorefiendScale)
  5337. end
  5338. if VExRT.Bossmods.Alpha then
  5339. frame:SetAlpha(VExRT.Bossmods.Alpha / 100)
  5340. end
  5341.  
  5342. if i == 1 then
  5343. frame.close = ELib:Icon(frame,[[Interface\AddOns\ExRT\media\DiesalGUIcons16x256x128.tga]],16,true):Point("TOPRIGHT",2,18)
  5344. frame.close.texture:SetTexCoord(0.5,0.5625,0.5,0.625)
  5345. frame.close:SetScript("OnClick",function(self)
  5346. HideAllFrames()
  5347. end)
  5348. frame.close:SetScript("OnEnter",function(self)
  5349. self.texture:SetVertexColor(1,0,.7,1)
  5350. end)
  5351. frame.close:SetScript("OnLeave",function(self)
  5352. self.texture:SetVertexColor(1,1,1,1)
  5353. end)
  5354.  
  5355. frame.optionsDropDown = CreateFrame("Frame", "ExRTBossmodsGorefiendOptionsDropDown", nil, "UIDropDownMenuTemplate")
  5356.  
  5357. frame.options = ELib:Icon(frame,[[Interface\AddOns\ExRT\media\DiesalGUIcons16x256x128.tga]],16,true):Point("TOPRIGHT",-14,18)
  5358. frame.options.texture:SetTexCoord(0.26,0.3025,0.51,0.615)
  5359. frame.options:SetScript("OnClick",function()
  5360. EasyMenu({
  5361. {
  5362. text = L.bossmodsscale,
  5363. notCheckable = true,
  5364. func = function()
  5365. frame.scale:SetShown(not frame.scale:IsShown())
  5366. end,
  5367. },
  5368. {
  5369. text = L.BossmodsGorefiendTargeting,
  5370. notCheckable = true,
  5371. func = function()
  5372. CloseDropDownMenus()
  5373. if InCombatLockdown() then
  5374. print('Combat Error')
  5375. return
  5376. end
  5377. ExRT.F:ExBossmodsCloseAll()
  5378. module.A.Gorefiend2:Load()
  5379. end,
  5380. },
  5381. {
  5382. text = L.bossmodsclose,
  5383. notCheckable = true,
  5384. func = function()
  5385. ExRT.F:ExBossmodsCloseAll()
  5386. CloseDropDownMenus()
  5387. end,
  5388. },
  5389. {
  5390. text = L.BossWatcherSelectFightClose,
  5391. notCheckable = true,
  5392. func = function()
  5393. CloseDropDownMenus()
  5394. end,
  5395. },
  5396. }, frame.optionsDropDown, "cursor", 10 , -15, "MENU")
  5397. end)
  5398. end
  5399.  
  5400. frame:RegisterForDrag("LeftButton")
  5401. frame:SetScript("OnDragStart", function(self)
  5402. if self:IsMovable() then
  5403. self:StartMoving()
  5404. end
  5405. end)
  5406. frame:SetScript("OnDragStop", function(self)
  5407. self:StopMovingOrSizing()
  5408.  
  5409. VExRT.Bossmods.GorefiendPosX = self:GetLeft()
  5410. VExRT.Bossmods.GorefiendPosY = self:GetTop()
  5411. end)
  5412.  
  5413. frame.hp = frame:CreateTexture(nil, "BACKGROUND")
  5414. frame.hp:SetTexture(ExRT.F.barImg)
  5415. frame.hp:SetPoint("LEFT",0,0)
  5416. frame.hp:SetHeight(SIZE_HEIGHT)
  5417. frame.hp:SetVertexColor(1,.5,.5,1)
  5418.  
  5419. frame.back = frame:CreateTexture(nil, "BACKGROUND",nil,-7)
  5420. frame.back:SetTexture(ExRT.F.barImg)
  5421. frame.back:SetAllPoints()
  5422. frame.back:SetVertexColor(.2,.2,.2,.5)
  5423.  
  5424. frame.hpText = frame:CreateFontString(nil,"ARTWORK")
  5425. frame.hpText:SetPoint("RIGHT", -3, 0)
  5426. frame.hpText:SetFont(ExRT.F.defFont, 12)
  5427. frame.hpText:SetShadowOffset(1,-1)
  5428. frame.hpText:SetJustifyH("RIGHT")
  5429.  
  5430. frame.nameText = frame:CreateFontString(nil,"ARTWORK")
  5431. frame.nameText:SetPoint("LEFT", 4, 0)
  5432. frame.nameText:SetPoint("RIGHT", frame.hpText, "LEFT", -1, 0)
  5433. frame.nameText:SetFont(ExRT.F.defFont, 12)
  5434. frame.nameText:SetShadowOffset(1,-1)
  5435. frame.nameText:SetJustifyH("LEFT")
  5436.  
  5437. frame.cdIcon = frame:CreateTexture(nil, "ARTWORK")
  5438. frame.cdIcon:SetTexture(GetSpellTexture(181295))
  5439. frame.cdIcon:SetPoint("RIGHT",frame,"LEFT",0,0)
  5440. frame.cdIcon:SetSize(SIZE_HEIGHT,SIZE_HEIGHT)
  5441.  
  5442. frame.cd = CreateFrame("Cooldown", nil, frame, "CooldownFrameTemplate")
  5443. frame.cd:SetDrawEdge(false)
  5444. frame.cd:SetAllPoints(frame.cdIcon)
  5445. frame.cd:SetHideCountdownNumbers(true)
  5446.  
  5447. frame.cdText = frame.cd:CreateFontString(nil,"ARTWORK")
  5448. frame.cdText:SetPoint("CENTER", frame.cd, 0, 0)
  5449. frame.cdText:SetFont(ExRT.F.defFont, 14, "OUTLINE")
  5450. --frame.cdText:SetShadowOffset(1,-1)
  5451. frame.cdText:SetJustifyH("CENTER")
  5452. frame.cdText:SetJustifyH("MIDDLE")
  5453.  
  5454. frame:SetScript("OnUpdate",UpdateTimerText)
  5455.  
  5456. frame.UpdateFrame = UpdateFrame
  5457. end
  5458. end
  5459.  
  5460. local targetToMark = {
  5461. [0x1] = 1,
  5462. [0x2] = 2,
  5463. [0x4] = 3,
  5464. [0x8] = 4,
  5465. [0x10] = 5,
  5466. [0x20] = 6,
  5467. [0x40] = 7,
  5468. [0x80] = 8,
  5469. }
  5470.  
  5471. local data = IsEncounterInProgress() and {} or {
  5472. {name = UnitName'player',time = GetTime(),hp = soulMaxHP},
  5473. {name = UnitName'player',time = GetTime(),hp = soulMaxHP * 0.67},
  5474. {name = UnitName'player',time = GetTime(),hp = soulMaxHP * 0.33,mark = 0x4},
  5475. }
  5476.  
  5477. local guidToFrame,unkSouls = {},{}
  5478.  
  5479. local function UpdateFrames()
  5480. local counter = 0
  5481. for i=1,#data do
  5482. local currData = data[i]
  5483. if currData.hp > 0 then
  5484. counter = counter + 1
  5485. if not soulsFrames[counter] then
  5486. AddFrame(counter)
  5487. end
  5488. local mark
  5489. if currData.mark then
  5490. local icon_id = targetToMark[ currData.mark ]
  5491. if icon_id then
  5492. mark = "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_".. icon_id ..":0|t "
  5493. end
  5494. end
  5495. soulsFrames[counter]:UpdateFrame((mark or "")..currData.name,currData.hp,currData.time)
  5496. else
  5497. currData.hp = nil
  5498. end
  5499. end
  5500. for i=counter+1,#soulsFrames do
  5501. soulsFrames[i]:UpdateFrame()
  5502. end
  5503. for i=#data,1,-1 do
  5504. if not data[i].hp then
  5505. local guid = data[i].guid
  5506. if guid then
  5507. guidToFrame[ guid ] = nil
  5508. end
  5509. tremove(data,i)
  5510. end
  5511. end
  5512. end
  5513.  
  5514. local frame = CreateFrame'Frame'
  5515. Gorefiend.mainframe = frame
  5516. frame:RegisterEvent('ENCOUNTER_START')
  5517. frame:RegisterEvent('ENCOUNTER_END')
  5518. frame:RegisterEvent('INSTANCE_ENCOUNTER_ENGAGE_UNIT')
  5519. frame.isEnabled = true
  5520. local function Engage()
  5521. wipe(guidToFrame)
  5522. wipe(data)
  5523. wipe(unkSouls)
  5524. HideAllFrames()
  5525.  
  5526. local _,_,difficultyID = GetInstanceInfo()
  5527. if difficultyID ~= 16 then
  5528. return
  5529. end
  5530.  
  5531. frame:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
  5532. end
  5533. frame.Engage = Engage
  5534. frame.Close = function(self)
  5535. self:UnregisterAllEvents()
  5536. self.isEnabled = false
  5537. HideAllFrames()
  5538. end
  5539. frame.SetAlpha = function(self,val)
  5540. for i=1,#soulsFrames do
  5541. soulsFrames[i]:SetAlpha(val)
  5542. end
  5543. end
  5544. frame.SetScale = function(self,val)
  5545. if soulsFrames[1] then
  5546. ExRT.F.SetScaleFix(soulsFrames[1],val)
  5547. end
  5548. for i=2,#soulsFrames do
  5549. soulsFrames[i]:SetScale(val)
  5550. end
  5551. end
  5552. frame.ClearAllPoints = function(self)
  5553. if soulsFrames[1] then
  5554. soulsFrames[1]:ClearAllPoints()
  5555. soulsFrames[1]:SetPoint("TOP",UIParent,"CENTER",-350,200)
  5556. end
  5557. end
  5558. frame.Test = function()
  5559. if GetNumGroupMembers() > 0 then
  5560. data = {
  5561. {name = UnitName'player',time = GetTime(),hp = soulMaxHP},
  5562. {name = UnitName('raid'..fastrandom(1,GetNumGroupMembers())) or UnitName'player',time = GetTime()-8,hp = soulMaxHP * fastrandom(50,90)/100},
  5563. {name = UnitName('raid'..fastrandom(1,GetNumGroupMembers())) or UnitName'player',time = GetTime()-15,hp = soulMaxHP * fastrandom(15,45)/100},
  5564. }
  5565. else
  5566. data = {
  5567. {name = UnitName'player',time = GetTime(),hp = soulMaxHP},
  5568. {name = UnitName'player',time = GetTime()-8,hp = soulMaxHP * fastrandom(50,90)/100},
  5569. {name = UnitName'player',time = GetTime()-15,hp = soulMaxHP * fastrandom(15,45)/100},
  5570. }
  5571. end
  5572. UpdateFrames()
  5573. end
  5574. frame.soulsFrames = soulsFrames
  5575.  
  5576. UpdateFrames()
  5577. if soulsFrames[1] then
  5578. soulsFrames[1].scale = ELib:Slider(soulsFrames[1]):_Size(70,8):Point("BOTTOMRIGHT",soulsFrames[1],"TOPRIGHT",-70,6):Range(50,200,true):SetTo((VExRT.Bossmods.GorefiendScale or 1)*100):Scale(1 / (VExRT.Bossmods.GorefiendScale or 1)):OnChange(function(self,event)
  5579. event = ExRT.F.Round(event)
  5580. VExRT.Bossmods.GorefiendScale = event / 100
  5581. if soulsFrames[1] then
  5582. ExRT.F.SetScaleFixTR(soulsFrames[1],VExRT.Bossmods.GorefiendScale)
  5583. end
  5584. for i=2,#soulsFrames do
  5585. soulsFrames[i]:SetScale(VExRT.Bossmods.GorefiendScale)
  5586. end
  5587. self:SetScale(1 / VExRT.Bossmods.GorefiendScale)
  5588. self.tooltipText = event
  5589. self:tooltipReload(self)
  5590. end)
  5591. soulsFrames[1].scale:SetScript("OnMouseUp",function(self,button)
  5592. if button == "RightButton" then
  5593. self:SetValue(100)
  5594. end
  5595. end)
  5596. soulsFrames[1].scale:Hide()
  5597. end
  5598.  
  5599. local function Gorefiend_OnEvent(self,event,...)
  5600. if event == 'COMBAT_LOG_EVENT_UNFILTERED' then
  5601. local timestamp,event,hideCaster,sourceGUID,sourceName,sourceFlags,sourceFlags2,destGUID,destName,destFlags,destFlags2,spellID,swingOverkill,_,amount,overkill = ...
  5602. if event == "SPELL_AURA_APPLIED" then
  5603. if spellID == 179867 then
  5604. tinsert(data,{
  5605. name = delUnitNameServer(destName),
  5606. time = GetTime(),
  5607. hp = soulMaxHP,
  5608. })
  5609. UpdateFrames()
  5610. end
  5611. elseif event == "SPELL_DAMAGE" or event == "RANGE_DAMAGE" or event == "SPELL_PERIODIC_DAMAGE" or event == "SWING_DAMAGE" then
  5612. if not destGUID or GetMobID(destGUID) ~= 93288 then
  5613. return
  5614. end
  5615. if event == "SWING_DAMAGE" then
  5616. amount,overkill = spellID,swingOverkill
  5617. end
  5618. local target = guidToFrame[destGUID]
  5619. if target then
  5620. target.hp = target.hp - amount - overkill
  5621. target.mark = destFlags2
  5622. UpdateFrames()
  5623. else
  5624. if destName then
  5625. for i=1,#data do
  5626. local currData = data[i]
  5627. if destName:find(currData.name) then
  5628. guidToFrame[destGUID] = currData
  5629. currData.guid = destGUID
  5630. currData.mark = destFlags2
  5631.  
  5632. currData.hp = currData.hp - amount - overkill
  5633. if unkSouls[destGUID] then
  5634. currData.hp = currData.hp - unkSouls[destGUID]
  5635. unkSouls[destGUID] = nil
  5636. end
  5637. UpdateFrames()
  5638.  
  5639. return
  5640. end
  5641. end
  5642. end
  5643. unkSouls[destGUID] = (unkSouls[destGUID] or 0) + amount + overkill
  5644. end
  5645. elseif event == "UNIT_DIED" then
  5646. if GetMobID(destGUID) == 93288 then
  5647. for i=1,#data do
  5648. if data[i].guid == destGUID then
  5649. guidToFrame[destGUID] = nil
  5650. tremove(data,i)
  5651. UpdateFrames()
  5652. return
  5653. end
  5654. end
  5655. elseif GetUnitTypeByGUID(destGUID) == 0 and destName then
  5656. destName = delUnitNameServer(destName)
  5657. for i=1,#data do
  5658. if data[i].name == destName then
  5659. local guid = data[i].guid
  5660. if guid then
  5661. guidToFrame[ guid ] = nil
  5662. end
  5663. tremove(data,i)
  5664. UpdateFrames()
  5665. return
  5666. end
  5667. end
  5668. end
  5669. end
  5670. elseif event == 'ENCOUNTER_START' then
  5671. if ... == 1783 then
  5672. C_Timer.After(1,function()
  5673. local boss1guid = UnitGUID'boss1'
  5674. if boss1guid and GetMobID(boss1guid) == 90199 then
  5675. Engage()
  5676. else
  5677. self:RegisterEvent('INSTANCE_ENCOUNTER_ENGAGE_UNIT')
  5678. end
  5679. end)
  5680. end
  5681. elseif event == 'ENCOUNTER_END' then
  5682. self:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
  5683. self:UnregisterEvent('INSTANCE_ENCOUNTER_ENGAGE_UNIT')
  5684. HideAllFrames()
  5685. wipe(guidToFrame)
  5686. wipe(data)
  5687. wipe(unkSouls)
  5688. elseif event == "INSTANCE_ENCOUNTER_ENGAGE_UNIT" then
  5689. local boss1guid = UnitGUID'boss1'
  5690. if boss1guid and GetMobID(boss1guid) == 90199 then
  5691. self:UnregisterEvent('INSTANCE_ENCOUNTER_ENGAGE_UNIT')
  5692. Engage()
  5693. end
  5694. end
  5695.  
  5696. end
  5697.  
  5698. frame:SetScript("OnEvent",Gorefiend_OnEvent)
  5699. end
  5700.  
  5701. -----------------------------------------
  5702. -- Gorefiend 2
  5703. -----------------------------------------
  5704.  
  5705. local Gorefiend2 = {}
  5706. module.A.Gorefiend2 = Gorefiend2
  5707.  
  5708. function Gorefiend2:Load()
  5709. ExRT.Options.Frame:Hide()
  5710.  
  5711. local frame = Gorefiend2.mainframe
  5712. if frame then
  5713. frame:RegisterEvent('ENCOUNTER_START')
  5714. frame:RegisterEvent('ENCOUNTER_END')
  5715. frame:RegisterEvent('GROUP_ROSTER_UPDATE')
  5716. if not InCombatLockdown() then
  5717. frame:Test()
  5718. end
  5719. frame:Show()
  5720. frame.isEnabled = true
  5721. return
  5722. end
  5723.  
  5724. if InCombatLockdown() then
  5725. print('Combat Error')
  5726. return
  5727. end
  5728.  
  5729. local SIZE_WIDTH,SIZE_HEIGHT = 140,20
  5730.  
  5731. local soulMaxHP = 1047180
  5732.  
  5733. local soulsFrames = {}
  5734.  
  5735. local function OnUpdateFrame(self)
  5736. local soul_data = self.soul_data
  5737. if soul_data then
  5738. local currTime = GetTime() - soul_data.time
  5739. if currTime > 0 then
  5740. local barTime = 36 - currTime
  5741. local width = barTime *2
  5742. if width > 0 then
  5743. self.backtimer:SetWidth(width)
  5744. if barTime > 10 then
  5745. self.backtimer:SetTexture(1,1,1,.8)
  5746. else
  5747. self.backtimer:SetTexture(1,.2,.2,.8)
  5748. end
  5749. self.backtimer:Show()
  5750. else
  5751. self.backtimer:Hide()
  5752. end
  5753. else
  5754. self.backtimer:Hide()
  5755. end
  5756. if currTime < 0 then currTime = 0 elseif currTime > 34 then currTime = 34 end
  5757. if currTime <= 17 then
  5758. currTime = currTime / 17 * 0.5
  5759. self.hp:SetVertexColor(0.5+currTime,1,0.5,1)
  5760. else
  5761. currTime = (currTime - 17) / 17 * 0.5
  5762. self.hp:SetVertexColor(1,1 - currTime,0.5,1)
  5763. end
  5764. else
  5765. self.hp:SetVertexColor(1,.5,.5,1)
  5766. end
  5767. end
  5768. local function UpdateFrame(self)
  5769. local name = self.name
  5770. if not name then
  5771. self:Hide()
  5772. return
  5773. end
  5774. self.nameText:SetText(name)
  5775. local soul_data = self.soul_data
  5776. if soul_data then
  5777. local hp = soul_data.hp
  5778. if hp < 0 then hp = 0 elseif hp > soulMaxHP then hp = soulMaxHP end
  5779. local hp_per = hp / soulMaxHP
  5780. self.hp:SetWidth(SIZE_WIDTH * hp_per)
  5781. self.hpText:SetFormattedText("%dk / %.1f%%",hp / 1000,hp_per * 100)
  5782. self.cd:Show()
  5783. self.cd:SetCooldown(soul_data.time,36)
  5784. self:SetAlpha(1)
  5785. self.CD_TIMER = soul_data.time + 36
  5786. if not self.OnUpdateSetted then
  5787. self:SetScript("OnUpdate",OnUpdateFrame)
  5788. self.OnUpdateSetted = true
  5789. end
  5790. else
  5791. self.hp:SetWidth(SIZE_WIDTH)
  5792. self.hpText:SetText("")
  5793. self.cd:Hide()
  5794. self.cd:SetCooldown(GetTime(),0)
  5795. self:SetAlpha(.1)
  5796. self.backtimer:Hide()
  5797. self.CD_TIMER = nil
  5798. if self.OnUpdateSetted then
  5799. self:SetScript("OnUpdate",nil)
  5800. self.hp:SetVertexColor(1,.5,.5,1)
  5801. self.OnUpdateSetted = nil
  5802. end
  5803. end
  5804. self:Show()
  5805. end
  5806.  
  5807. local function UpdateTimerText(self)
  5808. local paernt = self:GetParent()
  5809. if paernt.CD_TIMER then
  5810. local curr = GetTime()
  5811. if paernt.CD_TIMER - curr > 0 then
  5812. paernt.cdText:SetFormattedText("%d",paernt.CD_TIMER - curr)
  5813. else
  5814. paernt.cdText:SetText("")
  5815. end
  5816. else
  5817. paernt.cdText:SetText("")
  5818. end
  5819. end
  5820.  
  5821. local frame = CreateFrame('Frame',nil,UIParent)
  5822. Gorefiend2.mainframe = frame
  5823. frame:SetSize(SIZE_WIDTH,16)
  5824. if VExRT.Bossmods.GorefiendPosX and VExRT.Bossmods.GorefiendPosY then
  5825. frame:SetPoint("TOPLEFT",UIParent,"BOTTOMLEFT",VExRT.Bossmods.GorefiendPosX,VExRT.Bossmods.GorefiendPosY)
  5826. else
  5827. frame:SetPoint("TOP",UIParent,"CENTER",-350,200)
  5828. end
  5829. frame:EnableMouse(true)
  5830. frame:SetMovable(true)
  5831. frame.texture = frame:CreateTexture(nil, "BACKGROUND")
  5832. frame.texture:SetAllPoints()
  5833. frame.texture:SetTexture(0,0,0,.3)
  5834.  
  5835. frame.optionsDropDown = CreateFrame("Frame", "ExRTBossmodsGorefiend2OptionsDropDown", nil, "UIDropDownMenuTemplate")
  5836.  
  5837. frame.options = ELib:Icon(frame,[[Interface\AddOns\ExRT\media\DiesalGUIcons16x256x128.tga]],16,true):Point("RIGHT",-1,0)
  5838. frame.options.texture:SetTexCoord(0.26,0.3025,0.51,0.615)
  5839. frame.options:SetScript("OnClick",function()
  5840. EasyMenu({
  5841. {
  5842. text = L.bossmodsscale,
  5843. notCheckable = true,
  5844. func = function()
  5845. frame.scale:SetShown(not frame.scale:IsShown())
  5846. end,
  5847. },
  5848. {
  5849. text = L.bossmodsclose,
  5850. notCheckable = true,
  5851. func = function()
  5852. ExRT.F:ExBossmodsCloseAll()
  5853. CloseDropDownMenus()
  5854. end,
  5855. },
  5856. {
  5857. text = L.BossWatcherSelectFightClose,
  5858. notCheckable = true,
  5859. func = function()
  5860. CloseDropDownMenus()
  5861. end,
  5862. },
  5863. }, frame.optionsDropDown, "cursor", 10 , -15, "MENU")
  5864. end)
  5865. if VExRT.Bossmods.GorefiendScale then
  5866. frame:SetScale(VExRT.Bossmods.GorefiendScale)
  5867. end
  5868. if VExRT.Bossmods.Alpha then
  5869. frame:SetAlpha(VExRT.Bossmods.Alpha / 100)
  5870. end
  5871. frame:RegisterForDrag("LeftButton")
  5872. frame:SetScript("OnDragStart", function(self)
  5873. if self:IsMovable() and not InCombatLockdown() then
  5874. self:StartMoving()
  5875. end
  5876. end)
  5877. frame:SetScript("OnDragStop", function(self)
  5878. self:StopMovingOrSizing()
  5879.  
  5880. VExRT.Bossmods.GorefiendPosX = self:GetLeft()
  5881. VExRT.Bossmods.GorefiendPosY = self:GetTop()
  5882. end)
  5883.  
  5884.  
  5885. local function AddFrame(i)
  5886. local frame = soulsFrames[i]
  5887. if not frame then
  5888. frame = CreateFrame('Button',nil,Gorefiend2.mainframe,"SecureActionButtonTemplate")
  5889. soulsFrames[i] = frame
  5890. frame:SetSize(SIZE_WIDTH,SIZE_HEIGHT)
  5891. if i==1 then
  5892. frame:SetPoint("TOP",Gorefiend2.mainframe,"BOTTOM",0,-3)
  5893. else
  5894. frame:SetPoint("TOP",soulsFrames[i-1],"BOTTOM",0,-3)
  5895. end
  5896. frame:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",edgeFile = ExRT.F.defBorder,tile = false,edgeSize = 4})
  5897. frame:SetBackdropBorderColor(0.2,0.2,0.2,0.8)
  5898. frame:SetBackdropColor(.2,.2,.2,0)
  5899.  
  5900. frame:RegisterForClicks("AnyDown")
  5901. frame:SetAttribute("type", "macro")
  5902. frame:SetAttribute("macrotext", "/tar "..UnitName'player')
  5903.  
  5904. frame.hp = frame:CreateTexture(nil, "BACKGROUND")
  5905. frame.hp:SetTexture(ExRT.F.barImg)
  5906. frame.hp:SetPoint("LEFT",0,0)
  5907. frame.hp:SetHeight(SIZE_HEIGHT)
  5908. frame.hp:SetVertexColor(1,.5,.5,1)
  5909.  
  5910. frame.back = frame:CreateTexture(nil, "BACKGROUND",nil,-7)
  5911. frame.back:SetTexture(ExRT.F.barImg)
  5912. frame.back:SetAllPoints()
  5913. frame.back:SetVertexColor(.2,.2,.2,.5)
  5914.  
  5915. frame.backtimer = frame:CreateTexture(nil, "BACKGROUND",nil,-7)
  5916. frame.backtimer:SetTexture(1, 228/255, 181/255,1)
  5917. frame.backtimer:SetPoint("RIGHT",frame,"LEFT", -SIZE_HEIGHT,0)
  5918. frame.backtimer:SetSize(70,SIZE_HEIGHT)
  5919. frame.backtimer:Hide()
  5920.  
  5921. frame.hpText = frame:CreateFontString(nil,"ARTWORK")
  5922. frame.hpText:SetPoint("RIGHT", -3, 0)
  5923. frame.hpText:SetFont(ExRT.F.defFont, 12)
  5924. frame.hpText:SetShadowOffset(1,-1)
  5925. frame.hpText:SetJustifyH("RIGHT")
  5926.  
  5927. frame.nameText = frame:CreateFontString(nil,"ARTWORK")
  5928. frame.nameText:SetPoint("LEFT", 4, 0)
  5929. frame.nameText:SetPoint("RIGHT", frame.hpText, "LEFT", -1, 0)
  5930. frame.nameText:SetFont(ExRT.F.defFont, 12)
  5931. frame.nameText:SetShadowOffset(1,-1)
  5932. frame.nameText:SetJustifyH("LEFT")
  5933.  
  5934. frame.cdIcon = frame:CreateTexture(nil, "ARTWORK")
  5935. frame.cdIcon:SetTexture(GetSpellTexture(181295))
  5936. frame.cdIcon:SetPoint("RIGHT",frame,"LEFT",0,0)
  5937. frame.cdIcon:SetSize(SIZE_HEIGHT,SIZE_HEIGHT)
  5938.  
  5939. frame.cd = CreateFrame("Cooldown", nil, frame, "CooldownFrameTemplate")
  5940. frame.cd:SetDrawEdge(false)
  5941. frame.cd:SetAllPoints(frame.cdIcon)
  5942. frame.cd:SetHideCountdownNumbers(true)
  5943.  
  5944. frame.cdText = frame.cd:CreateFontString(nil,"ARTWORK")
  5945. frame.cdText:SetPoint("CENTER", frame.cd, 0, 0)
  5946. frame.cdText:SetFont(ExRT.F.defFont, 14, "OUTLINE")
  5947. --frame.cdText:SetShadowOffset(1,-1)
  5948. frame.cdText:SetJustifyH("CENTER")
  5949. frame.cdText:SetJustifyH("MIDDLE")
  5950.  
  5951. frame.timerUpdater = CreateFrame('Frame',nil,frame)
  5952. frame.timerUpdater:SetScript("OnUpdate",UpdateTimerText)
  5953.  
  5954. frame.UpdateFrame = UpdateFrame
  5955. --frame.Update = UpdateFrame
  5956. --frame:SetScript("OnUpdate",OnUpdateFrame)
  5957. end
  5958. end
  5959.  
  5960. local targetToMark = {
  5961. [0x1] = 1,
  5962. [0x2] = 2,
  5963. [0x4] = 3,
  5964. [0x8] = 4,
  5965. [0x10] = 5,
  5966. [0x20] = 6,
  5967. [0x40] = 7,
  5968. [0x80] = 8,
  5969. }
  5970.  
  5971. local data = {}
  5972.  
  5973. for i=1,20 do AddFrame(i) end
  5974.  
  5975. local function UpdateFrames()
  5976. for i=1,#soulsFrames do
  5977. soulsFrames[i]:UpdateFrame()
  5978. end
  5979. end
  5980. local function UpdateFrames_Roster()
  5981. if InCombatLockdown() then
  5982. C_Timer.NewTimer(5,UpdateFrames_Roster)
  5983. return
  5984. end
  5985. local n = GetNumGroupMembers()
  5986. if n == 0 then return end
  5987. local gMax = ExRT.F.GetRaidDiffMaxGroup()
  5988. local roster = {}
  5989. for i=1,n do
  5990. local name,_,subgroup = GetRaidRosterInfo(i)
  5991. if name and subgroup <= gMax then
  5992. roster[subgroup] = roster[subgroup] or {}
  5993. roster[subgroup][ #roster[subgroup] + 1 ] = name
  5994. end
  5995. end
  5996. local frameCounter = 0
  5997. for i=1,gMax do
  5998. roster[i] = roster[i] or {}
  5999. for j=1,5 do
  6000. local name = roster[i][j]
  6001. if name then
  6002. frameCounter = frameCounter + 1
  6003. local frame = soulsFrames[frameCounter]
  6004. if frame then
  6005. frame.name = delUnitNameServer(name)
  6006. --frame:SetAttribute("macrotext", "/target "..ExRT.F:utf8sub(delUnitNameServer(name), 1, 3))
  6007. --frame:SetAttribute("macrotext", "/target "..delUnitNameServer(name))
  6008. local _name = delUnitNameServer(name)
  6009. frame:SetAttribute("macrotext", "/target "..ExRT.F:utf8sub(_name, 1, ExRT.F:utf8len(_name)-1))
  6010. --[[
  6011. if i < 3 then
  6012. frame:SetAttribute("macrotext", "/target "..delUnitNameServer(name))
  6013. elseif i == 3 then
  6014. frame:SetAttribute("macrotext", "/target "..ExRT.F:utf8sub(delUnitNameServer(name), 1, 3))
  6015. else
  6016. frame:SetAttribute("macrotext", "/target "..ExRT.F:utf8sub(delUnitNameServer(name), 1, 3).."\n")
  6017. end
  6018. ]]
  6019. frame.soul_data = nil
  6020. frame:UpdateFrame()
  6021. end
  6022. end
  6023. end
  6024. end
  6025. for i=frameCounter+1,20 do
  6026. local frame = soulsFrames[i]
  6027. frame.name = nil
  6028. frame.soul_data = nil
  6029. frame:UpdateFrame()
  6030. end
  6031. end
  6032.  
  6033. local guidToFrame,unkSouls = {},{}
  6034.  
  6035. frame:RegisterEvent('ENCOUNTER_START')
  6036. frame:RegisterEvent('ENCOUNTER_END')
  6037. frame:RegisterEvent('INSTANCE_ENCOUNTER_ENGAGE_UNIT')
  6038. frame:RegisterEvent('GROUP_ROSTER_UPDATE')
  6039. frame.isEnabled = true
  6040. local function Engage()
  6041. wipe(guidToFrame)
  6042. wipe(data)
  6043. wipe(unkSouls)
  6044.  
  6045. local _,_,difficultyID = GetInstanceInfo()
  6046. if difficultyID ~= 16 then
  6047. return
  6048. end
  6049.  
  6050. for i=1,20 do
  6051. local frame = soulsFrames[i]
  6052. frame.soul_data = nil
  6053. end
  6054. UpdateFrames()
  6055.  
  6056. frame:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
  6057. end
  6058. frame.Engage = Engage
  6059. frame.Close = function(self)
  6060. self:UnregisterAllEvents()
  6061. self.isEnabled = false
  6062. self:Hide()
  6063. end
  6064. frame.Test = function()
  6065. if GetNumGroupMembers() > 0 then
  6066. UpdateFrames_Roster()
  6067. else
  6068. data = {
  6069. {name = UnitName'player',time = GetTime(),hp = soulMaxHP},
  6070. {name = UnitName'player',time = GetTime() - fastrandom(1,35),hp = soulMaxHP * fastrandom()},
  6071. {name = UnitName'player',time = GetTime() - fastrandom(1,35),hp = soulMaxHP * fastrandom(),mark = 0x4},
  6072. }
  6073. for i=1,20 do
  6074. soulsFrames[i].name = UnitName'player'
  6075. soulsFrames[i].soul_data = nil
  6076. end
  6077. local f1,f2,f3 = fastrandom(1,20),fastrandom(1,20),fastrandom(1,20)
  6078. soulsFrames[f1].soul_data = data[1]
  6079. soulsFrames[f2].soul_data = data[2]
  6080. soulsFrames[f3].soul_data = data[3]
  6081. C_Timer.After(-GetTime()+36+data[1].time,function()soulsFrames[f1].soul_data = nil UpdateFrames() end)
  6082. C_Timer.After(-GetTime()+36+data[2].time,function()soulsFrames[f2].soul_data = nil UpdateFrames() end)
  6083. C_Timer.After(-GetTime()+36+data[3].time,function()soulsFrames[f3].soul_data = nil UpdateFrames() end)
  6084. end
  6085. UpdateFrames()
  6086. end
  6087. frame.soulsFrames = soulsFrames
  6088.  
  6089. frame:Test()
  6090.  
  6091. frame.scale = ELib:Slider(frame):_Size(70,8):Point("RIGHT",frame,"RIGHT",-70,0):Range(50,200,true):SetTo((VExRT.Bossmods.GorefiendScale or 1)*100):Scale(1 / (VExRT.Bossmods.GorefiendScale or 1)):OnChange(function(self,event)
  6092. event = ExRT.F.Round(event)
  6093. VExRT.Bossmods.GorefiendScale = event / 100
  6094. ExRT.F.SetScaleFixTR(frame,VExRT.Bossmods.GorefiendScale)
  6095. self:SetScale(1 / VExRT.Bossmods.GorefiendScale)
  6096. self.tooltipText = event
  6097. self:tooltipReload(self)
  6098. end)
  6099. frame.scale:SetScript("OnMouseUp",function(self,button)
  6100. if button == "RightButton" then
  6101. self:SetValue(100)
  6102. end
  6103. end)
  6104. frame.scale:Hide()
  6105.  
  6106. local function Gorefiend2_OnEvent(self,event,...)
  6107. if event == 'COMBAT_LOG_EVENT_UNFILTERED' then
  6108. local timestamp,event,hideCaster,sourceGUID,sourceName,sourceFlags,sourceFlags2,destGUID,destName,destFlags,destFlags2,spellID,swingOverkill,_,amount,overkill = ...
  6109. if event == "SPELL_AURA_APPLIED" then
  6110. if spellID == 179867 then
  6111. local shortName = delUnitNameServer(destName)
  6112. tinsert(data,{
  6113. name = shortName,
  6114. time = GetTime(),
  6115. hp = soulMaxHP,
  6116. })
  6117. for i=1,#soulsFrames do
  6118. local frame = soulsFrames[i]
  6119. if frame.name == shortName then
  6120. frame.soul_data = data[#data]
  6121. end
  6122. end
  6123. UpdateFrames()
  6124. end
  6125. elseif event == "SPELL_DAMAGE" or event == "RANGE_DAMAGE" or event == "SPELL_PERIODIC_DAMAGE" or event == "SWING_DAMAGE" then
  6126. if not destGUID or GetMobID(destGUID) ~= 93288 then
  6127. return
  6128. end
  6129. if event == "SWING_DAMAGE" then
  6130. amount,overkill = spellID,swingOverkill
  6131. end
  6132. local target = guidToFrame[destGUID]
  6133. if target then
  6134. target.hp = target.hp - amount - overkill
  6135. target.mark = destFlags2
  6136. UpdateFrames()
  6137. else
  6138. if destName then
  6139. for i=1,#data do
  6140. local currData = data[i]
  6141. if destName:find(currData.name) then
  6142. guidToFrame[destGUID] = currData
  6143. currData.guid = destGUID
  6144. currData.mark = destFlags2
  6145.  
  6146. currData.hp = currData.hp - amount - overkill
  6147. if unkSouls[destGUID] then
  6148. currData.hp = currData.hp - unkSouls[destGUID]
  6149. unkSouls[destGUID] = nil
  6150. end
  6151. UpdateFrames()
  6152.  
  6153. return
  6154. end
  6155. end
  6156. end
  6157. unkSouls[destGUID] = (unkSouls[destGUID] or 0) + amount + overkill
  6158. end
  6159. elseif event == "UNIT_DIED" then
  6160. if GetMobID(destGUID) == 93288 then
  6161. for i=1,#data do
  6162. local currData = data[i]
  6163. if currData.guid == destGUID then
  6164. for j=1,#soulsFrames do
  6165. local frame = soulsFrames[j]
  6166. if frame.soul_data == currData then
  6167. frame.soul_data = nil
  6168. break
  6169. end
  6170. end
  6171. tremove(data,i)
  6172. guidToFrame[destGUID] = nil
  6173. UpdateFrames()
  6174. return
  6175. end
  6176. end
  6177. elseif GetUnitTypeByGUID(destGUID) == 0 and destName then
  6178. destName = delUnitNameServer(destName)
  6179. for i=1,#data do
  6180. local currData = data[i]
  6181. if currData.name == destName then
  6182. local guid = currData.guid
  6183. if guid then
  6184. guidToFrame[ guid ] = nil
  6185. end
  6186. for j=1,#soulsFrames do
  6187. local frame = soulsFrames[j]
  6188. if frame.soul_data == currData then
  6189. frame.soul_data = nil
  6190. break
  6191. end
  6192. end
  6193. tremove(data,i)
  6194. UpdateFrames()
  6195. return
  6196. end
  6197. end
  6198. end
  6199. end
  6200. elseif event == 'ENCOUNTER_START' then
  6201. if ... == 1783 then
  6202. C_Timer.After(1,function()
  6203. local boss1guid = UnitGUID'boss1'
  6204. if boss1guid and GetMobID(boss1guid) == 90199 then
  6205. Engage()
  6206. else
  6207. self:RegisterEvent('INSTANCE_ENCOUNTER_ENGAGE_UNIT')
  6208. end
  6209. end)
  6210. end
  6211. elseif event == 'ENCOUNTER_END' then
  6212. self:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
  6213. self:UnregisterEvent('INSTANCE_ENCOUNTER_ENGAGE_UNIT')
  6214. wipe(guidToFrame)
  6215. wipe(data)
  6216. wipe(unkSouls)
  6217. for j=1,#soulsFrames do
  6218. soulsFrames[j].soul_data = nil
  6219. end
  6220. UpdateFrames()
  6221. elseif event == "INSTANCE_ENCOUNTER_ENGAGE_UNIT" then
  6222. local boss1guid = UnitGUID'boss1'
  6223. if boss1guid and GetMobID(boss1guid) == 90199 then
  6224. self:UnregisterEvent('INSTANCE_ENCOUNTER_ENGAGE_UNIT')
  6225. Engage()
  6226. end
  6227. elseif event == 'GROUP_ROSTER_UPDATE' then
  6228. UpdateFrames_Roster()
  6229. end
  6230. end
  6231.  
  6232. frame:SetScript("OnEvent",Gorefiend2_OnEvent)
  6233. UpdateFrames()
  6234. end
  6235.  
  6236. -----------------------------------------
  6237. -- Options
  6238. -----------------------------------------
  6239.  
  6240. local function GetSpellText(spellID)
  6241. if spellID < 0 then
  6242. local name, _, _, abilityIcon = EJ_GetSectionInfo(-spellID)
  6243. if not name then
  6244. return ""
  6245. end
  6246. return "|T"..(abilityIcon or "")..":0|t"..name
  6247. end
  6248. local spellName,_,spellTexture = GetSpellInfo(spellID)
  6249. if not spellName then
  6250. return ""
  6251. end
  6252.  
  6253. return "|T"..spellTexture..":0|t"..spellName
  6254. end
  6255.  
  6256. function module.options:Load()
  6257. self:CreateTilte()
  6258.  
  6259. local PI2 = PI * 2
  6260.  
  6261. local model = CreateFrame("PlayerModel", nil, self)
  6262. model:SetSize(280,220)
  6263. model:SetPoint("BOTTOMRIGHT", 0, 67)
  6264. model:SetFrameStrata("DIALOG")
  6265. model:Hide()
  6266. --EncounterJournal.ceatureDisplayID
  6267.  
  6268. model.fac = 0
  6269. model:SetScript("OnUpdate",function (self,elapsed)
  6270. self.fac = self.fac + 0.5
  6271. if self.fac >= 360 then
  6272. self.fac = 0
  6273. end
  6274. self:SetFacing(PI2 / 360 * self.fac)
  6275.  
  6276. end)
  6277. model:SetScript("OnShow",function (self)
  6278. self.fac = 0
  6279. end)
  6280.  
  6281. self.model = model
  6282.  
  6283. local function buttonOnEnter(self)
  6284. if self.modelID then
  6285. model:Show()
  6286. model:SetDisplayInfo(self.modelID)
  6287. end
  6288. ELib.Tooltip.Std(self)
  6289. end
  6290. local function buttonOnLeave(self)
  6291. model:Hide()
  6292. ELib.Tooltip:Hide()
  6293. end
  6294.  
  6295. local positionNow = -25
  6296. local function AddTitle(title)
  6297. local this = ELib:Text(self,title,14):Size(650,20):Point(5,positionNow):Center():Color()
  6298. positionNow = positionNow - 18
  6299. return this
  6300. end
  6301. local function AddButton(title,tooltip,clickFunction,modelID,isChk,chkEnabled,chkTooltip)
  6302. local this = ELib:Button(self,title):Size(isChk and 625 or 650,20):Point(5,positionNow):Tooltip(tooltip):OnClick(clickFunction)
  6303. this:SetScript("OnEnter",buttonOnEnter)
  6304. this:SetScript("OnLeave",buttonOnLeave)
  6305. this.modelID = modelID
  6306. if isChk then
  6307. this.chk = ELib:Check(self,"",chkEnabled):Point(635,positionNow):Tooltip(chkTooltip)
  6308. end
  6309. positionNow = positionNow - 24
  6310. return this
  6311. end
  6312.  
  6313. AddTitle(L.bossmodstot)
  6314. AddButton(L.bossmodsraden,'/rt raden',RaDen.Load,47739)
  6315. AddTitle(L.bossmodssoo)
  6316. AddButton(L.bossmodsshaofpride,'/rt shapride',ShaOfPride.Load,49098)
  6317.  
  6318. local malkorok_loadbut = AddButton(L.bossmodsmalkorok,'/rt malkorok\n/rt malkorok raid',Malkorok.Load,49070,true,not VExRT.Bossmods.MalkorokAutoload,L.bossmodsAutoLoadTooltip)
  6319. malkorok_loadbut.chk:SetScript("OnClick", function(self,event)
  6320. if self:GetChecked() then
  6321. VExRT.Bossmods.MalkorokAutoload = nil
  6322. else
  6323. VExRT.Bossmods.MalkorokAutoload = true
  6324. end
  6325. end)
  6326.  
  6327. local malkorokAI_loadbut = AddButton(L.bossmodsmalkorokai,'/rt malkorokai',MalkorokAI.Load,49070,true,VExRT.Bossmods.MalkorokAIAutoload,L.bossmodsAutoLoadTooltip)
  6328. malkorokAI_loadbut.chk:SetScript("OnClick", function(self,event)
  6329. if self:GetChecked() then
  6330. VExRT.Bossmods.MalkorokAIAutoload = true
  6331. else
  6332. VExRT.Bossmods.MalkorokAIAutoload = nil
  6333. end
  6334. end)
  6335.  
  6336. local Spoils_of_Pandaria_loadbut = AddButton(L.bossmodsSpoilsofPandaria,nil,SpoilsOfPandaria.Load,51173,true,VExRT.Bossmods.SpoilsOfPandariaAutoload,L.bossmodsAutoLoadTooltip)
  6337. Spoils_of_Pandaria_loadbut.chk:SetScript("OnClick", function(self,event)
  6338. if self:GetChecked() then
  6339. VExRT.Bossmods.SpoilsOfPandariaAutoload = true
  6340. else
  6341. VExRT.Bossmods.SpoilsOfPandariaAutoload = nil
  6342. end
  6343. end)
  6344.  
  6345.  
  6346. AddTitle(L.RaidLootT17Highmaul)
  6347.  
  6348. local Koragh_loadbut = AddButton(L.BossmodsKoragh,L.BossmodsKoraghHelp,Koragh.Load,54825,true,not VExRT.Bossmods.KoraghAutoload,L.bossmodsAutoLoadTooltip)
  6349. Koragh_loadbut.chk:SetScript("OnClick", function(self,event)
  6350. if self:GetChecked() then
  6351. VExRT.Bossmods.KoraghAutoload = nil
  6352. else
  6353. VExRT.Bossmods.KoraghAutoload = true
  6354. end
  6355. end)
  6356.  
  6357. AddButton(L.BossmodsMargok,nil,Margok.Load,54329)
  6358.  
  6359. AddTitle(L.RaidLootT17BF)
  6360.  
  6361. local Kromog_loadbut = AddButton(L.BossmodsKromog,"/rt kromog",Kromog.Load,56214,true,not VExRT.Bossmods.KromogAutoload,L.bossmodsAutoLoadTooltip)
  6362. Kromog_loadbut.chk:SetScript("OnClick", function(self,event)
  6363. if self:GetChecked() then
  6364. VExRT.Bossmods.KromogAutoload = nil
  6365. else
  6366. VExRT.Bossmods.KromogAutoload = true
  6367. end
  6368. end)
  6369.  
  6370. AddButton(L.BossmodsThogar,nil,Thogar.Load,53519)
  6371.  
  6372. AddTitle(L.RaidLootT18HC)
  6373.  
  6374. local Kormrok_loadbut = AddButton(L.RaidLootT18HCBoss3.." ["..L.sencounterWODMythic.."]","/rt kormrok|n|n"..GetSpellText(181092),Kormrok.Load,61990,true,not VExRT.Bossmods.KormrokAutoload,L.bossmodsAutoLoadTooltip)
  6375. Kormrok_loadbut.chk:SetScript("OnClick", function(self,event)
  6376. if self:GetChecked() then
  6377. VExRT.Bossmods.KormrokAutoload = nil
  6378. else
  6379. VExRT.Bossmods.KormrokAutoload = true
  6380. end
  6381. end)
  6382.  
  6383. local Gorefiend_loadbut = AddButton(L.RaidLootT18HCBoss6.." ["..L.sencounterWODMythic.."]","/rt gorefiend|n|n"..GetSpellText(-11547),Gorefiend.Load,61913,true,VExRT.Bossmods.GorefiendAutoload,L.bossmodsAutoLoadTooltip)
  6384. Gorefiend_loadbut.chk:SetScript("OnClick", function(self,event)
  6385. if self:GetChecked() then
  6386. VExRT.Bossmods.GorefiendAutoload = true
  6387. else
  6388. VExRT.Bossmods.GorefiendAutoload = nil
  6389. end
  6390. end)
  6391.  
  6392. AddButton(L.RaidLootT18HCBoss6.." ["..L.sencounterWODMythic.."] "..L.BossmodsGorefiendWithClicking,"/rt gorefiend2|n|n"..GetSpellText(-11547),Gorefiend2.Load,61913)
  6393.  
  6394. local Iskar_loadbut = AddButton(L.RaidLootT18HCBoss7,"/rt iskar|n|n"..GetSpellText(179202),Iskar.Load,61932,true,not VExRT.Bossmods.IskarAutoload,L.bossmodsAutoLoadTooltip)
  6395. Iskar_loadbut.chk:SetScript("OnClick", function(self,event)
  6396. if self:GetChecked() then
  6397. VExRT.Bossmods.IskarAutoload = nil
  6398. else
  6399. VExRT.Bossmods.IskarAutoload = true
  6400. end
  6401. end)
  6402.  
  6403. local Mannoroth_loadbut = AddButton(L.RaidLootT18HCBoss12,"/rt mannoroth|n|n"..GetSpellText(181597),Mannoroth.Load,62410,true,VExRT.Bossmods.MannorothAutoload,L.bossmodsAutoLoadTooltip)
  6404. Mannoroth_loadbut.chk:SetScript("OnClick", function(self,event)
  6405. if self:GetChecked() then
  6406. VExRT.Bossmods.MannorothAutoload = true
  6407. else
  6408. VExRT.Bossmods.MannorothAutoload = nil
  6409. end
  6410. end)
  6411.  
  6412. local Archimonde_loadbut = AddButton(L.RaidLootT18HCBoss13..": "..L.BossmodsArchimondeRadar,"/rt archimonde|n|n"..GetSpellText(186123),Archimonde.Load,62423,true,not VExRT.Bossmods.ArchimondeAutoload,L.bossmodsAutoLoadTooltip)
  6413. Archimonde_loadbut.chk:SetScript("OnClick", function(self,event)
  6414. if self:GetChecked() then
  6415. VExRT.Bossmods.ArchimondeAutoload = nil
  6416. else
  6417. VExRT.Bossmods.ArchimondeAutoload = true
  6418. end
  6419. end)
  6420.  
  6421. local ArchimondeInfernals_loadbut = AddButton(L.RaidLootT18HCBoss13..": "..L.BossmodsArchimondeInfernals,"/rt archimondeinf|n|n"..L.BossmodsArchimondeInfernalsTooltip,ArchimondeInfernals.Load,62423,true,not VExRT.Bossmods.ArchimondeInfernalsAutoload,L.bossmodsAutoLoadTooltip)
  6422. ArchimondeInfernals_loadbut.chk:SetScript("OnClick", function(self,event)
  6423. if self:GetChecked() then
  6424. VExRT.Bossmods.ArchimondeInfernalsAutoload = nil
  6425. else
  6426. VExRT.Bossmods.ArchimondeInfernalsAutoload = true
  6427. end
  6428. end)
  6429.  
  6430. local BossmodsSlider1 = ELib:Slider(self,L.bossmodsalpha):Size(640):Point("TOP",0,-550):Range(0,100):SetTo(VExRT.Bossmods.Alpha or 100):OnChange(function(self,event)
  6431. event = event - event%1
  6432. VExRT.Bossmods.Alpha = event
  6433. if RaDen.mainframe then
  6434. RaDen.mainframe:SetAlpha(event/100)
  6435. end
  6436. if Malkorok.mainframe then
  6437. Malkorok.mainframe:SetAlpha(event/100)
  6438. end
  6439. if ShaOfPride.mainframe then
  6440. ShaOfPride.mainframe:SetAlpha(event/100)
  6441. end
  6442. if SpoilsOfPandaria.mainframe then
  6443. SpoilsOfPandaria.mainframe:SetAlpha(event/100)
  6444. end
  6445. if Thogar.mainframe then
  6446. Thogar.mainframe:SetAlpha(event/100)
  6447. end
  6448. if Margok.mainframe then
  6449. Margok.mainframe:SetAlpha(event/100)
  6450. end
  6451. if Iskar.mainframe then
  6452. Iskar.mainframe:SetAlpha(event/100)
  6453. end
  6454. if Gorefiend.mainframe then
  6455. Gorefiend.mainframe:SetAlpha(event/100)
  6456. end
  6457. if Gorefiend2.mainframe then
  6458. --Gorefiend2.mainframe:SetAlpha(event/100)
  6459. end
  6460. if Archimonde.mainframe then
  6461. Archimonde.mainframe:SetAlpha(event/100)
  6462. end
  6463. if ArchimondeInfernals.mainframe then
  6464. ArchimondeInfernals.mainframe:SetAlpha(event/100)
  6465. end
  6466.  
  6467. self.tooltipText = event
  6468. self:tooltipReload(self)
  6469. end)
  6470.  
  6471. local BossmodsSlider2 = ELib:Slider(self,L.bossmodsscale):Size(640):Point("TOP",0,-580):Range(5,200):SetTo(VExRT.Bossmods.Scale or 100):OnChange(function(self,event)
  6472. event = event - event%1
  6473. VExRT.Bossmods.Scale = event
  6474. if RaDen.mainframe then
  6475. ExRT.F.SetScaleFix(RaDen.mainframe,event/100)
  6476. end
  6477. if Malkorok.mainframe then
  6478. ExRT.F.SetScaleFix(Malkorok.mainframe,event/100)
  6479. end
  6480. if ShaOfPride.mainframe then
  6481. ExRT.F.SetScaleFix(ShaOfPride.mainframe,event/100)
  6482. end
  6483. if SpoilsOfPandaria.mainframe then
  6484. ExRT.F.SetScaleFix(SpoilsOfPandaria.mainframe,event/100)
  6485. end
  6486. if Thogar.mainframe then
  6487. ExRT.F.SetScaleFix(Thogar.mainframe,event/100)
  6488. end
  6489. if Margok.mainframe then
  6490. ExRT.F.SetScaleFix(Margok.mainframe,event/100)
  6491. end
  6492. if Iskar.mainframe then
  6493. --ExRT.F.SetScaleFix(Iskar.mainframe,event/100)
  6494. end
  6495. if Archimonde.mainframe then
  6496. --ExRT.F.SetScaleFix(Archimonde.mainframe,event/100)
  6497. end
  6498. if ArchimondeInfernals.mainframe then
  6499. --ArchimondeInfernals.mainframe:SetScale(event/100)
  6500. end
  6501. self.tooltipText = event
  6502. self:tooltipReload(self)
  6503. end)
  6504.  
  6505. local clearallbut = ELib:Button(self,L.bossmodsclose):Size(320,20):Point("RIGHT",self,"TOP",-5,-515):OnClick(function()
  6506. ExRT.F:ExBossmodsCloseAll()
  6507. end)
  6508.  
  6509. local ButtonToCenter = ELib:Button(self,L.BossmodsResetPos):Size(320,20):Point("LEFT",self,"TOP",5,-515):Tooltip(L.BossmodsResetPosTooltip):OnClick(function()
  6510. StaticPopupDialogs["EXRT_BOSSMODS_CENTER"] = {
  6511. text = L.BossmodsResetPosTooltip,
  6512. button1 = L.YesText,
  6513. button2 = L.NoText,
  6514. OnAccept = function()
  6515. VExRT.Bossmods.RaDenLeft = nil
  6516. VExRT.Bossmods.RaDenTop = nil
  6517. if RaDen.mainframe then
  6518. RaDen.mainframe:ClearAllPoints()
  6519. RaDen.mainframe:SetPoint("CENTER",UIParent, "CENTER", 0, 0)
  6520. end
  6521.  
  6522. VExRT.Bossmods.ShaofprideLeft = nil
  6523. VExRT.Bossmods.ShaofprideTop = nil
  6524. if ShaOfPride.mainframe then
  6525. ShaOfPride.mainframe:ClearAllPoints()
  6526. ShaOfPride.mainframe:SetPoint("CENTER",UIParent, "CENTER", 0, 0)
  6527. end
  6528.  
  6529. VExRT.Bossmods.MalkorokLeft = nil
  6530. VExRT.Bossmods.MalkorokTop = nil
  6531. if Malkorok.mainframe then
  6532. Malkorok.mainframe:ClearAllPoints()
  6533. Malkorok.mainframe:SetPoint("CENTER",UIParent, "CENTER", 0, 0)
  6534. end
  6535.  
  6536. VExRT.Bossmods.SpoilsofPandariaLeft = nil
  6537. VExRT.Bossmods.SpoilsofPandariaTop = nil
  6538. if SpoilsOfPandaria.mainframe then
  6539. SpoilsOfPandaria.mainframe:ClearAllPoints()
  6540. SpoilsOfPandaria.mainframe:SetPoint("CENTER",UIParent, "CENTER", 0, 0)
  6541. end
  6542.  
  6543. VExRT.Bossmods.ThogarLeft = nil
  6544. VExRT.Bossmods.ThogarTop = nil
  6545. if Thogar.mainframe then
  6546. Thogar.mainframe:ClearAllPoints()
  6547. Thogar.mainframe:SetPoint("CENTER",UIParent, "CENTER", 0, 0)
  6548. end
  6549.  
  6550. VExRT.Bossmods.MargokLeft = nil
  6551. VExRT.Bossmods.MargokTop = nil
  6552. if Margok.mainframe then
  6553. Margok.mainframe:ClearAllPoints()
  6554. Margok.mainframe:SetPoint("CENTER",UIParent, "CENTER", 0, 0)
  6555. end
  6556.  
  6557. VExRT.Bossmods.IskarLeft = nil
  6558. VExRT.Bossmods.IskarTop = nil
  6559. if Iskar.mainframe then
  6560. Iskar.mainframe:ClearAllPoints()
  6561. Iskar.mainframe:SetPoint("CENTER",UIParent, "CENTER", 0, 0)
  6562. end
  6563.  
  6564. VExRT.Bossmods.GorefiendPosX = nil
  6565. VExRT.Bossmods.GorefiendPosY = nil
  6566. if Gorefiend.mainframe then
  6567. Gorefiend.mainframe:ClearAllPoints()
  6568. end
  6569. if Gorefiend2.mainframe then
  6570. Gorefiend2.mainframe:ClearAllPoints()
  6571. Gorefiend2.mainframe:SetPoint("TOP",UIParent,"CENTER",-350,200)
  6572. end
  6573.  
  6574. VExRT.Bossmods.ArchimondeLeft = nil
  6575. VExRT.Bossmods.ArchimondeTop = nil
  6576. if Archimonde.mainframe then
  6577. Archimonde.mainframe:ClearAllPoints()
  6578. Archimonde.mainframe:SetPoint("CENTER",UIParent, "CENTER", 0, 0)
  6579. end
  6580.  
  6581. VExRT.Bossmods.ArchimondeInfernalPosX = nil
  6582. VExRT.Bossmods.ArchimondeInfernalPosY = nil
  6583. if ArchimondeInfernals.mainframe then
  6584. ArchimondeInfernals.mainframe:ClearAllPoints()
  6585. end
  6586. end,
  6587. timeout = 0,
  6588. whileDead = true,
  6589. hideOnEscape = true,
  6590. preferredIndex = 3,
  6591. }
  6592. StaticPopup_Show("EXRT_BOSSMODS_CENTER")
  6593.  
  6594. end)
  6595.  
  6596. VExRT.Bossmods.ModuleViewed3580 = true
  6597. end
  6598.  
  6599. function ExRT.F:ExBossmodsCloseAll()
  6600. if RaDen.mainframe then
  6601. RaDen.mainframe:Hide()
  6602. RaDen.mainframe:SetScript("OnUpdate", nil)
  6603. RaDen.mainframe:SetScript("OnEvent", nil)
  6604. RaDen.mainframe:UnregisterAllEvents()
  6605. RaDen.mainframe = nil
  6606. end
  6607. if MalkorokAI.mainframe then
  6608. MalkorokAI.mainframe:Hide()
  6609. MalkorokAI.mainframe:UnregisterAllEvents()
  6610. MalkorokAI.mainframe:SetScript("OnUpdate", nil)
  6611. MalkorokAI.mainframe:SetScript("OnEvent", nil)
  6612. if MalkorokAI.mainframe_2 then
  6613. MalkorokAI.mainframe_2:SetScript("OnUpdate", nil)
  6614. MalkorokAI.mainframe_2 = nil
  6615. end
  6616. MalkorokAI.mainframe = nil
  6617. end
  6618. if Malkorok.mainframe then
  6619. Malkorok.mainframe:Hide()
  6620. Malkorok.mainframe:UnregisterAllEvents()
  6621. Malkorok.mainframe:SetScript("OnUpdate", nil)
  6622. Malkorok.mainframe:SetScript("OnEvent", nil)
  6623. Malkorok.mainframe = nil
  6624. end
  6625. if ShaOfPride.mainframe then
  6626. ShaOfPride.mainframe:Hide()
  6627. ShaOfPride.mainframe:UnregisterAllEvents()
  6628. ShaOfPride.mainframe:SetScript("OnUpdate", nil)
  6629. ShaOfPride.mainframe:SetScript("OnEvent", nil)
  6630. ShaOfPride.mainframe = nil
  6631. end
  6632. if SpoilsOfPandaria.mainframe then
  6633. SpoilsOfPandaria.mainframe:Hide()
  6634. SpoilsOfPandaria.mainframe:SetScript("OnUpdate", nil)
  6635. SpoilsOfPandaria.mainframe = nil
  6636. end
  6637. if Kromog.setupFrame then
  6638. Kromog.setupFrame:UnregisterAllEvents()
  6639. Kromog.setupFrame.isEnabled = nil
  6640. end
  6641. if Thogar.mainframe then
  6642. Thogar.mainframe:Hide()
  6643. Thogar.mainframe:UnregisterAllEvents()
  6644. Thogar.mainframe:SetScript("OnUpdate", nil)
  6645. Thogar.mainframe:SetScript("OnEvent", nil)
  6646. Thogar.mainframe = nil
  6647. end
  6648. if Margok.mainframe then
  6649. Margok.mainframe:Hide()
  6650. Margok.mainframe:UnregisterAllEvents()
  6651. Margok.mainframe:SetScript("OnUpdate", nil)
  6652. Margok.mainframe:SetScript("OnEvent", nil)
  6653. Margok.mainframe = nil
  6654. Margok.rosterFrame:UnregisterAllEvents()
  6655. Margok.rosterFrame:SetScript("OnEvent", nil)
  6656. Margok.rosterFrame = nil
  6657. end
  6658. if Koragh.mainframe then
  6659. Koragh.mainframe:UnregisterAllEvents()
  6660. Koragh.mainframe:SetScript("OnEvent", nil)
  6661. Koragh.mainframe = nil
  6662. end
  6663. if Iskar.mainframe then
  6664. Iskar.mainframe:Hide()
  6665. Iskar.mainframe:UnregisterAllEvents()
  6666. Iskar.mainframe:SetScript("OnUpdate", nil)
  6667. Iskar.mainframe:SetScript("OnEvent", nil)
  6668. Iskar.mainframe:Close()
  6669. if not Iskar.mainframe:IsShown() then
  6670. Iskar.mainframe = nil
  6671. end
  6672. end
  6673. if Kormrok.setupFrame then
  6674. Kormrok.setupFrame:UnregisterAllEvents()
  6675. Kormrok.setupFrame.isEnabled = nil
  6676. end
  6677. if Mannoroth.setupFrame then
  6678. Mannoroth.setupFrame:UnregisterAllEvents()
  6679. Mannoroth.setupFrame.isEnabled = nil
  6680. end
  6681. if Gorefiend.mainframe then
  6682. Gorefiend.mainframe:Close()
  6683. end
  6684. if Gorefiend2.mainframe then
  6685. Gorefiend2.mainframe:Close()
  6686. end
  6687. if Archimonde.mainframe then
  6688. Archimonde.mainframe:Hide()
  6689. Archimonde.mainframe:UnregisterAllEvents()
  6690. Archimonde.mainframe.isEnabled = nil
  6691. end
  6692. if ArchimondeInfernals.mainframe then
  6693. ArchimondeInfernals.mainframe:Close()
  6694. end
  6695. end
  6696.  
  6697. function module:miniMapMenu()
  6698. SetMapToCurrentZone()
  6699. local cmap = GetCurrentMapAreaID()
  6700. local clvl = GetCurrentMapDungeonLevel()
  6701.  
  6702. if cmap==930 and clvl==8 then
  6703. ExRT.F.MinimapMenuAdd("|cff00ff00"..L.bossmodsraden, function() RaDen:Load() CloseDropDownMenus() end,3,"Bossmods_Raden")
  6704. else
  6705. ExRT.F.MinimapMenuRemove("Bossmods_Raden")
  6706. end
  6707.  
  6708. if cmap==953 and clvl==8 then
  6709. ExRT.F.MinimapMenuAdd(L.bossmodsmalkorok, function() Malkorok:Load() CloseDropDownMenus() end,3,"Bossmods_Malkorok")
  6710. else
  6711. ExRT.F.MinimapMenuRemove("Bossmods_Malkorok")
  6712. end
  6713.  
  6714. if cmap==953 and clvl==8 then
  6715. ExRT.F.MinimapMenuAdd(L.bossmodsmalkorokai, function() MalkorokAI:Load() CloseDropDownMenus() end,3,"Bossmods_MalkorokAI")
  6716. else
  6717. ExRT.F.MinimapMenuRemove("Bossmods_MalkorokAI")
  6718. end
  6719.  
  6720. if cmap==953 and clvl==3 then
  6721. ExRT.F.MinimapMenuAdd(L.bossmodsshaofpride, function() ShaOfPride:Load() CloseDropDownMenus() end,3,"Bossmods_Sha")
  6722. else
  6723. ExRT.F.MinimapMenuRemove("Bossmods_Sha")
  6724. end
  6725.  
  6726. if cmap==953 and clvl==9 then
  6727. ExRT.F.MinimapMenuAdd(L.bossmodsSpoilsofPandaria, function() SpoilsOfPandaria:Load() CloseDropDownMenus() end,3,"Bossmods_Spoils")
  6728. else
  6729. ExRT.F.MinimapMenuRemove("Bossmods_Spoils")
  6730. end
  6731.  
  6732. if cmap==994 and clvl==4 then
  6733. ExRT.F.MinimapMenuAdd(L.BossmodsKoragh, function() Koragh:Load() CloseDropDownMenus() end,3,"Bossmods_Koragh")
  6734. else
  6735. ExRT.F.MinimapMenuRemove("Bossmods_Koragh")
  6736. end
  6737.  
  6738. if cmap==994 and clvl==6 then
  6739. ExRT.F.MinimapMenuAdd(L.BossmodsMargok, function() Margok:Load() CloseDropDownMenus() end,3,"Bossmods_Margok")
  6740. else
  6741. ExRT.F.MinimapMenuRemove("Bossmods_Margok")
  6742. end
  6743.  
  6744. if cmap==988 and clvl==1 then
  6745. ExRT.F.MinimapMenuAdd(L.BossmodsKromog, function() Kromog:Load() CloseDropDownMenus() end,3,"Bossmods_Kromog")
  6746. else
  6747. ExRT.F.MinimapMenuRemove("Bossmods_Kromog")
  6748. end
  6749.  
  6750. if cmap==988 and clvl==4 then
  6751. ExRT.F.MinimapMenuAdd(L.BossmodsThogar, function() Thogar:Load() CloseDropDownMenus() end,3,"Bossmods_Thogar")
  6752. else
  6753. ExRT.F.MinimapMenuRemove("Bossmods_Thogar")
  6754. end
  6755.  
  6756. if cmap==1026 and clvl==2 then
  6757. ExRT.F.MinimapMenuAdd(L.RaidLootT18HCBoss6, function() Gorefiend:Load() CloseDropDownMenus() end,3,"Bossmods_Gorefiend")
  6758. else
  6759. ExRT.F.MinimapMenuRemove("Bossmods_Gorefiend")
  6760. end
  6761.  
  6762. if cmap==1026 and clvl==6 then
  6763. ExRT.F.MinimapMenuAdd(L.RaidLootT18HCBoss7, function() Iskar:Load() CloseDropDownMenus() end,3,"Bossmods_Iskar")
  6764. else
  6765. ExRT.F.MinimapMenuRemove("Bossmods_Iskar")
  6766. end
  6767.  
  6768. if cmap==1026 and clvl==4 then
  6769. ExRT.F.MinimapMenuAdd(L.RaidLootT18HCBoss3, function() Kormrok:Load() CloseDropDownMenus() end,3,"Bossmods_Kormrok")
  6770. else
  6771. ExRT.F.MinimapMenuRemove("Bossmods_Kormrok")
  6772. end
  6773.  
  6774. if cmap==1026 and clvl==9 then
  6775. ExRT.F.MinimapMenuAdd(L.RaidLootT18HCBoss12, function() Mannoroth:Load() CloseDropDownMenus() end,3,"Bossmods_Mannoroth")
  6776. else
  6777. ExRT.F.MinimapMenuRemove("Bossmods_Mannoroth")
  6778. end
  6779.  
  6780. if cmap==1026 and clvl==10 then
  6781. ExRT.F.MinimapMenuAdd(L.RaidLootT18HCBoss13..": "..L.BossmodsArchimondeRadar, function() Archimonde:Load() CloseDropDownMenus() end,3,"Bossmods_Archimonde")
  6782. ExRT.F.MinimapMenuAdd(L.RaidLootT18HCBoss13..": "..L.BossmodsArchimondeInfernals, function() ArchimondeInfernals:Load() CloseDropDownMenus() end,3,"Bossmods_ArchimondeInf")
  6783. else
  6784. ExRT.F.MinimapMenuRemove("Bossmods_Archimonde")
  6785. ExRT.F.MinimapMenuRemove("Bossmods_ArchimondeInf")
  6786. end
  6787.  
  6788. if RaDen.mainframe or Malkorok.mainframe or ShaOfPride.mainframe or SpoilsOfPandaria.mainframe or Thogar.mainframe or Margok.mainframe or (Kromog.setupFrame and Kromog.setupFrame.isEnabled) or Koragh.mainframe or Iskar.mainframe or (Archimonde.mainframe and Archimonde.mainframe.isEnabled) or (Mannoroth.setupFrame and Mannoroth.setupFrame.isEnabled) or (ArchimondeInfernals.mainframe and ArchimondeInfernals.mainframe.isEnabled) or (Gorefiend.mainframe and Gorefiend.mainframe.isEnabled) or (Gorefiend2.mainframe and Gorefiend2.mainframe.isEnabled) then
  6789. ExRT.F.MinimapMenuAdd("|cffff9999"..L.bossmodsclose, function() ExRT.F:ExBossmodsCloseAll() CloseDropDownMenus() end,4,"Bossmods_Close")
  6790. else
  6791. ExRT.F.MinimapMenuRemove("Bossmods_Close")
  6792. end
  6793. end
  6794.  
  6795. function module.main:ADDON_LOADED()
  6796. VExRT = _G.VExRT
  6797. VExRT.Bossmods = VExRT.Bossmods or {}
  6798.  
  6799. module:RegisterEvents('ENCOUNTER_START','ENCOUNTER_END','ZONE_CHANGED','ZONE_CHANGED_NEW_AREA')
  6800. module:RegisterAddonMessage()
  6801. module:RegisterMiniMapMenu()
  6802. module:RegisterSlash()
  6803.  
  6804. module.main:ZONE_CHANGED()
  6805.  
  6806. --Kromog
  6807. VExRT.Bossmods.Kromog = VExRT.Bossmods.Kromog or {}
  6808. --Kormrok
  6809. VExRT.Bossmods.Kormrok = VExRT.Bossmods.Kormrok or {}
  6810. --Mannoroth
  6811. VExRT.Bossmods.Mannoroth = VExRT.Bossmods.Mannoroth or {}
  6812. --Archimonde
  6813. VExRT.Bossmods.Archimonde = nil
  6814.  
  6815. if VExRT.Addon.Version < 3580 and VExRT.Addon.Version ~= 0 then
  6816. VExRT.Bossmods.ModuleViewed3580 = true
  6817. end
  6818. if VExRT.Addon.Version < 3505 then
  6819. VExRT.Bossmods.MannorothAutoload = nil
  6820. end
  6821. if VExRT.Addon.Version < 3525 then
  6822. if VExRT.Bossmods.Scale then
  6823. VExRT.Bossmods.ArchimondeScale = VExRT.Bossmods.Scale / 100
  6824. VExRT.Bossmods.IskarScale = VExRT.Bossmods.Scale / 100
  6825. VExRT.Bossmods.ArchimondeInfernalsScale = VExRT.Bossmods.Scale / 100
  6826. end
  6827. end
  6828.  
  6829. if not VExRT.Bossmods.ModuleViewed3580 then
  6830. ExRT.Options:AddIcon(L.bossmods,{"Interface\\common\\help-i",28})
  6831. end
  6832. end
  6833.  
  6834.  
  6835. function module:addonMessage(sender, prefix, ...)
  6836. Malkorok:addonMessage(sender, prefix, ...)
  6837. Kromog:addonMessage(sender, prefix, ...)
  6838. Kormrok:addonMessage(sender, prefix, ...)
  6839. Mannoroth:addonMessage(sender, prefix, ...)
  6840. end
  6841.  
  6842. function module.main:ENCOUNTER_START(encounterID,encounterName,difficultyID,groupSize,...)
  6843. if encounterID == 1595 and not VExRT.Bossmods.MalkorokAutoload and not Malkorok.mainframe then
  6844. Malkorok:Load()
  6845. if VExRT.Bossmods.MalkorokAIAutoload then
  6846. MalkorokAI:Load()
  6847. end
  6848. elseif encounterID == 1594 and VExRT.Bossmods.SpoilsOfPandariaAutoload and not SpoilsOfPandaria.mainframe then
  6849. SpoilsOfPandaria:Load()
  6850. elseif encounterID == 1692 and not Thogar.mainframe and 1==2 then
  6851. Thogar:Load()
  6852. local func = Thogar.mainframe:GetScript("OnEvent")
  6853. func(Thogar.mainframe,encounterID,encounterName,difficultyID,groupSize,...)
  6854. elseif encounterID == 1723 and not Koragh.mainframe and not VExRT.Bossmods.KoraghAutoload and difficultyID == 16 then
  6855. Koragh:Load()
  6856. elseif encounterID == 1713 and not Kromog.setupFrame and not VExRT.Bossmods.KromogAutoload then
  6857. Kromog:Load()
  6858. Kromog.setupFrame:Hide()
  6859. elseif encounterID == 1787 and (not Kormrok.setupFrame or not Kormrok.setupFrame.isEnabled) and not VExRT.Bossmods.KormrokAutoload and difficultyID == 16 then
  6860. Kormrok:Load()
  6861. Kormrok.setupFrame:Hide()
  6862. elseif encounterID == 1795 and (not Mannoroth.setupFrame or not Mannoroth.setupFrame.isEnabled) and VExRT.Bossmods.MannorothAutoload then
  6863. Mannoroth:Load()
  6864. Mannoroth.setupFrame:Hide()
  6865. elseif encounterID == 1783 and (not Gorefiend.mainframe or Gorefiend.mainframe.isEnabled) and (not Gorefiend2.mainframe or not Gorefiend2.mainframe.isEnabled) and VExRT.Bossmods.GorefiendAutoload and difficultyID == 16 then
  6866. Gorefiend:Load()
  6867. Gorefiend.mainframe:Engage()
  6868. elseif encounterID == 1799 then
  6869. if (not Archimonde.mainframe or not Archimonde.mainframe.isEnabled) and not VExRT.Bossmods.ArchimondeAutoload then
  6870. Archimonde:Load()
  6871. Archimonde.mainframe:Hide()
  6872. end
  6873. if (not ArchimondeInfernals.mainframe or not ArchimondeInfernals.mainframe.isEnabled) and not VExRT.Bossmods.ArchimondeInfernalsAutoload then
  6874. ArchimondeInfernals:Load()
  6875. ArchimondeInfernals.mainframe:Engage()
  6876. end
  6877. end
  6878. end
  6879.  
  6880. function module.main:ENCOUNTER_END(encounterID,_,_,_,success)
  6881. if not (success == 1) then
  6882. return
  6883. elseif encounterID == 1594 and SpoilsOfPandaria.mainframe then
  6884. ExRT.F:ExBossmodsCloseAll()
  6885. elseif encounterID == 1604 and ShaOfPride.mainframe then
  6886. ExRT.F:ExBossmodsCloseAll()
  6887. elseif encounterID == 1595 and Malkorok.mainframe then
  6888. ExRT.F:ExBossmodsCloseAll()
  6889. elseif encounterID == 1692 and Thogar.mainframe then
  6890. ExRT.F:ExBossmodsCloseAll()
  6891. elseif encounterID == 1723 and Koragh.mainframe then
  6892. ExRT.F:ExBossmodsCloseAll()
  6893. elseif encounterID == 1788 and Iskar.mainframe then
  6894. C_Timer.NewTimer(4, function() ExRT.F:ExBossmodsCloseAll() end)
  6895. C_Timer.NewTimer(10, function() ExRT.F:ExBossmodsCloseAll() end)
  6896. elseif encounterID == 1787 and Kormrok.setupFrame and Kormrok.setupFrame.isEnabled then
  6897. ExRT.F:ExBossmodsCloseAll()
  6898. elseif encounterID == 1795 and Mannoroth.setupFrame and Mannoroth.setupFrame.isEnabled then
  6899. ExRT.F:ExBossmodsCloseAll()
  6900. elseif encounterID == 1783 then
  6901. if Gorefiend.mainframe and Gorefiend.mainframe.isEnabled then
  6902. ExRT.F:ExBossmodsCloseAll()
  6903. end
  6904. if Gorefiend2.mainframe and Gorefiend2.mainframe.isEnabled then
  6905. C_Timer.NewTimer(4, function() ExRT.F:ExBossmodsCloseAll() end)
  6906. C_Timer.NewTimer(10, function() ExRT.F:ExBossmodsCloseAll() end)
  6907.  
  6908. end
  6909. elseif encounterID == 1799 and ((Archimonde.mainframe and Archimonde.mainframe.isEnabled) or (ArchimondeInfernals.mainframe and ArchimondeInfernals.mainframe.isEnabled)) then
  6910. ExRT.F:ExBossmodsCloseAll()
  6911. end
  6912. end
  6913.  
  6914. function module.main:ZONE_CHANGED()
  6915. local y,x,_,map = UnitPosition'player'
  6916. if map == 1448 then
  6917. if x > 2455 and x < 2620 and y < 4105 and y > 3980 then
  6918. module:RegisterEvents('PLAYER_TARGET_CHANGED')
  6919. else
  6920. module:UnregisterEvents('PLAYER_TARGET_CHANGED')
  6921. end
  6922. end
  6923. end
  6924.  
  6925. function module.main:ZONE_CHANGED_NEW_AREA()
  6926. ExRT.F.Timer(module.main.ZONE_CHANGED,2)
  6927. end
  6928.  
  6929. function module.main:PLAYER_TARGET_CHANGED()
  6930. local targetGUID = UnitGUID'target'
  6931. if not targetGUID then
  6932. return
  6933. elseif GetMobID(targetGUID) == 90316 then
  6934. if InCombatLockdown() then
  6935. return
  6936. end
  6937. if not VExRT.Bossmods.IskarAutoload then
  6938. Iskar:AutoLoad()
  6939. end
  6940. end
  6941.  
  6942. end
  6943.  
  6944. function module:slash(arg)
  6945. if arg == "raden" then
  6946. RaDen:Load()
  6947. elseif arg == "malkorok raid" then
  6948. Malkorok:PShow()
  6949. elseif arg == "malkorok map" then
  6950. Malkorok:MapNow()
  6951. elseif arg == "malkorok" then
  6952. Malkorok:Load()
  6953. elseif arg == "malkorokai" then
  6954. MalkorokAI:Load()
  6955. elseif arg == "shapride" then
  6956. ShaOfPride:Load()
  6957. elseif arg == "kromog" then
  6958. Kromog:Load()
  6959. elseif arg == "iskar" then
  6960. Iskar:Load()
  6961. elseif arg == "kormrok" then
  6962. Kormrok:Load()
  6963. elseif arg == "mannoroth" then
  6964. Mannoroth:Load()
  6965. elseif arg == "gorefiend" then
  6966. Gorefiend:Load()
  6967. elseif arg == "gorefiend2" then
  6968. Gorefiend2:Load()
  6969. elseif arg == "archimonde" then
  6970. Archimonde:Load()
  6971. elseif arg == "archimondeinf" then
  6972. ArchimondeInfernals:Load()
  6973. end
  6974. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement