ignore spell immune mobs when casting
This commit is contained in:
+2
-2
@@ -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功能来显示战斗中的单位并监视诅咒等
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
+22
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user