From d08d10eaf61dd87ae54ea353dab081ccfce67943 Mon Sep 17 00:00:00 2001 From: NoM0Re Date: Thu, 5 Jun 2025 00:23:13 +0200 Subject: [PATCH] (feat/Prototypes): Add Spell Cast Succeeded --- WeakAuras/Prototypes.lua | 39 +++++---------------------------------- 1 file changed, 5 insertions(+), 34 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index e5fd263..b1a263d 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -6061,7 +6061,6 @@ Private.event_prototypes = { timedrequired = true, progressType = "timed" }, - --[==[ maybe some day ["Spell Cast Succeeded"] = { type = "event", events = function(trigger) @@ -6070,15 +6069,6 @@ Private.event_prototypes = { AddUnitEventForEvents(result, unit, "UNIT_SPELLCAST_SUCCEEDED") return result end, - init = function(trigger) - local ret = [[ - local _, rankId = GetSpellInfo(%d) - local spellRank = %d - rankId = (rankId and tonumber(rankId:match("Rank (%d+)"))) or 0 - local rank = (spellRank and tonumber(spellRank:match("Rank (%d+)"))) or 0 - ]]; - return ret:format(trigger.spellId or 0, trigger.spellRank or nil); - end, name = L["Spell Cast Succeeded"], statesParameter = "unit", args = { @@ -6095,6 +6085,8 @@ Private.event_prototypes = { return state and state.show and (UnitIsUnit(needle, state.unit or '') == (op == "==")) end }, + { -- castGUID + }, { name = "spellNames", init = "arg", @@ -6109,26 +6101,6 @@ Private.event_prototypes = { test = "spellChecker:Check(spellNames)", noValidation = true, }, - { - name = "spellRank", - hidden = true, - init = "arg", - type = "number", - store = true, - test = "true", - }, - { - name = "rank", - hidden = true, - init = "rank", - display = L["Rank"], - store = true, - conditionType = "number", - multiEntry = { - operator = "or", - limit = 2 - }, - }, { name = "spellId", display = L["Exact Spell ID(s)"], @@ -6141,21 +6113,21 @@ Private.event_prototypes = { }, preamble = "local spellChecker = Private.ExecEnv.CreateSpellChecker()", preambleGroup = "spell", - test = "spellChecker:Check(spellId)", + test = "spellChecker:CheckName(spellNames)", conditionType = "number", noProgressSource = true }, { name = "icon", hidden = true, - init = "GetSpellInfo(spellId or spellNames or 0)", + init = "(spellId and select(3, GetSpellInfo(spellId))) or 'Interface\\\\Icons\\\\INV_Misc_QuestionMark'", store = true, test = "true" }, { name = "name", hidden = true, - init = "GetSpellInfo(spellId or spellNames or 0)", + init = "GetSpellInfo(spellId or 0)", store = true, test = "true" }, @@ -6165,7 +6137,6 @@ Private.event_prototypes = { timedrequired = true, progressType = "timed" }, - ]==] ["Ready Check"] = { type = "event", events = {