From 380d3f7539938136d8a75385691bbce2562051bd Mon Sep 17 00:00:00 2001 From: pepopo978 Date: Mon, 18 Aug 2025 16:41:22 -0700 Subject: [PATCH] handle molten blast refreshing flame shock --- Cursive.toc | 4 ++-- Localization.lua | 4 ++++ curses.lua | 23 +++++++++++++++++++---- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Cursive.toc b/Cursive.toc index f49438a..51053d8 100644 --- a/Cursive.toc +++ b/Cursive.toc @@ -1,6 +1,6 @@ ## Interface: 11200 -## Title: [|CFF33AAFFSUPERWOW|R] Cursive 2.4.3 -## Title-zhCN: [|CFF33AAFFSUPERWOW|R] Cursive 2.4.3 +## Title: [|CFF33AAFFSUPERWOW|R] Cursive 2.4.4 +## Title-zhCN: [|CFF33AAFFSUPERWOW|R] Cursive 2.4.4 ## Author: Pepopo ## Notes: Uses SuperWoW GUIDs to show units in combat and track curses ## Notes-zhCN: 使用SuperWoW的GUID功能来显示战斗中的单位并监视诅咒等 diff --git a/Localization.lua b/Localization.lua index 080a9a0..1a1a221 100644 --- a/Localization.lua +++ b/Localization.lua @@ -41,6 +41,7 @@ L:RegisterTranslations("enUS", function() ["Your (.+) fail.+\. (.+) is immune"] = true, ["Your (.+) was blocked by (.+)"] = true, ["Your (.+) was dodged by (.+)"] = true, + ["Your Molten Blast(.+)for .+ Fire damage"] = true, -- global ["|cffffcc00Cursive:|cffffaaaa Couldn't detect SuperWoW."] = true, @@ -178,6 +179,7 @@ L:RegisterTranslations("enUS", function() -- shaman ["flame shock"] = true, + ["molten blast"] = true, -- warlock ["conflagrate"] = true, @@ -249,6 +251,7 @@ L:RegisterTranslations("zhCN", function() ["Your (.+) was dodged by (.+)"] = "你的(.+)被(.+)躲闪过去了", ["Your (.+) was blocked by (.+)"] = "你的(.+)被(.+)格挡了", ["Your (.+) fail.+\. (.+) is immune"] = "你的(.+)施放失败。(.+)对此免疫", + ["Your Molten Blast(.+)for .+ Fire damage"] = "你的熔岩爆裂(.+)造成了.+点火焰伤害", -- global ["|cffffcc00Cursive:|cffffaaaa Couldn't detect SuperWoW."] = "|cffffcc00Cursive:|cffffaaaa 无法检测到SuperWoW.", @@ -382,6 +385,7 @@ L:RegisterTranslations("zhCN", function() -- shaman ["flame shock"] = "烈焰震击", -- no idea if right + ["molten blast"] = "熔岩爆裂", -- no idea if right -- warlock ["conflagrate"] = "引燃", -- no idea if right diff --git a/curses.lua b/curses.lua index 516b184..c48a13b 100644 --- a/curses.lua +++ b/curses.lua @@ -30,6 +30,7 @@ local curses = { lastComboPoints = 0, lastCastSpellId = 0, lastCastTargetGuid = 0, + lastMoltenBlastTargetGuid = 0, sharedDebuffs = { faeriefire = {}, @@ -48,6 +49,8 @@ local immune_test = L["Your (.+) fail.+\. (.+) is immune"] local block_test = L["Your (.+) was blocked by (.+)"] local dodge_test = L["Your (.+) was dodged by (.+)"] +local molten_blast_test = L["Your Molten Blast(.+)for .+ Fire damage"] + local lastGuid = nil function curses:LoadCurses() @@ -241,6 +244,10 @@ Cursive:RegisterEvent("UNIT_CASTEVENT", function(casterGuid, targetGuid, event, curses.lastCastSpellId = spellID curses.lastCastTargetGuid = targetGuid + if spellID >= 36916 and spellID <= 36921 then + curses.lastMoltenBlastTargetGuid = targetGuid + end + if curses.trackedCurseIds[spellID] then lastGuid = targetGuid local duration = curses:GetCurseDuration(spellID) - 0.2 @@ -307,17 +314,17 @@ Cursive:RegisterEvent("CHAT_MSG_SPELL_SELF_DAMAGE", } end - local spellName, target + local spellName, failedTarget for _, test in pairs(spell_failed_tests) do local _, _, foundSpell, foundTarget = string.find(message, test) if foundSpell and foundTarget then spellName = foundSpell - target = foundTarget + failedTarget = foundTarget break end end - if spellName and target then + if spellName and failedTarget then spellName = string.lower(spellName) -- clear pending cast @@ -332,6 +339,14 @@ Cursive:RegisterEvent("CHAT_MSG_SPELL_SELF_DAMAGE", elseif spellName == L["conflagrate"] and lastGuid then Cursive:CancelScheduledEvent("updateCurse" .. lastGuid .. spellName) end + return + end + + if curses.isShaman and string.find(message, molten_blast_test) then + local flame_shock = L["flame shock"] + if curses:HasCurse(flame_shock, curses.lastMoltenBlastTargetGuid, 0) then + curses.guids[curses.lastMoltenBlastTargetGuid][flame_shock]["start"] = GetTime() -- reset start time to current time + end end end ) -- resists @@ -499,7 +514,7 @@ function curses:HasCurse(lowercaseSpellNameNoRank, targetGuid, minRemaining) if curses.guids[targetGuid] and curses.guids[targetGuid][lowercaseSpellNameNoRank] then local remaining = Cursive.curses:TimeRemaining(curses.guids[targetGuid][lowercaseSpellNameNoRank]) - if remaining > minRemaining then + if remaining >= minRemaining then return true end end