forked from kyoma/ESO-RaidNotifier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrialDreadsailReef.lua
174 lines (150 loc) · 9.17 KB
/
TrialDreadsailReef.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
RaidNotifier = RaidNotifier or {}
RaidNotifier.DSR = {}
local RaidNotifier = RaidNotifier
local function p() end
local function dbg() end
local data = {}
function RaidNotifier.DSR.Initialize()
p = RaidNotifier.p
dbg = RaidNotifier.dbg
data = {}
data.reefHeartCounter = 0
data.reefHearts = {}
end
function RaidNotifier.DSR.OnEffectChanged(eventCode, changeType, eSlot, eName, uTag, beginTime, endTime, stackCount, iconName, buffType, eType, aType, statusEffectType, uName, uId, abilityId, uType)
local raidId = RaidNotifier.raidId
local self = RaidNotifier
local buffsDebuffs, settings = self.BuffsDebuffs[raidId], self.Vars.dreadsailReef
-- Player receiving stacks while holding Fire/Ice Dome at the Lylanar&Turlassil encounter
if ((abilityId == buffsDebuffs.destructive_ember_stack or abilityId == buffsDebuffs.piercing_hailstone_stack) and string.sub(uTag, 1, 5) == "group") then
local shouldNotify = (abilityId == buffsDebuffs.destructive_ember_stack and settings.dome_type == 1)
or (abilityId == buffsDebuffs.piercing_hailstone_stack and settings.dome_type == 2)
or settings.dome_type == 3
local isPlayer = AreUnitsEqual(uTag, "player")
shouldNotify = shouldNotify and (
settings.dome_stack_alert == 1 and isPlayer
or settings.dome_stack_alert == 2 and not isPlayer
or settings.dome_stack_alert == 3
)
if (shouldNotify and changeType ~= EFFECT_RESULT_FADED and stackCount == settings.dome_stack_threshold) then
local text
if (isPlayer) then
if (abilityId == buffsDebuffs.destructive_ember_stack) then
text = zo_strformat(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_FIRE_DOME_STACK_ALERT), stackCount)
else
text = zo_strformat(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_ICE_DOME_STACK_ALERT), stackCount)
end
else
local playerName = self.UnitIdToString(uId)
if (abilityId == buffsDebuffs.destructive_ember_stack) then
text = zo_strformat(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_FIRE_DOME_STACK_ALERT_OTHER), playerName, stackCount)
else
text = zo_strformat(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_ICE_DOME_STACK_ALERT_OTHER), playerName, stackCount)
end
end
self:AddAnnouncement(text, "dreadsailReef", "dome_stack_alert")
end
end
end
function RaidNotifier.DSR.OnCombatStateChanged(inCombat)
local bossCount, bossAlive, bossFull = RaidNotifier:GetNumBosses(true)
if bossCount == 0 or bossAlive == 0 or bossFull == bossCount then
data.reefHeartCounter = 0
data.reefHearts = {}
end
end
function RaidNotifier.DSR.OnCombatEvent(_, result, isError, aName, aGraphic, aActionSlotType, sName, sType, tName, tType, hitValue, pType, dType, log, sUnitId, tUnitId, abilityId)
local raidId = RaidNotifier.raidId
local self = RaidNotifier
local buffsDebuffs, settings = self.BuffsDebuffs[raidId], self.Vars.dreadsailReef
if (tName == nil or tName == "") then
tName = self.UnitIdToString(tUnitId)
end
if (result == ACTION_RESULT_BEGIN) then
-- Lylanar's Heavy Attack
if (abilityId == buffsDebuffs.lylanar_broiling_hew and settings.brothers_heavy_attack > 0) then
if (tType == COMBAT_UNIT_TYPE_PLAYER) then
self:AddAnnouncement(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_BROILING_HEW), "dreadsailReef", "brothers_heavy_attack")
elseif (settings.brothers_heavy_attack == 2 and tName ~= "") then
self:AddAnnouncement(zo_strformat(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_BROILING_HEW_OTHER), tName), "dreadsailReef", "brothers_heavy_attack")
end
-- Turlassil's Heavy Attack
elseif (abilityId == buffsDebuffs.turlassil_stinging_shear and settings.brothers_heavy_attack > 0) then
if (tType == COMBAT_UNIT_TYPE_PLAYER) then
self:AddAnnouncement(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_STINGING_SHEAR), "dreadsailReef", "brothers_heavy_attack")
elseif (settings.brothers_heavy_attack == 2 and tName ~= "") then
self:AddAnnouncement(zo_strformat(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_STINGING_SHEAR_OTHER), tName), "dreadsailReef", "brothers_heavy_attack")
end
end
elseif (result == ACTION_RESULT_EFFECT_GAINED_DURATION) then
-- Lylanar's Imminent Blister debuff
if (abilityId == buffsDebuffs.lylanar_imminent_blister and settings.imminent_debuffs) then
if (tType == COMBAT_UNIT_TYPE_PLAYER) then
self:StartCountdown(hitValue, GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_IMMINENT_BLISTER), "dreadsailReef", "imminent_debuffs", true)
elseif (tName ~= "") then
self:StartCountdown(hitValue, zo_strformat(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_IMMINENT_BLISTER_OTHER), tName), "dreadsailReef", "imminent_debuffs", true)
end
-- Turlassil's Imminent Chill debuff
elseif (abilityId == buffsDebuffs.turlassil_imminent_chill and settings.imminent_debuffs) then
if (tType == COMBAT_UNIT_TYPE_PLAYER) then
self:StartCountdown(hitValue, GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_IMMINENT_CHILL), "dreadsailReef", "imminent_debuffs", true)
elseif (tName ~= "") then
self:StartCountdown(hitValue, zo_strformat(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_IMMINENT_CHILL_OTHER), tName), "dreadsailReef", "imminent_debuffs", true)
end
-- Tideborn Taleria's Rapid Deluge
elseif (buffsDebuffs.taleria_rapid_deluge[abilityId] and settings.taleria_rapid_deluge > 0) then
if (tType == COMBAT_UNIT_TYPE_PLAYER) then
self:StartCountdown(hitValue, GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_RAPID_DELUGE), "dreadsailReef", "taleria_rapid_deluge", true)
elseif (settings.taleria_rapid_deluge == 2 and tName ~= "") then
self:StartCountdown(hitValue, zo_strformat(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_RAPID_DELUGE_OTHER), tName), "dreadsailReef", "taleria_rapid_deluge", false)
end
end
elseif (result == ACTION_RESULT_EFFECT_GAINED) then
-- Player activated Fire Dome at the Lylanar&Turlassil encounter
if (abilityId == buffsDebuffs.destructive_ember and settings.dome_activation and tName ~= "") then
self:AddAnnouncement(
zo_strformat(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_DESTRUCTIVE_EMBER), tName),
"dreadsailReef",
"dome_activation"
)
-- Player activated Ice Dome at the Lylanar&Turlassil encounter
elseif (abilityId == buffsDebuffs.piercing_hailstone and settings.dome_activation and tName ~= "") then
self:AddAnnouncement(
zo_strformat(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_PIERCING_HAILSTONE), tName),
"dreadsailReef",
"dome_activation"
)
-- Reef Guardian's Heartburn buff on Reef Heart
elseif (abilityId == buffsDebuffs.reef_guardian_heartburn_buff and (settings.reef_guardian_reef_heart or settings.reef_guardian_reef_heart_result)) then
data.reefHeartCounter = data.reefHeartCounter + 1
data.reefHearts[tUnitId] = data.reefHeartCounter
if (settings.reef_guardian_reef_heart) then
self:AddAnnouncement(
zo_strformat(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_REEFGUARDIAN_REEFHEART), data.reefHeartCounter),
"dreadsailReef",
"reef_guardian_reef_heart"
)
end
-- Reef Heart was successfully destroyed
elseif (abilityId == buffsDebuffs.reef_guardian_heartburn_vulnerability and settings.reef_guardian_reef_heart_result) then
local alertMsg
if (tUnitId and data.reefHearts[tUnitId]) then
alertMsg = zo_strformat(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_REEFHEART_SUCCESS), data.reefHearts[tUnitId])
else
-- It shouldn't happen, but for now we'd like to handle it just in case
alertMsg = GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_REEFHEART_SUCCESS_UNKNOWN)
end
self:AddAnnouncement(alertMsg, "dreadsailReef", "reef_guardian_reef_heart_result")
-- Reef Heart wasn't destroyed in time
elseif (abilityId == buffsDebuffs.reef_guardian_heartburn_empowerment and settings.reef_guardian_reef_heart_result) then
local alertMsg
if (tUnitId and data.reefHearts[tUnitId]) then
alertMsg = zo_strformat(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_REEFHEART_FAILURE), data.reefHearts[tUnitId])
else
-- It shouldn't happen, but for now we'd like to handle it just in case
alertMsg = GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_REEFHEART_FAILURE_UNKNOWN)
end
self:AddAnnouncement(alertMsg, "dreadsailReef", "reef_guardian_reef_heart_result")
end
end
end