summaryrefslogtreecommitdiff
path: root/npc/merchants/refine.txt
blob: b5db207913951fa1e94faf91c17782d1267fdfc9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
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
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
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
//===== rAthena Script ======================================= 
//= Refining NPCs
//===== By: ==================================================
//= Syrus22 (1.1) dafide18 (1.4) Skotlex (1.5)
//===== Current Version: =====================================
//= 3.1
//===== Compatible With: =====================================
//= Any Athena Version
//===== Description: =========================================
//= Refining NPCs and Metal Salesmen.
//===== Additional Comments: =================================
//= 1.0 - by A bunch of people!
//=       Syrus22 - Completely redid the script using functions... also
//=       added the option for auto safe refining and multiple refining.
//= 1.1 - Negative input bug fixed [Lupus]
//= 1.2 - Added additional reparimen in morroc and payon. Added
//=       Christopher the blacksmith in Geffen. Edited some dialogue [kobra_k88]
//= 1.3 - New Payon Locations [Darkchild]
//=       Corrected zeny subtraction thx to jpnmania77.[kobra_k88]
//= 1.3a - Temporary corrected an exploit. Need to check sources
//=        to fully fix bug [Shinigami]
//=        Fixed repairman prices [shadowlady]
//=        Fixed bug that skips requirements thanks to sir_loon [massdriller]
//=        Fixed itemid error thanks to -Vitamin- [massdriller]
//= 1.4 - check again item in refining procedure to avoid
//=        hacker that can change item [dafide18]
//= 1.5 - Fixed crashing due to badly used callfunc's [Skotlex]
//        Lupus, don't rollback this important fix again! >.<
//= 1.5a - Corrected an unneeded callfunc, fixed the anti-bot 
//=       exploit ruining the safe refine loop. [Skotlex]
//= 1.5b - Fixed Spelling mistakes. [Nexon] 
//= 1.6	- Replaced all breaks for ends as per the new script engine [Skotlex]
//= 1.7 - Added Einbroch Refiners (Custom names ^^;) and a duplicated BS Shop. [Poki#3]
//= 1.8 - Added Lighthalzen Refiners (Custom names again ^^;) [Poki#3]
//= 1.8a - Fixed wrong indication thanks to NeoSaro [Lupus]
//= 1.9 - Rewrote repairman, removed the Steel from repair cost [DracoRPG]
//= 2.0 - Fixed missed equppment presence check. Thx2 Coltaro [Lupus]
//= 2.0a - Added weight checks thanks to Neouni [Playtester]
//= 2.0b - Fixed the names of Lighthalzen and Einbroch refiners thanks to Maud_Dib [Kargha]
//= 2.1 - Removed Duplicates [Silent]
//= 2.2 - Changed name from "Emvertacon" to "Emveretarcon". [Samuray22]
//	- Thanks to Barron-Monster.
//= 2.2b - Changed name from "Pharacon" to "Phracon". [Samuray22]
//	- Thanks to Barron-Monster.
//= 2.3 Corrected NPC names to fall within proper restrictions. [L0ne_W0lf]
//= 2.4 Updated Refiner function. cleaner, and less dated. [L0ne_w0lf]
//= 2.5 Rather large update to the refiner and merchants. :D [L0ne_W0lf]
//= 2.6 Fixed a few bugs with creating pure stones. [L0ne_W0lf]
//= 2.7 Refiner function accepts additional paramater. [L0ne_W0lf]
//=     0 = No special features; 1 = new refining features
//=     Updated Repairmen and function. No longer shows menu.
//= 2.7a A couple touch-ups to the repairman function. [L0ne_w0lf]
//= 2.8 Changed the nonexistent variable .@matname$ for getitemname(.@material). (bugreport:2340) [Samuray22]
//= 2.8 Added proper Blacksmith Supplier to Einroch. [L0ne_W0lf]
//=     Updated dated features comment to reflect new usage.
//= 2.8a Small bugfix. (bugreport:2418) [Paradox924X]
//= 2.9 Moved Morroc repairman to Morroc Ruins. [L0ne_W0lf]
//= 3.0 Updated several NPC names and locations. [Xantara]
//		Added WoE map Refiners.
//= 3.1 Added the new refinement & Ore creation NPC's for +11 and above Refinement. [Masao]
//============================================================


//=========================================================
// Christopher: Geffen Blacksmith
//=========================================================
geffen_in,110,172,0	script	Christopher#1	63,{
	mes "[Christopher Guillenrow]";
	mes "Welcome to Christopher's Workshop. Ye can get all yer stuff for forging here. What business";
	mes "brings ye to me?";
	next;
	switch(select("Purchase Anvil:Purchase Forging Item:Purchase Metal:Purify Rough Ores:Cancel")) {
	case 1:
		mes "[Christopher Guillenrow]";
		mes "A better Anvil gives ye a greeeater chance to make better weapons, ye know? But they'll cost ye more zeny. Just get it off yer chest and buy what fits your purposes best, laddy.";
		next;
		switch(select("Anvil - 30,000 zeny:Oridecon Anvil - 120,000 zeny:Golden Anvil - 300,000 zeny:Better Anvil than the others.:Cancel.")) {
		case 1:
			if (Zeny < 30000) {
				mes "[Christopher Guillenrow]";
				mes "I don't think I can let ye have this with the zeny ye have. I can't lose me money because of ye.";
				close;
			}
			getitem 986,1; // Anvil
			set Zeny,Zeny-30000;
			mes "[Christopher Guillenrow]";
			mes "This is the cheapest one, but efficient enough to forge most items. Thank ye fer shopping at me workshop.  Feel free to come anytime, whenever ye need.";
			close;
		case 2:
			if (Zeny < 120000) {
				mes "[Christopher Guillenrow]";
				mes "I don't think I can let ye have this with the zeny ye have. I can't lose me money because of ye.";
				close;
			}
			getitem 987,1; // Oridecon_Anvil
			set Zeny,Zeny-120000;
			mes "[Christopher Guillenrow]";
			mes "Aye, friend ye have an eye for the anvil. This must be the proper anvil for a Blacksmith, eh? Thank ye fer shopping at me workshop.  Feel free to come anytime, whenever ye need.";
			close;
		case 3:
			if (Zeny < 300000) {
				mes "[Christopher Guillenrow]";
				mes "I don't think I can let ye have this with the zeny ye have. I can't lose me money because of ye.";
				close;
			}
			getitem 988,1; // Golden_Anvil
			set Zeny,Zeny-300000;
			mes "[Christopher Guillenrow]";
			mes "This one is the best among all me stuffs in me workshop! With this, ye can rule the Blacksmith world! Thank ye fer shopping at me workshop.  Feel free to come anytime, whenever ye need.";
			close;
		case 4:
			mes "[Christopher Guillenrow]";
			mes "Well, sorry. But I don't have anythin' harder' than the Golden Anvil.";
			next;
			mes "[Christopher Guillenrow]";
			mes "Me thinks 'Ringgel,' the Legendary Anvil Maker would have one. But, I don't think ye can find him, though he be somewhere in this world.";
			close;
		case 5:
			mes "[Christopher Guillenrow]";
			mes "Okay, feel free to come anytime, whenever ye need. Fare ye well.";
			close;
		}
	case 2:
		mes "[Christopher Guillenrow]";
		mes "A respectable blacksmith uses fine tools. Ye can become one o'those with me Stuff. Choose anything ye want.";
		next;
		switch(select("Mini-Furnace - 150 zeny:Iron Hammer - 1000 zeny:Golden Hammer - 3000 zeny:Oridecon Hammer - 5000 zeny:Cancel.")) {
		case 1:
			mes "[Christopher Guillenrow]";
			mes "It's a much needed tool fer refining metal! So, How many do ye wish to buy? If ye want to quit, just type the number '0.'";
			next;
			while(1) {
				input .@input;
				if (.@input == 0) {
					mes "[Christopher Guillenrow]";
					mes "Aye, the deal is canceled. Fare ye well.";
					close;
				}
				else if ((.@input < 0) || (.@input > 500)) {
					mes "[Christopher Guillenrow]";
					mes "Ye can buy 500, er less.";
					next;
				}
				else {
					break;
				}
			}
			set .@sell,.@input * 150;
			if (Zeny < .@sell) {
				mes "[Christopher Guillenrow]";
				mes "I don't think I can let ye have this with the zeny ye have. I can't lose me money because of ye.";
				close;
			}
			if (checkweight(612,.@input) == 0) {
				mes "[Christopher Guillenrow]";
				mes "Ye look like you don't got enough room in yer inventory. Put some stuff into your Kafra Storage, why don't ye?";
				close;
			}
			getitem 612,.@input; // Portable_Furnace
			set Zeny,Zeny-.@sell;
			mes "[Christopher Guillenrow]";
			mes "Thank ye fer shopping at me workshop. Feel free to come anytime, whenever ye need.";
			close;
		case 2:
			if (Zeny < 1000) {
				mes "[Christopher Guillenrow]";
				mes "I don't think I can let ye have this with the zeny ye have. I can't lose me money because of ye.";
				close;
			}
			getitem 613,1; // Iron_Hammer
			set Zeny,Zeny-1000;
			mes "[Christopher Guillenrow]";
			mes "Thank ye fer shopping at me workshop. Feel free to come anytime, whenever ye need.";
			close;
		case 3:
			if (Zeny < 3000) {
				mes "[Christopher Guillenrow]";
				mes "I don't think I can let ye have this with the zeny ye have. I can't lose me money because of ye.";
				close;
			}
			getitem 614,1; // Golden_Hammer
			set Zeny,Zeny-3000;
			mes "[Christopher Guillenrow]";
			mes "Thank ye fer shopping at me workshop. Feel free to come anytime, whenever ye need.";
			close;
		case 4:
			if (Zeny < 5000) {
				mes "[Christopher Guillenrow]";
				mes "I don't think I can let ye have this with the zeny ye have. I can't lose me money because of ye.";
				close;
			}
			getitem 615,1; // Oridecon_Hammer
			set Zeny,Zeny-5000;
			mes "[Christopher Guillenrow]";
			mes "Thank ye fer shopping at me workshop. Feel free to come anytime, whenever ye need.";
			close;
		case 5:
			mes "[Christopher Guillenrow]";
			mes "Feel free to come anytime, whenever ye need. Fare ye well.";
			close;
		}
	case 3:
		mes "[Christopher Guillenrow]";
		mes "I prepare every Metal, and only the high quality ones o'course. Now then, which one do ye need?";
		next;
		switch(select("Phracon - 200z.:Emveretarcon - 1000z.:Cancel.")) {
		case 1:
			mes "[Christopher Guillenrow]";
			mes "So, How many do ye wish to buy? If ye dont want anything, just type the number as '0.'";
			next;
			while(1) {
				input .@input;
				if (.@input == 0) {
					mes "[Christopher Guillenrow]";
					mes "Deal has";
					mes "been canceled.";
					mes "Fare ye well.";
					close;
				}
				else if ((.@input < 0) || (.@input > 500)) {
					mes "[Christopher Guillenrow]";
					mes "Ye can buy 500, er less.";
					next;
				}
				else {
					break;
				}
			}
			set .@sell,.@input * 200;
			if (Zeny < .@sell) {
				mes "[Christopher Guillenrow]";
				mes "Ye don't have enough money. Ye know I can't sell this at a lower price... You know how the wifey nags about Zeny.";
				close;
			}
			if (checkweight(1010,.@input) == 0) {
				mes "[Christopher Guillenrow]";
				mes "Ye look like you don't have the room to carry anythin' new. Why don't ye put some things into Kafra Storage n' come back.";
				close;
			}
			getitem 1010,.@input; // Phracon
			set Zeny,Zeny-.@sell;
			mes "[Christopher Guillenrow]";
			mes "Thank ye fer shopping at me workshop. Feel free to come anytime, whenever ye need.";
			close;
		case 2:
			mes "[Christopher Guillenrow]";
			mes "So, how many do ye wish to buy? If ye dont want anything at all, just type the number as '0.'";
			next;
			while(1) {
				input .@input;
				if (.@input == 0) {
					mes "[Christopher Guillenrow]";
					mes "Deal has";
					mes "been canceled.";
					mes "Fare ye well.";
					close;
				}
				else if ((.@input < 0) || (.@input > 500)) {
					mes "[Christopher Guillenrow]";
					mes "Ye can buy 500, er less.";
					next;
				}
				else {
					break;
				}
			}
			set .@sell,.@input * 1000;
			if (Zeny < .@sell) {
				mes "[Christopher Guillenrow]";
				mes "I don't think I can let ye have this with the zeny ye have. I can't lose me money because of ye.";
				close;
			}
			if (checkweight(1011,.@input) == 0) {
				mes "[Christopher Guillenrow]";
				mes "Me friend... Seems to me ye don't have Inventory space. Why doncha put some things into Kafra Storage first?";
				close;
			}
			getitem 1011,.@input; // Emveretarcon
			set Zeny,Zeny-.@sell;
			mes "[Christopher Guillenrow]";
			mes "Thank ye fer shopping at me workshop. Feel free to come anytime, whenever ye need, whenever ye want.";
			close;
		case 3:
			mes "[Christopher Guillenrow]";
			mes "Feel free to come anytime, whenever ye need. Fare ye well.";
			close;
		}
	case 4:
		mes "[Christopher Guillenrow]";
		mes "I can purify yer Oridecon and Elunium. I make a refined Ore out of 5 o'each rough ones. Well... Which one do ye want to make?";
		next;
		switch(select("Make Oridecon:Make Elunium:Cancel.")) {
		case 1:
			if (countitem(756) < 5) {
				mes "[Christopher Guillenrow]";
				mes "I told ye, I need 5 o'the rough Oridecons fer one Oridecon.";
				close;
			}
			else {
				delitem 756,5;  //Oridecon_Stone
				getitem 984,1; // Oridecon
				mes "[Christopher Guillenrow]";
				mes "Here's an Oridecon fer ye. Ye will be always welcome here, I'll be waitin' for ye.";
				close;
			}
		case 2:
			if (countitem(757) < 5) {
				mes "[Christopher Guillenrow]";
				mes "I told ye, I need 5 rough Eluniums fer one Elunium.";
				close;
			}
			else {
				delitem 757,5;  //Elunium_Stone
				getitem 985,1; // Elunium
				mes "[Christopher Guillenrow]";
				mes "Arrr, here's yer Elunium. Yer business is always welcome here, so feel free to come again.";
				close;
			}
		case 3:
			mes "[Christopher Guillenrow]";
			mes "Feel free to come anytime, whenever ye need. Fare ye well.";
			close;
		}
	case 5:
		mes "[Christopher Guillenrow]";
		mes "Feel free to come anytime, whenever ye need and whenever ye want. Fare ye well.";
		close;
	}
}

//=========================================================
// Paul Spanner: Einbroch Blacksmith Supplier
//=========================================================
ein_in01,38,29,0	script	Paul Spanner	63,{
	if (checkweight(1201,1) == 0) {
		mes "- Wait a minute !! -";
		mes "- Currently you're carrying -";
		mes "- too many items with you. -";
		mes "- Please try again -";
		mes "- after you loose some weight. -";
		close;
	}
	mes "[Paul Spanner]";
	mes "Welcome, my friend.";
	mes "In my shop, you will find everything that you need in forging.";
	mes "Tell me what you need.";
	next;
	switch(select("Purchase Anvil.:Purchase Forging Items.:Purchase Metal.:Process Ores.:Quit.")) {
	case 1:
		mes "[Paul Spanner]";
		mes "Anvil is the most necessary item for Blacksmiths.";
		mes "Since you will use an Anvil more than once, you'd better buy a nice one.";
		next;
		switch(select("Anvil - 30,000z.:Oridecon Anvil - 120,000z.:Golden Anvil - 300,000z.:I need a better anvil.:Cancel.")) {
		case 1:
			if (zeny < 30000) {
				mes "[Paul Spanner]";
				mes "With that much of money, you cannot even buy a toy anvil!";
				close;
			}
			getitem 986,1; //Anvil
			set zeny,zeny-30000;
			mes "[Paul Spanner]";
			mes "It is the cheapest anvil which has the most basic ability.";
			mes "Thank you for using my shop. If you need anything, just let me know.";
			close;
		case 2:
			if (zeny < 120000) {
				mes "[Paul Spanner]";
				mes "With that much of money, you cannot even buy a toy anvil!";
				close;
			}
			getitem 987,1; //Oridecon_Anvil
			set zeny,zeny-120000;
			mes "[Paul Spanner]";
			mes "Ah, you have an eye for anvil. A Blacksmith needs an anvil at least as good as this.";
			mes "Thank you for using my shop. If you need anything, just let me know.";
			close;
		case 3:
			if (zeny < 300000) {
				mes "[Paul Spanner]";
				mes "With that much of money, you cannot even buy a toy anvil!";
				close;
			}
			getitem 988,1; //Golden_Anvil
			set zeny,zeny-300000;
			mes "[Paul Spanner]";
			mes "I can tell your ambition to become a good Blacksmith just by looking at you to choose this Golden Anvil!";
			mes "This anvil will surely aid you in creating the best weapons.";
			close;
		case 4:
			mes "[Paul Spanner]";
			mes "I am sorry, but I do not sell better anvils than Golden Anvil.";
			mes "Unless you find the legendary anvil of 'Linggell', I don't think that you could find better one than Golden Anvil in any other places.";
			close;
		case 5:
			mes "[Paul Spanner]";
			mes "If you need anything, just let me know.";
			close;
		}
	case 2:
		mes "[Paul Spanner]";
		mes "You need various materials to process ores and to forge weapons.";
		mes "I have everything that you need. Take a look.";
		next;
		switch(select("Mini Furnace - 150z.:Iron Hammer - 1,000z.:Golden Hammer - 3,000z.:Oridecon Hammer - 5,000z.:Cancel.")) {
		case 1:
			set .@item,612;
			set .@item_cost,150;
			set .@item_weight,200;
			mes "[Paul Spanner]";
			mes "You definately need this furnce to process ores!";
			next;
			break;
		case 2:
			set .@item,613;
			set .@item_cost,1000;
			set .@item_weight,200;
			break;
		case 3:
			set .@item,614;
			set .@item_cost,3000;
			set .@item_weight,300;
			break;
		case 4:
			set .@item,615;
			set .@item_cost,5000;
			set .@item_weight,400;
			break;
		case 5:
			mes "[Paul Spanner]";
			mes "If you need anything, just let me know.";
			close;
		}
		mes "[Paul Spanner]";
		mes "So, how many do you need? If you want to cancel the trade, enter '0'.";
		next;
		while(1) {
			input .@input;
			if (.@input == 0) {
				mes "[Paul Spanner]";
				mes "You have canceled the trade. If you need anything, just let me know.";
				close;
			}
			else if ((.@input < 0) || (.@input > 500)) {
				mes "[Paul Spanner]";
				mes "You can only buy 500 or less at a time.";
				next;
			}
			else {
				break;
			}
		}
		set .@sell,.@input * .@item_cost;
		if (zeny < .@sell) {
			mes "[Paul Spanner]";
			mes "You don't have enough money. Sorry, I cannot sell them at a loss.";
			close;
		}
		if (checkweight(.@item,.@input) == 0) {
			mes "[Paul Spanner]";
			mes "Hey, you look pale. Why don't you go lighten your weight first.";
			close;
		}
		set zeny,zeny-.@sell;
		getitem .@item,.@input;
		mes "[Paul Spanner]";
		mes "Thank you for using my shop. If you need anything, just let me know.";
		close;
	case 3:
		mes "[Paul Spanner]";
		mes "I have high quality metal.";
		mes "So, which metal would you like to buy?";
		next;
		switch(select("Phracon - 200z.:Emveretarcon - 1,000z.:Quit.")) {
		case 1:
			set .@item,1010;
			set .@item_price,200;
			break;
		case 2:
			set .@item,1011;
			set .@item_price,1000;
			break;
		case 3:
			mes "[Paul Spanner]";
			mes "If you need anything, just let me know.";
			close;
		}
		mes "[Paul Spanner]";
		mes "So, how many of them do you need? If you want to cancel the trade, enter '0'.";
		next;
		while(1) {
			input .@input;
			if (.@input == 0) {
				mes "[Paul Spanner]";
				mes "The trade has been canceled. If you need anything, just let me know.";
				close;
			}
			else if ((.@input < 0) || (.@input > 500)) {
				mes "[Paul Spanner]";
				mes "You can buy 500 or less at a time.";
				next;
			}
			else {
				break;
			}
		}
		set .@sell,.@input * .@item_price;
		if (zeny < .@sell) {
			mes "[Paul Spanner]";
			mes "You don't have enough money. Sorry, I cannot sell them at a loss.";
			close;
		}
		if (checkweight(.@item,.@input) == 0) {
			mes "[Paul Spanner]";
			mes "Hey, you look pale. Why don't you go lighten your weight first?";
			close;
		}
		getitem .@item,.@input;
		set zeny,zeny-.@sell;
		mes "[Paul Spanner]";
		mes "Thank you for using my shop. If you need anything, just let me know.";
		close;
	case 4:
		mes "[Paul Spanner]";
		mes "I can process Oridecon and Elunium for you.";
		mes "You need 5 ores to process them into one Oridecon or Elunium.";
		mes "So, which one do you want to process?";
		switch(select("Oridecon:Elunium:Quit.")) {
		case 1:
			if (countitem(756) < 5) {
				mes "[Paul Spanner]";
				mes "You need 5 ores to process them into one pure Oridecon.";
				close;
			}
			else {
				delitem 756,5; //Oridecon_Stone
				getitem 984,1; //Oridecon
				mes "[Paul Spanner]";
				mes "There you go. Thank you for using my service.";
				close;
			}
		case 2:
			if (countitem(757) < 5) {
				mes "[Paul Spanner]";
				mes "You need 5 ores to process them into one pure Elunium.";
				close;
			}
			else {
				delitem 757,5; //Elunium_Stone
				getitem 985,1; //Elunium
				mes "[Paul Spanner]";
				mes "There you go. Thank you for using my service.";
				close;
			}
		case 3:
			mes "[Paul Spanner]";
			mes "If you need anything, just let me know.";
			close;
		}
	case 5:
		mes "[Paul Spanner]";
		mes "If you need anything, just let me know.";
		close;
	}
}

//=====================================================================================
// Weapon/Armor Refiners
//=====================================================================================
prt_in,63,60,0	script	Hollgrehenn	85,{
	callfunc "refinemain","Hollgrehenn",0;
	end;
}
morocc_in,73,38,6	script	Aragham	99,{
	callfunc "refinemain","Aragham",0;
	end;
}
payon,144,173,5	script	Antonio	88,{
	callfunc "refinemain","Antonio",0;
	end;
}
alberta_in,28,58,0	script	Fredrik	85,{
	callfunc "refinemain","Fredrik",0;
	end;
}
yuno_in01,171,21,4	script	Lambert	88,{
	callfunc "refinemain","Lambert",0;
	end;
}
ein_in01,24,87,5	script	Manthasman	826,{
	callfunc "refinemain","Manthasman Pruhag",0;
	end;
}
lhz_in02,282,20,7	script	Fulerr	869,{
	callfunc "refinemain","Fulerr",0;
	end;
}

//============================================================
//= Main Refiner Function
//============================================================
//= To allow auto safe refining/multiple refining set the
//= second argument to '1' in the function call.
//= If you enable this function make sure you set the appropiate +x Level in your refine_db.txt
//= to 100 and adjust the .@safe Value in the Script to your desired max. Safe Level.
//= Otherwise it won't work .
//============================================================
function	script	refinemain	{
	set .@features,getarg(1);
	mes "[" + getarg(0) + "]";
	mes "I'm the Armsmith.";
	mes "I can refine all kinds of weapons, armor and equipment, so let me";
	mes "know what you want me to refine.";
	next;

	setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
	set .@menu$,"";
	for( set .@i,1; .@i <= 10; set .@i,.@i+1 )
	{
		if( getequipisequiped(.@i) )
			set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";

		set .@menu$, .@menu$ + ":";
	}
	set .@part,select(.@menu$);
	if(!getequipisequiped(.@part)) {
		mes "[" + getarg(0) + "]";
		mes "You're not wearing";
		mes "anything there that";
		mes "I can refine.";
		emotion 6;
		close;
	}
	//Check if the item is refinable...
	if(!getequipisenableref(.@part)) {
		mes "[" + getarg(0) + "]";
		mes "I don't think I can";
		mes "refine this item at all...";
		close;
	}
	//Check if the item is identified... (Don't know why this is in here... but kept it anyway)
	if(!getequipisidentify(.@part)) {
		mes "[" + getarg(0) + "]";
		mes "You can't refine this";
		mes "if you haven't appraised";
		mes "it first. Make sure your";
		mes "stuff is identified before";
		mes "I can refine it.";
		close;
	}
	//Check to see if the items is already +10
	if(getequiprefinerycnt(.@part) >= 10) {
		mes "[" + getarg(0) + "]";
		mes "I can't refine this";
		mes "any more. This is as";
		mes "refined as it gets!";
		close;
	}
	set .@refineitemid, getequipid(.@part); // save id of the item
	set .@refinerycnt, getequiprefinerycnt(.@part); //save refinery count
	switch(getequipweaponlv(.@part)){
	case 0: 	//Refine Armor
		set .@price,2000;
		set .@material,985;
		set .@safe,4;
		break;
	case 1: 	//Refine Level 1 Weapon
		set .@price,50;
		set .@material,1010;
		set .@safe,7; 
		break;
	case 2: 	//Refine Level 2 Weapon
		set .@price,200;
		set .@material,1011;
		set .@safe,6; 
		break;
	case 3: 	//Refine Level 3 Weapon
		set .@price,5000;
		set .@material,984;
		set .@safe,5; 
		break;
	case 4: 	//Refine Level 4 Weapon
		set .@price,20000;
		set .@material,984;
		set .@safe,4; 
		break;
	case 5: 	//Refine other stuff?
		set .@price,2000;
		set .@material,985;
		set .@safe,4; 
		break;
	}
	if(.@features != 1) {
		mes "[" + getarg(0) + "]";
		mes "To refine this I need";
		mes "one ^003366"+getitemname(.@material)+"^000000 and";
		mes "a service fee of " + .@price + " Zeny.";
		mes "Do you really wish to continue?";
		next;
		if(select("Yes:No") == 2){
			mes "[" + getarg(0) + "]";
			mes "Yeah...";
			mes "There's no need to";
			mes "rush. Take your time.";
			close;
		}
		if(getequippercentrefinery(.@part) < 100) {
			mes "[" + getarg(0) + "]";
			mes "Oh no! If I continue to";
			mes "refine this, there's a risk it could";
			switch(.@material) {
			case 985:
				mes "be destroyed! That means that ^FF0000this equipment^000000, and ^FF0000any cards^000000 or special properties added to this armor, ^FF0000will be gone^000000.";
				break;
			default:
				mes "be destroyed, and you'd ^FF0000lose the weapon^000000, any ^FF0000cards in the weapon^000000,";
				mes "or any added special properties.";
				break;
			}
			next;
			mes "["+getarg(0)+"]";
			mes "I can't make it any clearer.";
			mes "Once a weapon is destroyed,";
			mes "there's no getting it back.";
			mes "You really have a chance to";
			mes "^FF0000lose this weapon^000000 forever.";
			mes "Do you still want to refine?";
			next;
			if(select("Yes:No") == 2){
				mes "[" + getarg(0) + "]";
				mes "I completely agree...";
				mes "I might be a great refiner, but sometimes even I make mistakes.";
				close;
			}
		}
		if((countitem(.@material) < 1) || (Zeny < .@price)) {
			mes "[" + getarg(0) + "]";
			mes "You don't seem to have";
			mes "enough Zeny or "+getitemname(.@material)+"...";
			mes "Go get some more. I'll be";
			mes "here all day if you need me.";
			close;
		}
		set Zeny,Zeny-.@price;
		delitem .@material,1;
		if(getequipisequiped(.@part) == 0) { // hacker has removed the item (not changed, why?)
			mes "[" + getarg(0) + "]";
			mes "Look here... you don't have any Items on...";
			close;
		}
		if(getequiprefinerycnt(.@part) != .@refinerycnt || getequipid(.@part) != .@refineitemid) { // hacker has changed the item
			mes "[" + getarg(0) + "]";
			Emotion e_an;
			mes "Wait a second...";
			mes "Do you think I'm stupid?!";
			mes "You switched the item while I wasn't looking! Get out of here!";
			close;
		}
		if(getequippercentrefinery(.@part) <= rand(100)) {
			failedrefitem .@part;
			mes "[" + getarg(0) + "]";
			set .@emo,rand(1,5);
			if (.@emo == 1) {
				Emotion e_cash;
			} else {
				Emotion e_swt;
			}
			set .@lose,rand(1,3);
			if (.@lose == 1) {
				mes "OH! MY GOD!";
				mes "Damn it! Not again!";
				mes "I'm terribly sorry, but you know practice does make perfect.";
				mes "Um, right? Heh heh...";
			} else if(.@lose == 2) {
				mes "Nooooooo!";
				mes "It broke!";
				mes "I-I'm sorry!";
			} else {
				mes "Crap!";
				mes "It couldn't take";
				mes "much more tempering!";
				mes "Sorry about this...";
			}
			close;
		}
		mes "["+getarg(0)+"]";
		successrefitem .@part;
		Emotion e_heh;
		set .@win,rand(1,3);
		if (.@win == 1) {
			mes "Perfect!";
			mes "Heh heh!";
			mes "Once again,";
			mes "flawless work";
			mes "from the master~";
		} else if(.@win == 2) {
			mes "Success...!";
			mes "Yet again, my amazing";
			mes "talent truly dazzles";
			mes "and shines today.";
		} else {
			mes "Heh heh!";
			mes "I'm all done.";
			mes "No doubt, my work is";
			mes "to your satisfaction.";
			mes "Sheer, utter perfection~";
		}
		close;
	}

// New Refining Functions ========================
	if(getequiprefinerycnt(.@part) < .@safe) {
		mes "[" + getarg(0) + "]";
		mes "I can refine this to the safe limit or a desired number of times... it's your choice...";
		next;
		set .@menu2,select("To the safe limit please.","I'll decide how many times.","I've changed my mind...");
	} else set .@menu2,2;
	switch(.@menu2){
	case 1: 
		set .@refinecnt,.@safe - getequiprefinerycnt(.@part);
		break;
	case 2:
		next;
		mes "[" + getarg(0) + "]";
		mes "So how many times would you like me to refine your item?";
		next;
		input .@refinecnt;
		set .@refinecheck,.@refinecnt + getequiprefinerycnt(.@part);
		if (.@refinecnt < 1 || .@refinecheck > 10) {
			mes "[" + getarg(0) + "]";
			mes "I can't refine this item that many times.";
			close;
		}
		if(.@refinecheck > .@safe) {
			set .@refinecheck,.@refinecheck - .@safe;
			mes "[" + getarg(0) + "]";
			mes "This will try to refine the equipment " + .@refinecheck + " times past the safe limit. Your equipment may be destroyed... is that ok?";
			next;
			if(select("Yes...","No...") == 2){
				mes "[" + getarg(0) + "]";
				mes "You said so..Hmm so be it...";
				close;
			}
		}
		break;
	case 3:
		next;
		mes "[" + getarg(0) + "]";
		mes "You said so..Hmm so be it...";
		close;
	}
	set .@fullprice,.@price * .@refinecnt;
	mes "[" + getarg(0) + "]";
	mes "That will cost you " + .@refinecnt + " " + getitemname(.@material) + " and " + .@fullprice + " Zeny. Is that ok?";
	next;
	if(select("Yes","No...") == 2){
		mes "[" + getarg(0) + "]";
		mes "You said so..Hmm so be it...";
		close;
	}
	if(countitem(.@material) < .@refinecnt || Zeny < .@fullprice) {
		mes "[" + getarg(0) + "]";
		mes "Is that all you got? Unfortunately I can't work for you at a lower price. Try putting yourself in my shoes.";
		close;
	}
	set Zeny,Zeny - .@fullprice;
	delitem .@material,.@refinecnt;
	while(.@refinecnt){
		if (getequipisequiped(.@part) == 0) {
			mes "[" + getarg(0) + "]";
			mes "Look here... you don't have any Items on...";
			close;
		}
		if (getequipid(.@part) != .@refineitemid || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) {
			mes "[" + getarg(0) + "]";
			mes "Clan... No, but Did you imagine I could be so stupid !?!";
			mes "You have changed it...";
			mes "Go out before I stun you with my Hammer!!!";
			close;
		} 
		mes "Clang, clang!!!";
		if(.@menu2 == 2 && getequippercentrefinery(.@part) <= rand(100)) {
			failedrefitem .@part;
			emotion 23;
			mes "[" + getarg(0) + "]";
			mes "WAHHHH!!! I'm so sorry... I warned you this could happen...";
			set .@refinecnt,.@refinecnt - 1;
			if(.@refinecnt == 0) close;
			mes "Here's the unused Zeny and Material back...";
			getitem .@material,.@refinecnt;
			set .@fullprice,.@refinecnt * .@price;
			set Zeny,Zeny + .@fullprice;
			close;
		}
		successrefitem .@part;
		emotion 21;
		set .@refinecnt,.@refinecnt - 1;
		next;
	}
	mes "[" + getarg(0) + "]";
	mes "All finished... Come again soon.";
	close;
}



//==============================================================================
// Material Salesmen
//==============================================================================
prt_in,56,68,5	script	Vurewell	86,{
	callfunc "phramain","Vurewell";
	end;
}
payon,145,178,3	script	Begnahd	88,{
	callfunc "phramain","Begnahd";
	end;
}
morocc_in,63,32,6	script	Sade	99,{
	callfunc "phramain","Sade";
	end;
}
alberta_in,13,71,3	script	Kahlamanlith	86,{
	callfunc "phramain","Kahlamanlith";
	end;
}
yuno_in01,171,27,4	script	Dilemma	88,{
	callfunc "phramain","Dilemma";
	end;
}
ein_in01,15,87,3	script	Tirehaus	86,{
	callfunc "phramain","Tirehaus";
	end;
}
lhz_in02,278,24,3	script	Krugg	86,{
	callfunc "phramain","Krugg";
	end;
}

//============================================================
//= Material Salesmen Functions
//============================================================
function	script	phramain	{
	if (checkweight(1201,1) == 0) {
		mes "- Wait a minute !! -";
		mes "- Currently you're carrying -";
		mes "- too many items with you. -";
		mes "- Please try again -";
		mes "- after you loose some weight. -";
		close;
	}
	mes "[" + getarg(0) + "]";
	mes "I sell 2 kinds of Metal";
	mes "for tempering weaponry.";
	mes "I have ^007777Phracon^000000 for Level 1";
	mes "Weapons, and ^007777Emveretarcon^000000";
	mes "for Level 2 Weapons.";
	next;
	switch(select("Phracon - 200 Zeny:Emveretarcon - 1000 Zeny:Ask about other Metals")) {
	case 1:
		set .@material,1010;
		set .@price,200;
		break;
	case 2:
		set .@material,1011;
		set .@price,1000;
		break;
	case 3:
		mes "[" + getarg(0) + "]";
		mes "Other metals?";
		mes "Well, you'll need special metals to upgrade higher level weapons, or any kind of armor. But you know, Oridecon and Elunium is really";
		mes "hard to just find...";
		close;
	}
	mes "[" + getarg(0) + "]";
	mes "So how many do you wish to buy?";
	mes "If you don't want any, please enter the number, '0.'";
	next;
	while(1) {
		input .@input;
		if (.@input == 0) {
			mes "[" + getarg(0) + "]";
			mes "The deal has";
			mes "been cancelled.";
			close;
		}
		else if (.@input < 0 || .@input > 500) {
			mes "[" + getarg(0) + "]";
			mes "Alright, you can";
			mes "puchase up to 500.";
			mes "No more than that,";
			mes "got it? Good.";
			next;
		}
		else {
			break;
		}
	}
	set .@sell,.@input * .@price;
	if (Zeny < .@sell) {
		mes "[" + getarg(0) + "]";
		mes "Err...";
		mes "You don't have";
		mes "enough Zeny to buy";
		mes ""+ .@input +" of them.";
		close;
	}
	if (checkweight(.@material,.@input) == 0) {
		mes "[" + getarg(0) + "]";
		mes "Hmm...";
		mes "I can't give you anything if you don't have enough room in your inventory. Why don't you put your extra things in Kafra Storage and try again?";
		close;
	}
	getitem .@material,.@input;
	set Zeny,Zeny-.@sell;
	mes "[" + getarg(0) + "]";
	mes "Here you are!";
	mes "Thank you for";
	mes "your patronage.";
	close;
}



//==============================================================================
// Ori/Elu Refiners
//==============================================================================
prt_in,63,69,3	script	Dietrich	84,{
	callfunc "orimain","Dietrich";
	end;
}
payon,137,178,5	script	Hakhim	88,{
	callfunc "orimain","Hakhim";
	end;
}
morocc_in,72,32,6	script	Abdula	99,{
	callfunc "orimain","Abdula";
	end;
}
alberta_in,21,63,5	script	Xenophon	84,{
	callfunc "orimain","Xenophon Zolotas";
	end;
}
yuno_in01,164,27,4	script	Delight	88,{
	callfunc "orimain","Delight";
	end;
}
ein_in01,18,82,6	script	Matestein	84,{
	callfunc "orimain","Matestein";
	end;
}
lhz_in02,281,24,5	script	Fruel	84,{
	callfunc "orimain","Fruel";
	end;
}

//============================================================
//= Ori/Elu Functions
//============================================================
function	script	orimain	{
	if (checkweight(1201,1) == 0) {
		mes "- Wait a minute !! -";
		mes "- Currently you're carrying -";
		mes "- too many items with you. -";
		mes "- Please try again -";
		mes "- after you loose some weight. -";
		close;
	}
	mes "[" + getarg(0) + "]";
	mes "I can purify your";
	mes "Rough Oridecons or";
	mes "Rough Eluniums. I'll need";
	mes "5 Rough Stones to make";
	mes "1 pure one for you.";
	next;
	switch(select("Make Oridecon:Make Elunium:Ask about Enchanted Stones")) {
	case 1:
		if (countitem(756) > 4) {
			delitem 756,5;  //Oridecon_Stone
			getitem 984,1; // Oridecon
			mes "[" + getarg(0) + "]";
			mes "Here's your Oridecon.";
			mes "You're welcome to come";
			mes "back whenever you want.";
			close;
		}
		else {
			mes "[" + getarg(0) + "]";
			mes "You're kidding me, right?";
			mes "I just told you that I need 5 Rough Oridecons to make a pure Oridecon.";
			close;
		}
	case 2:
		if (countitem(757) > 4) {
			delitem 757,5;  //Elunium_Stone
			getitem 985,1; // Elunium
			mes "[" + getarg(0) + "]";
			mes "Here's your Elunium.";
			mes "You're welcome to come";
			mes "back whenever you want.";
			close;
		}
		else {
			mes "[" + getarg(0) + "]";
			mes "You're kidding me, right?";
			mes "I just told you that I need 5 Rough Eluniums to make a pure Elunium.";
			close;
		}
	case 3:
		mes "[" + getarg(0) + "]";
		mes "Enchanted Stones...?";
		mes "I've been a stonesmith for 20 years, so I've heard a lot about them. Supposedly, there are";
		mes "four different kinds.";
		next;
		mes "[" + getarg(0) + "]";
		mes "Each Enchanted Stone possesses one of the following elemental properties: Earth, Wind, Water and Fire.";
		next;
		mes "[" + getarg(0) + "]";
		mes "If someone combines a Enchanted Stone with a weapon while smithing, that weapon will possess the same property as the Stone.";
		next;
		mes "[" + getarg(0) + "]";
		mes "Needless to say, you need to have some smithing skill to produce this kind of elemental weapon.";
		close;
	}
}



//=====================================================================================
// Equipment Repairmen
//=====================================================================================
alberta_in,31,65,4	script	Repairman#alb	86,{
	callfunc "repairmain","Repairman";
	end;
}

moc_ruins,107,94,4	script	Repairman#moc	99,{
	callfunc "repairmain","Repairman";
	end;
}

payon,143,165,4	script	Repairman#pay	88,{
	callfunc "repairmain","Repairman";
	end;
}

prt_in,63,54,2	script	Repairman#prt	86,{
	callfunc "repairmain","Grendal";
	end;
}

yuno_in01,175,28,3	script	Repairman#juno	86,{
	callfunc "repairmain","Repairman";
	end;
}

geffen_in,34,166,3	script	Repairman#gef	99,{
	callfunc "repairmain","Repairman";
	end;
}

aldeba_in,38,60,3	script	Repairman#alde	86,{
	callfunc "repairmain","Repairman";
	end;
}

lhz_in02,284,14,3	script	Repairman#lhz	86,{
	callfunc "repairmain","Repairman";
	end;
}

prt_gld,139,117,4	script	Repairman#prt_gld	86,{
	callfunc "repairmain","Repairman";
	end;
}

gef_fild13,263,117,4	script	Repairman#gef_fild	86,{
	callfunc "repairmain","Repairman";
	end;
}

pay_gld,295,183,4	script	Repairman#pay_gld	86,{
	callfunc "repairmain","Repairman";
	end;
}

alde_gld,220,152,4	script	Repairman#alde_gld	86,{
	callfunc "repairmain","Repairman";
	end;
}

aru_gld,189,336,4	script	Repairman#aru_gld	86,{
	callfunc "repairmain","Repairman";
	end;
}

sch_gld,340,80,7	script	Repairman#sch_gld	86,{
	callfunc "repairmain","Repairman";
	end;
}

//============================================================
//= Equipment Repair Function
//============================================================
function	script	repairmain	{
	set .@repairprice,5000;
	mes "["+getarg(0)+"]";
	mes "Hey there!";
	mes "Do you want me";
	mes "to repair any items?";
	mes "You can count on me";
	mes "for item repairs!";
	next;
	switch(select("Actually, I do have some items...:None at the moment.")) {
	case 1:
		set .@checkitem,1;
		while (1) {
			if (getbrokenid(.@checkitem) == 0) {
				break;
			}
			set .@checkitem,.@checkitem+1;
		}
		set .@checkitem,.@checkitem-1;
		if (!.@checkitem) {
			mes "["+getarg(0)+"]";
			mes "Oh wow, this is incredible!";
			mes "You must take very good care of your things. None of your items are damaged!";
			next;
			mes "["+getarg(0)+"]";
			mes "If everyone is like you, I'm going to be unemployed!! Haha~!";
			close;
		}
		mes "["+getarg(0)+"]";
		mes "Hmm...";
		mes "Let's see...";
		mes "Out of all your items,";
		mes "" + .@checkitem + " are damaged.";
		mes "Would you like to repair?";
		next;
		set .@totalcost,.@repairprice*.@checkitem;
		mes "["+getarg(0)+"]";
		mes "Each repair costs " + .@repairprice + " Zeny. So to repair all your damaged items would cost " + .@totalcost + " Zeny! Would you like to repair the items?";
		next;
		switch(select("Yes:No")) {
		case 1:
			if (Zeny < .@totalcost) {
				mes "["+getarg(0)+"]";
				mes "Whoa whoa...";
				mes "Check your wallet before you receive the repair bill! I can't repair anything because you don't have enough Zeny.";
				close;
			}
			set .@checkitem2,1;
			while (1) {
				if (getbrokenid(.@checkitem2) == 0) {
					break;
				}
				set .@checkitem2,.@checkitem2+1;
			}
			set .@checkitem2,.@checkitem2-1;
			if (.@checkitem == .@checkitem2) {
				set zeny,zeny-.@totalcost;
				while (.@checkitem) {
					repair(.@checkitem);
					set .@checkitem,.@checkitem-1;
				}
				mes "["+getarg(0)+"]";
				mes "Okay! All done. Now, try to be a little more careful. Items have lives too you know.";
				close;
			}
			else {
				mes "["+getarg(0)+"]";
				mes "Mmm? Something's wrong. Wait... Equip the items you need to repair and then come back to me.";
				close;
			}
		case 2:
			mes "["+getarg(0)+"]";
			mes "Well, it's no skin off my nose, but it's not good to leave items damaged. You should get them repaired as soon as possible!";
			close;
		}
	case 2:
		mes "["+getarg(0)+"]";
		mes "Hohoho...";
		mes "You don't have";
		mes "any business with me";
		mes "if you don't have any";
		mes "items to repair.";
		close;
	}
}

//=====================================================================================
// +11 and above Weapon/Armor Refiners
//=====================================================================================
prt_in,90,72,5	script	Bestry#prt	826,{
	callfunc "refinenew","Bestry",0,0;
	end;
}
morocc_in,64,41,5	script	Bestry#moc	826,{
	callfunc "refinenew","Bestry",0,0;
	end;
}
payon_in01,18,132,3	script	Bestry#pay	826,{
	callfunc "refinenew","Bestry",0,0;
	end;
}

//=====================================================================================
// +11 and above Weapon/Armor Function
//=====================================================================================
//= To allow auto safe refining/multiple refining set the
//= second argument to '1' in the function call.
//= If you enable this function make sure you set the appropiate +x Level in your refine_db.txt
//= to 100 and adjust the .@safe Value in the Script to your desired max. Safe Level.
//= Otherwise it won't work .
//=
//= In the official script the NPC uses an new Command which is called 'GetExdEquipIsSuccessRefinery',
//= this command seems to generate a random number between 1 and 3 to decide either of 
//= the following:
//= 1: Success
//= 2: Downgrade
//= 3: Failure
//=
//= If you want to enable that feature just set the third argument to '1' in the function call.
//= Otherwise it will use the % chance in your refine_db.txt .
//= Side Note: Current values for +11 and above upgrading in the refine_db.txt are custom.
//=====================================================================================

function	script	refinenew	{

	mes "["+ getarg(0) +"]";
	mes "I am the best Blacksmith ever!";
	mes "I don't work with normal, boring items.";
	mes "But only with items that are level 10 or higher!";
	next;
	mes "["+ getarg(0) +"]";
	mes "Anyway, you may use my services if your item is lv 10 or higher.";
	mes "What do you want to have refined?";
	next;
	setarray .@position$[1],"Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
	set .@menu$,"";
	for( set .@i,1; .@i <= 10; set .@i,.@i+1 )
	{
		if( getequipisequiped(.@i) )
			set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";

		set .@menu$, .@menu$ + ":";
	}
	set .@part,select(.@menu$);
	if(!getequipisequiped(.@part)) {
		mes "[" + getarg(0) + "]";
		mes "You're not wearing";
		mes "anything there that";
		mes "I can refine.";
		emotion e_an;
		close;
	}
	//Check if the item is refinable...
	if(!getequipisenableref(.@part)) {
		mes "[" + getarg(0) + "]";
		mes "I don't think I can";
		mes "refine this item at all...";
		close;
	}
	//Check if the item is identified... (Don't know why this is in here... but kept it anyway)
	if(!getequipisidentify(.@part)) {
		mes "[" + getarg(0) + "]";
		mes "You can't refine this";
		mes "if you haven't appraised";
		mes "it first. Make sure your";
		mes "stuff is identified before";
		mes "I can refine it.";
		close;
	}
	//Check to see if the items is at least +10
	if(getequiprefinerycnt(.@part) < 10) {
		mes "["+ getarg(0) +"]";
		mes "I said I don't work with Equipment under lv. 10.";
		close;
	}
	if(getequiprefinerycnt(.@part) >= 20) {
		mes "["+ getarg(0) +"]";
		mes "I can't refine this";
		mes "any more. This is as";
		mes "refined as it gets!";
		close;
	}
	set .@refineitemid, getequipid(.@part); // save id of the item
	set .@refinerycnt, getequiprefinerycnt(.@part); //save refinery count
	if ((getequipweaponlv(.@part) >= 1) && (getequipweaponlv(.@part) <= 4)) {
		set .@material,6224;
		set .@price,100000;
		set .@safe,10;
		mes "["+ getarg(0) +"]";
		mes "Hmm a weapon, is that ok?";
		mes "If you want to refine this weapon,";
		mes "I will need 1 ^003366Bradium^000000 and 100,000 zeny.";
		mes "Are you sure you want to continue?";
	} else {
		set .@material,6223;
		set .@price,100000;
		set .@safe,10;
		mes "["+ getarg(0) +"]";
		mes "Hmm an armor, is that ok?";
		mes "If you want to refine this armor,";
		mes "I will need 1 ^003366Carnium^00000 and 100,000 zeny.";
		mes "Are you sure you want to continue?";
	}
	next;
	if(select("Yes:No") == 2){
		mes "["+ getarg(0) +"]";
		mes "Well, no challenge is one way..";
		mes "No risk.. that could be wise.";
		close;
	}
	if(getarg(1) != 1) {
		if ((getequipweaponlv(.@part) >= 1) && (getequipweaponlv(.@part) <= 4)) {
				mes "["+ getarg(0) +"]";
			mes "This weapon already has been refined serveral times.";
			mes "It could be destroyed if you try more.";
			mes "It won't break 100%, but is has a small chance.";
			next;
			mes "["+ getarg(0) +"]";
			mes "You could have the upgrade level of the weapon decreased,";
			mes "or if it breaks, you will lose ^FF0000any cards^000000 or special properties added to it.";
		} else {
			mes "["+ getarg(0) +"]";
			mes "This armor already has been refined serveral times.";
			mes "It could be destroyed if you try more.";
			mes "It won't break 100%, but is has a small chance.";
			next;
			mes "["+ getarg(0) +"]";
			mes "You could have the upgrade level of the armor decreased,";
			mes "or if it breaks, you will lose ^FF0000any cards^000000 or special properties added to it.";
		}
		next;
		mes "["+ getarg(0) +"]";
		mes "Do you want me to refine it?";
		mes "I think I gave you enough warnings.";
		next;
		switch (select("Yes.:No.")) {
		case 1:
			break;
		case 2:
			mes "["+ getarg(0) +"]";
			mes "Well, no challenge is one way..";
			mes "No risk.. that could be wise.";
			close;
		}
		if(countitem(.@material) < 1 || Zeny < .@price) {
			mes "["+ getarg(0) +"]";
			mes "Hm, it seems you don't have enough materials or money.";
			mes "Please check it out.";
			close;
		}
		set Zeny,Zeny - .@price;
		delitem .@material,1;
		if(getequipisequiped(.@part) == 0) { // hacker has removed the item (not changed, why?)
			mes "[" + getarg(0) + "]";
			mes "Look here... you don't have any Items on...";
			close;
		}
		if(getequiprefinerycnt(.@part) != .@refinerycnt || getequipid(.@part) != .@refineitemid) { // hacker has changed the item
			mes "[" + getarg(0) + "]";
			Emotion e_an;
			mes "Wait a second...";
			mes "Do you think I'm stupid?!";
			mes "You switched the item while I wasn't looking! Get out of here!";
			close;
		}
		if(getarg(2) == 1){
			set .@rand,rand(1,3);
			if (.@rand == 1) {
				mes "Clang! Clang! Clang! Clang!";
				successrefitem .@part;
				next;
				emotion e_no1;
				mes "["+ getarg(0) +"]";
				mes "Good! Succes!!!";
				mes "I am the best Blacksmith.";
				close;
			}
			if (.@rand == 2) {
				mes "["+ getarg(0) +"]";
				mes "Clang! Clang! Clang! Clang!";
				downrefitem .@part;
				next;
				set .@emo, rand(1,5);
				if (.@emo == 1) {
					emotion e_cash;
				}
				else {
					emotion e_omg;
				}
				mes "["+ getarg(0) +"]";
				mes "Ahhh!!!";
				next;
				mes "["+ getarg(0) +"]";
				mes "Oh my!";
				mes "The upgrade level has dropped...";
				mes "There could've been made an mistake even though I am the best ever.";
				mes "It was out of my hands.";
				next;
				mes "["+ getarg(0) +"]";
				mes "I will do a better job next time! Don't worry!";
				close;
			}
			mes "["+ getarg(0) +"]";
			mes "Clang! Clang! Clang!";
			failedrefitem .@part;
			next;
			set .@emo, rand(1,5);
			if (.@emo == 1) {
				emotion e_cash;
			} else {
				emotion e_omg;
			}
			mes "["+ getarg(0) +"]";
			mes "Hmmm!";
			next;
			mes "["+ getarg(0) +"]";
			mes "Oh my! I've failed to refine stuff...";
			mes "I didn't mean it!";
			mes "There could've been made an mistake even though I am the best ever.";
			mes "It was out of my hands.";
			next;
			mes "["+ getarg(0) +"]";
			mes "I will do a better job next time! Don't worry!";
			close;
		}
		set .@rand,rand(100);
		if (getequippercentrefinery(.@part) > .@rand) {
			mes "Clang! Clang! Clang! Clang!";
			successrefitem .@part;
			next;
			emotion e_no1;
			mes "["+ getarg(0) +"]";
			mes "Good! Succes!!!";
			mes "I am the best Blacksmith.";
			close;
		}
		if (getequippercentrefinery(.@part) < .@rand) {
			mes "["+ getarg(0) +"]";
			mes "Clang! Clang! Clang! Clang!";
			downrefitem .@part;
			next;
			set .@emo, rand(1,5);
			if (.@emo == 1) {
				emotion e_cash;
			} else {
				emotion e_omg;
			}
			mes "["+ getarg(0) +"]";
			mes "Ahhh!!!";
			next;
			mes "["+ getarg(0) +"]";
			mes "Oh my!";
			mes "The upgrade level has dropped...";
			mes "There could've been made an mistake even though I am the best ever.";
			mes "It was out of my hands.";
			next;
			mes "["+ getarg(0) +"]";
			mes "I will do a better job next time! Don't worry!";
			close;
		}
		mes "["+ getarg(0) +"]";
		mes "Clang! Clang! Clang!";
		failedrefitem .@part;
		next;
		set .@emo, rand(1,5);
		if (.@emo == 1) {
			emotion e_cash;
		} else {
			emotion e_omg;
		}
		mes "["+ getarg(0) +"]";
		mes "Hmmm!";
		next;
		mes "["+ getarg(0) +"]";
		mes "Oh my! I've failed to refine stuff...";
		mes "I didn't mean it!";
		mes "There could've been made an mistake even though I am the best ever.";
		mes "It was out of my hands.";
		next;
		mes "["+ getarg(0) +"]";
		mes "I will do a better job next time! Don't worry!";
		close;
	}
// New +11 and above Refining Functions ========================
	if(getequiprefinerycnt(.@part) < .@safe) {
		mes "[" + getarg(0) + "]";
		mes "I can refine this to the safe limit or a desired number of times... it's your choice...";
		next;
		set .@menu2,select("To the safe limit please.","I'll decide how many times.","I've changed my mind...");
	} else {
		set .@menu2,2;
	}
	switch(.@menu2){
	case 1: 
		set .@refinecnt,.@safe - getequiprefinerycnt(.@part);
		break;
	case 2:
		next;
		mes "[" + getarg(0) + "]";
		mes "So how many times would you like me to refine your item?";
		next;
		input .@refinecnt;
		set .@refinecheck,.@refinecnt + getequiprefinerycnt(.@part);
		if (.@refinecnt < 1 || .@refinecheck > 10) {
			mes "[" + getarg(0) + "]";
			mes "I can't refine this item that many times.";
			close;
		}
		if(.@refinecheck > .@safe) {
			set .@refinecheck,.@refinecheck - .@safe;
			mes "[" + getarg(0) + "]";
			mes "This will try to refine the equipment " + .@refinecheck + " times past the safe limit. Your equipment may be destroyed... is that ok?";
			next;
			if(select("Yes...","No...") == 2){
				mes "[" + getarg(0) + "]";
				mes "You said so..Hmm so be it...";
				close;
			}
		}
		break;
	case 3:
		next;
		mes "[" + getarg(0) + "]";
		mes "You said so..Hmm so be it...";
		close;
	}
	set .@fullprice,.@price * .@refinecnt;
	mes "[" + getarg(0) + "]";
	mes "That will cost you " + .@refinecnt + " " + getitemname(.@material) + " and " + .@fullprice + " Zeny. Is that ok?";
	next;
	if(select("Yes","No...") == 2){
		mes "[" + getarg(0) + "]";
		mes "You said so..Hmm so be it...";
		close;
	}
	if(countitem(.@material) < .@refinecnt || Zeny < .@fullprice) {
		mes "[" + getarg(0) + "]";
		mes "Is that all you got? Unfortunately I can't work for you at a lower price. Try putting yourself in my shoes.";
		close;
	}
	set Zeny,Zeny - .@fullprice;
	delitem .@material,.@refinecnt;
	while(.@refinecnt){
		if (getequipisequiped(.@part) == 0) {
			mes "[" + getarg(0) + "]";
			mes "Look here... you don't have any Items on...";
			close;
		}
		if (getequipid(.@part) != .@refineitemid || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) {
			mes "[" + getarg(0) + "]";
			mes "Clan... No, but Did you imagine I could be so stupid !?!";
			mes "You have changed it...";
			mes "Go out before I stun you with my Hammer!!!";
			close;
		}
		if(getarg(2) == 1){
			set .@rand,rand(1,3);
			if (.@rand == 1) {
				mes "Clang! Clang! Clang! Clang!";
				successrefitem .@part;
				next;
				emotion e_no1;
				mes "["+ getarg(0) +"]";
				mes "Good! Succes!!!";
				mes "I am the best Blacksmith.";
				close;
			}
			if (.@rand == 2) {
				mes "["+ getarg(0) +"]";
				mes "Clang! Clang! Clang! Clang!";
				downrefitem .@part;
				next;
				set .@emo, rand(1,5);
				if (.@emo == 1) {
					emotion e_cash;
				}
				else {
					emotion e_omg;
				}
				mes "["+ getarg(0) +"]";
				mes "Ahhh!!!";
				next;
				mes "["+ getarg(0) +"]";
				mes "Oh my!";
				mes "The upgrade level has dropped...";
				mes "There could've been made an mistake even though I am the best ever.";
				mes "It was out of my hands.";
				next;
				mes "["+ getarg(0) +"]";
				mes "I will do a better job next time! Don't worry!";
				close;
			}
			mes "["+ getarg(0) +"]";
			mes "Clang! Clang! Clang!";
			failedrefitem .@part;
			next;
			set .@emo, rand(1,5);
			if (.@emo == 1) {
				emotion e_cash;
			} else {
				emotion e_omg;
			}
			mes "["+ getarg(0) +"]";
			mes "Hmmm!";
			next;
			mes "["+ getarg(0) +"]";
			mes "Oh my! I've failed to refine stuff...";
			mes "I didn't mean it!";
			mes "There could've been made an mistake even though I am the best ever.";
			mes "It was out of my hands.";
			next;
			mes "["+ getarg(0) +"]";
			mes "I will do a better job next time! Don't worry!";
			close;
		}
		set .@rand,rand(100);
		if (getequippercentrefinery(.@part) > .@rand) {
			mes "Clang! Clang! Clang! Clang!";
			successrefitem .@part;
			next;
			emotion e_no1;
			mes "["+ getarg(0) +"]";
			mes "Good! Succes!!!";
			mes "I am the best Blacksmith.";
			close;
		}
		if (getequippercentrefinery(.@part) < .@rand) {
			mes "["+ getarg(0) +"]";
			mes "Clang! Clang! Clang! Clang!";
			downrefitem .@part;
			next;
			set .@emo, rand(1,5);
			if (.@emo == 1) {
				emotion e_cash;
			} else {
				emotion e_omg;
			}
			mes "["+ getarg(0) +"]";
			mes "Ahhh!!!";
			next;
			mes "["+ getarg(0) +"]";
			mes "Oh my!";
			mes "The upgrade level has dropped...";
			mes "There could've been made an mistake even though I am the best ever.";
			mes "It was out of my hands.";
			next;
			mes "["+ getarg(0) +"]";
			mes "I will do a better job next time! Don't worry!";
			close;
		}
		mes "["+ getarg(0) +"]";
		mes "Clang! Clang! Clang!";
		failedrefitem .@part;
		next;
		set .@emo, rand(1,5);
		if (.@emo == 1) {
			emotion e_cash;
		} else {
			emotion e_omg;
		}
		mes "["+ getarg(0) +"]";
		mes "Hmmm!";
		next;
		mes "["+ getarg(0) +"]";
		mes "Oh my! I've failed to refine stuff...";
		mes "I didn't mean it!";
		mes "There could've been made an mistake even though I am the best ever.";
		mes "It was out of my hands.";
		next;
		mes "["+ getarg(0) +"]";
		mes "I will do a better job next time! Don't worry!";
		close;
	}
	mes "[" + getarg(0) + "]";
	mes "All finished... Come again soon.";
	close;
}

//==============================================================================
// Ori/Elu to Carnium/Bradium Refiners
//==============================================================================
prt_in,85,71,5	script	Austry#prt	826,{
	callfunc "oreref","Austry";
	end;
}
payon_in01,14,125,5	script	Austry#pay	826,{
	callfunc "oreref","Austry";
	end;
}
morocc_in,60,38,5	script	Austry#moc	826,{
	callfunc "oreref","Austry";
	end;
}

//============================================================
//= Ori/Elu to Carnium/Bradium Function
//============================================================

function	script	oreref	{
	mes "["+ getarg(0) +"]";
	mes "If you bring me 3";
	mes "Oridecon or Elunium";
	mes "I can exchange them for";
	mes "Bradium or Carnium.";
	mes "Just give me 50,000z.";
	next;
	switch (select("Oridecon to Bradium.:Elunium to Carnium.:Purified Bradium to Carnium.:No thanks.")) {
	case 1:
		if ((countitem(984) > 2) && (Zeny > 49999)) {
			delitem 984,3; //Oridecon
			set Zeny, Zeny - 50000;
			getitem 6224,1; //Bradium
			mes "["+ getarg(0) +"]";
			mes "Ok! Here is your Bradium.";
			mes "Take it and use it well.";
			close;
		}
		mes "["+ getarg(0) +"]";
		mes "You better not be trying";
		mes "to cheat me because you";
		mes "don't have enough zeny";
		mes "or Oridecon.";
		close;
	case 2:
		if ((countitem(985) > 2) && (Zeny > 49999)) {
			delitem 985,3; //Elunium
			set Zeny, Zeny - 50000;
			getitem 6223,1; //Carnium
			mes "["+ getarg(0) +"]";
			mes "Ok! Here is your Carnium.";
			mes "Take it and use it well.";
			close;
		}
		mes "["+ getarg(0) +"]";
		mes "You better not be trying";
		mes "to cheat me because you";
		mes "don't have enough zeny";
		mes "or Elunium.";
		close;
	case 3:
		if ((countitem(6090) > 0) && (Zeny > 49999)) {
			delitem 6090,1; //Purified_Bradium
			set Zeny, Zeny - 50000;
			getitem 6223,1; //Carnium
			mes "["+ getarg(0) +"]";
			mes "Refining with Purified Bradium";
			mes "is a little expensive. I can";
			mes "trade it for some Carnium.";
			mes "Take it and use it well.";
			close;
		}
		mes "["+ getarg(0) +"]";
		mes "You better not be trying";
		mes "to cheat me because you";
		mes "don't have enough zeny";
		mes "or Purified Bradium.";
		close;
	case 4:
		mes "["+ getarg(0) +"]";
		mes "Hmm...";
		close;
	}
}