From 910d89ac309659dc3e2a61514d9422de86a825e1 Mon Sep 17 00:00:00 2001 From: Infus Date: Sun, 27 Oct 2024 18:45:29 +0100 Subject: [PATCH] Templates: Updates for 11.0.5, Stormbringer, Flurry Strikes, Dark Ranger --- WeakAurasTemplates/TriggerTemplates.lua | 51 ++++++++++++--------- WeakAurasTemplates/TriggerTemplatesData.lua | 15 +++++- 2 files changed, 43 insertions(+), 23 deletions(-) diff --git a/WeakAurasTemplates/TriggerTemplates.lua b/WeakAurasTemplates/TriggerTemplates.lua index d9ec1964ba..900e1c31fb 100644 --- a/WeakAurasTemplates/TriggerTemplates.lua +++ b/WeakAurasTemplates/TriggerTemplates.lua @@ -245,7 +245,7 @@ local function itemInRangeRed(conditions, trigger, regionType) tinsert(conditions, buildCondition(trigger, checks.itemInRange, {changes("red", regionType)})); end -local function createBuffTrigger(triggers, position, item, buffShowOn, isBuff) +local function createBuffTrigger(triggers, position, item, buffShowOn, isBuff, data) triggers[position] = { trigger = { unit = item.unit or isBuff and "player" or "target", @@ -294,6 +294,15 @@ local function createBuffTrigger(triggers, position, item, buffShowOn, isBuff) if (item.unit == "multi") then triggers[position].trigger.spellId = item.buffId or item.spell; end + + if item.progressSource then + data.progressSource = { position, item.progressSource } + end + + if item.maxProgress then + data.useAdjustededMax = true + data.adjustedMax = item.maxProgress + end end local function createDurationTrigger(triggers, position, item) @@ -437,13 +446,13 @@ local function createAbilityAndDurationTrigger(triggers, item) createAbilityTrigger(triggers, 2, item, "showAlways"); end -local function createAbilityAndBuffTrigger(triggers, item) - createBuffTrigger(triggers, 1, item, "showOnActive", true); +local function createAbilityAndBuffTrigger(triggers, item, data) + createBuffTrigger(triggers, 1, item, "showOnActive", true, data); createAbilityTrigger(triggers, 2, item, "showAlways"); end -local function createAbilityAndDebuffTrigger(triggers, item) - createBuffTrigger(triggers, 1, item, "showOnActive", false); +local function createAbilityAndDebuffTrigger(triggers, item, data) + createBuffTrigger(triggers, 1, item, "showOnActive", false, data); createAbilityTrigger(triggers, 2, item, "showAlways"); end @@ -991,8 +1000,8 @@ local function subTypesFor(item, regionType) icon = icon.cd, title = L["Show Only if Buffed"], description = L["Only shows the aura if the target has the buff."], - createTriggers = function(triggers, item) - createBuffTrigger(triggers, 1, item, "showOnActive", true); + createTriggers = function(triggers, item, data) + createBuffTrigger(triggers, 1, item, "showOnActive", true, data); end, data = data, }); @@ -1001,8 +1010,8 @@ local function subTypesFor(item, regionType) title = L["Always Show"], description = L["Always shows the aura, highlight it if buffed."], buffShowOn = "showAlways", - createTriggers = function(triggers, item) - createBuffTrigger(triggers, 1, item, "showAlways", true); + createTriggers = function(triggers, item, data) + createBuffTrigger(triggers, 1, item, "showAlways", true, data); end, createConditions = function(conditions, item, regionType) isBuffedGlowAuraAlways(conditions, 1, regionType); @@ -1013,8 +1022,8 @@ local function subTypesFor(item, regionType) icon = icon.cd2, title = L["Always Show"], description = L["Always shows the aura, grey if buff not active."], - createTriggers = function(triggers, item) - createBuffTrigger(triggers, 1, item, "showAlways", true); + createTriggers = function(triggers, item, data) + createBuffTrigger(triggers, 1, item, "showAlways", true, data); end, createConditions = function(conditions, item, regionType) missingBuffGreyed(conditions, 1, regionType); @@ -1028,8 +1037,8 @@ local function subTypesFor(item, regionType) icon = icon.cd, title = L["Show Only if Debuffed"], description = L["Only show the aura if the target has the debuff."], - createTriggers = function(triggers, item) - createBuffTrigger(triggers, 1, item, "showOnActive", false); + createTriggers = function(triggers, item, data) + createBuffTrigger(triggers, 1, item, "showOnActive", false, data); end, data = data, }); @@ -1037,8 +1046,8 @@ local function subTypesFor(item, regionType) icon = icon.glow, title = L["Always Show"], description = L["Always show the aura, highlight it if debuffed."], - createTriggers = function(triggers, item) - createBuffTrigger(triggers, 1, item, "showAlways", false); + createTriggers = function(triggers, item, data) + createBuffTrigger(triggers, 1, item, "showAlways", false, data); end, createConditions = function(conditions, item, regionType) isBuffedGlowAuraAlways(conditions, 1, regionType); @@ -1049,8 +1058,8 @@ local function subTypesFor(item, regionType) icon = icon.cd2, title = L["Always Show"], description = L["Always show the aura, turns grey if the debuff not active."], - createTriggers = function(triggers, item) - createBuffTrigger(triggers, 1, item, "showAlways", false); + createTriggers = function(triggers, item, data) + createBuffTrigger(triggers, 1, item, "showAlways", false, data); end, createConditions = function(conditions, item, regionType) missingBuffGreyed(conditions, 1, regionType); @@ -1271,9 +1280,9 @@ function WeakAuras.CreateTemplateView(Private, frame) end end - local function createTriggersFor(item, subType) + local function createTriggersFor(item, subType, data) local triggers = {}; - subType.createTriggers(triggers, item); + subType.createTriggers(triggers, item, data); return triggers; end @@ -1303,7 +1312,7 @@ function WeakAuras.CreateTemplateView(Private, frame) if (item.triggers) then triggers = item.triggers; else - triggers = createTriggersFor(item, subType); + triggers = createTriggersFor(item, subType, data); end data.triggers = {} @@ -1326,7 +1335,7 @@ function WeakAuras.CreateTemplateView(Private, frame) if (item.triggers) then triggers = item.triggers; else - triggers = createTriggersFor(item, subType); + triggers = createTriggersFor(item, subType, data); end for i, v in pairs(triggers) do diff --git a/WeakAurasTemplates/TriggerTemplatesData.lua b/WeakAurasTemplates/TriggerTemplatesData.lua index be6314d431..d41cc80a4b 100644 --- a/WeakAurasTemplates/TriggerTemplatesData.lua +++ b/WeakAurasTemplates/TriggerTemplatesData.lua @@ -1233,7 +1233,7 @@ templates.class.HUNTER = { { spell = 459731, type = "buff", unit = "player", talent = 126411 }, -- Huntmaster's Call { spell = 459735, type = "buff", unit = "player" }, -- Summon Fenryr { spell = 459759, type = "buff", unit = "player", talent = 126414 }, -- A Murder of Crows - { spell = 461762, type = "buff", unit = "player", herotalent = 117590 }, -- Withering Fire + { spell = 466991, type = "buff", unit = "player", herotalent = 117590 }, -- Withering Fire { spell = 461866, type = "buff", unit = "player", herotalent = 117566 }, -- Scattered Prey { spell = 462515, type = "buff", unit = "player", herotalent = 117589 }, -- Howl of the Pack { spell = 136, type = "buff", unit = "pet" }, -- Mend Pet @@ -1277,6 +1277,7 @@ templates.class.HUNTER = { { spell = 459668, type = "debuff", unit = "target", talent = 126429 }, -- Venomous Bite { spell = 459753, type = "debuff", unit = "target" }, -- Ravenous Leap { spell = 462033, type = "debuff", unit = "target", talent = 126829 }, -- Implosive Trap + { spell = 467745, type = "debuff", unit = "target", herotalent = 128219 }, -- Shadow Dagger }, icon = 135860 }, @@ -1377,7 +1378,7 @@ templates.class.HUNTER = { { spell = 459468, type = "buff", unit = "player", talent = 126448 }, -- Ghillie Suit { spell = 459805, type = "buff", unit = "player", talent = 126359 }, -- Wailing Arrow { spell = 459919, type = "buff", unit = "player", talent = 126370 }, -- Kill Zone - { spell = 461762, type = "buff", unit = "player", herotalent = 117590 }, -- Withering Fire + { spell = 466991, type = "buff", unit = "player", herotalent = 117590 }, -- Withering Fire { spell = 378770, type = "buff", unit = "player", talent = 126474 }, -- Deathblow { spell = 264663, type = "buff", unit = "pet" }, -- Predator's Thirst { spell = 459722, type = "buff", unit = "pet" }, -- Mastery: Spirit Bond @@ -1412,6 +1413,7 @@ templates.class.HUNTER = { { spell = 451531, type = "debuff", unit = "target", herotalent = 123870 }, -- Crescent Steel { spell = 459796, type = "debuff", unit = "target", talent = 126392 }, -- Barrage { spell = 462033, type = "debuff", unit = "target", talent = 126829 }, -- Implosive Trap + { spell = 467745, type = "debuff", unit = "target", herotalent = 128219 }, -- Shadow Dagger }, icon = 236188 }, @@ -2390,11 +2392,15 @@ templates.class.SHAMAN = { { spell = 443454, type = "buff", unit = "player", herotalent = 117491 }, -- Ancestral Swiftness { spell = 447244, type = "buff", unit = "player", herotalent = 117485 }, -- Call of the Ancestors { spell = 454015, type = "buff", unit = "player", herotalent = 117489 }, -- Tempest + { spell = 454025, type = "buff", unit = "player", herotalent = 128226 }, -- Electroshock + { spell = 454376, type = "buff", unit = "player", herotalent = 125617 }, -- Surging Currents { spell = 454394, type = "buff", unit = "player", herotalent = 117483 }, -- Unlimited Power + { spell = 455089, type = "buff", unit = "player", herotalent = 117470 }, -- Storm Swell { spell = 462131, type = "buff", unit = "player", herotalent = 117464 }, -- Awakening Storms { spell = 462725, type = "buff", unit = "player", talent = 127917 }, -- Storm Frenzy { spell = 462818, type = "buff", unit = "player", talent = 101870 }, -- Icefury { spell = 462854, type = "buff", unit = "player" }, -- Skyfury + { spell = 468226, type = "buff", unit = "player", herotalent = 117460 }, -- Lightning Conduit { spell = 157348, type = "buff", unit = "pet" }, -- Call Lightning }, icon = 135863 @@ -2525,15 +2531,18 @@ templates.class.SHAMAN = { { spell = 453406, type = "buff", unit = "player" }, -- Whirling Earth { spell = 453409, type = "buff", unit = "player" }, -- Whirling Air { spell = 454015, type = "buff", unit = "player", herotalent = 117489 }, -- Tempest + { spell = 454025, type = "buff", unit = "player", herotalent = 128226 }, -- Electroshock { spell = 454376, type = "buff", unit = "player", herotalent = 125617 }, -- Surging Currents { spell = 454394, type = "buff", unit = "player", herotalent = 117483 }, -- Unlimited Power { spell = 455097, type = "buff", unit = "player", herotalent = 125616 }, -- Arc Discharge + { spell = 455089, type = "buff", unit = "player", herotalent = 117470 }, -- Storm Swell { spell = 456369, type = "buff", unit = "player", herotalent = 117471 }, -- Amplification Core { spell = 457387, type = "buff", unit = "player", herotalent = 117488 }, -- Wind Barrier { spell = 458269, type = "buff", unit = "player", herotalent = 117487 }, -- Totemic Rebound { spell = 461242, type = "buff", unit = "player", herotalent = 117479 }, -- Lively Totems { spell = 462131, type = "buff", unit = "player", herotalent = 117464 }, -- Awakening Storms { spell = 462854, type = "buff", unit = "player" }, -- Skyfury + { spell = 468226, type = "buff", unit = "player", herotalent = 117460 }, -- Lightning Conduit { spell = 470058, type = "buff", unit = "player", talent = 128270 }, -- Voltaic Blaze }, icon = 136099 @@ -3638,6 +3647,7 @@ templates.class.MONK = { { spell = 451508, type = "buff", unit = "player", herotalent = 125043 }, -- Balanced Stratagem { spell = 454494, type = "buff", unit = "player", talent = 124861 }, -- August Blessing { spell = 455071, type = "buff", unit = "player", talent = 125004 }, -- Ox Stance + { spell = 470670, type = "buff", unit = "player", herotalent = 125069, progressSource = "stacks", maxProgress = "240" }, -- Flurry Strikes }, icon = 613398 }, @@ -3907,6 +3917,7 @@ templates.class.MONK = { { spell = 459841, type = "buff", unit = "player", talent = 126307 }, -- Darting Hurricane { spell = 460127, type = "buff", unit = "player", herotalent = 125061 }, -- Courage of the White Tiger { spell = 460490, type = "buff", unit = "player", talent = 124952 }, -- Chi Burst + { spell = 470670, type = "buff", unit = "player", herotalent = 125069, progressSource = "stacks", maxProgress = "240" }, -- Flurry Strikes }, icon = 611420 },