-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSkeram.lua
200 lines (182 loc) · 8.05 KB
/
Skeram.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
------------------------------
-- Are you local? --
------------------------------
local boss = AceLibrary("Babble-Boss-2.2")["The Prophet Skeram"]
local L = AceLibrary("AceLocale-2.2"):new("BigWigs"..boss)
----------------------------
-- Localization --
----------------------------
L:RegisterTranslations("enUS", function() return {
mcplayer = "You are afflicted by True Fulfillment.",
mcplayerother = "(.*) is afflicted by True Fulfillment.",
mcplayeryouend = "True Fulfillment fades from you.",
mcplayerotherend = "True Fulfillment fades from (.*).",
mcplayer_message = "You are mindcontrolled!",
mcplayerother_message = "%s is mindcontrolled!",
mindcontrol_bar = "MC: %s",
deathyou_trigger = "You die.",
deathother_trigger = "(.*) dies.",
splitsoon_message = "Split soon! Get ready!",
split_message = "Split!",
kill_trigger = "You only delay",
cmd = "Skeram",
mc_cmd = "mc",
mc_name = "Mind Control Alert",
mc_desc = "Warn for Mind Control",
split_cmd = "split",
split_name = "Split Alert",
split_desc = "Warn before Splitting",
} end )
L:RegisterTranslations("deDE", function() return {
mcplayer = "Ihr seid von Wahre Erf\195\188llung betroffen.",
mcplayerother = "(.*) ist von Wahre Erf\195\188llung betroffen.",
mcplayeryouend = "Wahre Erf\195\188llung\' schwindet von Euch.",
mcplayerotherend = "Wahre Erf\195\188llung schwindet von (.*).",
mcplayer_message = "Ihr seid von Wahre Erf\195\188llung betroffen.",
mcplayerother_message = "%s steht unter Gedankenkontrolle!",
mindcontrol_bar = "GK: %s",
deathyou_trigger = "Du stirbst.",
deathother_trigger = "(.*) stirbt.",
splitsoon_message = "Abbilder bald! Sei bereit!",
split_message = "Abbilder!",
kill_trigger = "You only delay",
cmd = "Skeram",
mc_cmd = "mc",
mc_name = "Gedankenkontrolle",
mc_desc = "Warnen, wenn jemand \195\188bernommen ist",
split_cmd = "split",
split_name = "Abbilder",
split_desc = "Alarm vor der Aufteilung",
} end )
----------------------------------
-- Module Declaration --
----------------------------------
BigWigsSkeram = BigWigs:NewModule(boss)
BigWigsSkeram.zonename = AceLibrary("Babble-Zone-2.2")["Ahn'Qiraj"]
BigWigsSkeram.enabletrigger = boss
BigWigsSkeram.bossSync = "Skeram"
BigWigsSkeram.toggleoptions = {"mc", "split", "bosskill"}
BigWigsSkeram.revision = tonumber(string.sub("$Revision: 11204 $", 12, -3))
------------------------------
-- Initialization --
------------------------------
function BigWigsSkeram:OnEnable()
self.started = nil
splittime = false
self:RegisterEvent("CHAT_MSG_MONSTER_YELL")
self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_SELF_DAMAGE", "Event")
self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_HOSTILEPLAYER_DAMAGE", "Event")
self:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_SELF", "Event")
self:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_PARTY", "Event")
self:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_OTHER", "Event")
self:RegisterEvent("CHAT_MSG_COMBAT_FRIENDLY_DEATH", "Event")
self:RegisterEvent("UNIT_HEALTH")
self:RegisterEvent("PLAYER_REGEN_DISABLED", "CheckForEngage")
self:RegisterEvent("BigWigs_RecvSync")
self:TriggerEvent("BigWigs_ThrottleSync", "SkeramMC", 1)
self:TriggerEvent("BigWigs_ThrottleSync", "SkeramMCEnd", 1)
self:TriggerEvent("BigWigs_ThrottleSync", "SkeramSplit80Soon", 100)
self:TriggerEvent("BigWigs_ThrottleSync", "SkeramSplit75Now", 100)
self:TriggerEvent("BigWigs_ThrottleSync", "SkeramSplit55Soon", 100)
self:TriggerEvent("BigWigs_ThrottleSync", "SkeramSplit50Now", 100)
self:TriggerEvent("BigWigs_ThrottleSync", "SkeramSplit30Soon", 100)
self:TriggerEvent("BigWigs_ThrottleSync", "SkeramSplit25Now", 100)
end
------------------------------
-- Event Handlers --
------------------------------
function BigWigsSkeram:Event(msg)
local _,_, mindcontrolother, mctype = string.find(msg, L["mcplayerother"])
local _,_, mindcontrolotherend, mctype = string.find(msg, L["mcplayerotherend"])
local _,_, mindcontrolotherdeath,mctype = string.find(msg, L["deathother_trigger"])
if string.find(msg, L["mcplayer"]) then
self:TriggerEvent("BigWigs_SendSync", "SkeramMC "..UnitName("player"))
elseif string.find(msg, L["mcplayeryouend"]) then
self:TriggerEvent("BigWigs_SendSync", "SkeramMCEnd "..UnitName("player"))
elseif string.find(msg, L["deathyou_trigger"]) then
self:TriggerEvent("BigWigs_SendSync", "SkeramMCEnd "..UnitName("player"))
elseif mindcontrolother then
self:TriggerEvent("BigWigs_SendSync", "SkeramMC "..mindcontrolother)
elseif mindcontrolotherend then
self:TriggerEvent("BigWigs_SendSync", "SkeramMCEnd "..mindcontrolotherend)
elseif mindcontrolotherdeath then
self:TriggerEvent("BigWigs_SendSync", "SkeramMCEnd "..mindcontrolotherdeath)
end
end
function BigWigsSkeram:CHAT_MSG_MONSTER_YELL(msg)
if string.find(msg, L["kill_trigger"]) then
if self.db.profile.bosskill then
self:TriggerEvent("BigWigs_Message", string.format(AceLibrary("AceLocale-2.2"):new("BigWigs")["%s has been defeated"], self:ToString()), "Bosskill", nil, "Victory")
end
self:TriggerEvent("BigWigs_RemoveRaidIcon")
self.core:ToggleModuleActive(self, false)
end
end
function BigWigsSkeram:UNIT_HEALTH(arg1)
if UnitName(arg1) == boss then
local health = UnitHealth(arg1)
local maxhealth = UnitHealthMax(arg1)
if (health > 424782 and health <= 453100) and maxhealth == 566375 and not splittime then
self:TriggerEvent("BigWigs_SendSync", "SkeramSplit80Soon")
elseif (health > 283188 and health <= 311507) and maxhealth == 566375 and not splittime then
self:TriggerEvent("BigWigs_SendSync", "SkeramSplit55Soon")
elseif (health > 141594 and health <= 169913) and maxhealth == 566375 and not splittime then
self:TriggerEvent("BigWigs_SendSync", "SkeramSplit30Soon")
elseif (health > 311508 and health <= 424781) and maxhealth == 566375 and splittime then
self:TriggerEvent("BigWigs_SendSync", "SkeramSplit75Now")
elseif (health > 169914 and health <= 283187) and maxhealth == 566375 and splittime then
self:TriggerEvent("BigWigs_SendSync", "SkeramSplit50Now")
elseif (health > 1 and health <= 141593) and maxhealth == 566375 and splittime then
self:TriggerEvent("BigWigs_SendSync", "SkeramSplit25Now")
end
end
end
function BigWigsSkeram:BigWigs_RecvSync(sync, rest, nick)
if not self.started and sync == "BossEngaged" and rest == self.bossSync then
self:StartFight()
elseif sync == "SkeramSplit80Soon" then
splittime = true
if self.db.profile.split then
self:TriggerEvent("BigWigs_Message", L["splitsoon_message"], "Urgent")
end
elseif sync == "SkeramSplit55Soon" then
splittime = true
if self.db.profile.split then
self:TriggerEvent("BigWigs_Message", L["splitsoon_message"], "Urgent")
end
elseif sync == "SkeramSplit30Soon" then
splittime = true
if self.db.profile.split then
self:TriggerEvent("BigWigs_Message", L["splitsoon_message"], "Urgent")
end
elseif sync == "SkeramSplit75Now" then
splittime = false
if self.db.profile.split then
self:TriggerEvent("BigWigs_Message", L["split_message"], "Important", "Alarm")
end
elseif sync == "SkeramSplit50Now" then
splittime = false
if self.db.profile.split then
self:TriggerEvent("BigWigs_Message", L["split_message"], "Important", "Alarm")
end
elseif sync == "SkeramSplit25Now" then
splittime = false
if self.db.profile.split then
self:TriggerEvent("BigWigs_Message", L["split_message"], "Important", "Alarm")
end
elseif sync == "SkeramMC" then
if self.db.profile.mc then
if rest == UnitName("player") then
self:TriggerEvent("BigWigs_StartBar", self, string.format(L["mindcontrol_bar"], UnitName("player")), 20, "Interface\\Icons\\Spell_Shadow_Charm", true, "White")
self:TriggerEvent("BigWigs_Message", L["mcplayer_message"], "Attention")
else
self:TriggerEvent("BigWigs_StartBar", self, string.format(L["mindcontrol_bar"], rest), 20, "Interface\\Icons\\Spell_Shadow_Charm", true, "White")
self:TriggerEvent("BigWigs_Message", string.format(L["mcplayerother_message"], rest), "Urgent")
end
end
elseif sync == "SkeramMCEnd" then
if self.db.profile.mc then
self:TriggerEvent("BigWigs_StopBar", self, string.format(L["mindcontrol_bar"], rest))
end
end
end