Advertisement
Guest User

Untitled

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