有点摸到门道,但是还是有点不清楚
背景是多开,控制T,其他DPS和奶脚本控制,术士的脚本在单开时没有任务问题但是多开就出现,而且是100%
由于还是小号,术士的宏是这样的
[Lua] 纯文本查看 复制代码 --无腐蚀上腐蚀
if BeeUnitAffectingCombat("focus") or BeeUnitAffectingCombat("player") and not UnitIsDeadOrGhost("target") and BeeUnitBuff("腐蚀术","target",0,2)<=0
then BeeRun("腐蚀术") return; end
--无献祭献祭
if BeeUnitAffectingCombat("focus") or BeeUnitAffectingCombat("player") and not UnitIsDeadOrGhost("target") and BeeTargetDeBuffTime("献祭")<=0 and BeeIsRun("献祭")
then BeeRun("献祭"); BeeUnitCastSpellDelay("献祭",1,"target") return; end
if BeeUnitCastSpellName("player")=="吸取灵魂" then return;end
--生命低下时灵魂吸取
if BeeUnitAffectingCombat("player") and not UnitIsDeadOrGhost("target") and BeeUnitHealth("target","%")<=25
then
BeeRun("/cast [nochanneling] 吸取灵魂")
end
--暗影箭填充
if BeeUnitAffectingCombat("focus") or BeeUnitAffectingCombat("player") and not UnitIsDeadOrGhost("target") and BeeIsRun("暗影箭") then BeeRun("/cast [nochanneling] 暗影箭") return;
end
当然代码存在之前版主指出的重复问题,降低了执行效率,但是至少在单开时并没有任何问题,上腐蚀、献祭,然后暗影箭填充,没有DOT补DOT,都很流畅,但是一旦多开,就无限腐蚀术了
后面受到版主点评提醒,优化了下重复代码,将腐蚀术和献祭纳入一个前置条件
[Lua] 纯文本查看 复制代码 if BeeUnitAffectingCombat("focus") or BeeUnitAffectingCombat("player") and not UnitIsDeadOrGhost("target") then
if BeeTargetDeBuffTime("腐蚀术")<=0 and BeeIsRun("腐蚀术") then BeeRun("腐蚀术") else if BeeTargetDeBuffTime("献祭")<=0 and BeeIsRun("献祭") then BeeRun("献祭") return;
end
end
end
多开就没再出现无限上DOT直至蓝空的情况了
没想清楚是哪里出了问题.gif)
|