|
发表于 2012-5-9 13:46:03
|
显示全部楼层
可以用table来做,sample:
TransferPathTable = {
["断魂崖"] = function() x = "(zou tiesuo)"; y = "(sd)" return x,y,true end,
["缥缈峰山脚"] = function() x = "(zou tiesuo)"; y = "(sd) (sd)" return x,y,true end,
["松林"] = function() x = "(nw) (ne) (nu)"; y = nil return x,y,false end,
["仙愁门"] = function() x = nil; y = nil return x,y,false end,
["百丈涧"] = function() x = "(zou tiesuo)"; y = nil return x,y,true end,
["青石大道"] = function() x = "(nw) (ne) (nu) (nu)"; y = nil return x,y,false end,
["山路"] = function() x = "(nw)"; y = nil return x,y,false end,
["小路"] = function() x = "(zou tiesuo)"; y = "(sd) (sd) s" return x,y,false end
}
function WalkToAddress(address)
cmdWalk = "";
temp = false;
cmdWalk,ContinueAfterTiesuo,temp = TransferPathTable[address]();
if (cmdWalk ~= nil) then
DoAfterSpeedWalk(1,cmdWalk);
end
if (not temp) then
DoAfter(2,"hp");
end
end |
|