From 9768c924edde818d64f76062f426711b7e33830c Mon Sep 17 00:00:00 2001 From: pepopo978 Date: Tue, 1 Apr 2025 18:19:59 -0700 Subject: [PATCH] fix rank removal to work with faerie fire feral --- commands.lua | 6 +++--- utils.lua | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/commands.lua b/commands.lua index e1db3d2..e008900 100644 --- a/commands.lua +++ b/commands.lua @@ -485,7 +485,7 @@ function Cursive:Curse(spellName, targetedGuid, options) end -- remove (Rank x) from spellName if it exists - local spellNameNoRank = string.lower(string.gsub(spellName, "%(.+%)", "")) + local spellNameNoRank = Cursive.utils.GetSpellNameNoRank(spellName) if targetedGuid and not Cursive.curses:HasCurse(spellNameNoRank, targetedGuid, options["refreshtime"]) and not isMobCrowdControlled(targetedGuid) then castSpellWithOptions(string.lower(spellName), spellNameNoRank, targetedGuid, options) @@ -514,7 +514,7 @@ local function getSpellTarget(spellName, priority, options) local selectedPriority = priority or PRIORITY_HIGHEST_HP -- remove (Rank x) from spellName if it exists - local spellNameNoRank = string.lower(string.gsub(spellName, "%(.+%)", "")) + local spellNameNoRank = Cursive.utils.GetSpellNameNoRank(spellName) return pickTarget(selectedPriority, spellNameNoRank, true, options) end @@ -522,7 +522,7 @@ end function Cursive:Multicurse(spellName, priority, options) local targetedGuid = getSpellTarget(spellName, priority, options) if targetedGuid then - local spellNameNoRank = string.lower(string.gsub(spellName, "%(.+%)", "")) + local spellNameNoRank = Cursive.utils.GetSpellNameNoRank(spellName) castSpellWithOptions(string.lower(spellName), spellNameNoRank, targetedGuid, options) return true elseif options["warnings"] then diff --git a/utils.lua b/utils.lua index 253dac0..8c85076 100644 --- a/utils.lua +++ b/utils.lua @@ -175,4 +175,8 @@ utils.GetLevelString = function(unitstr) return level end +utils.GetSpellNameNoRank = function(spellName) + return string.lower(string.gsub(spellName, "%([rR]ank %d%)", "")) +end + Cursive.utils = utils