From 290fb39f872a4df411350a566c8caa5cc92f2947 Mon Sep 17 00:00:00 2001 From: andrew6180 <16847730+andrew6180@users.noreply.github.com> Date: Fri, 17 Oct 2025 13:05:19 -0700 Subject: [PATCH] add manastorm load condition --- WeakAuras/Prototypes.lua | 32 ++++++++++++++++++++++++++++++++ WeakAuras/WeakAuras.lua | 5 +++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index aa87155..29700ab 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -1020,6 +1020,14 @@ Private.load_prototype = { optional = true, events = {"PLAYER_FLAGS_CHANGED", "UNIT_FACTION", "ZONE_CHANGED"} }, + { + name = "manastorm", + display = L["In Manastorm"], + type = "toggle", + init = "arg", + width = WeakAuras.normalWidth, + events = {"ACTIVE_MANASTORM_UPDATED"} + }, { name = "vehicle", display = L["In Vehicle"], @@ -7838,6 +7846,22 @@ Private.event_prototypes = { name = "defensiveStatsHeader", display = L["Defensive Stats"], }, + { + name = "defensevalue", + display = L["Defense Value"], + type = "number", + init = "UnitDefense('player')", + store = true, + conditionType = "number" + }, + { + name = "defensepercent", + display = L["Defense (%)"], + type = "number", + init = "0.04 * ( UnitDefense('player') + select(2,UnitDefense('player') ) - UnitLevel('player')*5 )", + store = true, + conditionType = "number" + }, { name = "dodgerating", display = L["Dodge Rating"], @@ -7938,6 +7962,14 @@ Private.event_prototypes = { }, formatter = "Number", }, + { + name = "avoidancetotalpercent", + display = L["Total Avoidance (%)"], + type = "number", + init = "0.04 * ( UnitDefense('player') + select(2,UnitDefense('player') ) - UnitLevel('player')*5 ) + GetDodgeChance() + GetParryChance() + GetBlockChance()", + store = true, + conditionType = "number" + }, }, automaticrequired = true, progressType = "none" diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 082276d..e5822e3 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -1616,6 +1616,7 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...) local ruleset = WeakAuras.Ruleset() local specialization = SpecializationUtil.GetActiveSpecialization() + local manastorm = C_Manastorm.IsInManastorm() local changed = 0; local shouldBeLoaded, couldBeLoaded; @@ -1628,8 +1629,8 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...) if (data and not data.controlledChildren) then local loadFunc = loadFuncs[id]; local loadOpt = loadFuncsForOptions[id]; - shouldBeLoaded = loadFunc and loadFunc("ScanForLoads_Auras", inCombat, alive, inEncounter, pvp, vehicle, vehicleUi, mounted, class, specialization, player, realm, guild, race, faction, playerLevel, role, role, raidRole, group, groupSize, raidMemberType, ruleset, zone, zoneId, subzone, encounter_id, size, difficulty); - couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, inEncounter, pvp, vehicle, vehicleUi, mounted, class, specialization, player, realm, guild, race, faction, playerLevel, role, role, raidRole, group, groupSize, raidMemberType, ruleset, zone, zoneId, subzone, encounter_id, size, difficulty); + shouldBeLoaded = loadFunc and loadFunc("ScanForLoads_Auras", inCombat, alive, inEncounter, pvp, manastorm, vehicle, vehicleUi, mounted, class, specialization, player, realm, guild, race, faction, playerLevel, role, role, raidRole, group, groupSize, raidMemberType, ruleset, zone, zoneId, subzone, encounter_id, size, difficulty); + couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, inEncounter, pvp, manastorm, vehicle, vehicleUi, mounted, class, specialization, player, realm, guild, race, faction, playerLevel, role, role, raidRole, group, groupSize, raidMemberType, ruleset, zone, zoneId, subzone, encounter_id, size, difficulty); if(shouldBeLoaded and not loaded[id]) then changed = changed + 1;