-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGolemagg.lua
104 lines (86 loc) · 3.53 KB
/
Golemagg.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
------------------------------
-- Are you local? --
------------------------------
local boss = AceLibrary("Babble-Boss-2.2")["Golemagg the Incinerator"]
local L = AceLibrary("AceLocale-2.2"):new("BigWigs"..boss)
----------------------------
-- Localization --
----------------------------
L:RegisterTranslations("enUS", function() return {
corerager_name = "Core Rager",
earthquakesoonwarn = "Earthquake soon - melees get out!",
golemaggenrage = "Golemagg the Incinerator gains Enrage",
enragewarn = "Boss is enraged! Spam heals!",
cmd = "Golemagg",
enraged_cmd = "enraged",
enraged_name = "Announce boss Enrage",
enraged_desc = "Lets you know when boss hits harder",
earthquake_cmd = "earthquake",
earthquake_name = "Earthquake announce",
earthquake_desc = "Announces when it's time for melees to back off",
} end)
L:RegisterTranslations("deDE", function() return {
corerager_name = "Core Rager",
earthquakesoonwarn = "Erdbeben bald - Melees geht weg!",
golemaggenrage = "Golemagg the Incinerator bekommt \'Wutanfall",
enragewarn = "Boss ist in Raserei! Spam Heilung!",
cmd = "Golemagg",
enraged_cmd = "enraged",
enraged_name = "Verk\195\188ndet Boss' Raserei",
enraged_desc = "L\195\164sst dich wissen, wenn Boss h\195\164rter zuschl\195\164gt",
earthquake_cmd = "earthquake",
earthquake_name = "Verk\195\188ndet erdbeben",
earthquake_desc = "Sagt an, wenn es f\195\188r die Melees zeit ist, weg zu gehen",
} end)
----------------------------------
-- Module Declaration --
----------------------------------
BigWigsGolemagg = BigWigs:NewModule(boss)
BigWigsGolemagg.zonename = AceLibrary("Babble-Zone-2.2")["Molten Core"]
BigWigsGolemagg.enabletrigger = boss
BigWigsGolemagg.bossSync = "Golemagg"
BigWigsGolemagg.wipemobs = { L["corerager_name"] }
BigWigsGolemagg.toggleoptions = { "earthquake", "enraged", "bosskill"}
BigWigsGolemagg.revision = tonumber(string.sub("$Revision: 11204 $", 12, -3))
------------------------------
-- Initialization --
------------------------------
function BigWigsGolemagg:OnEnable()
self.started = nil
earthquakeon = nil
self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_BUFFS")
self:RegisterEvent("PLAYER_REGEN_DISABLED", "CheckForEngage")
self:RegisterEvent("UNIT_HEALTH")
self:RegisterEvent("BigWigs_RecvSync")
self:TriggerEvent("BigWigs_ThrottleSync", "GolemaggEarthquake", 10)
self:TriggerEvent("BigWigs_ThrottleSync", "GolemaggEnrage", 10)
end
------------------------------
-- Event Handlers --
------------------------------
function BigWigsGolemagg:BigWigs_RecvSync(sync, rest, nick)
if not self.started and sync == "BossEngaged" and rest == self.bossSync then
self:StartFight()
self:KTM_SetTarget(boss)
elseif sync == "GolemaggEarthquake" and self.db.profile.earthquake then
self:TriggerEvent("BigWigs_Message", L["earthquakesoonwarn"], "Attention", "Alarm")
elseif sync == "GolemaggEnrage" and self.db.profile.enraged then
self:TriggerEvent("BigWigs_Message", L["enragewarn"], "Attention")
end
end
function BigWigsGolemagg:CHAT_MSG_SPELL_PERIODIC_CREATURE_BUFFS(msg)
if string.find(msg, L["golemaggenrage"]) then
self:TriggerEvent("BigWigs_SendSync", "GolemaggEnrage")
end
end
function BigWigsGolemagg:UNIT_HEALTH(arg1)
if UnitName(arg1) == boss then
local health = UnitHealth(arg1)
if health > 110000 and health <= 162000 and not earthquakeon then
self:TriggerEvent("BigWigs_SendSync", "GolemaggEarthquake")
earthquakeon = true
elseif health > 162000 and earthquakeon then
earthquakeon = nil
end
end
end