Skip to content

Commit

Permalink
Stop countdown when eternal servant is bashed.
Browse files Browse the repository at this point in the history
Few changes that i can't remember xD
  • Loading branch information
memus committed Aug 1, 2019
1 parent 7c658f5 commit 816722e
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 37 deletions.
3 changes: 2 additions & 1 deletion BuffsDebuffs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,9 @@ sunspire.time_breach_time = 3000
sunspire.time_breach = 121210
sunspire.time_breach_use = 121213 -- 2240 T
sunspire.return_to_reality = 121254 -- 2245 T
sunspire.find_the_enemy = 121275 -- 2250 T
sunspire.find_the_enemy = 121275
sunspire.shocking_bolt = 121443 -- 2245 T
sunspire.shocking_bolt_delay = 4000
sunspire.translation_apocalypse = 121436
--[[
2240 time shift 121500
Expand Down
43 changes: 30 additions & 13 deletions Notifications.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ function AbstractNotification:GetEndTime()
return self.endTime
end

function AbstractNotification:Stop()
EVENT_MANAGER:UnregisterForUpdate("RNNotification_" .. self.id)
-- dbg("Stopped: %d %s", self.id, self.text)
self:SetHidden(true)
self.freeToUse = true
end

function AbstractNotification:_runTimer(ms, f)
self.displayTime = math.floor((self.endTime - GetGameTimeMilliseconds())/ms + 0.5) * ms
if (f) then
Expand Down Expand Up @@ -181,19 +188,19 @@ function CountdownNotification:GetScale()
end

local function OnCountdown(self, precise)
if (self.scale) then
self.ctrl.counter:SetScale(self.scale)
end
if (precise < 1000) then
txt = string.format("%0.1f", self.displayTime/1000)
else
self.countdownAnimation:PlayFromStart()
txt = self.displayTime/1000
end
if (self.displayTime <= 3000) then
txt = "|cff0000" .. txt .."|r"
end
self.ctrl.counter:SetText(txt)
if (self.scale) then
self.ctrl.counter:SetScale(self.scale)
end
if (precise < 1000) then
txt = string.format("%0.1f", self.displayTime/1000)
else
self.countdownAnimation:PlayFromStart()
txt = self.displayTime/1000
end
if (self.displayTime <= 3000) then
txt = "|cff0000" .. txt .."|r"
end
self.ctrl.counter:SetText(txt)
end

function CountdownNotification:Show(text, precise)
Expand Down Expand Up @@ -308,6 +315,16 @@ function NotificationsPool:Add(text, displayTime, isCountdown)
return notify:Show(text, self.precise)
end

function NotificationsPool:Stop(id)
if (id <= #self.pool and id > 0) then
for i = 1, #self.pool, 1 do
if (self.pool[i]:GetId() == id) then
self.pool[i]:Stop()
end
end
end
end

RaidNotifier = RaidNotifier or {}
RaidNotifier.Notification = Notification
RaidNotifier.NotificationsPool = NotificationsPool
4 changes: 4 additions & 0 deletions RaidNotifier.lua
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ do ---------------------------------

function RaidNotifier:StopCountdown(countdownIndex)
LCSA:EndCountdown(countdownIndex)
-- if self.Vars.general.use_center_screen_announce == 0 and not important then
local pool = RaidNotifier.NotificationsPool.GetInstance()
pool:Stop(countdownIndex)
-- end
countdownInProgress = false
end

Expand Down
41 changes: 25 additions & 16 deletions TrialSunspire.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function RaidNotifier.SS.Initialize()
dbg = RaidNotifier.dbg

data = {}
data.translation_apocalypse_id = 0
data.frozen_tomb = 0
data.last_frozen_tomb = 0
data.time_breach_used = false
Expand Down Expand Up @@ -86,8 +87,9 @@ function RaidNotifier.SS.OnCombatEvent(_, result, isError, aName, aGraphic, aAct
end
end
elseif (buffsDebuffs.translation_apocalypse == abilityId) then
if (settings.translation_apocalypse == true) then
self:AddAnnouncement(GetString(RAIDNOTIFIER_ALERTS_SUNSPIRE_APOCALYPSE), "sunspire", "translation_apocalypse")
dbg("Translation apocalypse %d", hitValue)
if (settings.translation_apocalypse == true and hitValue < 3000) then
self:StartCountdown(hitValue, GetString(RAIDNOTIFIER_ALERTS_SUNSPIRE_APOCALYPSE), "sunspire", "translation_apocalypse", false)
end
end
elseif (result == ACTION_RESULT_EFFECT_GAINED) then
Expand All @@ -110,17 +112,26 @@ function RaidNotifier.SS.OnCombatEvent(_, result, isError, aName, aGraphic, aAct
data.time_breach_used = true
end
elseif (buffsDebuffs.shocking_bolt == abilityId) then
dbg("Shocking bolt: %s %d", tName, hitValue)
-- if (settings.shock_bolt == true) then
-- if (tType == COMBAT_UNIT_TYPE_PLAYER) then
-- self:AddAnnouncement(GetString(RAIDNOTIFIER_ALERTS_SUNSPIRE_SHOCK_BOLT), "sunspire", "shock_bolt")
-- elseif (tName ~= "") then
-- self:AddAnnouncement(zo_strformat(GetString(RAIDNOTIFIER_ALERTS_SUNSPIRE_SHOCK_BOLT_OTHER), tName), "sunspire", "shock_bolt")
-- end
-- end
elseif (buffsDebuffs.translation_apocalypse == abilityId) then
if (settings.translation_apocalypse == true) then
data.translation_apocalypse_id = self:StartCountdown(hitValue, GetString(RAIDNOTIFIER_ALERTS_SUNSPIRE_APOCALYPSE_ENDS), "sunspire", "translation_apocalypse", false)
end
dbg("Translation apocalypse ends in %d id: %d", hitValue, data.translation_apocalypse_id)
elseif (buffsDebuffs.find_the_enemy == abilityId) then
dbg("Find the enemy %d", hitValue)
if (settings.shock_bolt == true) then
if (tType == COMBAT_UNIT_TYPE_PLAYER) then
self:AddAnnouncement(GetString(RAIDNOTIFIER_ALERTS_SUNSPIRE_SHOCK_BOLT), "sunspire", "shock_bolt")
elseif (tName ~= "") then
self:AddAnnouncement(zo_strformat(GetString(RAIDNOTIFIER_ALERTS_SUNSPIRE_SHOCK_BOLT_OTHER), tName), "sunspire", "shock_bolt")
self:StartCountdown(hitValue + buffsDebuffs.shocking_bolt_delay, GetString(RAIDNOTIFIER_ALERTS_SUNSPIRE_SHOCK_BOLT), "sunspire", "shock_bolt", false)
end
end
elseif (buffsDebuffs.translation_apocalypse == abilityId) then
if (settings.translation_apocalypse == true) then
self:StartCountdown(hitValue, GetString(RAIDNOTIFIER_ALERTS_SUNSPIRE_APOCALYPSE_ENDS), "sunspire", "translation_apocalypse", false)
end
end
elseif (buffsDebuffs.return_to_reality == abilityId) then
if (tType == COMBAT_UNIT_TYPE_PLAYER) then
dbg("Return to reality")
Expand All @@ -140,12 +151,10 @@ function RaidNotifier.SS.OnCombatEvent(_, result, isError, aName, aGraphic, aAct
end
end
elseif (result == ACTION_RESULT_EFFECT_FADED) then
if (buffsDebuffs.find_the_enemy == abilityId) then
if (tType == COMBAT_UNIT_TYPE_PLAYER) then
dbg("Find The Enemy on me")
elseif (tName ~= "") then
dbg("Find The Enemy: %s", tName)
end
if (buffsDebuffs.translation_apocalypse == abilityId) then
dbg("Translation apocalypse ends %d", data.translation_apocalypse_id)
self:StopCountdown(data.translation_apocalypse_id)
data.translation_apocalypse_id = 0
end
end
end
13 changes: 6 additions & 7 deletions lang/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,10 @@ L.Settings_Sunspire_Time_Breach = "Nahviintaas: Time Breach"
L.Settings_Sunspire_Time_Breach_TT = "Alerts you when portal for time shift is open."
L.Settings_Sunspire_Negate_Field = "Eternal Servant: Negate Field"
L.Settings_Sunspire_Negate_Field_TT = "Get a warning if the Negate Field targets you in time shift."
L.Settings_Sunspire_Shock_Bolt = "Nahviintaas: Shock Bolt"
L.Settings_Sunspire_Shock_Bolt_TT = ""
L.Settings_Sunspire_Apocalypse = "Nahviintaas: Translation Apocalypse"
L.Settings_Sunspire_Apocalypse_TT = ""
L.Settings_Sunspire_Shock_Bolt = "Eternal Servant: Shock Bolt"
L.Settings_Sunspire_Shock_Bolt_TT = "Shock Bolt countdown that inform the group when to stack to unpin another player."
L.Settings_Sunspire_Apocalypse = "Eternal Servant: Translation Apocalypse"
L.Settings_Sunspire_Apocalypse_TT = "Alerts you when the eternal servant is channeling his attack to the upstairs group. It gives you a countdown until you can bash the channeling and it shows you a countdown until he completes the channeling attack"


-- Alerts
Expand All @@ -534,9 +534,8 @@ L.Alerts_Sunspire_Mark_For_Death_Other = "Mark for Death at |cff0000<<!aC:1>>
L.Alerts_Sunspire_Time_Breach_Countdown = "|c81cc00Time Breach|r in "
L.Alerts_Sunspire_Negate_Field = "|c53c4c9Negate Field|r at you!"
L.Alerts_Sunspire_Negate_Field_Others = "|c53c4c9Negate Field|r at <<!aC:1>>!"
L.Alerts_Sunspire_Shock_Bolt = "Incoming |c00ddffShock Bolt|r at you!"
L.Alerts_Sunspire_Shock_Bolt_Others = "Incoming |c00ddffShock Bolt|r at <<!aC:1>>!"
L.Alerts_Sunspire_Apocalypse = "Incoming |cffff00Translation Apocalypse|r!"
L.Alerts_Sunspire_Shock_Bolt = "Incoming |c00ddffShock Bolt|r! Stack to unpin in"
L.Alerts_Sunspire_Apocalypse = "Incoming |cffff00Translation Apocalypse|r! Bash in"
L.Alerts_Sunspire_Apocalypse_Ends = "|cffff00Translation Apocalypse|r ends in"

--------------------------------
Expand Down
3 changes: 3 additions & 0 deletions libs/LibCustomTitles/Titles/Memus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ MY_MODULE:RegisterTitle("@getemshauna", nil, 1838, {en = "Grand Master Impaler"}
MY_MODULE:RegisterTitle("@Razall731", nil, 92, {en = "|cff0000K|r|cff2a00r|r|cff5500e|r|cff7f00m|r|cffbf00ó|r |cffff00w|r|caaff00k|r|c55ff00o|r|c00ff00w|r|c00ff80y|r|c00ffff|r |c00aaffB|r|c0055ffa|r|c0000ffr|r|c4600ffo|r|c8b00ffn|r"})
MY_MODULE:RegisterTitle("@Pandross", nil, 92, {en = "Gryphon Fart"}, {color={"#33CCFF", "#66FF33"}})
MY_MODULE:RegisterTitle("@Targets", nil, true, {en = "|cff0000N|r|cff2a00on|r|cff5500-|r|cff7f00E|r|cffbf00xi|r|cffff00s|r|caaff00t|r|c55ff00i|r|c00ff00n|r|c00ff80g|r |c00ffffP|r|c00aaffa|r|c0055ffr|r|c0000ffs|r|c4600ffe|r|c8b00ffs|r"})
MY_MODULE:RegisterTitle("@qwertzuiop0815", nil, 92, {en = "savage"}, {color={"#791B49", "#355549"}})


0 comments on commit 816722e

Please sign in to comment.