-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy path就职魔术.js
232 lines (227 loc) · 5.62 KB
/
就职魔术.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
var cga = require(process.env.CGA_DIR_PATH_UTF8+'/cgaapi')(function(){
var taskObj = cga.task.Task('就职魔术师', [
{
intro: '1.与法兰城平民武器贩售处(150.122)对话,购买就职职业对应的武器。',
workFunc: function(cb2){
var findWeap = cga.findItem((item)=>{
return item.type == 3;
})
if(findWeap >= 8)
{
cga.UseItem(findWeap);
setTimeout(cb2, 1000, true);
return;
}
cga.travel.falan.toStone('C', ()=>{
cga.turnTo(150, 122);
cga.AsyncWaitNPCDialog(()=>{
cga.ClickNPCDialog(0, 0);
cga.AsyncWaitNPCDialog(()=>{
cga.BuyNPCStore([{index:6, count:1}]);
cga.AsyncWaitNPCDialog((err, dlg)=>{
if(dlg && dlg.message.indexOf('谢谢') >= 0){
cga.UseItem(cga.findItem((item)=>{
return item.type == 3;
}));
setTimeout(cb2, 1000, true);
return;
}
else
{
cb2(false);
return;
}
});
});
});
});
}
},
{
intro: '2.到法兰城的东医院[224.87]内找护士买“止痛药”',
workFunc: function(cb2){
cga.travel.falan.toEastHospital(function(r){
var npc = cga.findNPC('药剂师波洛姆');
if(!npc){
cb2(false);
return;
}
cga.walkList([
[npc.xpos-1, npc.ypos]
], (r)=>{
cga.turnTo(npc.xpos, npc.ypos);
cga.AsyncWaitNPCDialog(()=>{
cga.ClickNPCDialog(0, 0);
cga.AsyncWaitNPCDialog(()=>{
cga.BuyNPCStore([{index:1, count:1}]);
cga.AsyncWaitNPCDialog((err, dlg)=>{
if(dlg && dlg.message.indexOf('请保重') >= 0){
cb2(true);
return;
}
else
{
cb2(false);
return;
}
});
});
});
});
});
}
},
{
intro: '3.接著再到公会[73.60],把止痛药交给安布伦后他会给你一张“通行证” ',
workFunc: function(cb2){
cga.travel.falan.toStone('W1', ()=>{
cga.walkList([
[73, 60, '职业公会'],
[8, 6]
], (r)=>{
cga.turnTo(10, 6);
cga.AsyncWaitNPCDialog(()=>{
cga.ClickNPCDialog(4, 0);
cga.AsyncWaitNPCDialog(()=>{
cga.walkList([
[9, 24, '法兰城'],
[63, 79],
], ()=>{
cb2(true);
})
});
});
});
});
}
},
{
intro: '4、出西门进国营第24坑道(351.146),在一楼左方找哈鲁迪亚说话就可以进入试练洞窟。直闯6F大厅,和波洛米亚(23.15)交谈后就可以拿到推荐信。',
workFunc: (cb2)=>{
cga.travel.falan.toStone('W1', (r)=>{
cga.walkList([
[22, 87, '芙蕾雅'],
[351, 145, '国营第24坑道 地下1楼'],
[9, 15],
], (r)=>{
cga.TurnTo(9, 13);
cga.AsyncWaitNPCDialog((dlg)=>{
cga.ClickNPCDialog(1, 0);
cga.AsyncWaitMovement({x: 7, y: 15}, ()=>{
cga.walkList([
[9, 5, '试炼之洞窟 第1层'],
[33, 31, '试炼之洞窟 第2层'],
[22, 42, '试炼之洞窟 第3层'],
[42, 34, '试炼之洞窟 第4层'],
[27, 12, '试炼之洞窟 第5层'],
[39, 36, '试炼之洞窟 大厅'],
[23, 20],
], (r)=>{
var job = cga.GetPlayerInfo().job;
if(job == '游民'){
cga.walkList([
[23, 17]
], (r)=>{
cga.turnDir(6);
cga.AsyncWaitNPCDialog(()=>{
cga.ClickNPCDialog(1, 0);
setTimeout(cb2, 1000, true);
});
});
} else {
cga.walkList([
[22, 12],
[23, 12],
], (r)=>{
cga.SayWords('驯兽师', 0, 0, 0);
cga.AsyncWaitNPCDialog((err, dlg)=>{
if(dlg && dlg.message.indexOf('那就拿去吧') >= 0){
cga.ClickNPCDialog(1, 0);
setTimeout(cb2, 1000, true);
}
else
{
cb2(false);
return;
}
});
});
}
});
});
});
});
});
}
},
{
intro: '5、返回法兰城与相关职业就职人员对话,就职成功,任务完结。',
workFunc: (cb2)=>{
cga.travel.falan.toStone('W1', ()=>{
cga.walkList([
[22, 88, '芙蕾雅'],
[298, 148],
], ()=>{
cga.task.waitForNPC('神木', ()=>{
var npc = cga.findNPC('神木');
if(!npc){
cb2(false);
return;
}
var target = cga.getRandomSpace(npc.xpos,npc.ypos);
cga.walkList([
target
], ()=>{
cga.turnTo(npc.xpos, npc.ypos);
cga.AsyncWaitNPCDialog(()=>{
cga.SayWords('魔术', 0, 3, 1);
cga.AsyncWaitNPCDialog(()=>{
cga.ClickNPCDialog(0, 0);
cga.AsyncWaitMovement({map:['魔女之家'], delay:1000, timeout:5000}, ()=>{
cga.walkList([
[18, 13],
], ()=>{
cga.turnTo(19, 13);
cga.AsyncWaitNPCDialog(()=>{
cga.ClickNPCDialog(0, 0);
cga.AsyncWaitNPCDialog(()=>{
cb2(true);
});
});
});
});
});
});
});
});
});
});
}
}
],
[//任务阶段是否完成
function(){//小刀
var job = cga.GetPlayerInfo().job;
if(job == '游民' && cga.getItemCount((item)=>{
return item.type == 3 && item.pos < 8;
}, true) > 0) return true;
if(job != '游民')
return true;
return false;
},
function(){//止痛药
return (cga.getItemCount('#18233') > 0) ? true : false;
},
function(){//试炼洞穴通行证
return (cga.getItemCount('#18100') > 0) ? true : false;
},
function(){
return (cga.getItemCount('魔术师推荐信') > 0) ? true : false;
},
function(){
return false;
}
]
);
taskObj.doTask();
});