Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.54 KB | None | 0 0
  1. --------------------------------------------------------------------------------
  2. -- Module Declaration
  3. --
  4.  
  5. local mod = BigWigs:NewBoss("Lord Rhyolith", 800, 193)
  6. if not mod then return end
  7. mod:RegisterEnableMob(52577, 53087, 52558) -- Left foot, Right Foot, Lord Rhyolith
  8.  
  9. --------------------------------------------------------------------------------
  10. -- Locales
  11. --
  12.  
  13. local moltenArmor,superheated,stomp,fragments,spark,heatedVolcano,meltdown,lavaLine,immolation = GetSpellInfo(98255),GetSpellInfo(101305),GetSpellInfo(97282),GetSpellInfo(98136),GetSpellInfo(98552),GetSpellInfo(98493),GetSpellInfo(101648),GetSpellInfo(100650),GetSpellInfo(99846)
  14. local lastFragments = nil
  15. local secondFragments = nil
  16. local moltenArmorTime = nil
  17. local phaseTwo = nil
  18.  
  19. --------------------------------------------------------------------------------
  20. -- Localization
  21. --
  22.  
  23. local CL = LibStub("AceLocale-3.0"):GetLocale("Big Wigs: Common")
  24. local L = mod:NewLocale("enUS", true)
  25. if L then
  26.     L.superheated_message = "%dx stacks on boss!"
  27.     L.molten_message = "%dx stacks on boss!"
  28.     L.armor_message = "%d%% armor left"
  29.     L.armor_gone_message = "Armor go bye-bye!"
  30.     L.phase2_soon_message = "Phase 2 soon!"
  31.     L.immolated_message = "Phase 2!"
  32.     L.stomp_message = "Stomp! Stomp! Stomp!"
  33.     L.heated_volcano_message = "Volcano Activating!"
  34.     L.lava_line_message = "Magma Flow Activating!"
  35.     L.big_add_message = "Big add spawned!"
  36.     L.small_adds_message = "Small adds inc!"
  37. end
  38. L = mod:GetLocale()
  39.  
  40. --------------------------------------------------------------------------------
  41. -- Initialization
  42. --
  43.  
  44. function mod:GetOptions(CL)
  45.     return {
  46.         98632, 98552, 98136, 97282, 98255, 99846, 101305,98493,101648,100650,
  47.         "bosskill"
  48.     }, {
  49.         [98632] = "general"
  50.     }
  51. end
  52.  
  53. function mod:OnBossEnable()
  54.     self:Log("SPELL_AURA_APPLIED_DOSE", "Immolated", 99846)
  55.     self:Log("SPELL_AURA_APPLIED_DOSE", "Superheated", 101305)
  56.     self:Log("SPELL_AURA_APPLIED_DOSE", "MoltenArmor", 98255, 101157)
  57.     self:Log("SPELL_CAST_START", "Stomp", 97282, 100411, 100968, 100969)
  58.     self:Log("SPELL_CAST_SUCCESS", "HeatedVolcano", 98493)
  59.     self:Log("SPELL_CAST_SUCCESS", "LavaLine", 100650)
  60.     self:Log("SPELL_SUMMON", "Spark", 98552)
  61.     self:Log("SPELL_SUMMON", "Fragments", 100392, 98136)
  62.     self:Log("SPELL_AURA_REMOVED_DOSE", "ObsidianStack", 98632)
  63.     self:Log("SPELL_AURA_REMOVED", "Obsidian", 98632)
  64.  
  65.     self:RegisterEvent("PLAYER_REGEN_DISABLED", "CheckBossStatus")
  66.  
  67.     self:Death("Win", 52558)
  68. end
  69.  
  70. function mod:OnEngage(diff)
  71.     self:RegisterEvent("UNIT_HEALTH_FREQUENT")
  72.     lastFragments = GetTime()
  73.     moltenArmorTime = nil
  74.     self:Bar(101305, superheated, 301, 101305)
  75.     self:Bar(97282, stomp, 15, 97282)
  76.     self:Bar(98136, fragments, 24, 98136)
  77.     self:Bar(98493, heatedVolcano, 30.5, 98493)
  78.     secondFragments = true
  79.     phase2 = nil
  80. end
  81.  
  82. --------------------------------------------------------------------------------
  83. -- Event Handlers
  84. --
  85.  
  86. function mod:Obsidian(_, spellId, _, _, _, _, _, _, _, dGUID)
  87.     local unitId = tonumber(dGUID:sub(7, 10), 16)
  88.     if unitId ~= 52558 then return end
  89.     self:Message(98632, L["armor_gone_message"], "Positive", spellId)
  90. end
  91.  
  92. function mod:ObsidianStack(_, spellId, _, _, _, buffStack, _, _, _, dGUID)
  93.     local unitId = tonumber(dGUID:sub(7, 10), 16)
  94.     if unitId ~= 52558 then return end
  95.     if buffStack % 20 ~= 0 then return end -- Only warn every 20
  96.     self:Message(98632, L["armor_message"]:format(buffStack), "Positive", spellId)
  97. end
  98.  
  99. function mod:Spark(_, spellId)
  100.     self:Message(98552, L["big_add_message"], "Important", spellId, "Alarm")
  101.     self:Bar(98136, fragments, 23, 98136)
  102.     secondFragments = nil
  103. end
  104.  
  105. function mod:Fragments(_, spellId)
  106.     local t = GetTime()
  107.     if lastFragments and t < (lastFragments + 5) then return end
  108.     lastFragments = t
  109.     self:Message(98136, L["small_adds_message"], "Attention", spellId, "Info")
  110.     self:Bar(101648, meltdown, 30, 101648)
  111.     if (secondFragments) then
  112.         self:Bar(98552, spark, 23, 98552)
  113.     else
  114.         self:Bar(98136, fragments, 23, 98136)
  115.         secondFragments = true
  116.     end
  117. end
  118.  
  119. function mod:Stomp(_, spellId, _, _, spellName)
  120.     self:Message(97282, L["stomp_message"], "Urgent",  spellId, "Alert")
  121.     self:Bar(97282, L["stomp_message"], 3, spellId)
  122.     if phaseTwo then
  123.         self:Bar(97282, spellName, 13, spellId)
  124.     else
  125.         self:Bar(97282, spellName, 30, spellId)
  126.     end
  127. end
  128.  
  129. function mod:HeatedVolcano(_, spellId, _, _, spellName)
  130.     self:Message(98493, L["heated_volcano_message"], "Attention",  spellId)
  131.     self:Bar(98493, L["heated_volcano_message"], 5, spellId)
  132.     self:Bar(98493, spellName, 25.5, spellId)
  133. end
  134.  
  135. function mod:LavaLine(_, spellId, _, _, spellName)
  136.     self:Message(100650, L["lava_line_message"], "Urgent",  spellId, "Alert")
  137.     self:Bar(100650, L["lava_line_message"], 4, spellId)
  138. end
  139.  
  140. function mod:MoltenArmor(_, spellId, _, _, _, stack, _, _, _, dGUID)
  141.     if moltenArmorTime == nil and stack > 0 then
  142.         moltenArmorTime = GetTime()
  143.         self:Bar(98255, moltenArmor, 15*stack, spellId)
  144.     end
  145.     if moltenArmorTime ~= nil and stack > 0 then
  146.         self:SendMessage("BigWigs_StopBar", self, moltenArmor)
  147.         self:Bar(98255, moltenArmor, (GetTime() - moltenArmorTime) % 15 + (stack - 1) * 15, spellId)
  148.     end
  149.     local unitId = tonumber(dGUID:sub(7, 10), 16)
  150.     if stack < 4 or stack % 2 ~= 0 or unitId ~= 52558 then return end
  151.     self:Message(98255, L["molten_message"]:format(stack), "Attention", spellId)
  152. end
  153.  
  154. function mod:Superheated(_, spellId, _, _, spellName, stack)
  155.     self:Message(101305, L["superheated_message"]:format(stack), "Urgent", spellId, "Alert")
  156.     self:Bar(101305, superheated, 10, spellId)
  157. end
  158.  
  159. function mod:Immolated(_, spellId, _, _, spellName, stack)
  160.     self:SendMessage("BigWigs_StopBar", self, heatedVolcano)
  161.     self:SendMessage("BigWigs_StopBar", self, stomp)
  162.     self:SendMessage("BigWigs_StopBar", self, fragments)
  163.     self:SendMessage("BigWigs_StopBar", self, spark)
  164.     self:SendMessage("BigWigs_StopBar", self, meltdown)
  165.     phaseTwo = true
  166.     self:Message(99846, L["immolated_message"], "Urgent", spellId, "Alert")
  167.     self:Bar(97282, stomp, 7, spellId)
  168. end
  169.  
  170. function mod:UNIT_HEALTH_FREQUENT(_, unitId)
  171.     -- Boss frames were jumping around, there are 3 up with the buff on, so one of boss1 or boss2 is bound to exist
  172.     if unitId == "boss1" or unitId == "boss2" then
  173.         local hp = UnitHealth(unitId) / UnitHealthMax(unitId) * 100
  174.         if hp < 30 then -- phase starts at 25
  175.             self:Message(99846, L["phase2_soon_message"], "Positive", 99846, "Info")
  176.             self:UnregisterEvent("UNIT_HEALTH_FREQUENT")
  177.             local stack = select(4, UnitBuff(unitId, moltenArmor))
  178.             if stack then
  179.                 self:Message(98255, L["molten_message"]:format(stack), "Important", 98255, "Alarm")
  180.             end
  181.         end
  182.     end
  183. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement