|
发表于 2025-5-25 09:10:41
|
显示全部楼层
local function CastSpellIfNotImmune(spellName, target)
local _, _, _, _, _, _, _, _, spellID = GetSpellInfo(spellName)
if IsSpellBlocked(spellID, target) then
return false -- 目标免疫,不执行技能
else
CastSpellByName(spellName, target)
return true -- 技能成功施放
end
end
while true do
-- 检查目标是否在攻击范围内
local inRange = IsSpellInRange("攻击技能", "target")
if not inRange then
AttackStop()
return
end
-- 尝试施放撕裂,如果目标免疫则跳过
if not CastSpellIfNotImmune("撕裂", "target") then
-- 目标免疫撕裂,跳过
else
-- 撕裂成功施放
end
-- 尝试施放断筋,如果是Boss或免疫则跳过
if UnitIsBoss("target") or not CastSpellIfNotImmune("断筋", "target") then
-- 目标是Boss或免疫断筋,跳过
else
-- 断筋成功施放
end
-- 其他攻击技能
-- ...
AttackStop() -- 停止自动攻击,防止重复攻击
return
end
自己删掉注释就行 |
|