LUACN论坛

 找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
热搜: YJWOW MagicStone BoL
查看: 233|回复: 3

[wowbee] 新手求助 改了个戒律牧的 但是只能奶自己 怎么回事呢

[复制链接]
发表于 2023-1-29 11:33:35 | 显示全部楼层 |阅读模式
--判断是否在团队中
if GetNumRaidMembers()>0 then
    --在团队里获得掉血玩家
    grouptype="raid";
    local RaidDX = BeeGroupMinScript('BeeRange(unit)<=40 and BeeUnitHealth(unit,"%")<100 and UnitCanAssist("player",unit) and not UnitIsDeadOrGhost(unit)',"BeeUnitHealth(unit)",grouptype)
    --有掉血玩家
    if RaidDX
    then
        if BeeUnitHealth(RaidDX,"%")<20 and BeeSpellCoolDown("绝望祷言")==0 and BeeIsRun("绝望祷言",RaidDX)
        then
            BeeRun("绝望祷言",RaidDX);
            return;
        end;
        if BeeUnitHealth(RaidDX,"%")<=100 and BeeIsRun("真言术:盾",RaidDX) and BeeUnitBuff("虚弱灵魂",RaidDX)<1
        then
            BeeRun("真言术:盾",RaidDX);
            return;
        end;
        if BeeSpellCoolDown("苦修")==0 and BeeUnitHealth(RaidDX,"%")<80 and BeeIsRun("苦修",RaidDX)
        then
            BeeRun("苦修",RaidDX);
            return;
        elseif BeeUnitHealth(RaidDX,"%")<95 and BeeIsRun("快速治疗",RaidDX)
        then
            BeeRun("快速治疗",RaidDX);
            return;
        end;
        return;
    end;
else
    --在小队里
    grouptype="party";
    --获得掉血玩家
    local partyDX = BeeGroupMinScript('BeeRange(unit)<=40 and BeeUnitHealth(unit,"%")<100 and UnitCanAssist("player",unit) and not UnitIsDeadOrGhost(unit)',"BeeUnitHealth(unit)",grouptype)
    --有掉血玩家
    if partyDX
    then
        if BeeUnitHealth(partyDX,"%")<20 and BeeSpellCoolDown("绝望祷言")==0 and BeeIsRun("绝望祷言",partyDX)
        then
            BeeRun("绝望祷言",partyDX);
            return;
        end;
        if BeeUnitHealth(partyDX,"%")<=100 and BeeIsRun("真言术:盾",partyDX) and BeeUnitBuff("虚弱灵魂",partyDX)<1
        then
            BeeRun("真言术:盾",partyDX);
            return;
        elseif BeeUnitHealth(partyDX,"%")<80 and BeeSpellCoolDown("苦修")==0 and BeeIsRun("苦修",partyDX)
        then
            BeeRun("苦修",partyDX);
            return;
        end;
        if BeeUnitHealth(partyDX,"%")<60 and BeeIsRun("强效治疗术",partyDX)
        then
            BeeRun("强效治疗术",partyDX);
            return;
        elseif BeeUnitHealth(partyDX,"%")<95 and BeeIsRun("快速治疗",partyDX)
        then
            BeeRun("快速治疗",partyDX);
            return;
        end;
        return;
    end;
    return;
end;


回复

使用道具 举报

发表于 2023-1-29 12:22:25 | 显示全部楼层
新人不懂,是不是第一步获取掉血玩家时错了,只能获取到自己,所以只奶自己。
我觉得问题应该还是出在这一行吧
local RaidDX = BeeGroupMinScript('BeeRange(unit)<=40 and BeeUnitHealth(unit,"%")<100 and UnitCanAssist("player",unit) and not UnitIsDeadOrGhost(unit)',"BeeUnitHealth(unit)",grouptype)
UnitCanAssist("player",unit)这里是不是可以把player删除只留unit
回复 支持 反对

使用道具 举报

发表于 2023-1-29 18:24:57 | 显示全部楼层
复制全了么?   前边是不是少什么东西了
回复 支持 反对

使用道具 举报

发表于 2023-1-31 09:41:28 来自手机 | 显示全部楼层
语法错误  写代码的时候别乱用return  
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

小黑屋|手机版|Archiver|LUACN论坛

GMT+8, 2025-8-11 12:13 PM , Processed in 0.064078 second(s), 19 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表