diff --git a/Cursive.toc b/Cursive.toc index 25c88ae..61c4bc9 100644 --- a/Cursive.toc +++ b/Cursive.toc @@ -1,6 +1,6 @@ ## Interface: 11200 -## Title: Cursive 3.0.7 -## Title-zhCN: Cursive 3.0.7 +## Title: Cursive 3.0.8 +## Title-zhCN: Cursive 3.0.8 ## Author: Pepopo ## Notes: Uses GUIDs to show units in combat and track curses ## Notes-zhCN: 使用的GUID功能来显示战斗中的单位并监视诅咒等 diff --git a/README.md b/README.md index 2c4fa13..7d4312b 100644 --- a/README.md +++ b/README.md @@ -185,6 +185,8 @@ All commands will ignore targets with the following CCs on them: - Freezing Trap - Banish +All commands will also ignore spell-immune mobs the same way they ignore crowd controlled mobs. Currently this is only used for `Blackwing Spellbinder` in BWL. + Multicurse will only ever target enemies that are already in combat (except if you target a mob directly first) to prevent pulling things you didn't intend like marked patrols. diff --git a/commands.lua b/commands.lua index f6e4bbd..ce1f6f8 100644 --- a/commands.lua +++ b/commands.lua @@ -250,8 +250,18 @@ local crowdControlledSpellIds = { [57644] = { name = "Veil of Vorgendor" }, } +local spellImmuneGuids = { + ["0xF1300030A9014A44"] = true, -- Blackwing Spellbinder + ["0xF1300030A911F78C"] = true, -- Blackwing Spellbinder + ["0xF1300030A911F78D"] = true, -- Blackwing Spellbinder + ["0xF1300030A9014EFE"] = true, -- Blackwing Spellbinder + ["0xF1300030A9014F08"] = true, -- Blackwing Spellbinder + ["0xF1300030A9014E75"] = true, -- Blackwing Spellbinder + ["0xF1300030A9014E6D"] = true, -- Blackwing Spellbinder +} + local function isMobCrowdControlled(guid) - local auras = GetUnitField(guid, "aura") + local auras = GetUnitField(guid, "aura") or {} for i, spellId in pairs(auras) do if crowdControlledSpellIds[spellId] then return true @@ -260,6 +270,10 @@ local function isMobCrowdControlled(guid) return false end +local function isMobSpellImmune(guid) + return spellImmuneGuids[guid] and true or false +end + local function GetSquarePrioRaidTargetIndex(guid) local index = GetRaidTargetIndex(guid) if index == 7 then @@ -377,7 +391,9 @@ local function pickTarget(selectedPriority, lowercaseSpellNameNoRank, checkRange end if passedRangeCheck then -- check if the target has the curse - if not Cursive.curses:HasCurse(lowercaseSpellNameNoRank, guid, refreshTime, options["malediction"]) and not isMobCrowdControlled(guid) then + if not Cursive.curses:HasCurse(lowercaseSpellNameNoRank, guid, refreshTime, options["malediction"]) and + not isMobCrowdControlled(guid) and + not isMobSpellImmune(guid) then local mobHp = UnitHealth(guid) if not minHp or mobHp >= minHp then local primaryValue = -1 @@ -488,7 +504,10 @@ function Cursive:Curse(spellName, targetedGuid, options) -- remove (Rank x) from spellName if it exists local lowercaseSpellNameNoRank = Cursive.utils.GetLowercaseSpellNameNoRank(spellName) - if targetedGuid and not Cursive.curses:HasCurse(lowercaseSpellNameNoRank, targetedGuid, options["refreshtime"], options["malediction"]) and not isMobCrowdControlled(targetedGuid) then + if targetedGuid and + not Cursive.curses:HasCurse(lowercaseSpellNameNoRank, targetedGuid, options["refreshtime"], options["malediction"]) and + not isMobCrowdControlled(targetedGuid) and + not isMobSpellImmune(targetedGuid) then castSpellWithOptions(string.lower(spellName), lowercaseSpellNameNoRank, targetedGuid, options) return true elseif options["warnings"] then