Skip to content

Commit

Permalink
Added support for alliance mercenary
Browse files Browse the repository at this point in the history
  • Loading branch information
linaori committed Dec 9, 2022
1 parent 6e87833 commit a21dc7e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Changelog.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
local _, Namespace = ...

Namespace.Changelog = {
{
version = '10.0.2-16',
improvements = {
'Added mercenary buff support for alliance',
},
},
{
version = '10.0.2-15',
improvements = {
Expand Down
12 changes: 9 additions & 3 deletions QueueTools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ local locale = GetLocale()

local SpellIds = {
DeserterDebuff = 26013,
MercenaryContractBuff = 193475,
MercenaryContractAlliance = 193472,
MercenaryContractHorde = 193475,
}

local tableStructure = {
Expand Down Expand Up @@ -129,9 +130,14 @@ end
function Private.ScheduleSendSyncData()
local shouldSchedule = Memory.syncDataPayloadBuffer == nil

local remainingMercenary = Private.GetRemainingAuraTime(SpellIds.MercenaryContractHorde)
if remainingMercenary == -1 then
remainingMercenary = Private.GetRemainingAuraTime(SpellIds.MercenaryContractAlliance)
end

Memory.syncDataPayloadBuffer = {
addonVersion = Namespace.Meta.version,
remainingMercenary = Private.GetRemainingAuraTime(SpellIds.MercenaryContractBuff),
remainingMercenary = remainingMercenary,
remainingDeserter = Private.GetRemainingAuraTime(SpellIds.DeserterDebuff),
autoAcceptRole = Namespace.Database.profile.QueueTools.Automation.acceptRoleSelection,
}
Expand Down Expand Up @@ -815,7 +821,7 @@ end
function Module:COMBAT_LOG_EVENT_UNFILTERED()
local _, _, _, _, _, _, _, _, _, _, _, spellId = CombatLogGetCurrentEventInfo()

if spellId ~= SpellIds.MercenaryContractBuff then return end
if spellId ~= SpellIds.MercenaryContractHorde and spellId ~= SpellIds.MercenaryContractAlliance then return end
Private.ScheduleSendSyncData()
end

Expand Down

0 comments on commit a21dc7e

Please sign in to comment.