|
楼主 |
发表于 2009-5-3 16:54:39
|
显示全部楼层
领悟时,自动遍历skill,寻找 可领悟 或 可练习 的skill
下为目前使用的领悟机器人选择技能函数,task为领悟任务列表,每一元素有lingwu,lianxi两个域
function DoLingWu ()
local lingwu = nil
local lianxi = nil
for i = 1, #task do
local v = task
if not lingwu and v.lingwu ~= "dodge" and skill[v.lingwu].level < skill[v.lianxi].level + 1 and skill[v.lingwu].level < limit then
lingwu = v.lingwu
end
if not lianxi and skill[v.lianxi].level < skill[v.lingwu].level and skill[v.lianxi].level < limit then
lianxi = v.lingwu
end
end
if lingwu and (not task_type or task_type == "lingwu") then
for i = 1, 3 do
Send ("yun regenerate")
Send ("lingwu " .. lingwu .. " 50")
end
elseif lianxi and (not task_type or task_type == "lianxi") then
Send ("yun recover")
Send ("lian " .. lianxi .. " 50")
else
Send ("say lingwu end")
EnableTimer ("ticker_main", false)
end
end |
|