summaryrefslogblamecommitdiff
path: root/npc/re/jobs/2e/kagerou_oboro.txt
blob: f8b7803e5f749cd4ed77977e3e1c4e7234b873d6 (plain) (tree)
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
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506





























                                                                           
                             
                                                                           
                                                   




                                                                           

































































































































































































































































































































































































































































































































































































































































































































































                                                                                                                                                                                                            
                                                            































































































































































































































                                                                                                                                                                                                                                                                                      
                                                            
 
               







































































































































                                                                                                         
               
                                          



















                                                                      
                                          











































                                                                                           
                                          
















                                                                                 
                                          











































                                                                                                              
                                                  











                                                                                                                
                    













































































                                                                                                                                                              
                                                               




















































































































































































































































































































































































































































































































































































                                                                                                                                                                                      
                                                            
































































































































































































































































































































































































































































































































































































                                                                                                                                                                                                        
                                                            














































































































































































































































                                                                                                                                                           
                                                            


























































































































                                                                                                                                                                                 
 
//================= Hercules Script =======================================
//=       _   _                     _
//=      | | | |                   | |
//=      | |_| | ___ _ __ ___ _   _| | ___  ___
//=      |  _  |/ _ \ '__/ __| | | | |/ _ \/ __|
//=      | | | |  __/ | | (__| |_| | |  __/\__ \
//=      \_| |_/\___|_|  \___|\__,_|_|\___||___/
//================= License ===============================================
//= This file is part of Hercules.
//= http://herc.ws - http://github.com/HerculesWS/Hercules
//=
//= Copyright (C) 2015  Hercules Dev Team
//= Copyright (C)  Kisuka
//= Copyright (C)  Euphy
//= Copyright (C)  M45T3R
//= Copyright (C)  Dastgir
//=
//= Hercules is free software: you can redistribute it and/or modify
//= it under the terms of the GNU General Public License as published by
//= the Free Software Foundation, either version 3 of the License, or
//= (at your option) any later version.
//=
//= This program is distributed in the hope that it will be useful,
//= but WITHOUT ANY WARRANTY; without even the implied warranty of
//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//= GNU General Public License for more details.
//=
//= You should have received a copy of the GNU General Public License
//= along with this program.  If not, see <http://www.gnu.org/licenses/>.
//=========================================================================
//= Kagerou / Oboro Job Quest
//================= Description ===========================================
//= Job change Quest from Ninja -> Kagerou / Oboro.
//================= Current Version =======================================
//= 1.1.1
//=========================================================================

//== Starting the Quest ====================================
que_ng,28,156,0	script	Start#ko	HIDDEN_WARP_NPC,1,1,{
	end;

OnTouch:
	if (BaseLevel >= 99 && JobLevel >= 70 && job_kagero == 0 && Class == Job_Ninja) {
		mes "Secret Passage to ^25C18DNinja Guild^25C18D";
		mes "You hear familiar voices talking to each other.";
		next;
		mes "[Unknown Voice A]";
		mes "Long time, no see. How are you? How are the kids you've taken in?";
		next;
		mes "[Unknown Voice B]";
		mes "I have to hand it to you. You've picked some competitive ones.";
		next;
		mes "[Unknown Voice A]";
		mes "Sounds like music to my ears. Being sent to a foreign land with air pollution was bad enough, now haunted with memories of this place...";
		next;
		mes "[Unknown Voice A]";
		mes "What do you think? Should we rotate now?";
		next;
		mes "[Unknown Voice B]";
		mes "Haven't given up, have ya. Do you really think he'll approve?";
		next;
		mes "[Unknown Voice A]";
		mes "No need to be bitter. Hey! Were any of the kids that come and go here the ones that found the ^BD0408place^BD0408?";
		next;
		mes "[Unknown Voice B]";
		mes "Since finding the hidden place was also a part of the test.";
		next;
		mes "[Unknown Voice A]";
		mes "You are as stubborn as the first time I met you. It's just a wall in some place...";
		next;
		mes "[Unknown Voice B]";
		mes "Shssh! I think someone is eavesdropping. Hurry! Go back to the mission area.";
		next;
		mes "The conversation stopped abruptly. Hidden place? Wall? Part of a test? What is all this about?";
		setquest 5131;
		set job_kagero,1;
		close;
	} else if (BaseJob != Job_Ninja && job_kagero > 0) {
		for (set .@i,5131; .@i<=5146; set .@i,.@i+1)
			if (questprogress(.@i)) erasequest .@i;
		set job_kagero,0;
	}
	end;
}

que_ng,21,76,0	script	Wall with a Drawing#ko	CLEAR_NPC,{
	if (Class == Job_Oboro || Class == Job_Kagerou) {
		mes "You should no longer use this secret passage.";
		close;
	} else if (job_kagero == 1 && Class == Job_Ninja) {
		mes "You found a location that resembles the hidden place.";
		next;
		mes "This wall was here ever since. How come I didn't notice it before?";
		next;
		mes "Now that I know it's a secret passage, what do I do to get in?";
		next;
		if(select("Tear the drawing down.", "Touch the drawing with your hand.") == 1) {
			mes "I can't rip it down because I don't own it.";
			close;
		}
		mes "You touch the drawing with the tip of your hand and felt a sudden sensation of being pulled.";
		close2;
		warp "job_ko",26,111;
		end;
	} else if (job_kagero > 1 && Class == Job_Ninja) {
		mes "Entrance to the ^25C18DNinja Guild^000000 hideout.";
		next;
		if(select("Enter.", "Do not enter.") == 2)
			close;
		mes "When touching the drawing, you get the feeling of being pulled...";
		close2;
		warp "job_ko",26,111;
		end;
	} else {
		mes "There is a wall with a great drawing on it.";
		close;
	}
	end;
}

job_ko,25,115,4	script	Old Man#ko	4_M_KAGE_OLD,{
	if (MaxWeight - Weight < 1000 || checkweight("Knife",1) == 0) {
		mes "[Cougar]";
		mes "You don't need to carry so many things.";
		close;
	}
	if (BaseJob != Job_Ninja) {
		for (set .@i,5131; .@i<=5146; set .@i,.@i+1)
			if (questprogress(.@i)) erasequest .@i;
		set job_kagero,0;
		mes "[Cougar]";
		mes "You are not in the Family of the Ninja.";
		close2;
		warp "amatsu",147,136;
		end;
	}
	if (job_kagero == 1) {
		cutin "job_ko03",2;
		mes "^1A95E6An old man looking hale and hearty is sitting and gazing vacantly.^1A95E6";
		next;
		if(select("Ignore.", "Talk to him.") == 1) {
			close2;
			cutin "",255;
			end;
		}
		mes "["+strcharinfo(0)+"]";
		mes "Excuse me...";
		next;
		mes "^1A95E6You tried to talk to the old man but there is no response. Just when you are about to turn away...^1A95E6";
		next;
		mes "[Old Man]";
		mes "At last, a customer! Hmm... and a live one, too!";
		next;
		select("Excuse me... where am I?");
		mes "[Old Man]";
		mes "^1A95E6He keeps talking and doesn't stop to answer your question.^1A95E6";
		next;
		mes "[Old Man]";
		mes "There once was a quiet family living in ancient Amatsu times that is never mentioned in history books or stories.";
		next;
		mes "[Old Man]";
		mes "They lived beneath shadows but always yearned for the bright sun, like a sunflower.";
		next;
		mes "[Old Man]";
		mes "A family that was loyal to their lord who they served as their bright sun.";
		next;
		mes "[Old Man]";
		mes "...a very trustworthy family...";
		next;
		mes "[Old Man]";
		mes "....loyal to their core...";
		next;
		mes "[Old Man]";
		mes "...a family of integrity...";
		next;
		select("What happened to them?");
		mes "^1A95E6The old man looks at you with a melancholy face.^1A95E6";
		next;
		mes "[Old Man]";
		mes "Why are you interested in a family that was abandoned by their lord and disappeared from history itself?";
		next;
		if(select("I'm a Ninja.", "I'm bored.") == 2) {
			mes "[Old Man]";
			mes "Was nice to meet you.";
			close2;
			warp "amatsu",147,136;
			end;
		}
		cutin "job_ko02",2;
		mes "[Old Man]";
		mes "Ninja! There was a time when the family was called ninjas, too.";
		next;
		erasequest 5131;
		setquest 5132;
		set job_kagero,2;
		mes "[Old Man]";
		mes "You'll have to lend me your ear for I have so much to tell you about the family story.";
		close2;
		cutin "",255;
		end;
	} else if (job_kagero == 2) {
		cutin "job_ko01",2;
		mes "^1A95E6The Old Man starts the story with a very soothing tone as if he is telling his grandchild a story.^1A95E6";
		next;
		mes "[Old Man]";
		mes "This goes way back to ancient times and nobody in Amatsu remembers about it.";
		next;
		mes "[Old Man]";
		mes "The family worked behind the scenes and basically lived their lives for their lord.";
		next;
		mes "[Old Man]";
		mes "They were very loyal doing whatever deed their lord asked for.";
		next;
		mes "[Old Man]";
		mes "Ninja, the family was known as the dark family but that doesn't mean they wanted to be hidden in the darkness.";
		next;
		mes "[Old Man]";
		mes "They were loyal enough to be satisfied as the lord's servants but their loyalty became the problem.";
		next;
		select("Problem?");
		mes "[Old Man]";
		mes "They are a secret organization that even the lord didn't know much about.";
		next;
		mes "[Old Man]";
		mes "The few that knew about the family's existence, tried to investigate them but nobody was able to reveal their true identity.";
		next;
		mes "[Old Man]";
		mes "That is why this family has grown from loyal servants to a group feared for its secrets.";
		next;
		mes "[Old Man]";
		mes "The lord shunned the family and didn't call them for their service any more but they never betrayed him.";
		next;
		select("They were really loyal people.");
		cutin "job_ko03",2;
		mes "[Old Man]";
		mes "Yes, they were. Very loyal.";
		next;
		erasequest 5132;
		setquest 5133;
		set job_kagero,3;
		mes "^1A95E6The old man looks even more forlorn.^1A95E6";
		close2;
		cutin "",255;
		end;
	} else if (job_kagero == 3) {
		cutin "job_ko03",2;
		mes "[Old Man]";
		mes "The family has been living in hiding for so long since the old days. The current lord didn't even know of their existence.";
		next;
		select(".........");
		cutin "job_ko01",2;
		mes "[Old Man]";
		mes "I'm Guide Gion, the last of the dark ninja family.";
		next;
		if(select("I think your time has ended.", "I need your teaching.") == 1) {
			cutin "job_ko04",2;
			mes "[Guide Gion]";
			mes "Are you an assassin to end this old man's life?";
			next;
			mes "[Guide Gion]";
			mes "So that is why you've shown interest in my family. I won't give up easily.";
			next;
			percentheal -99,0;
			mes "Pow!!";
			mes "^1A95E6You lose conscience with the great impact.^000000";
			close2;
			warp "amatsu",147,136;
			end;
		}
		cutin "job_ko02",2;
		mes "[Guide Gion]";
		mes "Teaching...";
		mes "Been a long time since I last heard that word.";
		next;
		mes "[Guide Gion]";
		mes "I guess this little visit was not by coincidence but a start of a connection.";
		next;
		mes "[Guide Gion]";
		mes "Sorry I am not a teacher. But!";
		next;
		mes "[Guide Gion]";
		mes "I can help you on the path you've chosen, the ^33CC71"+((Sex)?"Kagerou":"Oboro")+"^000000 path.";
		next;
		mes "^1A95E6You hear Guide Gion's voice faintly as you slip away.^1A95E6";
		next;
		erasequest 5133;
		setquest 5134;
		set job_kagero,4;
		mes "[Guide Gion]";
		mes "If you are prepared to follow me, Guide Gion, on the "+((Sex)?"Kagerou":"Oboro")+" path, we will meet again.";
		close2;
		warp "amatsu",147,136;
		end;
	} else if (job_kagero == 4) {
		cutin "job_ko02",2;
		mes "[Guide Gion]";
		mes "I thought you were afraid of the ^33CC71path of the "+((Sex)?"Kagerou":"Oboro")+"^33CC71 and wouldn't come back.";
		next;
		mes "[Guide Gion]";
		mes "But from the look of your eyes, I guess I misjudged you.";
		next;
		mes "[Guide Gion]";
		mes "You will have to train your mind and body to walk steadily in the unknown world and never fall into temptation to stay on the path.";
		next;
		mes "[Guide Gion]";
		mes "Our ancestors had 4 tests to train our people.";
		next;
		select("4 tests?");
		cutin "job_ko01",2;
		mes "[Guide Gion]";
		mes "Yes, there are 4 tests.";
		mes "My ancestors trained my people with 4 tests that involve ^087FF8knowledge^000000, ^087FF8survival^000000, ^087FF8weapons^000000, and ^087FF8battle^000000.";
		next;
		mes "[Guide Gion]";
		mes "I know you are curious what these tests are. Let me explain one by one.";
		next;
		while(1) {
			set .@i, select("Test of Knowledge", "Test of Survival", "Test of Weaponry", "Test of Battle");
			set .@test, .@test | (1<<(.@i-1));
			switch (.@i) {
			case 1:
				mes "[Guide Gion]";
				mes "We need to be knowledgeable in order to assist the lord. This test is for this purpose.";
				next;
				mes "[Guide Gion]";
				mes "You can pass the test if you successfully solve more than 9 out of 10 questions.";
				next;
				if (.@test != 15) {
					mes "[Guide Gion]";
					mes "The test will be easy to pass if you've been steady in your studies. Now what other test are you curious about?";
					next;
				}
				break;
			case 2:
				mes "[Guide Gion]";
				mes "Missions aren't always easy and safe. That is why survival instincts are vital to us.";
				next;
				mes "[Guide Gion]";
				mes "My ancestors call this test the dice test. It is a test to advance forward depending on the dice results.";
				next;
				mes "[Guide Gion]";
				mes "Think of it as the simple dice games people play.";
				next;
				mes "[Guide Gion]";
				mes "But never let your guard down during the test because it isn't called the survival test for nothing.";
				next;
				mes "[Guide Gion]";
				mes "There will be blocks that help you while there are blocks that will interrupt you.";
				next;
				if (.@test != 15) {
					mes "[Guide Gion]";
					mes "If you deal with various situations wisely, you will be able to pass the test. Now what other test are you curious about?";
					next;
				}
				break;
			case 3:
				mes "[Guide Gion]";
				mes "My family was famous for using unique weapons that we created.";
				next;
				mes "[Guide Gion]";
				mes "You would be considered blessed if you created your own unique weapon.";
				next;
				mes "[Guide Gion]";
				mes "Creating a weapon for yourself and refining it is the purpose of this test.";
				next;
				if (.@test != 15) {
					mes "[Guide Gion]";
					mes "I hope you will be blessed and find the best weapon for yourself. Now what other test are you curious about?";
					next;
				}
				break;
			case 4:
				mes "[Guide Gion]";
				mes "Missions are not always done alone. You will often work in teams of 2 or 3 for a common goal.";
				next;
				mes "[Guide Gion]";
				mes "The battle test is only for those that pass that knowledge, survival and weapon tests. So! It is the very last test.";
				next;
				mes "[Guide Gion]";
				mes "Unlike the other three tests that are done alone, you will have to compete with others in this final test.";
				next;
				mes "[Guide Gion]";
				mes "There is only one target!!";
				mes "And only the first to get to the target passes the test.";
				next;
				mes "[Guide Gion]";
				mes "You'll be lucky if you have no competitors during your test.";
				next;
				if (.@test != 15) {
					mes "[Guide Gion]";
					mes "A challenge is better than explaining it a hundred times. It's the actual experience that makes you better.";
					next;
				}
				break;
			}
			if (.@test == 15) break;
		}
		cutin "job_ko02",2;
		mes "[Guide Gion]";
		mes "Seeing is believing, so go on and take the challenge.";
		next;
		erasequest 5134;
		setquest 5135;
		set job_kagero,5;
		mes "[Guide Gion]";
		mes "Let's start right away after you are done with preparations.";
		close2;
		cutin "",255;
		end;
	} else if (job_kagero == 5) {
		set .@ko_test_01, questprogress(5136);
		set .@ko_test_02, questprogress(5137);
		set .@ko_test_03, questprogress(5138);
		set .@ko_test, .@ko_test_01 + .@ko_test_02 + .@ko_test_03;
		if (.@ko_test == 0) {
			cutin "job_ko03",2;
			mes "[Guide Gion]";
			mes "It's been a while.";
			next;
			mes "[Guide Gion]";
			mes "Since I felt happy like this. I feel young and energetic seeing young people like you challenge themselves with a new path.";
			next;
			mes "[Guide Gion]";
			mes "We're done with explaining about the tests, now should I tell you my family story?";
			next;
			cutin "job_ko01",2;
			mes "[Guide Gion]";
			mes "My family started from two warriors.";
			next;
			mes "[Guide Gion]";
			mes "Kagerou, a warrior like the dancing flames of the sun.";
			next;
			mes "[Guide Gion]";
			mes "Oboro, a warrior like the misty moonlight.";
			next;
			mes "[Guide Gion]";
			mes "The Sun and the Moon.";
			mes "The sunlight that lights up the world and the moonlight that lights up the night. Both were very similar but different warriors.";
			next;
			mes "[Guide Gion]";
			mes "There was a time there was an enmity between both warriors.";
			next;
			mes "[Guide Gion]";
			mes "But it didn't take long for them to become one as a family.";
			next;
			select("How did it go afterwards?");
			cutin "job_ko02",2;
			mes "[Guide Gion]";
			mes "Ha ha ha. It is never fun to listen to the whole story all at once, no? Come back after passing a test and I'll continue my story.";
			next;
			mes "[Guide Gion]";
			mes "Which test will you select as your first test?";
			next;
			callsub L_StartTest,select("Test of Knowledge", "Test of Survival", "Test of Weaponry"),1;
			end;
		} else if (.@ko_test == 2) {
			cutin "job_ko01",2;
			mes "[Guide Gion]";
			if (.@ko_test_01 == 2) {
				set .@menu$,":Test of Survival:Test of Weaponry";
				mes "You've passed the Test of Knowledge.";
				next;
				mes "[Guide Gion]";
				mes "My friend doesn't approve of others that easily but I guess he liked you.";
				next;
			} else if (.@ko_test_02 == 2) {
				set .@menu$,"Test of Knowledge::Test of Weaponry";
				mes "You've passed the Test of Survival.";
				next;
				mes "[Guide Gion]";
				mes "Looks like you went through hell with this test.";
				next;
			} else if (.@ko_test_03 == 2) {
				set .@menu$,"Test of Knowledge:Test of Survival:";
				mes "You've passed the Test of Weaponry.";
				next;
				mes "[Guide Gion]";
				mes "I wonder if Joe is satisfied with your performance.";
				next;
			}
			select("Please continue with the family story.");
			cutin "job_ko02",2;
			mes "[Guide Gion]";
			mes "Looks like you are pretty eager to hear more. Where did I leave off... Ah! I remember.";
			next;
			mes "[Guide Gion]";
			mes "Kagerou, a warrior like the dancing flames of the sun.";
			next;
			mes "[Guide Gion]";
			mes "Oboro, a warrior like the misty moonlight.";
			next;
			mes "[Guide Gion]";
			mes "Both warriors weren't close at first, because personality and everything else was completely opposite of each other.";
			next;
			mes "[Guide Gion]";
			mes "The first place they met was the battlefield. And you know how enemies greet each other on a battlefield.";
			next;
			mes "[Guide Gion]";
			mes "They ended up injuring each other badly.";
			next;
			mes "[Guide Gion]";
			mes "But what can you do? War is a war.";
			next;
			mes "[Guide Gion]";
			mes "The friend you've laughed with yesterday is a foe that you have to fight with in a war today.";
			next;
			mes "[Guide Gion]";
			mes "So nobody can get along with anyone during a war.";
			next;
			mes "[Guide Gion]";
			mes "I'll continue the story after you pass another test.";
			next;
			mes "[Guide Gion]";
			mes "Which test will you choose for the second test?";
			next;
			callsub L_StartTest,select(.@menu$),2;
			end;
		} else if (.@ko_test == 4) {
			cutin "job_ko04",2;
			mes "[Guide Gion]";
			if (.@ko_test_01 == 2 && .@ko_test_02 == 2) {
				set .@last_test,3;
				mes "You've passed the ^339CCCTests of Knowledge and Survival^000000!";
			} else if (.@ko_test_01 == 2 && .@ko_test_03 == 2) {
				set .@last_test,2;
				mes "You've passed the ^339CCCTests of Knowledge and Weaponry^000000!";
			} else if (.@ko_test_02 == 2 && .@ko_test_03 == 2) {
				set .@last_test,1;
				mes "You've passed the ^339CCCTests of Survival and Weaponry^000000!";
			}
			next;
			mes "[Guide Gion]";
			mes "You are already done with two tests. Hope you've learned a lot from them.";
			next;
			cutin "job_ko01",2;
			mes "[Guide Gion]";
			mes "Shall we continue with the story?";
			next;
			mes "[Guide Gion]";
			mes "Kagerou, a warrior like the dancing flames of the sun.";
			next;
			mes "[Guide Gion]";
			mes "Oboro, a warrior like the misty moonlight.";
			next;
			mes "[Guide Gion]";
			mes "I think I left off when the two warriors met at the battlefield as enemies.";
			next;
			mes "[Guide Gion]";
			mes "The long war ended eventually but the wounds and pain of those that survived had just started.";
			next;
			mes "[Guide Gion]";
			mes "So these two warriors started to embrace and heal the war wounds together and became one.";
			next;
			mes "[Guide Gion]";
			mes "There is a backstory of a man appearing in front of them and winning the loyalty from both warriors.";
			next;
			select("Who is this man?");
			mes "[Guide Gion]";
			mes "There isn't much known about this man. Only a short mentioning of the two warriors pledging their allegiance.";
			next;
			mes "[Guide Gion]";
			mes "Maybe current generations like me are the ancestors of the current Amatsu lord? But this is only an assumption.";
			next;
			mes "[Guide Gion]";
			mes "I'm almost at the end of my family story. Come back after you've passed the third test and I will tell you the rest.";
			next;
			callsub L_StartTest,.@last_test,3;
			end;
		} else if (.@ko_test == 6) {
			cutin "job_ko01",2;
			mes "[Guide Gion]";
			mes "You've gone through three tests leaving only one to pass.";
			next;
			mes "[Guide Gion]";
			mes "As I've told you before, the last test is different because you have to compete against others.";
			next;
			select("Will you continue the story?");
			cutin "job_ko02",2;
			mes "[Guide Gion]";
			mes "Ha ha ha. I will finish the story.";
			next;
			mes "[Guide Gion]";
			mes "Kagerou, a warrior like the dancing flames of the sun.";
			next;
			mes "[Guide Gion]";
			mes "Oboro, a warrior like the misty moonlight.";
			next;
			mes "[Guide Gion]";
			mes "It is told that the man that earned the loyalty of the two warriors was a humorous person.";
			next;
			mes "[Guide Gion]";
			mes "He like the jokes and conversations better than quarrels and he liked women over men.";
			next;
			mes "[Guide Gion]";
			mes "Hmm... I don't know why this part of the story was kept alive all these years but this man wanted to bring these two warriors together.";
			next;
			mes "[Guide Gion]";
			mes "Both warriors did travel together after the war but kept an awkward distance from each other.";
			next;
			mes "[Guide Gion]";
			mes "They must have had their reasons but their lord would send them out to a difficult mission together, put them in a secret room together and all sorts of situations together.";
			next;
			select("Sounds like an odd person.");
			mes "[Guide Gion]";
			mes "Yes, he was. And his efforts didn't go in vain since the two warriors eventually got acquainted and married.";
			next;
			mes "[Guide Gion]";
			mes "This is how the family started.";
			next;
			select("What happened after?");
			mes "[Guide Gion]";
			mes "Sadly, the next part of story was purposely discontinued.";
			next;
			mes "[Guide Gion]";
			mes "I think it's because someone wanted us to let go of the past and move forward.";
			next;
			mes "[Guide Gion]";
			mes "That's that. Now shouldn't you be preparing for the last test?";
			next;
			set job_kagero,6;
			mes "[Guide Gion]";
			mes "But you must be tired from all the tests so far. Take a rest.";
			close2;
			cutin "",255;
			end;
		} else if (.@ko_test == 1 || .@ko_test == 3 || .@ko_test == 5) {
			cutin "job_ko04",2;
			if (.@ko_test_01 == 1)
				set .@test_ko$, "Knowledge";
			else if (.@ko_test_02 == 1)
				set .@test_ko$, "Survival";
			else if (.@ko_test_03 == 1)
				set .@test_ko$, "Weaponry";
			mes "[Guide Gion]";
			mes "Weren't you taking the Test of " + .@test_ko$ + " just now?";
			next;
			switch(select("I want to go back to test site.", "Ah... no.")) {
			case 1:
				mes "[Guide Gion]";
				mes "The Test of " + .@test_ko$ + " site is over here.";
				close2;
				if (.@ko_test_01 == 1)
					warp "job_ko",72,128;
				else if (.@ko_test_02 == 1)
					warp "job_ko",62,16;
				else if (.@ko_test_03 == 1)
					warp "job_ko",121,129;
				end;
			case 2:
				mes "[Guide Gion]";
				mes "The village is over here.";
				close2;
				warp "amatsu",147,136;
				end;
			}
		}
	} else if (job_kagero == 6) {
		cutin "job_ko01",2;
		mes "[Guide Gion]";
		mes "You've come back already? You could have rested more. Is there a reason to hurry?";
		next;
		input .@inputstr$;
		cutin "job_ko03",2;
		mes "[Guide Gion]";
		mes "Because of ^B24E59" + .@inputstr$ + "^000000?";
		next;
		mes "[Guide Gion]";
		mes "I have to admit, I don't understand you now.";
		next;
		mes "[Guide Gion]";
		mes "But since you've gone through much, I'm sure you will do good with the final test.";
		next;
		cutin "job_ko01",2;
		mes "[Guide Gion]";
		mes "Now! No more small talk. I'll let you know what the target is for the Test of Battle.";
		next;
		mes "[Guide Gion]";
		mes "The target is a monster called the ^FF0000Family Secret^000000.";
		next;
		mes "[Guide Gion]";
		mes "You will have to be careful because there are many similiar shaped and named monsters in test site.";
		next;
		mes "[Guide Gion]";
		mes "And if you are lucky, there will be others targeting the monster.";
		next;
		mes "[Guide Gion]";
		mes "May the blessings of '" + ((Sex)?"Kagerou, dancing sun":"Oboro, misty moonlight") + "' be with you.";
		next;
		setquest 5146;
		set job_kagero,7;
		mes "[Guide Gion]";
		mes "Then let's go to the battle test field.";
		close2;
		switch(rand(3)) {
			case 0: warp "job_ko",142,20; break;
			case 1: warp "job_ko",141,80; break;
			case 2: warp "job_ko",107,60; break;
		}
		end;
	} else if (job_kagero == 7 || job_kagero == 8) {
		cutin "job_ko03",2;
		mes "[Guide Gion]";
		mes "I see you are in the middle of the ^339CCCTest of Battle^000000. Will you go back to the test site?";
		next;
		switch(select("Go back to the test site.", "Visit the village.")) {
		case 1:
			mes "[Guide Gion]";
			mes "The test site is over here.";
			close2;
			switch(rand(3)) {
				case 0: warp "job_ko",142,20; break;
				case 1: warp "job_ko",141,80; break;
				case 2: warp "job_ko",107,60; break;
			}
			end;
		case 2:
			mes "[Guide Gion]";
			mes "The village is over here.";
			close2;
			cutin "",255;
			end;
		}
	} else {
		cutin "job_ko03",2;
		mes "[Guide Gion]";
		mes "You should not be here. Leave!";
		close2;
		warp "amatsu",147,136;
		end;
	}
	end;

//callsub L_StartTest,<1=Knowledge,2=Survival,3=Weaponry>,<test number [1..3]>;
L_StartTest:
	switch (getarg(1)) {
		case 1: set .@str$,"You are starting with the ^339CCCTest of %s^000000? "; break;
		case 2: set .@str$,"You are taking the ^339CCCTest of %s^000000 as the second test? "; break;
		case 3: set .@str$,"Your third test is the ^339CCCTest of %s^000000! "; break;
	}
	mes "[Guide Gion]";
	switch (getarg(0)) {
	case 1:
		mes sprintf(.@str$ + "Then I will get to see a familiar face after so long...","Knowledge");
		next;
		select("Familiar face?");
		setquest 5136;
		mes "[Guide Gion]";
		mes "Ha ha ha. You'll know when we get there. The Test of Knowledge is taken over here.";
		close2;
		warp "job_ko",72,128;
		end;
	case 2:
		mes sprintf(.@str$ + "It's a lonesome test that you have to face alone.","Survival");
		next;
		setquest 5137;
		mes "[Guide Gion]";
		mes "But I believe you can handle it. The Test of Survival is taken over here.";
		close2;
		warp "job_ko",62,16;
		end;
	case 3:
		mes sprintf(.@str$ + "I have something to give you before you go.","Weaponry");
		next;
		setquest 5138;
		getitem "Iron_Ore", 5;
		getitem "Phracon", 1;
		mes "You receive 5 Iron Ore and 1 Phracon.";
		next;
		mes "[Guide Gion]";
		mes "You will find these useful. The Test of Weaponry is taken over here.";
		close2;
		warp "job_ko",121,129;
		end;
	}
}

//== Test of Knowledge =====================================
job_ko,81,124,4	script	Cougar#ko	4_M_JOB_ASSASSIN,{
	if (BaseJob != Job_Ninja) {
		for (set .@i,5131; .@i<=5146; set .@i,.@i+1)
			if (questprogress(.@i)) erasequest .@i;
		set job_kagero,0;
		mes "[Cougar]";
		mes "Sorry, your family is not same as ours, is there something wrong?";
		close2;
		warp "amatsu",147,136;
		end;
	}
	if (job_kagero != 5) {
		goto L_Kick;
	}
	if (MaxWeight - Weight < 1000 || checkweight("Knife",1) == 0) {
		mes "[Cougar]";
		mes "This is a test of knowledge, so why did you bring so many things?";
		close;
	}
	set .@ko_test_01, questprogress(5136);
	set .@ko_test_01_1, questprogress(5139);
	if (.@ko_test_01 == 1 && .@ko_test_01_1 == 0) {
		mes "[Cougar]";
		mes "It's been a while.";
		next;
		select("Aren't you...");
		mes "[Cougar]";
		mes "I remember you from before looking for the way of the ninja.";
		next;
		mes "[Cougar]";
		mes "You've grown this strong already?";
		next;
		mes "[Cougar]";
		mes "Ha ha ha-";
		mes "A truly determined youth! I like that.";
		next;
		mes "[Cougar]";
		mes "Good! The test you are about to take is the ^339CCCTest of Knowledge^000000.";
		next;
		mes "[Cougar]";
		mes "I hope you haven't been lazy with your studies while focusing on getting stronger?";
		next;
		switch(select("Yes", "No")) {
		case 1:
			setquest 5139;
			mes "[Cougar]";
			mes "That's a relief. Let me know when you are ready to start the test.";
			close;
		case 2:
			setquest 5139;
			mes "[Cougar]";
			mes "So you were all talk? Well, let me know when you are ready then.";
			close;
		}
	} else if (.@ko_test_01 == 1 && .@ko_test_01_1 == 1) {
		mes "[Cougar]";
		mes "I'm ready at my end. Are you ready for the test?";
		next;
		if(select("Yes", "No") == 2) {
			mes "[Cougar]";
			mes "Well, what can I do but wait for you.";
			close;
		}
		mes "[Cougar]";
		mes "This isn't your first test, is it?";
		next;
		mes "[Cougar]";
		mes "You only need to choose the correct answer to my questions.";
		next;
		mes "[Cougar]";
		mes "Let's start.";
		next;

		set .@questions,10;  // number of questions to ask

		// shuffle array an array of questions to be asked
		freeloop(1);
		setarray .@n[0],
			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;
		for (set .@i,getarraysize(.@n)-1; .@i>0; set .@i,.@i-1) {
			set .@rand, rand(.@i);
			set .@tmp, .@n[.@i];
			set .@n[.@i], .@n[.@rand];
			set .@n[.@rand], .@tmp;
		}
		deletearray .@n[10],getarraysize(.@n) - .@questions;
		freeloop(0);

		set @job_ko_cougar,0;
		for (set .@i,1; .@i<=.@questions; set .@i,.@i+1) {
			mes "[Cougar]";
			mes (.@i < .@questions)?"Question number "+.@i+":":"Last question:";
			switch (.@n[.@i-1]) {
				case 1: callsub L_Question,"What is the DEX + LUK total for a Job Master?",2,"8:10:12:14"; break;
				case 2: callsub L_Question,"What is the highest job level for a ninja?",1,"70:50:99:100"; break;
				case 3: callsub L_Question,"How many skill points do you need to master the Throw Coins skill?",3,"25:30:35:37"; break;
				case 4: callsub L_Question,"Which of the following is the correct number of Evasion and effect duration for Mirror Image level 10?",4,"Up to 7 and 200 seconds:Up to 5 and 220 seconds:Up to 6 and 240 seconds:Up to 5 and 240 seconds"; break;
				case 5: callsub L_Question,"How many skill points do you need to master the Cicada Skin Shed?",1,"5:3:1:4"; break;
				case 6: callsub L_Question,"If Dagger Throwing Practice is at 7, how much ATK is added to Shuriken attacks?",2,"18:21:27:30"; break;
				case 7: callsub L_Question,"What is the basic attack range for Throw Shuriken?",3,"7 blocks:8 blocks:9 blocks:10 blocks"; break;
				case 8: callsub L_Question,"What is the maximum moving range of Shadow Leap?",4,"6 blocks:7 blocks:8 blocks:9 blocks"; break;
				case 9: callsub L_Question,"How much money is used for Throw Coins level 6?",4,"2000-8000:1000-6000:3000-8000:3000-6000"; break;
				case 10: callsub L_Question,"What is the most important aspect of increasing ATK for the Killing Strike skill?",2,"VIT:MAXHP:INT:MAXSP"; break;
				case 11: callsub L_Question,"What is not the effect you get after reaching the STR status?",3,"Close range attack increase:Weight limit increase:Magic attack increase:Weapon attack increase"; break;
				case 12: callsub L_Question,"What is not the effect you get after reaching the INT status?",4,"MAXSP increase:MATK increase:Magic damage increase:Staff attack increase"; break;
				case 13: callsub L_Question,"What is not the effect you get after reaching the DEX status?",2,"Casting time decrease:Evasion increase:Accuracy increase:Long range attack increase"; break;
				case 14: callsub L_Question,"What is not the effect you get after reaching the AGI status?",1,"Accuracy increase:Flee increase:Attack speed increase:Delay after attack decrease"; break;
				case 15: callsub L_Question,"What is not the effect you get after reaching the VIT status?",4,"Weapon defense increase:MAXHP increase:Magic defense increase:Attack increase"; break;
				case 16: callsub L_Question,"What is not the effect you get after reaching the LUK status?",3,"Accuracy increase:Complete evasion increase:Magic damage decrease:Critical rate increase"; break;
				case 17: callsub L_Question,"You need to equip a card to your shoes to enhance Killing Strike attack. Which of the following is the appropriate card to equip?",2,"Gold Acidus Card:Matyr Card:Odium of Thantos Card:Eddga Card"; break;
				case 18: callsub L_Question,"You need a catalyst to use ninja skills. Which of the following skills does not need a catalyst?",3,"Blaze Shield:Watery Evasion:Flaming Petals:Snow Flake Draft"; break;
				case 19: callsub L_Question,"How much does STR/INT go up when Ninja Aura level 5 is used?",2,"4:5:6:7"; break;
				case 20: callsub L_Question,"You are hunting the Orc Warrior. Which Kunai would you use? ",1,"Heat Wave Kunai:Icicle Kunai:Fell Poison Kunai:High Wind Kunai"; break;
				case 21: callsub L_Question,"Which village is the Ninja Guild located in?",2,"Lutie:Amatsu:Dewata:Comodo"; break;
				case 22: callsub L_Question,"How do Ninjas get promoted?",3,"By Val Kiwi:By Randgris:None:By Valkyrie"; break;
				case 23: callsub L_Question,"What was next to me when you first met me?",4,"A cushion:A folding screen:A flowerpot:A brazier"; break;
				case 24: callsub L_Question,"What is the level of Dagger Throwing Practice you have to reach to learn the Killing Strike skill?",1,"7:5:6:8"; break;
				case 25: callsub L_Question,"How many hits does a Throw Kunai give to a monster?",2,"2:3:4:5"; break;
				case 26: callsub L_Question,"When your First Wind is at level 4, what will go with the MATK and range?",3,"MATK400, 8 blocks:MATK500, 7 blocks:MATK500, 8 blocks:MATK400, 7 blocks"; break;
				case 27: callsub L_Question,"Which of the following skills can't you learn at Dagger Throwing Practice level 7?",4,"Throw Kunai:Throw Huuma Shuriken:Killing Strike:Throw Coins"; break;
				case 28: callsub L_Question,"What level do you have to be in Dagger Throwing Practice in order to learn the Throw Coins skill?",4,"4:6:8:10"; break;
				case 29: callsub L_Question,"What is the attack range for the Exploding Dragon?",3,"3*3:4*4:5*5:6*6"; break;
				case 30: callsub L_Question,"How long is the effect time for the Watery Evasion level 7 skill?",2,"40 seconds:45 seconds:50 seconds:55 seconds"; break;
				case 31: callsub L_Question,"What is the attack effect for Haze Slasher level 4?",1,"140%:150%:160%:170%"; break;
				case 32: callsub L_Question,"How much power is in the Huuma Blaze Shuriken weapon?",1,"Fireball 5 , DEX-2:Fireball 5 , DEX-3:Fireball 4 , DEX-2:Fireball 4 , DEX-3"; break;
				case 33: callsub L_Question,"How much power is in the Murasame weapon?",2,"Human attack 10%:Human critical +10:Demon attack 10%:Demon critical +10"; break;
				case 34: callsub L_Question,"What is the maximum hit number for Blaze Shield level 10?",3,"7:8:9:10"; break;
				case 35: callsub L_Question,"What is the property of the Lightning Jolt?",4,"Fire:Water:Ground:Wind"; break;
				case 36: callsub L_Question,"You are creating a weapon for small monsters. What is the best card to use?",4,"Hydra Card:Minorous Card:Skel Woker Card:Desert Wolf Card"; break;
				case 37: callsub L_Question,"You are creating a weapon for mid-sized monsters. What is the best card to use?",3,"Hydra Card:Minorous Card:Skel Woker Card:Desert Wolf Card"; break;
				case 38: callsub L_Question,"You are creating a weapon for huge monsters. What is the best card to use?",2,"Hydra Card:Minorous Card:Skel Woker Card:Desert Wolf Card"; break;
				case 39: callsub L_Question,"Which NPC promotes you?",1,"Valkyrie:Val Kiwi:Balp Hiri:Elephant"; break;
				case 40: callsub L_Question,"Which catalyst do you need to use the Blaze Shield skill?",2,"Ice Stone:Flame Stone:Wind Stone:Earth Stone"; break;
				case 41: callsub L_Question,"Which of the following is not an effect of the Watery Evasion skill?",4,"Movement speed decrease:Waterball availability:Holy Water craftability:VIT decrease"; break;
				case 42: callsub L_Question,"Which of the following matches are incorrect for skill and property?",3,"Flaming Petals-Fire:Snow Flake Draft-Water:Freezing Spear-Ground:Lightning Jolt-Wind"; break;
				case 43: callsub L_Question,"Which of the following is the best skill to use when attacking a ground property enemy?",2,"First Wind:Exploding Dragon:Snow Flake Draft:Wind Blade"; break;
				case 44: callsub L_Question,"Which Ninja Mastery skill level do you need to learn the Exploding Dragon skill?",1,"10:9:8:1"; break;
				case 45: callsub L_Question,"What is the attack range when you master Flip Tatami?",3,"5:7:3:1"; break;
				case 46: callsub L_Question,"What weapon cannot be made by the blacksmith Khaibara?",4,"Khukri:Murasame:Hakujin:Humma Wing Shuriken"; break;
				case 47: callsub L_Question,"Which of the following correctly matches material needed to make a Icicle Kunai?",2,"4 Nimbus Shuriken, 2 Ice Stone:8 Nimbus Shuriken, 2 Ice Stone:2 Nimbus Shuriken, 1 Ice Stone:1 Nimbus Shuriken, 2 Ice Stone"; break;
				case 48: callsub L_Question,"Which of the following Kunai will give the most damage to the ground property monster, Porcellio?",1,"Heat Wave Kunai:Icicle Kunai:Fell Poison Kunai:High Wind Kunai"; break;
				case 49: callsub L_Question,"Which of the following blacksmiths do not create ninja items?",2,"Khaibara:Aiku:Tetsu:Toshu"; break;
				case 50: callsub L_Question,"What is the name of the suspicious man you can meet during the Ninja job change quest?",3,"Red Leopard Jack:Black Leopard Jack:Red Leopard Joe:Black Leopard Joe"; break;
				default:
					mes "[Cougar]";
					mes "An unknown error has occurred.";
					mes "Please contact customer service.";
					close;
			}
		}
		mes "[Cougar]";
		mes "You're through all 10 questions. Wasn't so bad! The important part starts now.";
		next;
		mes "[Cougar]";
		mes "... ... ...";
		next;
		if (@job_ko_cougar < 90) {
			mes "[Cougar]";
			mes "You fool!!";
			mes "You couldn't even solve these?";
			next;
			mes "[Cougar]";
			mes "Can't believe someone who is taking a new path can be so pathetic.";
			next;
			mes "[Cougar]";
			mes "I'll give you another chance.";
			mes "You will take the test again with new questions. Better pass it this time.";
		} else {
			mes "[Cougar]";
			mes "Hmm. " + (@job_ko_cougar) + "?";
			next;
			mes "[Cougar]";
			mes "Well, looks like you weren't lazy with your studies.";
			next;
			mes "[Cougar]";
			mes "What? Proud of yourself for solving these questions?";
			next;
			mes "[Cougar]";
			mes "You still have a long way to go and this is only a small fraction of it.";
			next;
			mes "[Cougar]";
			mes "Well... I'm curious how far your strong will can take you through other tests.";
			next;
			completequest 5136;
			erasequest 5139;
			mes "[Cougar]";
			mes "I'll let you go now so go report back to Guide Gion with your results.";
			close2;
			warp "job_ko",16,113;
			end;
		}
		set @job_ko_cougar,0;
		close;
	} else if (.@ko_test_01 == 2 && .@ko_test_01_1 == 0) {
		mes "[Cougar]";
		mes "I'll let you go now so go report back to Guide Gion with your results.";
		close2;
		warp "job_ko",16,113;
		end;
	} else {
	L_Kick:
		mes "[Cougar]";
		mes "How did you get here?";
		next;
		mes "[Cougar]";
		mes "It's my duty to get rid of you.";
		mes "^000099(He's a short, silent man.)^000000";
		mes "This will push you back!";
		close2;
		warp "amatsu",147,136;
		end;
	}
	end;

//callsub L_Question,"<Question>",<correct answer choice>,"<Choice 1>:<Choice 2>:<Choice 3>:<Choice 4>";
L_Question:
	mes getarg(0);
	next;
	if(select(getarg(2)) == getarg(1))
		set @job_ko_cougar, @job_ko_cougar + 10;
	return;
}

//== Test of Survival ======================================

//- Functions -
function	script	F_KO_Survival_mes	{
	mes "[No. " + getarg(0) + "]";
	mes "^1A95E6Other letters are too small to read. Let's look up close.^000000";
	close;
}

function	script	F_KO_Survival_warp	{
	close2;
	switch (getarg(0)) {
		case  0: warp "job_ko",63,16; break;
		case  1: warp "job_ko",54,16; break;
		case  2: warp "job_ko",46,16; break;
		case  3: warp "job_ko",38,16; break;
		case  4: warp "job_ko",30,16; break;
		case  5: warp "job_ko",22,16; break;
		case  6: warp "job_ko",17,19; break;
		case  7: warp "job_ko",17,27; break;
		case  8: warp "job_ko",17,35; break;
		case  9: warp "job_ko",17,43; break;
		case 10: warp "job_ko",17,51; break;
		case 11: warp "job_ko",17,60; break;
		case 12: warp "job_ko",25,60; break;
		case 13: warp "job_ko",33,60; break;
		case 14: warp "job_ko",41,60; break;
		case 15: warp "job_ko",49,60; break;
		case 16: warp "job_ko",57,60; break;
		case 17: warp "job_ko",62,56; break;
		case 18: warp "job_ko",62,48; break;
		case 19: warp "job_ko",62,40; break;
		case 20: warp "job_ko",62,32; break;
		case 21: warp "job_ko",62,23; break;
		case 22: warp "job_ko",54,23; break;
		case 23: warp "job_ko",46,23; break;
		case 24: warp "job_ko",38,23; break;
		case 25: warp "job_ko",30,23; break;
		case 26: warp "job_ko",25,27; break;
		case 27: warp "job_ko",25,35; break;
		case 28: warp "job_ko",25,43; break;
		case 29: warp "job_ko",25,52; break;
		case 30: warp "job_ko",33,52; break;
		case 31: warp "job_ko",41,52; break;
		case 32: warp "job_ko",49,52; break;
		case 33: warp "job_ko",54,48; break;
		case 34: warp "job_ko",54,40; break;
		case 35: warp "job_ko",54,31; break;
		case 36: warp "job_ko",46,31; break;
		case 37: warp "job_ko",38,31; break;
		case 38: warp "job_ko",33,35; break;
		case 39: warp "job_ko",33,44; break;
		case 40: warp "job_ko",41,44; break;
	}
	end;
}

//callfunc "F_KO_Survival_dice",<location>{,<LP (default:1)>{,<0:auto-warp (default), 1:do not warp>}}
//Return: dice value [1..6] ONLY IF arg2 = 1
function	script	F_KO_Survival_dice	{
	mes "Location: " + getarg(0);
	mes "Total LP: " + job_kagero_lp;
	mes "To roll the dice, you need to consume " + getarg(1,1) + " ^FD0260LP^000000.";
	next;
	select("Roll the dice.");
	if (job_kagero_lp < getarg(1,1)) {
		mes "Due to insufficient ^FD0260LP^000000, you will be returned to starting position.";
		callfunc "F_KO_Survival_warp",0;
		end;
	}
	set job_kagero_lp, job_kagero_lp - getarg(1,1);
	set .@dice, rand(1,6);
	emotion 57 + .@dice,1;
	mes "The dice came out as " + .@dice + ".";
	if (getarg(2,0))
		return .@dice;
	else {
		mes "Press Close to move forward " + .@dice + " blocks.";
		callfunc "F_KO_Survival_warp", .@dice + getarg(0);
		end;
	}
}

//callfunc "F_KO_Survival_dice2",<location>{,<LP (default:2)>}
function	script	F_KO_Survival_dice2	{
	mes "Location: " + getarg(0);
	mes "Total LP: " + job_kagero_lp;
	mes "To roll the dice, you need to consume " + getarg(1,2) + " ^FD0260LP^000000.";
	next;
	select("Roll the first dice.");
	if (job_kagero_lp < getarg(1,2)) {
		mes "Due to insufficient ^FD0260LP^000000, you will be returned to starting position.";
		callfunc "F_KO_Survival_warp",0;
		end;
	}
	set job_kagero_lp, job_kagero_lp - getarg(1,2);
	mes "< Used " + getarg(1,2) + " LP >";
	next;
	set @job_ko_dice1, rand(1,6);
	emotion 57 + @job_ko_dice1,1;
	mes "First dice result is " + @job_ko_dice1 + ". Do you want to roll the second dice?";
	next;
	select("Roll the second dice.");
	set @job_ko_dice2, rand(1,6);
	emotion 57 + @job_ko_dice2,1;
	return;
}

//Return: 1:win, 0:draw, -1:lose
function	script	F_KO_Survival_rps	{
	setarray .@rps$[1], "Scissors", "Rock", "Paper";
	setarray .@emote[1], e_scissors, e_rock, e_paper;

	mes "Rock! Paper! Scissors!";
	next;
	set .@pc, select("Give scissors.", "Give rock.", "Give paper.");
	set .@npc, rand(1,3);
	emotion .@emote[.@pc],1;
	emotion .@emote[.@npc];
	mes "=Game Results=";
	mes "Machine: " + .@rps$[.@npc] + ".";
	mes "You: " + .@rps$[.@pc] + ".";
	next;
	if ((.@npc == 1 && .@pc == 2) || (.@npc == 2 && .@pc == 3) || (.@npc == 3 && .@pc == 1)) {
		mes "You Win";
		return 1;
	} else if (.@pc == .@npc) {
		mes "Draw";
		return 0;
	} else if ((.@npc == 1 && .@pc == 3) || (.@npc == 2 && .@pc == 1) || (.@npc == 3 && .@pc == 2)) {
		mes "You Lose";
		return -1;
	} else {
		mes "An unknown error has occurred.";
		mes "Please contact customer service.";
		close;
	}
}

//- Templates -
-	script	Sight#ko_trap	FAKE_NPC,{
	callfunc "F_KO_Survival_mes", atoi(substr(strnpcinfo(2),3,4));
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	switch (atoi(substr(strnpcinfo(2),3,4))) {
		case  2: set .@id,0; break;
		case  7: set .@id,5; break;
		case 11: set .@id,9; break;
		case 23: set .@id,18; break;
		case 26: set .@id,20; break;
		case 30: set .@id,9; break;
		case 35: set .@id,29; break;
	}
	mes "This block has a trap.";
	mes "Press Close to go back to block " + .@id + ".";
	callfunc "F_KO_Survival_warp", .@id;
	end;
}

-	script	Sight#ko_trap2	FAKE_NPC,{
	callfunc "F_KO_Survival_mes", atoi(substr(strnpcinfo(2),3,4));
	end;
OnTouch:
	set .@id, atoi(substr(strnpcinfo(2),3,4));
	switch (.@id) {
		case 10: set .@var$, "$20110808_vko01"; break;
		case 28: set .@var$, "$20110808_vko03"; break;
		//case 38: set .@var$, "$20110808_vko04"; break;
	}
	mes "There are tiny letters on the sign.";
	next;
	mes "If you don't want to be caught, install a trap.";
	next;
	if (getd(.@var$) == 0) {
		mes "There is currently no trap installed.";
		next;
		mes "Do you want to use 10 ^FD0260LP^000000 to install a trap?";
		next;
		if(select("Install a trap.", "Roll the Dice.") == 1) {
			if (job_kagero_lp > 9) {
				mes "< Used 10 LP >";
				set job_kagero_lp, job_kagero_lp - 10;
				setd .@var$,1;
				next;
				mes "The trap is installed. Please roll the dice.";
				next;
			} else {
				mes "< Did not use 10 LP >";
				mes "^FD0260LP^000000 insufficient! Please roll the dice.";
				next;
			}
		}
	} else {
		set job_kagero_lp,0;
		setd .@var$,0;
		mes "You are caught in the trap installed.";
		mes "Press Close to go back to block 0.";
		callfunc "F_KO_Survival_warp",0;
		end;
	}
	callfunc "F_KO_Survival_dice",.@id;
	end;
}

-	script	Sight#ko_heal	FAKE_NPC,{
	callfunc "F_KO_Survival_mes", atoi(substr(strnpcinfo(2),3,4));
	end;
OnTouch:
	set .@id, atoi(substr(strnpcinfo(2),3,4));
	mes "There are tiny letters on the sign.";
	next;
	mes "This block is blessed.";
	mes "Life Point recovers 7 ^FD0260LP^000000.";
	mes "Cannot exceed maximum 100 ^FD0260LP^000000.";
	next;
	mes "< Recovered " + ((job_kagero_lp + 7 > 100) ? "" : "7") + " LP >";
	next;
	set job_kagero_lp, ((job_kagero_lp + 7 > 100) ? 100 : job_kagero_lp + 7);
	callfunc "F_KO_Survival_dice",.@id;
	end;
}

-	script	Sight#ko_curse	FAKE_NPC,{
	callfunc "F_KO_Survival_mes", atoi(substr(strnpcinfo(2),3,4));
	end;
OnTouch:
	set .@id, atoi(substr(strnpcinfo(2),3,4));
	set .@playtime, questprogress(5141,PLAYTIME);
	if (!.@playtime) {
		mes "There are tiny letters on the sign.";
		next;
		mes "If you do not pay 5 ^FD0260LP^000000, you will be cursed and immobilized for 2 minutes.";
		next;
		if(select("Use 5 LP", "Do not pay.") == 1) {
			if (job_kagero_lp > 4) {
				set job_kagero_lp, job_kagero_lp - 5;
				mes "<Used 5 LP>";
				mes "You can roll the dice.";
				next;
				callfunc "F_KO_Survival_dice",.@id;
				end;
			} else {
				mes "< Did not use 5 LP >";
				mes "Could not withstand the curse.";
				next;
			}
		}
		setquest 5141;
		mes "You are cursed and cannot move to any other block for 2 minutes.";
		close;
	} else if (.@playtime == 1) {
		mes "You are cursed and cannot move to any other block for 2 minutes.";
		close;
	} else if (.@playtime == 2) {
		mes "The immobilize curse lasted for 2 minutes and then was removed.";
		next;
		erasequest 5141;
		callfunc "F_KO_Survival_dice",.@id;
		end;
	} else {
		erasequest 5141;
		mes "An unknown error has occurred.";
		mes "Please contact customer service.";
		close;
	}
}

-	script	Sight#ko_gravity	FAKE_NPC,{
	callfunc "F_KO_Survival_mes", atoi(substr(strnpcinfo(2),3,4));
	end;
OnTouch:
	set .@id, atoi(substr(strnpcinfo(2),3,4));
	mes "There are tiny letters on the sign.";
	next;
	mes "Area cursed with 10 times the normal gravity. You will need 10 ^FD0260LP^000000 to roll the dice.";
	next;
	callfunc "F_KO_Survival_dice",.@id,10;
	end;
}

//- Blocks (00-40) -
job_ko,57,16,4	script	Sight#ko_00	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",0;
	end;
OnTouch:
	if (job_kagero != 5) {
		mes "You should not be here.";
		close2;
		warp "amatsu",147,136;
		end;
	}
	if (questprogress(5137) == 1 && questprogress(5140) == 0) {
		mes "There are tiny letters on the sign.";
		next;
		callsub L_Description;
		setquest 5140;
		set job_kagero_lp,100;
		mes "You've gained 100 Life Points (LP).";
		next;
	} else {
		if (questprogress(5141,PLAYTIME) > 0)
			erasequest 5141;
		set job_kagero_lp,100;
		mes "You've returned to the first block. Your LP is recovered.";
		next;
		callsub L_Description;
	}
	callfunc "F_KO_Survival_dice",0;
	end;

L_Description:
	while (1) {
		if(select("Read the description.", "Start the test.") == 2)
			break;
		mes "The Test of Survival starts from here and you use ^FD0260100 Life Points (LP)^000000 and roll dice to advance forward through the test.";
		next;
		mes "The whole test starts from block 0 to block 40 and each block you get can either give or take your LP.";
		next;
		mes "You need to have some ^FD0260LP^000000 till you get to the arrival block at the end to pass the test.";
		next;
		mes "But! You still pass the test if your ^FD0260LP^000000 becomes 0 when you get to the arrival block.";
		next;
		mes "Game instructions end here. Good luck to you.";
		next;
	}
	return;
}

job_ko,49,16,4	script	Sight#ko_01	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",1;
	end;
OnTouch:
	set .@life_p, job_kagero_lp;
	mes "There are tiny letters on the sign.";
	next;
	mes "You are really bad at rolling dice. How can you get a 1 from the start? You can move to block 9 if you pay up 10 LP in this block.";
	next;
	if(select("Use 10 LP", "Roll the dice.") == 1) {
		if (job_kagero_lp > 9) {
			set .@reset_p, .@life_p - 10;
			set job_kagero_lp, .@reset_p;
			mes "< Used 10 LP >";
			mes "Press Close to move to block 9.";
			callfunc "F_KO_Survival_warp",9;
			end;
		} else {
			mes "< Did not use 10 LP >";
			mes "^FD0260LP^000000 insufficient!";
			next;
		}
	}
	mes "Roll the dice.";
	next;
	callfunc "F_KO_Survival_dice",1;
	end;
}

job_ko,41,16,4	duplicate(Sight#ko_trap)	Sight#ko_02	4_BULLETIN_BOARD2,1,1

job_ko,33,16,4	script	Sight#ko_03	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",3;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "Used 5 LP so you will have to resist the curse passed down through generations before moving forward.";
	next;
	select("Use 5 LP");
	if (job_kagero_lp > 4) {
		mes "< Used 5 LP >";
		set job_kagero_lp, job_kagero_lp - 5;
		callfunc "F_KO_Survival_dice",3;
	} else {
		mes "< Did not use 5 LP >";
		mes "^FD0260LP^000000 insufficient! Returning to start location.";
		callfunc "F_KO_Survival_warp",0;
	}
	end;
}

job_ko,25,16,4	script	Sight#ko_04	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",4;
	end;
OnTouch:
	mes "There are tiny letters scribbled on the sign.";
	next;
	if ($20110808_sko01$ != "") {
		mes "^0000FF" + $20110808_sko01$ +" was here.^000000";
		next;
	}
	mes "Should I leave my name since taking the test is a special occasion?";
	next;
	if(select("Use 5 LP and leave your name.", "Continue to roll the dice.") == 1) {
		if (job_kagero_lp > 4) {
			mes "< Used 5 LP >";
			set job_kagero_lp, job_kagero_lp - 5;
			next;
			set $20110808_sko01$, strcharinfo(0);
			mes strcharinfo(0)+" was here.";
			mes "You left your name.";
			next;
		} else {
			mes "< Did not use 5 LP >";
			mes "^FD0260LP^000000 insufficient! You can roll the dice.";
			next;
		}
	}
	callfunc "F_KO_Survival_dice",4;
	end;
}

job_ko,17,16,4	duplicate(Sight#ko_curse)	Sight#ko_05	4_BULLETIN_BOARD2,1,1
job_ko,17,24,4	duplicate(Sight#ko_heal)	Sight#ko_06	4_BULLETIN_BOARD2,1,1
job_ko,17,32,4	duplicate(Sight#ko_trap)	Sight#ko_07	4_BULLETIN_BOARD2,1,1

job_ko,17,40,4	script	Sight#ko_08	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",8;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "Rock-paper-scissors Machine:";
	mes "If you win, move to block 15.";
	mes "If it is a draw, roll the dice.";
	mes "If you lose, move to block 0.";
	next;
	switch (callfunc("F_KO_Survival_rps")) {
	case 1:
		mes "Press Close to move to block 15.";
		callfunc "F_KO_Survival_warp",15;
		end;
	case 0:
		mes "A tie, so roll the dice!";
		next;
		callfunc "F_KO_Survival_dice",8;
		end;
	case -1:
		mes "Press Close to move to block 0.";
		callfunc "F_KO_Survival_warp",0;
		end;
	}
}

job_ko,17,48,4	script	Sight#ko_09	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",9;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "Please proceed.";
	next;
	callfunc "F_KO_Survival_dice",9;
	end;
}

job_ko,17,56,4	duplicate(Sight#ko_trap2)	Sight#ko_10	4_BULLETIN_BOARD2,1,1
job_ko,22,60,4	duplicate(Sight#ko_trap)	Sight#ko_11	4_BULLETIN_BOARD2,1,1

job_ko,30,60,4	script	Sight#ko_12	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",12;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "Rock-paper-scissors Machine:";
	mes "If you win, move to block 20.";
	mes "If it is a draw, roll the dice.";
	mes "If you lose, move to block 9.";
	next;
	switch (callfunc("F_KO_Survival_rps")) {
	case 1:
		mes "Press Close to move to block 20.";
		callfunc "F_KO_Survival_warp",20;
		end;
	case 0:
		mes "A tie, so roll the dice!";
		next;
		callfunc "F_KO_Survival_dice",12;
		end;
	case -1:
		mes "Press Close to move to block 9.";
		callfunc "F_KO_Survival_warp",9;
		end;
	}
}

job_ko,38,60,4	duplicate(Sight#ko_heal)	Sight#ko_13	4_BULLETIN_BOARD2,1,1
job_ko,46,60,4	duplicate(Sight#ko_curse)	Sight#ko_14	4_BULLETIN_BOARD2,1,1

job_ko,54,60,4	script	Sight#ko_15	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",15;
	end;
OnTouch:
	set .@playtime, questprogress(5141,PLAYTIME);
	if (!.@playtime) {
		mes "There are tiny letters on the sign.";
		next;
		mes "You will be cursed by a powerful gravity curse that immobilizes you for 2 minutes.";
		setquest 5141;
		close;
	} else if (.@playtime == 1) {
		mes "You are cursed and cannot move to any other block for 2 minutes.";
		close;
	} else if (.@playtime == 2) {
		mes "The immobilize curse lasted for 2 minutes and then was removed.";
		next;
		erasequest 5141;
		callfunc "F_KO_Survival_dice",15;
		end;
	} else {
		erasequest 5141;
		mes "An unknown error has occurred.";
		mes "Please contact customer service.";
		close;
	}
}

job_ko,62,60,4	script	Sight#ko_16	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",16;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "Consume 2 ^FD0260LP^000000 and roll the dice twice.";
	mes "If you get the same number then you can move to block 30, if the numbers are different, consume 2 LP to roll again... until you get the same numbers.";
	next;
	while (1) {
		callfunc "F_KO_Survival_dice2",16;
		if (@job_ko_dice1 == @job_ko_dice2) break;
		else {
			mes "Second dice result is " + @job_ko_dice2 + ", which is not the same number.";
			next;
		}
	}
	set @job_ko_dice1,0;
	set @job_ko_dice2,0;
	//mes "Second dice result is " + @job_ko_dice2 + ", which is the same number. Press Close to move block 30.";
	mes "You got the same number. Press Close to move block 30.";
	callfunc "F_KO_Survival_warp",30;
	end;
}

job_ko,62,51,4	duplicate(Sight#ko_gravity)	Sight#ko_17	4_BULLETIN_BOARD2,1,1

job_ko,62,43,4	script	Sight#ko_18	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",18;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "Consume 2 ^FD0260LP^000000 and roll the dice twice.";
	next;
	mes "If the sum of the numbers from both dice is lower than 5, move to block 30, if it higher than 5, move to block 19.";
	next;
	callfunc "F_KO_Survival_dice2",18;
	mes "Second dice result is " + @job_ko_dice2 + ".";
	next;
	set .@dice_sum, @job_ko_dice1 + @job_ko_dice2;
	mes @job_ko_dice1 + " + " + @job_ko_dice2 + " = " + .@dice_sum;
	set @job_ko_dice1,0;
	set @job_ko_dice2,0;
	if (.@dice_sum < 5) {
		mes "You total is lower than 5. Press Close to move to block 30.";
		callfunc "F_KO_Survival_warp",30;
		end;
	} else {
		mes "You total is larger than 5. Press Close to move to block 19.";
		callfunc "F_KO_Survival_warp",19;
		end;
	}
}

job_ko,62,35,4	script	Sight#ko_19	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",19;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "Move forward.";
	next;
	callfunc "F_KO_Survival_dice",19;
	end;
}

job_ko,62,27,4	duplicate(Sight#ko_heal)	Sight#ko_20	4_BULLETIN_BOARD2,1,1
job_ko,57,23,4	duplicate(Sight#ko_gravity)	Sight#ko_21	4_BULLETIN_BOARD2,1,1

job_ko,49,23,4	script	Sight#ko_22	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",22;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "Leave all your remaining ^FD0260LP^000000 and go back to block 0, then the next person will be redeemed.";
	next;
	if ($20110808_vko02 == 0) {
		mes "Do you want to leave your ^FD0260LP^000000?";
		mes "If you leave your ^FD0260LP^000000 then the next person for test that arrives at the block will automatically pass the test.";
		next;
		if(select("Leave all your LP.", "Continue to roll the dice.") == 1) {
			set job_kagero_lp,0;
			set $20110808_vko02,1;
			mes "Leave all remaining ^FD0260LP^000000 here. Press Close and go back to block 0.";
			callfunc "F_KO_Survival_warp",0;
			end;
		}
	} else if ($20110808_vko02 == 1) {
		set $20110808_vko02,0;
		mes "Someone before you sacrificed all their ^FD0260LP^000000, so press Close and go to the last block.";
		callfunc "F_KO_Survival_warp",40;
		end;
	} else {
		mes "An unknown error has occurred.";
		mes "Please contact customer service.";
		close;
	}
	callfunc "F_KO_Survival_dice",22;
	end;
}

job_ko,41,23,4	duplicate(Sight#ko_trap)	Sight#ko_23	4_BULLETIN_BOARD2,1,1

job_ko,33,23,4	script	Sight#ko_24	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",24;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "Consume 2 ^FD0260LP^000000 and roll the dice twice.";
	next;
	mes "If the sum of the numbers from both dice is larger than 8, then you can move to any block between 25 to 30. But! If the sum is below 8, you must move back to block 19.";
	next;
	callfunc "F_KO_Survival_dice2",24;
	mes "Second dice result is " + @job_ko_dice2 + ".";
	next;
	set .@dice_sum, @job_ko_dice1 + @job_ko_dice2;
	if (.@dice_sum > 8) {
		mes @job_ko_dice1 + " + " + @job_ko_dice2 + " = " + .@dice_sum;
		set @job_ko_dice1,0;
		set @job_ko_dice2,0;
		mes "You total is larger than 8. Please choose a block to move between blocks 25 through 30.";
		callfunc "F_KO_Survival_warp", select("Move to block 25", "Move to block 26", "Move to block 27", "Move to block 28", "Move to block 29", "Move to block 30") + 24;
		end;
	} else {
		set @job_ko_dice1,0;
		set @job_ko_dice2,0;
		mes "You total is lower than 8. Press Close to move to block 19.";
		callfunc "F_KO_Survival_warp",19;
		end;
	}
}

job_ko,25,23,4	script	Sight#ko_25	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",25;
	end;
OnTouch:
	set .@playtime, questprogress(5141,PLAYTIME);
	if (!.@playtime) {
		mes "There are tiny letters on the sign.";
		next;
		mes "This is lame.";
		mes "Cannot read the writing. There should be a way to read it.";
		next;
		switch(select("Try something.", "Do nothing.")) {
		case 1:
			specialeffect2 EF_TALK_FROSTJOKE;
			mes "Tried a recent Prontera joke to do something.";
			next;
			setquest 5141;
			mes "Got cursed and became immobilized for 2 minutes.";
			close;
		case 2:
			if (rand(1,10) == 4) {
				mes "Its a wise decision to do nothing.";
				next;
			} else {
				mes "Nothing happened. Still need to do something.";
				close;
			}
			break;
		}
	} else if (.@playtime == 1) {
		mes "Cannot move because you are cursed.";
		close;
	} else if (.@playtime == 2) {
		mes "The immobilize curse lasted for 2 minutes and then was removed.";
		next;
		erasequest 5141;
	} else {
		erasequest 5141;
		mes "An unknown error has occurred.";
		mes "Please contact customer service.";
		close;
	}
	callfunc "F_KO_Survival_dice",25;
	end;
}

job_ko,25,32,4	duplicate(Sight#ko_trap)	Sight#ko_26	4_BULLETIN_BOARD2,1,1
job_ko,25,40,4	duplicate(Sight#ko_heal)	Sight#ko_27	4_BULLETIN_BOARD2,1,1
job_ko,25,48,4	duplicate(Sight#ko_trap2)	Sight#ko_28	4_BULLETIN_BOARD2,1,1

job_ko,30,52,4	script	Sight#ko_29	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",29;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "Go forth.";
	next;
	callfunc "F_KO_Survival_dice",29;
	end;
}

job_ko,38,52,4	duplicate(Sight#ko_trap)	Sight#ko_30	4_BULLETIN_BOARD2,1,1
job_ko,46,52,4	duplicate(Sight#ko_curse)	Sight#ko_31	4_BULLETIN_BOARD2,1,1

job_ko,54,52,4	script	Sight#ko_32	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",32;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "Rock-paper-scissors Machine:";
	mes "If you win, you get to move to any block between 33 to 38; if you lose or is a draw, you have to move to block 0.";
	next;
	switch (callfunc("F_KO_Survival_rps")) {
	case 1:
		mes "Please choose a block to move between blocks 33 through 38.";
		next;
		callfunc "F_KO_Survival_warp", select("Move to block 33", "Move to block 34", "Move to block 35", "Move to block 36", "Move to block 37", "Move to block 38") + 32;
		end;
	case 0:
	case -1:
		mes "Press Close to move to block 0.";
		callfunc "F_KO_Survival_warp",0;
		end;
	}
}

job_ko,54,43,4	script	Sight#ko_33	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",33;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "You can move to block 39 if you pay all points except for the last 1 ^FD0260LP^000000 to roll the dice one last time.";
	next;
	switch(select("Pay LP.", "Move forward a little bit at a time.")) {
	case 1:
		set .@sell_p, job_kagero_lp - 1;
		set job_kagero_lp,1;
		mes "< Used " + .@sell_p + " LP >";
		next;
		mes "Press Close to move to block 39.";
		callfunc "F_KO_Survival_warp",39;
		end;
	case 2:
		mes "Please roll the dice.";
		next;
		break;
	}
	callfunc "F_KO_Survival_dice",33;
	end;
}

job_ko,54,35,4	duplicate(Sight#ko_heal)	Sight#ko_34	4_BULLETIN_BOARD2,1,1
job_ko,49,31,4	duplicate(Sight#ko_trap)	Sight#ko_35	4_BULLETIN_BOARD2,1,1

job_ko,41,31,4	script	Sight#ko_36	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",36;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "There are only 4 blocks left till the last block.";
	next;
	mes "Rule 1 (Normal Dice Roll)";
	mes "You get to pass if you get 4 or above but nobody knows what will come from a dice roll.";
	next;
	mes "Rule 2";
	mes "If you get 1, 2, or 3 you move right to the arrival point; if you get 4, 5, or 6 you get to choose to move to block 29.";
	next;
	switch(select("Try it the other way.", "Go by the rules.")) {
	case 1:
		//mes "The Other Way (2nd Rule)";
		set .@dodoripo,0;
		break;
	case 2:
		set .@dodoripo,1;
		break;
	}
	set .@dice, callfunc("F_KO_Survival_dice",36,1,1);
	if (.@dodoripo == 0) {
		if (.@dice <= 3) {
			mes "Press Close to move to the end.";
			callfunc "F_KO_Survival_warp",40;
			end;
		} else {
			mes "Press Close to move to block 29.";
			callfunc "F_KO_Survival_warp",29;
			end;
		}
	} else {
		mes "Press Close to move to forward " + .@dice + " blocks.";
		callfunc "F_KO_Survival_warp", ((.@dice <= 3) ? .@dice + 36 : 40);
		end;
	}
}

job_ko,33,31,4	script	Sight#ko_37	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",37;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "There are only 3 blocks left to the finish line but you can't you go so easily.";
	next;
	mes "If you get 1, 3, or 5, move to the arrival point; if you get 2, 4, or 6, go back to the starting point.";
	next;
	set .@dice, callfunc("F_KO_Survival_dice",37,1,1);
	if (.@dice % 2) {
		mes "Press Close to move to the last block.";
		callfunc "F_KO_Survival_warp",40;
		end;
	} else {
		mes "Press Close to move to the starting point.";
		callfunc "F_KO_Survival_warp",0;
		end;
	}
}

job_ko,33,40,4	script	Sight#ko_38	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",38;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "Leave 1 LP and invest the remaining LP to install the trap to bring down other players!";
	next;
	if ($20110808_vko04 == 0) {
		mes "There is currently no trap installed. Do you want to install a trap?";
		next;
		switch(select("Install a trap.", "Do not install.")) {
		case 1:
			set .@reset_p, job_kagero_lp - 1;
			set job_kagero_lp,1;
			set $20110808_vko04,1;
			mes "< Used " + .@reset_p + " LP >";
			next;
			mes "The trap is installed. Please roll the dice.";
			next;
			break;
		case 2:
			mes "Did not set a trap. Please roll the dice.";
			next;
			break;
		}
	} else {
		set $20110808_vko04,0;
		set job_kagero_lp,0;
		mes "You are caught in the trap installed. Press Close to go back to block 0.";
		callfunc "F_KO_Survival_warp",0;
		end;
	}
	set .@dice, callfunc("F_KO_Survival_dice",38,1,1);
	mes "Press Close to move forward " + .@dice + " blocks.";
	callfunc "F_KO_Survival_warp", ((.@dice == 1) ? .@dice + 38 : 40);
	end;
}

job_ko,38,44,4	script	Sight#ko_39	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",39;
	end;
OnTouch:
	mes "There are tiny letters on the sign.";
	next;
	mes "Now there is only 1 block left till the end. Congratulations on all you've been through to get here.";
	next;
	mes "But you cannot go so easily. If you get a 3, you will go back to block 3.";
	next;
	set .@dice, callfunc("F_KO_Survival_dice",39,1,1);
	if (.@dice == 3) {
		mes "Press Close to move to the 3rd block.";
		callfunc "F_KO_Survival_warp",3;
		end;
	} else {
		mes "Press Close to move to the arrival point.";
		callfunc "F_KO_Survival_warp",40;
		end;
	}
}

job_ko,46,41,4	script	Sight#ko_40	4_BULLETIN_BOARD2,1,1,{
	callfunc "F_KO_Survival_mes",40;
	end;
OnTouch:
	if (job_kagero != 5) {
		mes "You should not be here.";
		close2;
		warp "amatsu",147,136;
		end;
	}
	if (questprogress(5137) != 1 || questprogress(5140) != 1) {
		mes "You must be here by mistake.";
		close2;
		warp "amatsu",147,136;
		end;
	}
	mes "There are tiny letters on the sign.";
	next;
	mes "To those you are preparing for a new turn...";
	mes "Well begun is half done. However always remember it is not the end.";
	next;
	completequest 5137;
	erasequest 5140;
	if (questprogress(5141)) erasequest 5141;
	set job_kagero_lp,0;
	mes "Let's read all the writing on the sign.";
	mes "You feel like you are moved to another place.";
	close2;
	warp "job_ko",35,113;
	end;
}

//== Test of Weaponry ======================================
job_ko,127,125,4	script	Red Leopard Joe#ko	4_M_JOB_ASSASSIN,{
	if (MaxWeight - Weight < 1000 || checkweight("Knife",1) == 0) {
		mes "[Red Leopard Joe]";
		mes "Go reduce your weight! This test will be too difficult otherwise...";
		close;
	}
	if (BaseJob != Job_Ninja) {
		for (set .@i,5131; .@i<=5146; set .@i,.@i+1)
			if (questprogress(.@i)) erasequest .@i;
		set job_kagero,0;
		mes "[Red Leopard Joe]";
		mes "Sorry, your family is not the same as ours, is there something wrong?";
		close2;
		warp "amatsu",147,136;
		end;
	}
	if (job_kagero != 5) {
		mes "[Red Leopard Joe]";
		mes "You are not supposed to be here...";
		mes "It's my duty to get rid of you,";
		mes "so I'll send you back now!";
		close2;
		warp "amatsu",147,136;
		end;
	}
	set .@ko_test_03_1, questprogress(5138);
	set .@ko_test_03_2, questprogress(5142);
	set .@ko_test_03_3, questprogress(5143);
	set .@ko_test_03_4, questprogress(5144);
	set .@ko_test_03_5, questprogress(5145);
	if (.@ko_test_03_1 == 1 && .@ko_test_03_2 == 0 && .@ko_test_03_3 == 0 && .@ko_test_03_4 == 0 && .@ko_test_03_5 == 0) {
		mes "[Red Leopard Joe]";
		mes "It's been a while!";
		next;
		select("Long time indeed, Joe.");
		mes "[Red Leopard Joe]";
		mes "You aren't surprised I'm here. Did you meet ^0237FDCougar^000000 before coming here?";
		next;
		mes "[Red Leopard Joe]";
		mes "Don't like it that I'm not the first one you visited but that is not important.";
		next;
		mes "[Red Leopard Joe]";
		mes "Alright, " + strcharinfo(0) + "!";
		mes "Welcome to the workshop where weapons are created for the family.";
		next;
		mes "[Red Leopard Joe]";
		mes "Our family has been creating and using unique weapons to serve our secret missions since ancient times.";
		next;
		select("Really? At Einbroch?");
		mes "[Red Leopard Joe]";
		mes "Hmm? You are not as slow as I thought you were!";
		next;
		mes "[Red Leopard Joe]";
		mes "Yes. Einbroch is known as an industrial city, the city of great blacksmiths create new technology.";
		next;
		mes "[Red Leopard Joe]";
		mes "My mission is to analyze their technology and report back to the family.";
		next;
		mes "[Red Leopard Joe]";
		mes "I spoke more than I intended to.";
		next;
		mes "[Red Leopard Joe]";
		mes "Did you bring enough ^6848B7Iron Ore, Iron, Steel, Phracon, Emveretaron, Rough Oridecon, and Rough Elunium^000000?";
		next;
		mes "[Red Leopard Joe]";
		mes "Let's now create a new prototype weapon.";
		next;
		specialeffect EF_GUIDEDATTACK,AREA,"Crafting Tools#ko_01";
		mes "[Red Leopard Joe]";
		mes "Feel free to use tools from here, and...";
		next;
		specialeffect EF_GUIDEDATTACK,AREA,"Crafting Tools#ko_02";
		mes "[Red Leopard Joe]";
		mes "...there...";
		next;
		specialeffect EF_GUIDEDATTACK,AREA,"Crafting Tools#ko_03";
		setquest 5142;
		mes "[Red Leopard Joe]";
		mes "...and everywhere else. Now let's begin!!";
		close;
	} else if (.@ko_test_03_1 == 1 && .@ko_test_03_2 == 1 && .@ko_test_03_3 == 0 && .@ko_test_03_4 == 0 && .@ko_test_03_5 == 0) {
		callsub L_Weapon,":";
		end;
	} else if (.@ko_test_03_1 == 1 && .@ko_test_03_2 == 0 && (.@ko_test_03_3 == 1 || .@ko_test_03_4 == 1) && .@ko_test_03_5 == 0) {
		callsub L_Weapon,":Yes, I'm done.";
		if (countitem("Ninja_Cutter")) {
			mes "[Red Leopard Joe]";
			mes "Hmm... Interesting... Is it a dagger in a shape of a Kunai?";
			next;
			mes "[Red Leopard Joe]";
		} else if (countitem("Huuma_Job_Test")) {
			mes "[Red Leopard Joe]";
			mes "Hmm... Is this an Ordinary Huuma?";
			next;
			mes "[Red Leopard Joe]";
			mes "Ahh, Its not an Ordinary Huuma.";
		} else {
			mes "[Red Leopard Joe]";
			mes "Ahh, how is it possible? You don't have weapons? Maybe you equipped it?";
			close;
		}
		mes "Very creative. I do see room for improvement but the weapon itself may come out useful after smoothing it out a bit.";
		next;
		mes "[Red Leopard Joe]";
		mes "Good. I think you are ready.";
		next;
		mes "[Red Leopard Joe]";
		mes "Now it's time to upgrade?";
		mes "There are refinement tools on both sides of me. Use those to refine a weapon and come back.";
		next;
		mes "[Red Leopard Joe]";
		mes "I created the refinement tools myself with great effort so you won't have any trouble using them.";
		next;
		setquest 5145;
		mes "[Red Leopard Joe]";
		mes "Ah... But just in case,";
		mes "^FF0000be careful not to cause trouble by showing these to blacksmiths outside of here.^000000";
		close;
	} else if (.@ko_test_03_1 == 1 && .@ko_test_03_2 == 0 && (.@ko_test_03_3 == 1 || .@ko_test_03_4 == 1) && .@ko_test_03_5 == 1) {
		disable_items;
		mes "[Red Leopard Joe]";
		mes "Did you get a successful result?";
		next;
		switch(select("Not yet.", "Here it is.", "Actually...")) {
		case 1:
			mes "[Red Leopard Joe]";
			mes "It isn't easy to get a satisfactory result at first.";
			close;
		case 2:
			break;
		case 3:
			mes "[Red Leopard Joe]";
			mes "You've lost the weapon even with my warning.";
			next;
			mes "[Red Leopard Joe]";
			mes "Nothing else we can do. Wait!";
			next;
			mes "Red Leopard Joe mumbles something and suddenly all weapons are unequipped.";
			next;
			nude;
			if (countitem("Ninja_Cutter") || countitem("Huuma_Job_Test")) {
				mes "[Red Leopard Joe]";
				mes "What is this? You still have the prototype. Stop playing around.";
				close;
			}
			mes "[Red Leopard Joe]";
			mes "Oh! You really lost it.";
			next;
			setquest 5142;
			if (questprogress(5143)) erasequest 5143;
			if (questprogress(5144)) erasequest 5144;
			erasequest 5145;
			mes "[Red Leopard Joe]";
			mes "Well! Lets try to make it again!";
			close;
		}
		mes "[Red Leopard Joe]";
		mes "Looks like you've got some results.";
		next;
		set .@part, EQI_HAND_R;
		if (!getequipisequiped(.@part)) {
			mes "[Red Leopard Joe]";
			mes "Ahh! You have not equipped any weapons!";
			close;
		} else {
			set .@equip_id, getequipid(.@part);
			if (.@equip_id == 13074 || .@equip_id == 13312) {
				mes "[Red Leopard Joe]";
				mes "Is that weapon yours? Let me have a look.";
				next;
			} else {
				mes "[Red Leopard Joe]";
				mes "Are you certain it's that weapon?";
				next;
				mes "[Red Leopard Joe]";
				mes "You plan to trick me with that? Again!!";
				close;
			}
		}
		mes "Joe took a thorough look at the seal.";
		next;
		set .@equip_refine, getequiprefinerycnt(.@part);
		if (.@equip_refine < 7) {
			mes "[Red Leopard Joe]";
			mes "Are you that low?";
			mes "I must have misjudged you. You might have been satisfied yourself but I'm not. Do it again!!";
			close;
		} else if (.@equip_refine > 6 && .@equip_refine < 9) {
			mes "[Red Leopard Joe]";
			mes "Hmm... Is this your limit?";
			mes "You've just made it that close to passing. I will ask one more time, are you satisfied?";
			next;
			if(select("Yes", "No") == 2) {
				mes "[Red Leopard Joe]";
				mes "You're still here. Why?";
				close;
			}
			mes "[Red Leopard Joe]";
			mes "Your competence is enough.";
			next;
		} else if (.@equip_refine > 8 && .@equip_refine < 13) {
			mes "[Red Leopard Joe]";
			mes "Ah, as I expected.";
			mes "I still believe that you will not stop here.";
			next;
			if(select("I want to stop.", "I want to continue.") == 2) {
				mes "[Red Leopard Joe]";
				mes "I will look forward for your result.";
				close;
			}
			mes "[Red Leopard Joe]";
			mes "Your competence is enough.";
			next;
		} else {
			mes "[Red Leopard Joe]";
			mes "Better than expected.";
			next;
			mes "[Red Leopard Joe]";
			mes "For beginners, quite good. This test may not be significant to you, but your competence is enough.";
			next;
		}
		mes "[Red Leopard Joe]";
		mes "I can feel it.";
		mes "I will take this weapon to give it some finishing touches.";
		next;
		delequip .@part;
		erasequest 5145;
		completequest 5138;
		if (questprogress(5143) == 1) completequest 5143;
		if (questprogress(5144) == 1) completequest 5144;
		mes "[Red Leopard Joe]";
		mes "'" + strcharinfo(0) + "'";
		mes "Passed the weapon test!!";
		close2;
		enable_items;
		end;
	} else if (.@ko_test_03_1 == 2 && .@ko_test_03_2 == 0 && (.@ko_test_03_3 == 2 || .@ko_test_03_4 == 2) && .@ko_test_03_5 == 0) {
		mes "[Red Leopard Joe]";
		mes "Oh, I almost forgot.";
		mes "Go report the test results to Gion!";
		close2;
		warp "job_ko",26,104;
		end;
	} else {
		mes "[Red Leopard Joe]";
		mes "You should not have come here...";
		mes "It's my duty to get rid of you.";
		mes "This will push you back!";
		close2;
		warp "amatsu",147,136;
		end;
	}
	end;

L_Weapon:
	mes "[Red Leopard Joe]";
	mes "Are you done making the prototype of the new weapons?";
	next;
	switch(select("Crafting tools?", "I don't have enough materials.", "How do you expect me to make a weapon?" + getarg(0))) {
	case 1:
		specialeffect EF_GUIDEDATTACK,AREA,"Crafting Tools#ko_01";
		mes "[Red Leopard Joe]";
		mes "Feel free to use tools from here, and...";
		next;
		specialeffect EF_GUIDEDATTACK,AREA,"Crafting Tools#ko_02";
		mes "[Red Leopard Joe]";
		mes "...there...";
		next;
		specialeffect EF_GUIDEDATTACK,AREA,"Crafting Tools#ko_03";
		mes "[Red Leopard Joe]";
		mes "...and everywhere else.";
		close;
	case 2:
		mes "[Red Leopard Joe]";
		mes "You haven't brought enough materials?";
		next;
		specialeffect EF_GUIDEDATTACK,AREA,"Drawer#ko";
		mes "[Red Leopard Joe]";
		mes "Then we'll have to pay a visit to the village. Try the ^FF0000drawer^000000 over there. It'll take you to the village.";
		close;
	case 3:
		mes "[Red Leopard Joe]";
		mes "Hmm... Guess I expected too much? Let me explain.";
		next;
		mes "[Red Leopard Joe]";
		mes "You first have to melt the ore to use for the weapon. And the best way to get high purity metal is to melt materials that are of the same kind.";
		next;
		mes "[Red Leopard Joe]";
		mes "For example, Iron Ore, Iron, and Steel are of similar property so you can get a high purity metal out of them.";
		next;
		mes "[Red Leopard Joe]";
		mes "Once you've melted a high purity metal, pour it in a mold to get the shape of the weapon and then make it firm through grinding and tempering.";
		next;
		mes "[Red Leopard Joe]";
		mes "By the way, you will get the best results by thoroughly rotating, grinding and tempering.";
		next;
		mes "[Red Leopard Joe]";
		mes "I think this is enough to get you started, don't you think? Now go and work on that prototype!!";
		close;
	case 4:
		return;
	}
}

job_ko,117,128,0	script	Drawer#ko	CLEAR_NPC,{
	mes "There is some kind of device on the drawer.";
	next;
	if(select("Stop.", "Try to operate it.") == 2) {
		mes "Clank clunk clink";
		close2;
		warp "amatsu",147,136;
		end;
	}
	close;
}

job_ko,131,124,0	script	Crafting Tools#ko_01	CLEAR_NPC,{
	if (MaxWeight - Weight < 1000 || checkweight("Knife",1) == 0) {
		mes "Too heavy! Please reduce your weight.";
		close;
	}
	if (questprogress(5138) == 1 && questprogress(5142) == 1 && questprogress(5143) == 0 && questprogress(5144) == 0 && questprogress(5145) == 0) {
		// fall through
	} else {
		mes "A crafting tool.";
		mes "Don't really need it now.";
		close;
	}
	mes "Tool to create weapons.";
	next;

	// Part 1: Melting Metal
	// Input similar materials to proceed to next step.
	mes "First need to melt metals like iron and iron ore to use to create a weapon.";
	next;
	callsub L_CheckMaterials;
	while(1) {
		switch(select("Melt Iron Ore.", "Melt Iron.", "Melt Steel.", "Melt Phracon.", "Melt Emveretarcon.", "Melt Rough Oridecon.", "Melt Rough Elunium.", "Stop.")) {
			case 1: set .@item,1002; set .@val1,1; break;  //Iron_Ore
			case 2: set .@item, 998; set .@val1,2; break;  //Iron
			case 3: set .@item, 999; set .@val1,3; break;  //Steel
			case 4: set .@item,1010; set .@val2,1; break;  //Phracon
			case 5: set .@item,1011; set .@val2,2; break;  //Emveretarcon
			case 6: set .@item, 756; set .@val2,3; break;  //Oridecon_Stone
			case 7: set .@item, 757; set .@val3,5; break;  //Elunium_Stone
			case 8: close;
		}
		if (countitem(.@item)) {
			delitem .@item,1;
			if (.@val1) {         //Iron Ore, Iron, Steel
				set .@ston_t01, .@ston_t01 + .@val1;
				if (.@ston_t02 > 0)
					set .@ston_t02, .@ston_t02 - .@val1;
			} else if (.@val2) {  //Phracon, Emveretarcon, Rough Oridecon
				set .@ston_t02, .@ston_t02 + .@val2;
				if (.@ston_t01 > 0)
					set .@ston_t01, .@ston_t01 - .@val2;
			} else if (.@val3) {  //Rouch Elunium
				if (.@ston_t01 > 0)
					set .@ston_t01, .@ston_t01 - .@val3;
				if (.@ston_t02 > 0)
					set .@ston_t02, .@ston_t02 - .@val3;
			}
			specialeffect EF_DEMONSTRATION;
			mes "Melted " + getitemname(.@item) + " in high temperature.";
			next;
			if (.@ston_t01 > 49 || .@ston_t02 > 49)
				break;
		} else {
			mes "Don't have " + getitemname(.@item) + ".";
			next;
		}
		callsub L_CheckMaterials;
		mes "Which metal will be melted next?";
		next;
	}
	set .@boll_01, ((.@ston_t01 > 49) ? .@ston_t01 : .@ston_t02);

	// Part 2: Forging
	// Grind and temper a weapon.
	mes "Now the metal is melted to use for creating weapons.";
	next;
	mes "Next is to make the melted metal firm by pouring it into a mold. Which mold shape will you use?";
	next;
	switch(select("Dagger Mold", "Shuriken Mold")) {
	case 1:
		set .@weapon_who,0;
		mes "Poured the melted metal into the dagger mold.";
		break;
	case 2:
		set .@weapon_who,1;
		mes "Poured the melted metal into the shuriken mold.";
		break;
	}
	next;
	progressbar "ffff00",3;
	mes "Looks like the metal is taking shape. Now what next?";
	next;
	set @job_ko_forge,0;
	set @job_ko_lastaction,0;
	callsub L_ForgeWeapon,":";
	while(1) {
		mes "Now what next?";
		next;
		if (callsub(L_ForgeWeapon,":Final Touches") == 0)
			break;
	}
	set .@boll_02, @job_ko_forge;
	set @job_ko_forge,0;
	set @job_ko_lastaction,0;

	// Part 3: Create the Weapon
	// Success rate based on previous two parts.
	set .@boll_00, .@boll_01 + .@boll_02;
	mes "Start to sharpen the tool using a whetstone for finishing touches.";
	next;
	progressbar "ffff00",3;
	set .@success_pp, rand(1,100);
	if (.@boll_00 < 100) {
		if (.@success_pp == 77) set .@success,1;
	} else {
		if (.@success_pp != 44) set .@success,1;
	}
	if (.@success) {
		specialeffect2 EF_PERFECTION;
		erasequest 5142;
		if (.@weapon_who == 0) {
			setquest 5143;
			getitem "Ninja_Cutter", 1;
		} else {
			setquest 5144;
			getitem "Huuma_Job_Test", 1;
		}
		mes "The weapon was created successfully.";
		next;
		mes "Let's take it to Red Leopard Joe.";
		close;
	} else {
		specialeffect2 EF_SUI_EXPLOSION;
		mes "The weapon was destroyed while doing the finishing touches to it.";
		next;
		mes "There must have been something missed while creating the weapon. Very sad this happened but you'll have to start all over again.";
		close;
	}
	end;

L_CheckMaterials:
	if (!countitem("Iron_Ore") && !countitem("Iron") && !countitem("Steel") && !countitem("Phracon") && !countitem("Emveretarcon") && !countitem("Oridecon_Stone") && !countitem("Elunium_Stone")) {
		mes "But you do not have any more metal to melt. Let's try again after getting more metal.";
		close;
	}
	return;

L_ForgeWeapon:
	set .@i, select("Grind the weapon", "Temper the weapon" + getarg(0));
	switch (.@i) {
	case 1:
		specialeffect2 EF_DETOXICATION;
		mes "Ground the weapon.";
		break;
	case 2:
		specialeffect2 EF_REPAIRWEAPON;
		mes "Tempered the weapon.";
		break;
	case 3:
		return 0;
	}
	next;
	if (@job_ko_lastaction == .@i)
		set @job_ko_forge, @job_ko_forge + 1;
	else
		set @job_ko_forge, @job_ko_forge + 2;
	set @job_ko_lastaction, .@i;
	return 1;
}
job_ko,129,129,0	duplicate(Crafting Tools#ko_01)	Crafting Tools#ko_02	CLEAR_NPC
job_ko,116,124,0	duplicate(Crafting Tools#ko_01)	Crafting Tools#ko_03	CLEAR_NPC

job_ko,121,121,0	script	Refinement Tools#ko_01	CLEAR_NPC,{
	if (questprogress(5138) == 1 && questprogress(5142) == 0 && (questprogress(5143) == 1 || questprogress(5144) == 1) && questprogress(5145) == 1) {
		disable_items;
	} else {
		mes "This tool helps you refine your weapons automatically. However, you won't need this just now.";
		close;
	}
	mes "You turn on the refinement tool.";
	mes "The equipment starts up with a pleasant vibration.";
	next;
	mes "Looks like you can use the tool right away for refinement because it holds a good deal of Elunium and Oridecon within it.";
	next;
	if(select("Start refining.", "Do not start refining.") == 2) {
		mes "You turned off the tool.";
		close;
	}
	set .@part, EQI_HAND_R;
	if (!getequipisequiped(.@part)) {
		mes "Bzzzt";
		mes "A warning beep comes from the tool.";
		next;
		mes "[Red Leopard Joe]";
		mes "This equipment does not work without an equipped item to refine.";
		close;
	} else {
		set .@equip_id, getequipid(.@part);
		if (.@equip_id == 13074 || .@equip_id == 13312) {
			mes "Analyzing the weapon.";
			next;
		} else {
			mes "[Red Leopard Joe]";
			mes "Wait... this weapon is not a customized one.";
			next;
			mes "[Red Leopard Joe]";
			mes "Why don't you refine this with those hot-headed blacksmiths out there?";
			close;
		}
	}
	if (!getequipisenableref(.@part)) {
		mes "Bzzzt";
		mes "A warning beep comes from the tool.";
		next;
		mes "[Red Leopard Joe]";
		mes "That weapon cannot be refined. Where did you get it?";
		close;
	}
	set .@equip_refine, getequiprefinerycnt(.@part);
	if (.@equip_refine >= 20) {
		mes "Bzzzt";
		mes "A warning beep comes from the tool.";
		next;
		mes "[Red Leopard Joe]";
		mes "This equipment is perfectly refined. Keep it for yourself!";
		close;
	}
	if (getequippercentrefinery(.@part) < 100) {
		mes "This is very well refined equipment. Do you want to continue? Refine skill decreases by 1 if refinement fails.";
		next;
		if(select("Continue.", "Stop.") == 2) {
			mes "You turned off the tool.";
			close;
		}
	} else {
		mes "Starting to refine.";
		next;
	}
	progressbar "ffff00",1;
	set .@rand, rand(1,100);
	if (.@equip_refine < 5) {          // 0>5 100%
		set .@wlevel_up,1;
	} else if (.@equip_refine == 5) {  // 5>6  40%
		if (.@rand < 41) set .@wlevel_up,1;
	} else if (.@equip_refine == 6) {  // 6>7  30%
		if (.@rand < 31) set .@wlevel_up,1;
	} else if (.@equip_refine == 7) {  // 7>8  20%
		if (.@rand < 21) set .@wlevel_up,1;
	} else if (.@equip_refine == 8) {  // 8>9  10%
		if (.@rand < 11) set .@wlevel_up,1;
	} else if (.@equip_refine == 9) {  // 9>10  5%
		if (.@rand < 6) set .@wlevel_up,1;
	} else {                           // 10>20 2%
		if (.@rand < 3) set .@wlevel_up,1;
	}
	if (.@wlevel_up) {
		successrefitem .@part;
		mes "Succeeded in refining.";
		mes "Turned off the refining tool.";
		close;
	} else {
		downrefitem .@part;
		mes "Failed in refining.";
		mes "Your weapon refinement skill dropped by 1.";
		mes "Turned off the refining tool.";
		close;
	}
	end;
}
job_ko,127,121,0	duplicate(Refinement Tools#ko_01)	Refinement Tools#ko_02	CLEAR_NPC

//== Test of Battle ========================================
job_ko,148,46,4	script	Guide Gion#ko2	4_M_KAGE_OLD,{
	if (MaxWeight - Weight < 2000 || checkweight("Knife",1) == 0) {
		mes "[Guide Gion]";
		mes "You don't need so many things now!";
		close;
	}
	if (job_kagero == 7) {
		cutin "job_ko01",2;
		mes "[Guide Gion]";
		mes "Looks like you haven't taken care of the target yet.";
		next;
		mes "[Guide Gion]";
		mes "I'll tell you once more. The target is the ^FF0000Family Secret^000000.";
		next;
		mes "[Guide Gion]";
		mes "Of course the path will be difficult, so continue searching!";
		close2;
		cutin "",255;
		end;
	} else if (job_kagero == 8) {
		cutin "job_ko02",2;
		mes "[Guide Gion]";
		mes "Looks like you've taken care of the target. Hmm.";
		next;
		if (checkmount()) {
			mes "[Guide Gion]";
			mes "But please get down from your frog. Otherwise I can't continue!";
			close2;
			cutin "",255;
			end;
		}
		if (BaseLevel < 99 || JobLevel < 70) {
			mes "[Guide Gion]";
			mes "How did you get weaker? Come back once you've regained your previous levels.";
			close2;
			cutin "",255;
			end;
		}
		if (SkillPoint != 0) {
			mes "[Guide Gion]";
			mes "Please come back after using all your Skill Points.";
			close2;
			cutin "",255;
			end;
		}
		mapannounce "job_ko","[Gion] Interrupting the Test of Battle.",bc_map;
		cutin "job_ko04",2;
		mes "[Guide Gion]";
		mes "The Test of Battle will be put off for a while. Don't worry because this does not have affect to other tests.";
		next;
		mapannounce "job_ko","[Gion] My Friend " + strcharinfo(0) + " made it to " + ((Sex)?"Kagerou":"Oboro") + " Path. Congratulations!!",bc_map;
		mes "[Guide Gion]";
		mes "My friend " + strcharinfo(0) + " made it to " + ((Sex)?"Kagerou":"Oboro") + " Path. Congratulations!!";
		next;
		cutin "job_ko02",2;
		mes "[Guide Gion]";
		mes "It is pleasant to meet a youth that is walking through a new path.";
		next;
		mes "[Someone's Voice]";
		mes "Wait for a while, Gion.";
		next;
		donpcevent "Cougar#ko2::OnEnable";
		donpcevent "Red Leopard Joe#ko2::OnEnable";
		cutin "job_ko04",2;
		mes "[Guide Gion]";
		mes "I'm sorry I almost forgot about you two. Do you have anything to share with " + strcharinfo(0) + "?";
		next;
		cutin "",255;
		mes "[Cougar]";
		mes "Hmm... Embarrassing... to speak so suddenly...";
		next;
		mes "[Cougar]";
		mes strcharinfo(0) + ", you are now a proud member of our family. Always hold your head high and...";
		next;
		mes "[Cougar]";
		mes "^777777(Gai's voice fades out.)^000000.";
		mes "I'm sorry I strangled you when we first met.";
		next;
		donpcevent "Cougar#ko2::OnDisable";
		mes "[Red Leopard Joe]";
		mes "Puhahaha! Gai is all talk. I know I was know valuable to you than that Gai.";
		next;
		if (questprogress(5143) == 2) {
			set .@item,13075; //Kurenai
			set .@weapon$,"dagger";
		} else {
			set .@item,13311; //Huuma_Shadow
			set .@weapon$,"shuriken";
		}
		mes "[Red Leopard Joe]";
		mes "I did some work on the prototype " + .@weapon$ + " you made.";
		next;
		mes "[Red Leopard Joe]";
		mes getitemname(.@item) + " now shines beautifully with a scarlet glow after I did the finishing touches.";
		next;
		mes "[Red Leopard Joe]";
		mes "I named your weapons on my own but I know you'll like the name.";
		next;
		mes "[Red Leopard Joe]";
		mes "Guide Gion, please continue.";
		next;
		cutin "job_ko01",2;
		donpcevent "Red Leopard Joe#ko2::OnDisable";
		mes "[Guide Gion]";
		mes "I don't have much to add because Gai and Joe said it all.";
		next;
		mes "[Guide Gion]";
		mes "I'm just sorry that the environment of all these tests could have been better for our later generation.";
		next;
		mes "[Guide Gion]";
		mes "You only need to look forward and never turn back.";
		next;
		for (set .@i,5131; .@i<=5146; set .@i,.@i+1)
			if (questprogress(.@i)) erasequest .@i;
		set job_kagero,9;
		getnameditem .@item,strcharinfo(0);
		jobchange (Sex)?Job_Kagerou:Job_Oboro;
		donpcevent "Summon Target#ko::OnEnable";
		mes "[Guide Gion]";
		mes "I hope the blessings of Kagerou, dancing sun and Oboro, misty moonlight will be with you on your journey ahead.";
		close2;
		warp "que_ng",21,71;
		end;
	} else if (job_kagero == 9) {
		cutin "job_ko01",2;
		mes "[Guide Gion]";
		mes "I hope the blessings of Kagerou, dancing sun and Oboro, misty moonlight will be with you on your journey ahead.";
		close2;
		warp "que_ng",21,71;
		end;
	} else {
		cutin "job_ko01",2;
		mes "[Guide Gion]";
		mes "You should not be here. Please leave!";
		close2;
		warp "amatsu",147,136;
		end;
	}
}

job_ko,151,47,4	script	Cougar#ko2	4_M_JOB_ASSASSIN,{
	mes "[Cougar]";
	mes "Congratulation for choosing the road of development!";
	close;
OnInit:
OnDisable:
	disablenpc "Cougar#ko2";
	end;
OnEnable:
	enablenpc "Cougar#ko2";
	end;
}

job_ko,145,47,6	script	Red Leopard Joe#ko2	4_M_JOB_ASSASSIN,{
	mes "[Red Leopard Joe]";
	mes "You have not found the target? Continue searching it.";
	close;
OnInit:
OnDisable:
	disablenpc "Red Leopard Joe#ko2";
	end;
OnEnable:
	enablenpc "Red Leopard Joe#ko2";
	end;
}

job_ko,1,1,4	script	Summon Target#ko	CLEAR_NPC,{
	end;
OnInit:
OnTimer180000:
	donpcevent "Summon Target#ko::OnEnable";
	end;
OnEnable:
	stopnpctimer;
	switch (rand(1,7)) {
		case 1: set .@mob,1002; break;
		case 2: set .@mob,1031; break;
		case 3: set .@mob,1113; break;
		case 4: set .@mob,1063; break;
		case 5: set .@mob,1010; break;
		case 6: set .@mob,1049; break;
		case 7: set .@mob,1050; break;
	}
	areamonster "job_ko",120,30,160,70,"Family Secret",.@mob,1,"Summon Target#ko::OnMyMobDead";
	end;
OnDisable:
	initnpctimer;
	end;
OnMyMobDead:
	if (mobcount("job_ko","Summon Target#ko::OnMyMobDead") < 1) {
		if (job_kagero == 7) {
			donpcevent "Summon Target#ko::OnDisable";
			set job_kagero,8;
		} else
			donpcevent "Summon Target#ko::OnEnable";
	}
	end;
}

job_ko,1,2,4	script	Summon Fake#ko	CLEAR_NPC,{
	end;
OnInit:
	donpcevent "Summon Fake#ko::OnEnable";
	end;
OnEnable:
	areamonster "job_ko",120,30,160,70,"Family's Legacy",1002,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Kagerou's Memory",1002,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Oboro's Memory",1002,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Family's Mistake",1031,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Oboro's Mistake",1031,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Kagerou's Mistake",1031,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Family's Memory",1113,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Oboro's Past",1113,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Kagerou's Past",1113,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Family's Legacy",1063,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Oboro's Legacy",1063,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Kagerou's Legacy",1063,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Family's Mistake",1010,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Oboro's Memory",1010,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Kagerou's Memory",1010,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Family's Past",1049,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Oboro's Mistake",1049,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Kagerou's Mistake",1049,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Family's Memory",1050,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Oboro's Past",1050,5,"Summon Fake#ko::OnMyMobDead";
	areamonster "job_ko",120,30,160,70,"Kagerou's Past",1050,5,"Summon Fake#ko::OnMyMobDead";
	end;
OnDisable:
	killmonster "job_ko","Summon Fake#ko::OnMyMobDead";
	end;
OnMyMobDead:
	if (mobcount("job_ko","Summon Fake#ko::OnMyMobDead") < 100) {
		donpcevent "Summon Fake#ko::OnDisable";
		donpcevent "Summon Fake#ko::OnEnable";
		warp "job_ko",16,113;
	}
	end;
}

//== GM Control Panel ======================================
job_ko,3,1,4	script	Battle Test Control#ko	4_M_KAGE_OLD,{
	callfunc "F_GM_NPC";
	if (callfunc("F_GM_NPC",1854,0) == 1) {
		mes "This is the Battle Test Control NPC.";
		next;
	} else {
		mes "Incorrect password.";
		close;
	}
	switch(select("Summon Target", "Summon Target Disable", "Summon Fake", "Summon Fake Disable")) {
	case 1:
		donpcevent "Summon Target#ko::OnEnable";
		mes "Summon Target activated.";
		break;
	case 2:
		donpcevent "Summon Target#ko::OnDisable";
		mes "Summon Target disabled.";
		break;
	case 3:
		donpcevent "Summon Fake#ko::OnEnable";
		mes "Summon Fake activated.";
		break;
	case 4:
		donpcevent "Summon Fake#ko::OnDisable";
		mes "Summon Fake disabled.";
		break;
	}
	next;
	mes "Control has completed.";
	close;
}

job_ko,4,1,4	script	Guide#ko_helper	4_M_KAGE_OLD,{
	callfunc "F_GM_NPC";
	if (callfunc("F_GM_NPC",1854,0) == 1) {
		mes "This is the Kagerou and Oboro Job Change assistant NPC.";
		next;
	} else {
		mes "Incorrect password.";
		close;
	}
	mes "I can solve any problems in the job change quest.";
	next;
	switch(select("Current Status", "Test Set", "Pre-Transfer", "Initialize")) {
	case 1:
		mes "Variable states (current/maximum)";
		mes "job_kagero (" + job_kagero + "/9)";
		mes "job_kagero_lp (" + job_kagero_lp + "/100)";
		next;
		mes "Quest states (current/maximum)";
		mes "5131 (" + questprogress(5131) + "/1)";
		mes "5132 (" + questprogress(5132) + "/1)";
		mes "5133 (" + questprogress(5133) + "/1)";
		mes "5134 (" + questprogress(5134) + "/1)";
		mes "5135 (" + questprogress(5135) + "/1)";
		mes "5136 (" + questprogress(5136) + "/2)";
		mes "5139 (" + questprogress(5139) + "/1)";
		mes "5137 (" + questprogress(5137) + "/2)";
		mes "5140 (" + questprogress(5140) + "/1)";
		mes "5141 (" + questprogress(5141,PLAYTIME) + "/1)";
		mes "5138 (" + questprogress(5138) + "/2)";
		mes "5142 (" + questprogress(5142) + "/1)";
		mes "5143 (" + questprogress(5143) + "/2)";
		mes "5144 (" + questprogress(5144) + "/2)";
		mes "5145 (" + questprogress(5145) + "/1)";
		mes "5146 (" + questprogress(5146) + "/1)";
		close;
	case 2:
		mes "Which test do you want to set as completed?";
		mes "Three tests must be completed before changing jobs. If you wish to reach a job change state, please select [Pre-Transfer] directly from the previous menu!";
		next;
		switch(select("Complete Test of Knowledge", "Complete Test of Survival", "Complete Test of Weaponry")) {
		case 1:
			set job_kagero,5;
			setquest 5136;
			completequest 5136;
			mes "The Test of Knowledge has been set as complete. I hope you have finished your initialization.";
			break;
		case 2:
			set job_kagero,5;
			set job_kagero_lp,0;
			setquest 5137;
			completequest 5137;
			mes "The Test of Survival has been set as complete. I hope you have finished your initialization.";
			break;
		case 3:
			set job_kagero,5;
			setquest 5138;
			completequest 5138;
			mes "The Test of Weaponry has been set as complete. I hope you have finished your initialization.";
			break;
		}
		close;
	case 3:
		mes "I will change your quest status to Pre-Transfer, but before that...";
		next;
		mes "Please select a weapon.";
		next;
		switch(select("Dagger", "Shuriken")) {
			case 1: set .@quest,5143; break;
			case 2: set .@quest,5144; break;
		}
		setquest 5136;
		completequest 5136;
		setquest 5137;
		completequest 5137;
		setquest 5138;
		completequest 5138;
		setquest .@quest;
		completequest .@quest;
		setquest 5146;
		set job_kagero,8;
		mes "I've set the Pre-Transfer status. Good luck!!";
		close;
	case 4:
		set job_kagero,0;
		set job_kagero_lp,0;
		for (set .@i,5131; .@i<=5146; set .@i,.@i+1)
			if (questprogress(.@i)) erasequest .@i;
		mes "The task of initialization is complete. You can confirm this through the [Current Status] option!";
		close;
	}
	end;
}