藏宝图 » 历史记录 » 修订 5
修订 4 (chenjun, 2022-06-08 16:17) → 修订 5/6 (chenjun, 2022-06-08 16:21)
h4. %{color:green}藏宝图%
标签:模块示例|藏宝图
*模块说明*
人物点击使用背包中的藏宝图,藏宝图被消耗,主界面显示寻路按钮
点击寻路按钮自动寻路至藏宝地点,主界面显示挖宝按钮
点击挖宝按钮,进度条走完触发挖宝事件
*相关配置*
一、物品表
..\Mud2\DB\StdItems.CSV
物品藏宝图,Anicount字段的配置值N,决定使用藏宝图时触发的QFunction-0.txt中的@StdModeFuncN
二、藏宝图坐标随机库文件
在文件中配置若干组藏宝图的随机坐标,然后在脚本中通过命令[[pgReadConfigFileItem]]获取
三、挖宝奖励物品随机库文件
在文件中配置若干组奖励物品,然后在脚本中通过命令[[getRandomText]]获取
-
-
h4. *%{color:deepskyblue}特戒引擎脚本示例:%*
-
-
bq. %{color:lightGrey};..\Mir200\Envir\Market_Def\QFunction-0.txt%
%{color:lightGrey};从随机库中获取藏宝图埋藏位置%
[<notextile>@</notextile>StdModeFunc1330]
#if
large U2907 9
#act
sendtipsmsg 每日藏宝图使用次数达到10次
give 藏宝图 1
break
#if
#act
inc U2907 1
mov U$藏宝图标记 1
#call [藏宝图\藏宝图.txt] <notextile>@</notextile>main
-
-
bq. %{color:lightGrey};..\Mir200\Envir\QuestDiary\藏宝图\藏宝图.txt%
[<notextile>@</notextile>main]
#if
#act
*{color:green}[[movr]]* N$随机坐标 1 15
#if
#act
%{color:lightGrey};从随机库中获取藏宝图埋藏位置%
*{color:green}[[pgReadConfigFileItem]]* ..\QuestDiary\配置文件\藏宝图.ini 藏宝图 N$随机坐标 <$str(s$坐标配置)> <$STR(S$坐标配置)>
*{color:green}[[extractString]]* : <$STR(S$坐标配置)> N$X坐标 N$Y坐标
mov U$X坐标 <$STR(N$X坐标)>
mov U$Y坐标 <$STR(N$Y坐标)>
goto <notextile>@</notextile>判断地图
%{color:lightGrey};藏宝图埋藏点不在当前地图的,主界面显示传送按钮%
[<notextile>@</notextile>判断地图]
#if
not *{color:green}[[isOnMap]]* 神兵城
#act
*{color:green}[[addMainCenterBtn]]* 点击挖宝按钮 1 lc_dianjixunzhao 400,-100 点击寻找 151 24 400,-170 lc_ditu_mc_di 0,0,0,0 点击寻找
#elseact
goto <notextile>@</notextile>寻路中
%{color:lightGrey};点击传送按钮,传送藏宝图埋藏点所在地图并自动寻路至埋藏点%
[<notextile>@</notextile>点击寻找]
#if
#act
mapmove 神兵城 312 183
delaygoto 300 <notextile>@</notextile>自动寻路
*{color:green}[[delMainCenterBtn]]* 点击挖宝按钮
addMainCenterBtn 挖宝中按钮 3 lc_xunluzhizhen 400,-100 寻路中 250 32 400,-183 lc_ditu_mc_di <$STR(U$X坐标)>,<$STR(U$Y坐标)>,5,1 寻路中,到达终点
[<notextile>@</notextile>自动寻路]
#if
isOnMap 神兵城
#act
*{color:green}[[autogotoxy]]* 神兵城 <$STR(U$X坐标)> <$STR(U$Y坐标)>
#elseact
mapmove 神兵城 312 183
autogotoxy 神兵城 <$STR(U$X坐标)> <$STR(U$Y坐标)>
[<notextile>@</notextile>寻路中]
#if
isOnMap 神兵城
#act
delMainCenterBtn 点击挖宝按钮
addMainCenterBtn 挖宝中按钮 3 lc_xunluzhizhen 400,-100 寻路中 250 32 400,-183 lc_ditu_mc_di <$STR(U$X坐标)>,<$STR(U$Y坐标)>,5,1 寻路中,到达终点
autogotoxy 神兵城 <$STR(U$X坐标)> <$STR(U$Y坐标)>
#elseact
mapmove 神兵城 312 183
autogotoxy 神兵城 <$STR(U$X坐标)> <$STR(U$Y坐标)>
%{color:lightGrey};到达藏宝图埋藏点,主界面显示挖宝按钮,点击开始走进度条%
[<notextile>@</notextile>到达终点]
#if
#act
delMainCenterBtn 挖宝中按钮
addMainCenterBtn 挖宝按钮 2 lc_wajue,lc_caiji_jishi2,5000,挖掘中 400,-100 挖掘宝藏 250 32 400,-183 lc_wajue_di <$STR(U$X坐标)>,<$STR(U$Y坐标)>,5,0 到达终点,进度条走完|离开终点
%{color:lightGrey};挖宝进度条走完触发%
[<notextile>@</notextile>进度条走完]
#if
#act
sendmsg 6 挖宝成功
delMainCenterBtn 挖宝按钮
mov U$藏宝图标记 0
#call [藏宝图\挖宝奖励.txt] <notextile>@</notextile>main
%{color:lightGrey};未挖宝离开挖宝区域,主界面挖宝按钮消失,显示寻路按钮%
[<notextile>@</notextile>离开终点]
#if
#act
delMainCenterBtn 挖宝按钮
addMainCenterBtn 挖宝中按钮 3 lc_xunluzhizhen 400,-100 寻路中 250 32 400,-183 lc_ditu_mc_di <$STR(U$X坐标)>,<$STR(U$Y坐标)>,5,1 寻路中,到达终点
-
-
bq. %{color:lightGrey};..\Mir200\Envir\QuestDiary\配置文件\藏宝图.ini%
%{color:lightGrey};藏宝图挖宝坐标的随机库%
[藏宝图]
0=227:158
1=229:72
2=101:193
3=101:176
4=145:221
5=160:182
6=197:218
7=101:156
8=227:59
9=166:135
10=82:170
11=70:204
12=99:223
13=126:239
14=165:238
-
-
bq. %{color:lightGrey};..\Mir200\Envir\QuestDiary\藏宝图\挖宝奖励.txt%
%{color:lightGrey};挖宝触发%
[<notextile>@</notextile>main]
#if
random 2
#act
%{color:lightGrey};召唤指定的怪物%
*{color:green}[[mongenex]]* 神兵城 <$X> <$Y> 【藏宝图】·神棺巨魔★秘宝 1 1 0 249 0 0 0 1 2 100 1
sendmsg 6 挖到【藏宝图】·神棺巨魔★秘宝请快速击杀!
break
#if
random 4
#act
%{color:lightGrey};召唤npc神秘商贩%
*{color:green}[[createNPC]]* 神秘商贩 神兵城 <$X> <$Y> 294 神秘商贩 1 1200 <$USERNAME>
set [32501] 0
set [32502] 0
set [32503] 0
set [32504] 0
set [32505] 0
set [32506] 0
sendmsg 6 神秘商店出现了,快去购买吧!
break
#if
random 1
#act
%{color:lightGrey};从随机库中获取物品奖励%
*{color:green}[[getRandomText]]* ..\QuestDiary\基础功能\藏宝图\挖宝奖励1.txt S99
give <$STR(S99)> <$Str(N99)>
sendmsg 7 恭喜你挖到了:[<$STR(S99)>]
-
-
bq. %{color:lightGrey};..\Mir200\Envir\QuestDiary\藏宝图\挖宝奖励1.txt%
%{color:lightGrey};奖励物品的名称和数量,可以自行配置%
100000元宝 1
血龙玉 1
血龙玉 2
100000元宝 1
噬魂虎卫づ普通 1
100000元宝 1
圣龙之魂 1
噬魂虎卫づ普通 1
噬魂虎卫づ极品 1
100000元宝 1
避水珠 1
定魂珠 1
100000元宝 1
龙鳞 1
夜光珠 1
100000元宝 1
噬魂虎卫づ普通 1
噬魂虎卫づ极品 1
噬魂虎卫づ宗师 1
100000元宝 1