Skip to content

Commit

Permalink
Templates: Updates for 11.0.5, Stormbringer, Flurry Strikes, Dark Ranger
Browse files Browse the repository at this point in the history
  • Loading branch information
InfusOnWoW committed Oct 27, 2024
1 parent 92facb1 commit 910d89a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 23 deletions.
51 changes: 30 additions & 21 deletions WeakAurasTemplates/TriggerTemplates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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,
});
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -1028,17 +1037,17 @@ 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,
});
tinsert(types, {
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);
Expand All @@ -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);
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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 = {}
Expand All @@ -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
Expand Down
15 changes: 13 additions & 2 deletions WeakAurasTemplates/TriggerTemplatesData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
},
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
},
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
},
Expand Down Expand Up @@ -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
},
Expand Down

0 comments on commit 910d89a

Please sign in to comment.