前期为了镯子和小箱子,刷财主家还是比较普遍的,
财主家的难点在于要判断是否得到了东厢钥匙
使用一个双输出回调的函数,
function _haszb(zbname,cb,cb1){ //如果找不到,则执行cb1,如果找到,则执行cb
find=0;
cmd("pack")
setTimeout(function(){ // 装备不需要循环等
if(wsdata["dialog"] && wsdata["dialog"].dialog == "pack"){
for (var i=0,len=wsdata["dialog"].items.length; i<len; i++){
//console.log(wsdata["dialog"].items[i]);
cname=wsdata["dialog"].items[i].name;
cid=wsdata["dialog"].items[i].id;
//if (cname == zbname){ //这里可考虑模糊匹配
if (cname.indexOf(zbname) != -1){
wsdata["dialog"]=null;
//console.log(cid+cname)
find=1;
cb();
break;
}
}
if(find == 0){
cb1(); //如果找不到,则执行cb
}
}
}
, 1000);
}
任务脚本
用法:cz.s0()
//副本 财主家
cz={
s0:function(){
//cr yz/cuifu/caizhu 1 0
cmd("jh fb 1 start2");
cmd("cr yz/cuifu/caizhu 1 0"); //困难模式
_zd(cz._s1)
},
_s1:function(){
cmd("go north");
_getnpc("管家",cz._s1a)
},
_s1a:function(npcid){
cmd("kill "+npcid);
_zd(cz._s2)
},
_s2:function(){
cmd("go south");
cmd("go north");
_getnpc("家丁",cz._s2a)
},
_s2a:function(npcid){
cmd("kill "+npcid);
_zd(cz._s3)
},
_s3:function(){
cmd("go south");
cmd("go north");
_getnpc("家丁",cz._s3a)
},
_s3a:function(npcid){
cmd("kill "+npcid);
_zd(cz._s4)
},
_s4:function(){
cmd("go north"); //后院
_getnpc("崔员外",cz._s4a)
},
_s4a:function(npcid){
cmd("kill "+npcid);
_zd(cz._s4b)
},
_s4b:function(){
_haszb("钥匙",cz._s5,cz._s5a); //如果没有东厢钥匙,则直接杀崔莺莺
},
_s5:function(){
cmd("open men"); //开门
cmd("go east"); //
_getnpc("丫鬟",cz._s6)
},
_s5a:function(){
cmd("go west");
_getnpc("崔莺莺",cz._s8)
},
_s6:function(npcid){
cmd("ok "+npcid); //ok 43b7313cdc7
cmd("go west");
cmd("go south");
cmd("go south");
cmd("go north");
cmd("go north");
cmd("go west");
_getnpc("崔莺莺",cz._s7)
},
_s7:function(npcid){
//ask ghuo313ccfa about 东厢
cmd("ask "+npcid+" about 东厢");
setTimeout(cz._s7a, 1000);//延迟一下
},
_s7a:function(){
cmd("go east");
cmd("go east");
cmd("search gui");
cmd("go west");
cmd("go west");
_getnpc("崔莺莺",cz._s8);
},
_s8:function(npcid){
cmd("kill "+npcid);
_zd(fbend)
},
}