Skip to content

Commit

Permalink
fix start timer for AV in classic era
Browse files Browse the repository at this point in the history
  • Loading branch information
danez authored and emmericp committed Mar 4, 2024
1 parent 3559dd7 commit ebf243a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 8 additions & 7 deletions DBM-PvP/PvPGeneral.lua
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,15 @@ do
end

function mod:CHAT_MSG_BG_SYSTEM_NEUTRAL(msg)
if self.Options.TimerStart and msg:find(L.BgStart120) then
startTimer:Update(isClassic and 1.5 or 0, 120)
elseif self.Options.TimerStart and (msg:find(L.BgStart60) or msg == L.ArenaStart60 or msg:find(L.ArenaStart60)) then
startTimer:Update(isClassic and 61.5 or 60, 120)
elseif self.Options.TimerStart and (msg:find(L.BgStart30) or msg == L.ArenaStart30 or msg:find(L.ArenaStart30)) then
startTimer:Update(isClassic and 91.5 or 90, 120)
-- in Classic era the chat msg is about 1.5 seconds early
if self.Options.TimerStart and (msg:find(L.BgStart120) or msg:find(L.BgStart120era)) then
startTimer:Update(0, 120)
elseif self.Options.TimerStart and (msg:find(L.BgStart60) or msg:find(L.BgStart60era) or msg == L.ArenaStart60 or msg:find(L.ArenaStart60)) then
startTimer:Update(isClassic and 58.5 or 60, 120)
elseif self.Options.TimerStart and (msg:find(L.BgStart30) or msg:find(L.BgStart30era) or msg == L.ArenaStart30 or msg:find(L.ArenaStart30)) then
startTimer:Update(isClassic and 88.5 or 90, 120)
elseif self.Options.TimerStart and (msg == L.ArenaStart15 or msg:find(L.ArenaStart15)) then
startTimer:Update(isClassic and 106.5 or 105, 120)
startTimer:Update(isClassic and 103.5 or 105, 120)
elseif not isClassic and (msg == L.Vulnerable1 or msg == L.Vulnerable2 or msg:find(L.Vulnerable1) or msg:find(L.Vulnerable2)) then
vulnerableTimer:Start()
end
Expand Down
4 changes: 4 additions & 0 deletions DBM-PvP/localization.en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ L:SetMiscLocalization({
BgStart120 = "The [bB]attle.*begin.*in 2 minutes.",
BgStart60 = "The [bB]attle.*begin.*in 1 minute.",
BgStart30 = "The [bB]attle.*begin.*in 30 seconds.",
-- Classic Era: 2 minutes until the battle for Alterac Valley begins.
BgStart120era = "2 minutes until the [bB]attle.*begins.",
BgStart60era = "1 minute until the [bB]attle.*begins.",
BgStart30era = "30 seconds until the [bB]attle.*begins.",
ArenaStart60 = "One minute until the Arena battle begins!",
ArenaStart30 = "Thirty seconds until the Arena battle begins!",
ArenaStart15 = "Fifteen seconds until the Arena battle begins!",
Expand Down

0 comments on commit ebf243a

Please sign in to comment.