-
Notifications
You must be signed in to change notification settings - Fork 8
/
TrialHelRaCitadel.lua
66 lines (58 loc) · 2.71 KB
/
TrialHelRaCitadel.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
RaidNotifier = RaidNotifier or {}
RaidNotifier.HRC = {}
local RaidNotifier = RaidNotifier
local function p() end
local function dbg() end
function RaidNotifier.HRC.Initialize()
p = RaidNotifier.p
dbg = RaidNotifier.dbg
data = {}
end
function RaidNotifier.HRC.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.helra
if (tName == nil or tName == "") then
tName = self.UnitIdToString(tUnitId)
end
if (result == ACTION_RESULT_BEGIN) then
-- Warrior Stone Form
-- This one needs a small trick: sometimes the Warrior will attempt to stone
-- two people but only the last person actually gets trapped. But because it
-- is the last person that gets trapped and not the first we cannot use the
-- normal interval code. So we add a delay and check if we got another alert
-- before actually displaying it.
if (abilityId == buffsDebuffs.warrior_stoneform) then
dbg("BEGIN >> Warrior Stone Form on %s, hitValue: %d", tName, hitValue)
if (settings.warrior_stoneform >= 1) then
local lastIndex = self:GetLastNotify("helra", "warrior_stoneform") + 1
self:SetLastNotify("helra", "warrior_stoneform", lastIndex)
zo_callLater(function()
if (lastIndex == self:GetLastNotify("helra", "warrior_stoneform")) then
if (tType == COMBAT_UNIT_TYPE_PLAYER) then
self:AddAnnouncement(GetString(RAIDNOTIFIER_ALERTS_HELRA_WARRIOR_STONEFORM), "helra", "warrior_stoneform")
elseif (tName ~= "" and settings.warrior_stoneform == 2) then
self:AddAnnouncement(zo_strformat(GetString(RAIDNOTIFIER_ALERTS_HELRA_WARRIOR_STONEFORM_OTHER), tName), "helra", "warrior_stoneform")
end
end
end, 200)
end
end
elseif (result == ACTION_RESULT_EFFECT_GAINED_DURATION) then
if (abilityId == buffsDebuffs.warrior_stoneform) then
dbg("GAINED_DURATION >> Warrior Stone Form on %s, hitValue: %d", tName, hitValue)
elseif abilityId == buffsDebuffs.yokeda_meteor then
if settings.yokeda_meteor > 0 then
if (tType == COMBAT_UNIT_TYPE_PLAYER) then
self:AddAnnouncement(GetString(RAIDNOTIFIER_ALERTS_HELRA_YOKEDA_METEOR), "helra", "yokeda_meteor")
elseif (tName ~= "" and settings.yokeda_meteor == 2) then
self:AddAnnouncement(zo_strformat(GetString(RAIDNOTIFIER_ALERTS_HELRA_YOKEDA_METEOR_OTHER), tName), "helra", "yokeda_meteor")
end
end
end
elseif (result == ACTION_RESULT_EFFECT_GAINED) then
if (abilityId == buffsDebuffs.warrior_stoneform) then
dbg("GAINED >> Warrior Stone Form on %s, hitValue: %d", tName, hitValue)
end
end
end