|
发表于 2012-4-13 07:18:44
|
显示全部楼层
本帖最后由 begin 于 2012-4-12 11:21 PM 编辑
- ----------------------------------------------------------------------------------------------------
- --护镖任务------------------------------------------------------------------------------------------
- ----------------------------------------------------------------------------------------------------
- hubiao_quest_list={}
- hubiao_quest_count=0
- hubiao_quest_region=""
- hubiao_quest_fellow=""
- hubiao_quest_position=""
- function Hubiao_Quest_Begin()
- hubiao_quest_list={}
- hubiao_quest_count=0
- EnableTrigger("hubiao_quest_list",true)
- EnableTrigger("hubiao_quest_end",true)
- end
- function Hubiao_Quest_List(n,l,w)
- hubiao_quest_count=hubiao_quest_count+1
- hubiao_quest_list[hubiao_quest_count]={}
- hubiao_quest_list[hubiao_quest_count]["id"]=w[1]
- hubiao_quest_list[hubiao_quest_count]["target"]=w[2]
- hubiao_quest_list[hubiao_quest_count]["time"]=w[3]
- hubiao_quest_list[hubiao_quest_count]["status"]=w[4]
- hubiao_quest_list[hubiao_quest_count]["player"]=w[5]
- if string.find(w[2],"嘉兴")~=nil then
- hubiao_quest_list[hubiao_quest_count]["value"]=0
- elseif string.find(w[2],"泉州")~=nil then
- hubiao_quest_list[hubiao_quest_count]["value"]=1
- elseif string.find(w[2],"岳王墓")~=nil then
- hubiao_quest_list[hubiao_quest_count]["value"]=2
- elseif string.find(w[2],"苏州")~=nil then
- hubiao_quest_list[hubiao_quest_count]["value"]=3
- elseif string.find(w[2],"杭州")~=nil then
- hubiao_quest_list[hubiao_quest_count]["value"]=4
- elseif string.find(w[2],"南昌")~=nil then
- hubiao_quest_list[hubiao_quest_count]["value"]=5
- elseif string.find(w[2],"牙山")~=nil then
- hubiao_quest_list[hubiao_quest_count]["value"]=6
- elseif string.find(w[2],"归云庄")~=nil then
- hubiao_quest_list[hubiao_quest_count]["value"]=7
- elseif string.find(w[2],"镇江")~=nil then
- hubiao_quest_list[hubiao_quest_count]["value"]=8
- end
- end
- function Hubiao_Quest_End()
- EnableTrigger("hubiao_quest_list",false)
- EnableTrigger("hubiao_quest_end",false)
- local id=""
- local value=-1
- for i in pairs(hubiao_quest_list)
- do
- if (hubiao_quest_list[i]["status"]=="待认领") then
- if (hubiao_quest_list[i]["value"]>value) then
- value=hubiao_quest_list[i]["value"]
- id=hubiao_quest_list[i]["id"]
- end
- end
- end
- if (id=="") then
- print("没有可用的任务!")
- else
- SendNoEcho("getesc "..id)
- EnableTrigger("hubiao_quest_detail",true)
- end
- end
- function Hubiao_Quest_Print()
- print("========================================")
- print("区域:"..hubiao_quest_region)
- print("人名:"..hubiao_quest_fellow)
- print("位置:"..hubiao_quest_position)
- print("========================================")
- end
- function Hubiao_Quest_Detail(n,l,w)
- hubiao_quest_region=w[1]
- hubiao_quest_fellow=w[2]
- hubiao_quest_position=w[3]
- DeleteAlias("hh")
- AddAlias("hubiao_quest_print", "hh", "", alias_flag.Enabled, "Hubiao_Quest_Print")
- end
- add_trigger("hubiao_quest_begin","^\\>*\\s*任务序号\\s+任务目的地\\s+任务发布时间\\s+任务状态\\s+认领玩家","hubiao","Hubiao_Quest_Begin")
- add_trigger("hubiao_quest_end","^\\>*\\s*使用命令【getesc\\s+任务序号】来认领押镖任务。","hubiao","Hubiao_Quest_End")
- add_trigger("hubiao_quest_list","^\\>*\\s*(\\d+)\\s*(.*)\\s*(\\d+)秒\\s*(.*)\\s+(.*)$","hubiao","Hubiao_Quest_List")
- add_trigger("hubiao_quest_detail","^\\>*\\s*柳亦风把这批红货送到(.*)那里,他已经派了个伙计名叫(.*)到(.*)附近接你,把镖车送到他那里就行了。$","hubiao","Hubiao_Quest_Detail")
- EnableTrigger("hubiao_quest_list",false)
- EnableTrigger("hubiao_quest_end",false)
复制代码
mush版本的领取任务的模块,根据某大大部分代码进行了修改(林震南部分)
领取任务的时候,输入listesc,会根据设定的优先级自动进行任务领取(这里优先级的策略是远的地方优先)
在护镖的过程中随时输入hh,可以查询当前镖的有关情况。 |
|