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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
|
//===== eAthena Script =======================================
//= Kafra Express - Warping Town Module
//===== By: ==================================================
//= Skotlex
//===== Current Version: =====================================
//= 2.1
//===== Compatible With: =====================================
//= eAthena SVN R3424+, RO Episode 8+ (Hugel)
//===== Description: =========================================
//= Part of the Kafra Express Script Package.
//= Offers warp services to towns.
//===== Additional Comments: =================================
//= See config.txt for configuration.
//= Flag values used for towns:
//= 0x00000001 Alberta
//= 0x00000002 AlDeBaran
//= 0x00000004 Amatsu
//= 0x00000008 Ayothaya
//= 0x00000010 Comodo
//= 0x00000020 Einbech
//= 0x00000040 Einbroch
//= 0x00000080 Geffen
//= 0x00000100 Gon Ryun
//= 0x00000200 Hugel
//= 0x00000400 Izlude
//= 0x00000800 Jawaii
//= 0x00001000 LightHalzen
//= 0x00002000 Lou Yang
//= 0x00004000 Lutie
//= 0x00008000 Morocc
//= 0x00010000 Niflheim
//= 0x00020000 Payon
//= 0x00040000 Prontera
//= 0x00080000 Umbala
//= 0x00100000 Yuno
//============================================================
- script keInit_warpTown -1,{
OnInit: //Load Config
donpcevent "keConfig::OnLoadWarpTown";
end;
}
function script F_keWarpTown {
function SF_check;
function SF_warp;
set @cost,callfunc("F_keCost",$@kewt_cost,$@kewt_discount);
set @niflcost,callfunc("F_keCost",$@kewt_niflCost,$@kewd_discount);
if (@cost > Zeny && $@kewt_free)
set @cost, Zeny;
do {
if ($@kewt_showOnline) {
set @kmenu, select(
"- Cancel",
"- Alberta ("+@cost+"z/"+(getmapusers("alberta.gat")+getmapusers("alberta_in.gat"))+" "+$@ked_users$+")",
"- Al De Baran ("+@cost+"z/"+(getmapusers("aldebaran.gat")+getmapusers("aldeba_in.gat"))+" "+$@ked_users$+")",
"- Amatsu ("+@cost+"z/"+(getmapusers("amatsu.gat")+getmapusers("ama_in01.gat")+getmapusers("ama_in02.gat"))
+" "+$@ked_users$+")",
"- Ayothaya ("+@cost+"z/"+(getmapusers("ayothaya.gat")+getmapusers("ayo_in01.gat")+getmapusers("ayo_in02.gat"))
+" "+$@ked_users$+")",
"- Comodo ("+@cost+"z/"+(getmapusers("comodo.gat")+getmapusers("cmd_in01.gat")+getmapusers("cmd_in02.gat"))
+" "+$@ked_users$+")",
"- Einbech ("+@cost+"z/"+(getmapusers("einbech.gat"))+" "+$@ked_users$+")",
"- Einbroch ("+@cost+"z/"+(getmapusers("einbroch.gat")+getmapusers("ein_in01.gat"))+" "+$@ked_users$+")",
"- Geffen ("+@cost+"z/"+(getmapusers("geffen.gat")+getmapusers("geffen_in.gat")+getmapusers("gef_tower.gat"))
+" "+$@ked_users$+")",
"- Gon Ryun ("+@cost+"z/"+(getmapusers("gonryun.gat")+getmapusers("gon_in.gat"))+" "+$@ked_users$+")",
"- Hugel ("+@cost+"z/"+(getmapusers("hugel.gat")+getmapusers("hu_in01.gat"))+" "+$@ked_users$+")",
"- Izlude ("+@cost+"z/"+(getmapusers("izlude.gat")+getmapusers("izlude_in.gat"))+" "+$@ked_users$+")",
"- Jawaii ("+@cost+"z/"+(getmapusers("jawaii.gat")+getmapusers("jawaii_in.gat"))+" "+$@ked_users$+")",
"- LightHalzen ("+@cost+"z/"+(getmapusers("lighthalzen.gat")+getmapusers("lhz_in01.gat")
+getmapusers("lhz_in02.gat")+getmapusers("lhz_in03.gat"))+" "+$@ked_users$+")",
"- Lou Yang ("+@cost+"z/"+(getmapusers("louyang.gat")+getmapusers("lou_in01.gat")+getmapusers("lou_in02.gat"))
+" "+$@ked_users$+")",
"- Lutie ("+@cost+"z/"+(getmapusers("xmas.gat")+getmapusers("xmas_in.gat"))+" "+$@ked_users$+")",
"- Morocc ("+@cost+"z/"+(getmapusers("morocc.gat")+getmapusers("morocc_in.gat")+getmapusers("moc_castle.gat"))
+" "+$@ked_users$+")",
"- Niflheim ("+@niflcost+"z/"+(getmapusers("niflheim.gat")+getmapusers("nif_in.gat"))+" "+$@ked_users$+")",
"- Payon ("+@cost+"z/"+(getmapusers("payon.gat")+getmapusers("payon_in01.gat")+getmapusers("payon_in02.gat"))
+" "+$@ked_users$+")",
"- Prontera ("+@cost+"z/"+(getmapusers("prontera.gat")+getmapusers("prt_castle.gat")
+getmapusers("prt_church.gat")+getmapusers("prt_in.gat"))+" "+$@ked_users$+")",
"- Umbala ("+@cost+"z/"+(getmapusers("umbala.gat")+getmapusers("um_in.gat"))+" "+$@ked_users$+")",
"- Yuno ("+@cost+"z/"+(getmapusers("yuno.gat")+getmapusers("yuno_in01.gat")+getmapusers("yuno_in02.gat")
+getmapusers("yuno_in03.gat")+getmapusers("yuno_in04.gat")+getmapusers("yuno_in05.gat"))+" "+$@ked_users$+")"
);
} else {
set @kmenu, select(
"- Cancel",
"- Alberta ("+@cost+"z)",
"- Al De Baran ("+@cost+"z)",
"- Amatsu ("+@cost+"z)",
"- Ayothaya ("+@cost+"z)",
"- Comodo ("+@cost+"z)",
"- Einbech ("+@cost+"z)",
"- Einbroch ("+@cost+"z)",
"- Geffen ("+@cost+"z)",
"- Gon Ryun ("+@cost+"z)",
"- Hugel ("+@cost+"z)",
"- Izlude ("+@cost+"z)",
"- Jawaii ("+@cost+"z)",
"- LightHalzen ("+@cost+"z)",
"- Lou Yang ("+@cost+"z)",
"- Lutie ("+@cost+"z)",
"- Morocc ("+@cost+"z)",
"- Niflheim ("+@niflcost+"z)",
"- Payon ("+@cost+"z)",
"- Prontera ("+@cost+"z)",
"- Umbala ("+@cost+"z)",
"- Yuno ("+@cost+"z)"
);
}
switch (@kmenu) {
case 2: //Alberta
if (SF_check(0x1))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"alberta.gat",117,56;
break;
case 3: //AlDeBaran
if (SF_check(0x2))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"aldebaran.gat",139,124;
break;
case 4: //Amatsu
if (SF_check(0x4))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"amatsu.gat",197,88;
break;
case 5: //Ayathoya
if (SF_check(0x8))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"ayothaya.gat",202,174;
break;
case 6: //Comodo
if (SF_check(0x10))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"comodo.gat",189,150;
break;
case 7: //Einbech
if (SF_check(0x20))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"einbech.gat",137,220;
break;
case 8: //Einbroch
if (SF_check(0x40))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"einbroch.gat",64,199;
break;
case 9: //Geffen
if (SF_check(0x80))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"geffen.gat",120,66;
break;
case 10: //GonRyun
if (SF_check(0x100))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"gonryun.gat",160,180;
break;
case 11: //Hugel
if (SF_check(0x200))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"hugel.gat",96,105;
break;
case 12: //Izlude
if (SF_check(0x400))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"izlude.gat",127,97;
break;
case 13: //Jawaii
if (SF_check(0x800))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"jawaii.gat",214,223;
break;
case 14: //LightHalzen
if (SF_check(0x1000))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"lighthalzen.gat",158,92;
break;
case 15: //LouYang
if (SF_check(0x2000))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"louyang.gat",218,118;
break;
case 16: //Lutie
if (SF_check(0x4000))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"xmas.gat",148,133;
break;
case 17: //Morocc
if (SF_check(0x8000))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"morocc.gat",162,91;
break;
case 18: //Niflheim
if (SF_check(0x10000)) {
if (nif_q_done != 1) {
mes "...?";
callfunc "F_keIntro", e_no, "For some reason I can't warp you there!";
} else
callfunc "F_keWarp",$@kewt_niflCost,$@kewd_discount,e_yawn,"niflheim.gat",194,185;
}
break;
case 19: //Payon
if (SF_check(0x20000))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"payon.gat",159,181;
break;
case 20: //Prontera
if (SF_check(0x40000))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"prontera.gat",156,175;
break;
case 21: //Umbala
if (SF_check(0x80000))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"umbala.gat",88,153;
break;
case 22: //Yuno
if (SF_check(0x100000))
SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"yuno.gat",158,77;
break;
}
} while (@kmenu > 1);
return;
//SubFunction SF_check(char-flag, account_flag)
//Checks if the character can warp to that town taking into consideration
//traveller's mode.
function SF_check {
if ($@kewt_travel && !((kewt_travel|#kewt_travel)&getarg(0))) {
callfunc "F_keIntro", e_sry, "Sorry, but we can only warp you to towns you have saved in at least once.";
return 0;
}
return 1;
}
//SubFunction SF_warp (int cost, int discount, int emotion, String map, int x, int y)
//Modded from F_keWarp to allow free warping to towns when not enough zeny.
function SF_warp {
set @cost, getarg(0);
if (@cost > Zeny && $@kewt_free)
set @cost, Zeny;
if (!(callfunc("F_keCharge",@cost,getarg(1),1))) {
callfunc "F_keIntro", e_an, "You don't have enough Zeny...";
return;
}
emotion getarg(2);
warp getarg(3),getarg(4),getarg(5);
end;
}
}
//Invoked when we want to add a map to the list of travelled-to towns
function script F_keAddTravelTown {
set @map$, getarg(0);
// Temporary code to update variables from old format to new.
if(ketw_alberta) {
set kewt_travel,kewt_travel|0x1;
set ketw_alberta,0;
}
if(ketw_aldebaran) {
set kewt_travel,kewt_travel|0x2;
set ketw_aldebaran,0;
}
if(ketw_amatsu) {
set kewt_travel,kewt_travel|0x4;
set ketw_amatsu,0;
}
if(ketw_ayothaya) {
set kewt_travel,kewt_travel|0x8;
set ketw_ayothaya,0;
}
if(ketw_comodo) {
set kewt_travel,kewt_travel|0x10;
set ketw_comodo,0;
}
if(ketw_einbech) {
set kewt_travel,kewt_travel|0x20;
set ketw_einbech,0;
}
if(ketw_einbroch) {
set kewt_travel,kewt_travel|0x40;
set ketw_einbroch,0;
}
if(ketw_geffen) {
set kewt_travel,kewt_travel|0x80;
set ketw_geffen,0;
}
if(ketw_gonryun) {
set kewt_travel,kewt_travel|0x100;
set ketw_gonryun,0;
}
if(ketw_hugel) {
set kewt_travel,kewt_travel|0x200;
set ketw_hugel,0;
}
if(ketw_izlude) {
set kewt_travel,kewt_travel|0x400;
set ketw_izlude,0;
}
if(ketw_jawaii) {
set kewt_travel,kewt_travel|0x800;
set ketw_jawaii,0;
}
if(ketw_lighthalzen) {
set kewt_travel,kewt_travel|0x1000;
set ketw_lighthalzen,0;
}
if(ketw_louyang) {
set kewt_travel,kewt_travel|0x2000;
set ketw_louyang,0;
}
if(ketw_lutie) {
set kewt_travel,kewt_travel|0x4000;
set ketw_lutie,0;
}
if(ketw_morroc) {
set kewt_travel,kewt_travel|0x8000;
set ketw_morroc,0;
}
if(ketw_niflheim) {
set kewt_travel,kewt_travel|0x10000;
set ketw_niflheim,0;
}
if(ketw_payon) {
set kewt_travel,kewt_travel|0x20000;
set ketw_payon,0;
}
if(ketw_prontera) {
set kewt_travel,kewt_travel|0x40000;
set ketw_prontera,0;
}
if(ketw_umbala) {
set kewt_travel,kewt_travel|0x80000;
set ketw_umbala,0;
}
if(ketw_yuno) {
set kewt_travel,kewt_travel|0x100000;
set ketw_yuno,0;
}
if(#ketw_alberta) {
set #kewt_travel,#kewt_travel|0x1;
set #ketw_alberta,0;
}
if(#ketw_aldebaran) {
set #kewt_travel,#kewt_travel|0x2;
set #ketw_aldebaran,0;
}
if(#ketw_amatsu) {
set #kewt_travel,#kewt_travel|0x4;
set #ketw_amatsu,0;
}
if(#ketw_ayothaya) {
set #kewt_travel,#kewt_travel|0x8;
set #ketw_ayothaya,0;
}
if(#ketw_comodo) {
set #kewt_travel,#kewt_travel|0x10;
set #ketw_comodo,0;
}
if(#ketw_einbech) {
set #kewt_travel,#kewt_travel|0x20;
set #ketw_einbech,0;
}
if(#ketw_einbroch) {
set #kewt_travel,#kewt_travel|0x40;
set #ketw_einbroch,0;
}
if(#ketw_geffen) {
set #kewt_travel,#kewt_travel|0x80;
set #ketw_geffen,0;
}
if(#ketw_gonryun) {
set #kewt_travel,#kewt_travel|0x100;
set #ketw_gonryun,0;
}
if(#ketw_hugel) {
set #kewt_travel,#kewt_travel|0x200;
set #ketw_hugel,0;
}
if(#ketw_izlude) {
set #kewt_travel,#kewt_travel|0x400;
set #ketw_izlude,0;
}
if(#ketw_jawaii) {
set #kewt_travel,#kewt_travel|0x800;
set #ketw_jawaii,0;
}
if(#ketw_lighthalzen) {
set #kewt_travel,#kewt_travel|0x1000;
set #ketw_lighthalzen,0;
}
if(#ketw_louyang) {
set #kewt_travel,#kewt_travel|0x2000;
set #ketw_louyang,0;
}
if(#ketw_lutie) {
set #kewt_travel,#kewt_travel|0x4000;
set #ketw_lutie,0;
}
if(#ketw_morroc) {
set #kewt_travel,#kewt_travel|0x8000;
set #ketw_morroc,0;
}
if(#ketw_niflheim) {
set #kewt_travel,#kewt_travel|0x10000;
set #ketw_niflheim,0;
}
if(#ketw_payon) {
set #kewt_travel,#kewt_travel|0x20000;
set #ketw_payon,0;
}
if(#ketw_prontera) {
set #kewt_travel,#kewt_travel|0x40000;
set #ketw_prontera,0;
}
if(#ketw_umbala) {
set #kewt_travel,#kewt_travel|0x80000;
set #ketw_umbala,0;
}
if(#ketw_yuno) {
set #kewt_travel,#kewt_travel|0x100000;
set #ketw_yuno,0;
}
// End update code.
if ($@kewt_travel > 1) {
if (@map$ == "alberta.gat" || kewt_travel&0x1)
set #kewt_travel,#kewt_travel|0x1;
if (@map$ == "aldebaran.gat" || kewt_travel&0x2)
set #kewt_travel,#kewt_travel|0x2;
if (@map$ == "amatsu.gat" || kewt_travel&0x4)
set #kewt_travel,#kewt_travel|0x4;
if (@map$ == "ayothaya.gat" || kewt_travel&0x8)
set #kewt_travel,#kewt_travel|0x8;
if (@map$ == "comodo.gat" || kewt_travel&0x10)
set #kewt_travel,#kewt_travel|0x10;
if (@map$ == "einbech.gat" || kewt_travel&0x20)
set #kewt_travel,#kewt_travel|0x20;
if (@map$ == "einbroch.gat" || kewt_travel&0x40)
set #kewt_travel,#kewt_travel|0x40;
if (@map$ == "geffen.gat" || kewt_travel&0x80)
set #kewt_travel,#kewt_travel|0x80;
if (@map$ == "gonryun.gat" || kewt_travel&0x100)
set #kewt_travel,#kewt_travel|0x100;
if (@map$ == "hugel.gat" || kewt_travel&0x200)
set #kewt_travel,#kewt_travel|0x200;
if (@map$ == "izlude.gat" || kewt_travel&0x400)
set #kewt_travel,#kewt_travel|0x400;
if (@map$ == "jawaii.gat" || kewt_travel&0x800)
set #kewt_travel,#kewt_travel|0x800;
if (@map$ == "lighthalzen.gat" || kewt_travel&1000)
set #kewt_travel,#kewt_travel|0x1000;
if (@map$ == "louyang.gat" || kewt_travel&0x2000)
set #kewt_travel,#kewt_travel|0x2000;
if (@map$ == "xmas.gat" || kewt_travel&0x4000)
set #kewt_travel,#kewt_travel|0x4000;
if (@map$ == "morocc.gat" || kewt_travel&0x8000)
set #kewt_travel,#kewt_travel|0x8000;
if (@map$ == "niflheim.gat" || kewt_travel&0x10000)
set #kewt_travel,#kewt_travel|0x10000;
if (@map$ == "payon.gat" || kewt_travel&0x20000)
set #kewt_travel,#kewt_travel|0x20000;
if (@map$ == "prontera.gat" || kewt_travel&0x40000)
set #kewt_travel,#kewt_travel|0x40000;
if (@map$ == "umbala.gat" || kewt_travel&0x80000)
set #kewt_travel,#kewt_travel|0x80000;
if (@map$ == "yuno.gat" || kewt_travel&0x100000)
set #kewt_travel,#kewt_travel|0x100000;
} else {
if (@map$ == "alberta.gat")
set kewt_travel,kewt_travel|0x1;
if (@map$ == "aldebaran.gat")
set kewt_travel,kewt_travel|0x2;
if (@map$ == "amatsu.gat")
set kewt_travel,kewt_travel|0x4;
if (@map$ == "ayothaya.gat")
set kewt_travel,kewt_travel|0x8;
if (@map$ == "comodo.gat")
set kewt_travel,kewt_travel|0x10;
if (@map$ == "einbech.gat")
set kewt_travel,kewt_travel|0x20;
if (@map$ == "einbroch.gat")
set kewt_travel,kewt_travel|0x40;
if (@map$ == "geffen.gat")
set kewt_travel,kewt_travel|0x80;
if (@map$ == "gonryun.gat")
set kewt_travel,kewt_travel|0x100;
if (@map$ == "hugel.gat")
set kewt_travel,kewt_travel|0x200;
if (@map$ == "izlude.gat")
set kewt_travel,kewt_travel|0x400;
if (@map$ == "jawaii.gat")
set kewt_travel,kewt_travel|0x800;
if (@map$ == "lighthalzen.gat")
set kewt_travel,kewt_travel|0x1000;
if (@map$ == "louyang.gat")
set kewt_travel,kewt_travel|0x2000;
if (@map$ == "xmas.gat")
set kewt_travel,kewt_travel|0x4000;
if (@map$ == "morocc.gat")
set kewt_travel,kewt_travel|0x8000;
if (@map$ == "niflheim.gat")
set kewt_travel,kewt_travel|0x10000;
if (@map$ == "payon.gat")
set kewt_travel,kewt_travel|0x20000;
if (@map$ == "prontera.gat")
set kewt_travel,kewt_travel|0x40000;
if (@map$ == "umbala.gat")
set kewt_travel,kewt_travel|0x80000;
if (@map$ == "yuno.gat")
set kewt_travel,kewt_travel|0x100000;
}
return;
}
|