forked from jvdnbus/DBM-Frostmourne
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmalon.lua
107 lines (89 loc) · 2.35 KB
/
Emalon.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
local mod = DBM:NewMod("Emalon", "DBM-VoA")
local L = mod:GetLocalizedStrings()
mod:SetRevision(("$Revision: 4264 $"):sub(12, -3))
mod:SetCreatureID(33993)
mod:SetUsedIcons(8)
mod:RegisterCombat("combat")
mod:RegisterEvents(
"SPELL_CAST_START",
"SPELL_HEAL",
"UNIT_TARGET",
"SPELL_AURA_APPLIED",
"SPELL_AURA_REMOVED"
)
local warnNova = mod:NewSpellAnnounce(65279, 3)
local warnOverCharge = mod:NewSpellAnnounce(64218, 2)
local specWarnNova = mod:NewSpecialWarningRun(65279)
local timerNova = mod:NewCastTimer(65279)
local timerNovaCD = mod:NewCDTimer(40, 65279)--Varies, 45-60seconds in between nova's
local timerOvercharge = mod:NewNextTimer(45, 64218)
local timerMobOvercharge = mod:NewTimer(20, "timerMobOvercharge", 64217)
local timerEmalonEnrage = mod:NewTimer(360, "EmalonEnrage", 26662)
mod:AddBoolOption("NovaSound")
mod:AddBoolOption("RangeFrame", true)
local overchargedMob
function mod:OnCombatStart(delay)
overchargedMob = nil
timerOvercharge:Start(-delay)
timerNovaCD:Start(20-delay)
timerEmalonEnrage:Start(-delay)
if self.Options.RangeFrame then
DBM.RangeCheck:Show(10)
end
end
function mod:OnCombatEnd()
if self.Options.RangeFrame then
DBM.RangeCheck:Hide()
end
end
function mod:SPELL_CAST_START(args)
if args.spellId == 64216 or args.spellId == 65279 then
timerNova:Start()
timerNovaCD:Start()
warnNova:Show()
specWarnNova:Show()
if self.Options.NovaSound then
PlaySoundFile("Sound\\Creature\\HoodWolf\\HoodWolfTransformPlayer01.wav")
end
end
end
function mod:UNIT_TARGET()
if overchargedMob then
self:TrySetTarget(overchargedMob)
end
end
function mod:TrySetTarget(target, icon)
icon = icon or 8
if DBM:GetRaidRank() >= 1 then
local found = false
for i = 1, GetNumRaidMembers() do
if UnitGUID("raid"..i.."target") == target then
found = true
SetRaidTarget("raid"..i.."target", icon)
break
end
end
if found then
overchargedMob = nil
else
overchargedMob = target
end
end
end
function mod:SPELL_HEAL(args)
if args.spellId == 64218 then
warnOverCharge:Show()
timerOvercharge:Start()
self:TrySetTarget(args.destGUID)
end
end
function mod:SPELL_AURA_APPLIED(args)
if args.spellId == 64217 then -- 1 of 10 stacks (+1 each 2 seconds)
timerMobOvercharge:Start()
end
end
function mod:SPELL_AURA_REMOVED(args)
if args.spellId == 64217 then
timerMobOvercharge:Stop()
end
end