Skip to content

Commit

Permalink
[AS] Fixed early warning for Olms's Gusts of Steam mechanic (jumps)
Browse files Browse the repository at this point in the history
  • Loading branch information
MysteryDragon committed Feb 7, 2022
1 parent 97ac80e commit 87c208b
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 7 deletions.
11 changes: 10 additions & 1 deletion RaidNotifier.lua
Original file line number Diff line number Diff line change
Expand Up @@ -630,12 +630,14 @@ do ----------------------
dbg("Register for %s (%s)", GetRaidZoneName(self.raidId), GetString("SI_DUNGEONDIFFICULTY", self.raidDifficulty))

local trial = self.Trial[self.raidId]
local combatStateChangedCallback

if (trial) then
trial.Initialize()
local combatEventCallback = trial.OnCombatEvent
local bossesChangedCallback = trial.OnBossesChanged
local effectChangedCallback = trial.OnEffectChanged
local combatStateChangedCallback = trial.OnCombatStateChanged
combatStateChangedCallback = trial.OnCombatStateChanged

local abilityList = {}
local function RegisterForAbility(abId)
Expand Down Expand Up @@ -745,6 +747,13 @@ do ----------------------
EVENT_MANAGER:UnregisterForEvent(self.Name, EVENT_BOSSES_CHANGED)
EVENT_MANAGER:UnregisterForEvent(self.Name, EVENT_PLAYER_COMBAT_STATE)

local trial = self.Trial[self.raidId]

-- Remove custom handlers which may have been assigned inside the trial "class"
if type(trial.Shutdown) == "function" then
trial.Shutdown()
end

--self:RemoveFragment()
self:HideAllElements()
listening = false
Expand Down
17 changes: 15 additions & 2 deletions TrialAsylumSanctorium.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,29 @@ local data = {}
function RaidNotifier.AS.Initialize()
p = RaidNotifier.p
dbg = RaidNotifier.dbg

data = {}
end

function RaidNotifier.AS.Shutdown()
-- In case of zoning out during the battle "OnCombatStateChanged" handler may be unregistered before it'll be called
-- outside the combat; so we have to manually unregister handler for interval check here
EVENT_MANAGER:UnregisterForUpdate(RaidNotifier.Name .. "_IntervalCheck")
end

local function OnIntervalCheck()
local self = RaidNotifier
local raidId = RaidNotifier.raidId
local buffsDebuffs = RaidNotifier.BuffsDebuffs[raidId]
local settings = self.Vars.asylum

if (settings.olms_gusts_of_steam and settings.olms_gusts_of_steam_slider > 0) then
health, maxHealth = GetUnitPower("boss1", POWERTYPE_HEALTH) -- Llothi
local health, maxHealth = GetUnitPower("boss1", POWERTYPE_HEALTH) -- It's always Olms in AS
-- Precautious check in case of situation when the fight is finished already but the combat state check didn't fire yet
-- (as we have 3 seconds delay for that currently)
if (health == 0 or maxHealth == 0) then
return
end
local healthPercent = health * 100 / maxHealth
if (data.olmsHealthChecked == nil) then
data.olmsHealthChecked = healthPercent
Expand All @@ -40,6 +51,8 @@ end
function RaidNotifier.AS.OnCombatStateChanged(inCombat)
local self = RaidNotifier
if (inCombat) then
-- At the start of the fight we want to clear all previous fight data collected
data = {}
EVENT_MANAGER:RegisterForUpdate(self.Name .. "_IntervalCheck", 1000, OnIntervalCheck);
dbg("start interval check")
else
Expand Down
2 changes: 1 addition & 1 deletion lang/de.lua
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ L.Alerts_Asylum_Teleport_Strike_Other = "|cFF3366Teleportationsschlag
L.Alerts_Asylum_Exhaustive_Charges = "Eingehende |cFF0000Erschöpfende Ladungen|r"
L.Alerts_Asylum_Storm_The_Heavens = "Eingehende |cFF0000Erstürmung des Himmels|r! Kite!"
L.Alerts_Asylum_Gusts_Of_Steam = "Eingehende |cFF9900Dampfschwaden|r! Verstecken!"
L.Alerts_Asylum_Pre_Gusts_Of_Steam = "<<1>> vor |cFF0000Sprung|r! Bereit zu Laufen!"
L.Alerts_Asylum_Pre_Gusts_Of_Steam = "|cFF0000<<1>>%|r vor |cFF9900Sprung|r! Bereit zu Laufen!"
L.Alerts_Asylum_Trial_By_Fire = "Eingehendes |cFF5500Feuer|r!"
L.Alerts_Asylum_Protector_Spawn = "|c0000FFGeschütz|r erscheint!"
L.Alerts_Asylum_Protector_Active = "|c0000FFGeschütz|r aktiv!"
Expand Down
2 changes: 1 addition & 1 deletion lang/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ L.Alerts_Asylum_Teleport_Strike_Other = "|cFF3366Teleport Strike|r on
L.Alerts_Asylum_Exhaustive_Charges = "Incoming |cFF0000Exhaustive Charges|r"
L.Alerts_Asylum_Storm_The_Heavens = "Incoming |cFF0000Storm The Heavens|r! Kite!"
L.Alerts_Asylum_Gusts_Of_Steam = "Incoming |cFF9900Gusts Of Steam|r! Hide!"
L.Alerts_Asylum_Pre_Gusts_Of_Steam = "<<1>> to |cFF0000jump|r! Prepare to Hide!"
L.Alerts_Asylum_Pre_Gusts_Of_Steam = "|cFF0000<<1>>%|r to |cFF9900jump|r! Prepare to Hide!"
L.Alerts_Asylum_Trial_By_Fire = "Incoming |cFF5500Fire|r!"
L.Alerts_Asylum_Protector_Spawn = "|c0000FFProtector|r spawning!"
L.Alerts_Asylum_Protector_Active = "|c0000FFProtector|r active!"
Expand Down
2 changes: 1 addition & 1 deletion lang/es.lua
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ L.Alerts_Asylum_Teleport_Strike_Other = "|cFF3366 Golpe de transporta
L.Alerts_Asylum_Exhaustive_Charges = "|cFF0000Cargas agotadoras|r inminente."
L.Alerts_Asylum_Storm_The_Heavens = "¡|cFF0000Asalto desde los Cielos|r inminente! ¡Aléjate lentamente!"
L.Alerts_Asylum_Gusts_Of_Steam = "¡|cFF9900Ráfagas de vapor|r inminente! ¡Escóndete!"
L.Alerts_Asylum_Pre_Gusts_Of_Steam = "¡<<1>> va a |cFF0000saltar|r! ¡Preparate para esconderte!"
L.Alerts_Asylum_Pre_Gusts_Of_Steam = "¡|cFF0000<<1>>%|r va a |cFF9900saltar|r! ¡Preparate para esconderte!"
L.Alerts_Asylum_Trial_By_Fire = "¡|cFF5500Fuego|r inminente!"
L.Alerts_Asylum_Protector_Spawn = "¡|c0000FFProtector|r apareciendo!"
L.Alerts_Asylum_Protector_Active = "¡|c0000FFProtector|r activo!"
Expand Down
2 changes: 1 addition & 1 deletion lang/fr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ L.Alerts_Asylum_Teleport_Strike_Other = "|cFF3366Téléportation|r su
L.Alerts_Asylum_Exhaustive_Charges = "En Approche |cFF0000Charges Épuisantes|r"
L.Alerts_Asylum_Storm_The_Heavens = "En Approche |cFF0000Assaillir les Cieux|r! Courez!"
L.Alerts_Asylum_Gusts_Of_Steam = "En Approche |cFF9900Nuages de Vapeur|r! Cachez vous!"
L.Alerts_Asylum_Pre_Gusts_Of_Steam = "<<1>>% avant |cFF0000Saut|r! Préparez vous!"
L.Alerts_Asylum_Pre_Gusts_Of_Steam = "|cFF0000<<1>>%|r avant |cFF9900Saut|r! Préparez vous!"
L.Alerts_Asylum_Trial_By_Fire = "En Approche |cFF5500Feu|r!"
L.Alerts_Asylum_Protector_Spawn = "Apparition d'un |c0000FFProtecteur|r!"
L.Alerts_Asylum_Protector_Active = "|c0000FFProtecteur|r actif!"
Expand Down
1 change: 1 addition & 0 deletions lang/ru.lua
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ L.Alerts_Asylum_Storm_The_Heavens = "Приближается |cF
L.Alerts_Asylum_Eruption = "|c595959Eruption|r нацелена на тебя!"
L.Alerts_Asylum_Eruption_Other = "|c595959Eruption|r нацелена на игрока |cFC0000<<!aC:1>>|r!"
L.Alerts_Asylum_Gusts_Of_Steam = "Приближается |cFF9900Gusts Of Steam|r! СПРЯЧЬСЯ!"
L.Alerts_Asylum_Pre_Gusts_Of_Steam = "|cFF0000<<1>>%|r до |cFF9900прыжка|r! ГОТОВЬСЯ прятаться!"
L.Alerts_Asylum_Trial_By_Fire = "Приближается |cFF5500Fire|r!"
L.Alerts_Asylum_Protector_Spawn = "Появляется |c0000FFЗащитник|r!"
L.Alerts_Asylum_Protector_Active = "|c0000FFЗащитник|r активирован!"
Expand Down

0 comments on commit 87c208b

Please sign in to comment.