Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.26 KB | None | 0 0
  1. --------------------------------------------------------------------------------
  2. -- TODO:
  3. -- - Assistant on robots?
  4. -- - Intermission soon warnings
  5. -- - Initial timers
  6. -- - Improve timers generally
  7.  
  8. --------------------------------------------------------------------------------
  9. -- Module Declaration
  10. --
  11.  
  12. local mod, CL = BigWigs:NewBoss("High Tinker Mekkatorque", 2070, 2334)
  13. if not mod then return end
  14. mod:RegisterEnableMob(0)
  15. mod.engageId = 2276
  16. --mod.respawnTime = 31
  17.  
  18. --------------------------------------------------------------------------------
  19. -- Locals
  20. --
  21.  
  22. local sparkBotCount = 1
  23.  
  24. --------------------------------------------------------------------------------
  25. -- Localization
  26. --
  27.  
  28. local L = mod:GetLocale()
  29. if L then
  30. L.gigavolt_alt_text = "Bomb"
  31. end
  32.  
  33. --------------------------------------------------------------------------------
  34. -- Initialization
  35. --
  36.  
  37. local gigavoltChargeMarker = mod:AddMarkerOption(false, "player", 1, 286646, 1, 2, 3) -- Gigavolt Charge
  38. local shrunkMarker = mod:AddMarkerOption(false, "player", 1, 284168, 1, 2, 3) -- Shrunk
  39. function mod:GetOptions()
  40. return {
  41. -- General
  42. 282153, -- Buster Cannon
  43. 282205, -- Blast Off
  44. {286646, "SAY", "SAY_COUNTDOWN"}, -- Gigavolt Charge
  45. gigavoltChargeMarker,
  46. 286646, -- Shrunk
  47. shrunkMarker,
  48. 287952, -- Dimensional Ripper XL
  49. 284042, -- Deploy Spark Bot
  50. 288049, -- Shrink Ray
  51. 286051, -- Hyperdrive
  52. -- Intermission
  53. 287929, -- Signal Exploding Sheep
  54. }
  55. end
  56.  
  57. function mod:OnBossEnable()
  58. self:Log("SPELL_CAST_START", "BusterCannon", 282153)
  59. self:Log("SPELL_CAST_START", "BlastOff", 282205)
  60. self:Log("SPELL_CAST_SUCCESS", "GigavoltCharge", 286597)
  61. self:Log("SPELL_AURA_APPLIED", "GigavoltChargeApplied", 286646)
  62. self:Log("SPELL_AURA_REMOVED", "GigavoltChargeRemoved", 286646)
  63. self:Log("SPELL_CAST_START", "DimensionalRipperXL", 287952)
  64. self:Log("SPELL_CAST_SUCCESS", "DeploySparkBot", 284042)
  65. self:Log("SPELL_CAST_START", "ShrinkRay", 288049)
  66. self:Log("SPELL_AURA_APPLIED", "Hyperdrive", 286051)
  67. self:Log("SPELL_CAST_START", "SignalExplodingSheep", 287929)
  68. self:Log("SPELL_AURA_APPLIED", "ShrunkApplied", 284168)
  69. self:Log("SPELL_AURA_REMOVED", "ShrunkChargeRemoved", 284168)
  70. end
  71.  
  72. function mod:OnEngage()
  73. sparkBotCount = sparkBotCount + 1
  74. end
  75.  
  76. --------------------------------------------------------------------------------
  77. -- Event Handlers
  78. --
  79.  
  80. function mod:BusterCannon(args)
  81. self:Message2(args.spellId, "yellow")
  82. self:PlaySound(args.spellId, "alert")
  83. self:CDBar(args.spellId, 25)
  84. end
  85.  
  86. function mod:BlastOff(args)
  87. self:Message2(args.spellId, "orange")
  88. self:PlaySound(args.spellId, "alarm")
  89. self:CDBar(args.spellId, 30)
  90. end
  91.  
  92. function mod:GigavoltCharge(args)
  93. self:CDBar(286646, 30, L.gigavolt_alt_text)
  94. end
  95.  
  96. do
  97. local playerList, isOnMe = {}, nil
  98.  
  99. local function announce()
  100. local meOnly = mod:CheckOption(286646, "ME_ONLY")
  101.  
  102. if isOnMe then
  103. mod:TargetBar(286646, 15, mod:UnitName("player"), L.gigavolt_alt_text)
  104. end
  105.  
  106. if isOnMe and (meOnly or #playerList == 1) then
  107. mod:Message2(286646, "blue", CL.you:format(("|T13700%d:0|t%s"):format(isOnMe, L.gigavolt_alt_text)))
  108. elseif not meOnly then
  109. local msg = ""
  110. for i=1, #playerList do
  111. local icon = ("|T13700%d:0|t"):format(i)
  112. msg = msg .. icon .. mod:ColorName(playerList[i]) .. (i == #playerList and "" or ",")
  113. end
  114.  
  115. mod:Message2(286646, "yellow", CL.other:format(L.gigavolt_alt_text, msg))
  116. end
  117.  
  118. playerList = {}
  119. isOnMe = nil
  120. end
  121.  
  122. function mod:GigavoltChargeApplied(args)
  123. playerList[#playerList+1] = args.destName
  124. if #playerList == 1 then
  125. self:SimpleTimer(announce, 0.1)
  126. end
  127. if self:Me(args.destGUID) then
  128. isOnMe = #playerList
  129. self:PlaySound(args.spellId, "warning")
  130. self:Say(args.spellId, CL.count_rticon:format(args.spellName, isOnMe, isOnMe))
  131. self:SayCountdown(args.spellId, 15)
  132. end
  133. if self:GetOption(gigavoltChargeMarker) then
  134. SetRaidTarget(args.destName, #playerList)
  135. end
  136. end
  137.  
  138. function mod:ShrunkApplied(args)
  139. playerList[#playerList+1] = args.destName
  140. if #playerList == 1 then
  141. self:SimpleTimer(announce, 0.1)
  142. end
  143. if self:Me(args.destGUID) then
  144. isOnMe = #playerList
  145. end
  146. if self:GetOption(shrunkMarker) then
  147. SetRaidTarget(args.destName, #playerList)
  148. end
  149. end
  150. end
  151.  
  152. do
  153. local prev = 0
  154. function mod:GigavoltChargeRemoved(args)
  155. if self:Me(args.destGUID) then
  156. self:CancelSayCountdown(args.spellId)
  157. self:StopBar(L.gigavolt_alt_text, args.destName)
  158. end
  159. if self:GetOption(gigavoltChargeMarker) then
  160. SetRaidTarget(args.destName, 0)
  161. end
  162. end
  163. end
  164.  
  165. function mod:DimensionalRipperXL(args)
  166. self:Message2(args.spellId, "red")
  167. self:PlaySound(args.spellId, "alert")
  168. self:CDBar(args.spellId, 44)
  169. end
  170.  
  171. function mod:DeploySparkBot(args)
  172. self:Message2(args.spellId, "cyan", CL.count:format(args.spellName, sparkBotCount))
  173. self:PlaySound(args.spellId, "info")
  174. sparkBotCount = sparkBotCount + 1
  175. end
  176.  
  177. function mod:ShrinkRay(args)
  178. self:Message2(args.spellId, "yellow")
  179. self:PlaySound(args.spellId, "long")
  180. end
  181.  
  182. function mod:Hyperdrive(args)
  183. self:Message2(args.spellId, "cyan")
  184. self:PlaySound(args.spellId, "info")
  185. end
  186.  
  187. function mod:SignalExplodingSheep(args)
  188. self:Message2(args.spellId, "yellow")
  189. self:PlaySound(args.spellId, "long")
  190. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement