- 第一步:怪物表添加怪物。行为代码Race要设置成250,原生底板中有三个采集怪(3棵树)
- 第二步:刷怪表中设置刷怪地点
- 第三步:QF中写触发函数,人物点击怪物触发collectmon1 + 怪物id
注意:
- 使用addhpper杀怪物不好使,使用humanhp(mon,“=”,0,-1,5)来杀,最后一个参数是延时杀死秒数,和showprogressbardlg函数的第二个参数对应
- showprogressbardlg函数的两个回调函数不能传怪物对象,所以可以设置人物获得什么,但是不能杀死怪物。可能还有其他办法
代码举例:
function collectmon1098(actor, mon)
sendmsg(actor, ConstCfg.notice.own, '{"Msg":"<font color=\'#ff0000\'>点击采集怪1</font>","Type":9}')
sendmsg(actor, ConstCfg.notice.own, '{"Msg":"<font color=\'#ff0000\'>点击采集怪1</font>","Type":9}')
sendmsg(actor, ConstCfg.notice.own, '{"Msg":"<font color=\'#ff0000\'>点击采集怪1</font>","Type":9}')
-- showprogressbardlg(actor,5,"@func_1","进度条测试..", 1,"@func_2")
showprogressbardlg(actor,5,"@func_1","进度条测试..", 1,"@func_2")
-- addhpper(mon,"=",0)
-- addhpper(mon,"-",100)
release_print("======================怪物对象",mon)
humanhp(mon,"=",0,-1,5)
end
function collectmon1099(actor, mon)
sendmsg(actor, ConstCfg.notice.own, '{"Msg":"<font color=\'#ff0000\'>点击采集怪2</font>","Type":9}')
sendmsg(actor, ConstCfg.notice.own, '{"Msg":"<font color=\'#ff0000\'>点击采集怪2</font>","Type":9}')
sendmsg(actor, ConstCfg.notice.own, '{"Msg":"<font color=\'#ff0000\'>点击采集怪2</font>","Type":9}')
sendmsg(actor, ConstCfg.notice.own, '{"Msg":"<font color=\'#ff0000\'>点击采集怪1</font>","Type":9}')
sendmsg(actor, ConstCfg.notice.own, '{"Msg":"<font color=\'#ff0000\'>点击采集怪1</font>","Type":9}')
sendmsg(actor, ConstCfg.notice.own, '{"Msg":"<font color=\'#ff0000\'>点击采集怪1</font>","Type":9}')
-- showprogressbardlg(actor,5,"@func_1","进度条测试..", 1,"@func_2")
showprogressbardlg(actor,5,"@func_1","进度条测试..", 1,"@func_2")
addhpper(mon,"=",0)
-- addhpper(mon,"-",99)
release_print("======================怪物对象",mon)
humanhp(mon,"=",0,-1,5)
end
function collectmon1100(actor, mon)
sendmsg(actor, ConstCfg.notice.own, '{"Msg":"<font color=\'#ff0000\'>点击采集怪3</font>","Type":9}')
sendmsg(actor, ConstCfg.notice.own, '{"Msg":"<font color=\'#ff0000\'>点击采集怪3</font>","Type":9}')
sendmsg(actor, ConstCfg.notice.own, '{"Msg":"<font color=\'#ff0000\'>点击采集怪3</font>","Type":9}')
end
-- 1098
-- 1099
-- 1100
-- [[注:跳转函数不能附带参数]]
function func_1(actor)
-- release_print("func_1采集完成")
sendmsg(actor, ConstCfg.notice.own, '{"Msg":"<font color=\'#ffffff\'>采集完成!!!</font>","Type":9}')
sendmsg(actor, ConstCfg.notice.own, '{"Msg":"<font color=\'#ffffff\'>你获得紫阳花</font>","Type":9}')
end
function func_2(actor)
release_print("func_2",getbaseinfo(actor,1))
end