jx3吧 关注:390贴子:1,739
  • 1回复贴,共1

自动选择龙胆蛇

只看楼主收藏回复

/script y0n = y0n or false
if y0n then
y0n=false OutputMessage("MSG_SYS","自动选定→关\n")
else
y0n=true OutputMessage("MSG_SYS","自动选定→开\n")
end
function Selto()
local p=GetClientPlayer()
local npc={}
for i,v in pairs(GetNpcList()) do
local s=GetNpc(v)
local d=math.floor(GetCharacterDistance(p.dwID,v)/64)
SceneObject_SetTitleEffect(TARGET.NPC, v, 0)
if s.szName=="龙胆蛇" or s.szName=="血玉" or (s.szName=="维提吠达特天罚剑" and s.nZ>(p.nZ+1000) and d<25) then
table.insert(npc,{I=v,S=s.szName,Z=s.nZ,D=d})
end
end
table.sort(npc,function(a,b) return (a.D<b.D) end)
SceneObject_SetTitleEffect(TARGET.NPC, npc[1].I,8)
local t=GetTargetHandle(p.GetTarget())
if t and t.szName==npc[1].S then return end
SelectTarget(TARGET.NPC,npc[1].I)
end
RegisterBreatheEvent("Selto",function()
if not y0n then return end
Selto()
end)


IP属地:广东1楼2011-10-29 21:58回复
    /script y0n = y0n or false
    if y0n then
    y0n=false;OutputMessage("MSG_SYS","关\n")
    else
    y0n=true;OutputMessage("MSG_SYS","开\n")
    end
    RegisterEvent("NPC_ENTER_SCENE",function()
    if not y0n then return end
    local n=GetNpc(arg0)
    local p=GetClientPlayer()
    if n.szName=="龙胆蛇" or n.szName=="血玉" then
    SelectTarget(TARGET.NPC,arg0)
    elseif n.szName=="维提吠达特天罚剑" and n.nZ>(p.nZ+2000) then
    local npc={}
    for i,v in pairs(GetNpcList()) do
    local s = GetNpc(v)
    if s.szName==n.szName then
    table.insert(npc,{id=v,dist=math.floor(GetCharacterDistance(p.dwID,v)/64)})
    end
    end
    table.sort(npc,function(a,b) return (a.dist<b.dist) end)
    SelectTarget(TARGET.NPC,npc[1].id)
    end
    end)
    


    IP属地:广东2楼2011-11-20 09:11
    回复