refine.txt 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881
  1. //===== eAthena Script =======================================
  2. //= Refining NPCs
  3. //===== By: ==================================================
  4. //= Syrus22 (1.1)
  5. //===== Current Version: =====================================
  6. //= 1.3
  7. //===== Compatible With: =====================================
  8. //= Any Athena Version
  9. //===== Description: =========================================
  10. //= Refining NPCs and Metal Salesmen.
  11. //===== Additional Comments: =================================
  12. //= 1.0 by A bunch of people!
  13. //= Syrus22 - Completely redid the script using functions... also
  14. //= added the option for auto safe refining and multiple refining.
  15. //= 1.1 Negative input bug fixed [Lupus]
  16. //= 1.2 Added additional reparimen in morroc and payon. Added
  17. //= Christopher the blacksmith in Geffen. Edited some dialogue [kobra_k88]
  18. //= 1.3 New Payon Locations [Darkchild]
  19. //= Corrected zeny subtraction thx to jpnmania77.[kobra_k88]
  20. //= 1.3a Temporary corrected an expliot. Need to check sources
  21. //= to fully fix bug [Shinigami]
  22. //= Fixed repairman prices [shadowlady]
  23. //============================================================
  24. //=========================================================
  25. // Christopher: Geffen Blacksmith
  26. //=========================================================
  27. geffen_in.gat,110,172,2 script Christopher 63,{
  28. mes "[Christopher Guillenrow]";
  29. mes "Welcome to Christopher's Workshop. Ye can find all yer forging equipment here. So what can I help ye with?";
  30. M_Menu:
  31. next;
  32. menu "Purchase Anvil",M_0, "Purchase Forging Item",M_1, "Purchase Metal",M_2, "Purify Rough Ores",M_3, "Cancel",M_End;
  33. M_0:
  34. mes "[Christopher Guillenrow]";
  35. mes "Higher quality Anvils gives ye a better chance ta make better weapons, ye know. But they cost more than yer typical ones.";
  36. next;
  37. menu "Anvil - 30000z.",sM_Anvil, "Oridecon Anvil - 120000z.",sM_OriAnvil, "Golden Anvil - 300000z.",sM_GolAnvil,
  38. "Better Anvil than others",sM_BetAnvil, "Cancel",M_Menu;
  39. sM_Anvil:
  40. if(Zeny < 30000) goto L_NoZeny;
  41. mes "[Christopher Guillenrow]";
  42. mes "This is the cheapest one but it's very efficient.";
  43. set Zeny, Zeny - 30000;
  44. getitem 986,1;
  45. next;
  46. goto L_Thanks;
  47. sM_OriAnvil:
  48. if(Zeny < 120000) goto L_NoZeny;
  49. mes "[Christopher Guillenrow]";
  50. mes "Ah! Ye have a good eye for anvils. This here is the proper anvil for a Blacksmith.";
  51. set Zeny, Zeny - 120000;
  52. getitem 987,1;
  53. next;
  54. goto L_Thanks;
  55. sM_GolAnvil:
  56. if(Zeny < 300000) goto L_NoZeny;
  57. mes "[Christopher Guillenrow]";
  58. mes "This is the best anvil in my workshop! With this ye'll be the best Blasksmith in no time.";
  59. set Zeny, Zeny - 300000;
  60. getitem 988,1;
  61. next;
  62. goto L_Thanks;
  63. sM_BetAnvil:
  64. mes "[Christopher Guillenrow]";
  65. mes "I'm sorry but I don't have anything better than a Golden Anvil.";
  66. mes "Maybe 'Ringgel' the legendary Anvil maker would have one... but he be a hard fellow ta find.";
  67. close;
  68. M_1:
  69. mes "[Christopher Guillenrow]";
  70. mes "A respectable Blacksmith uses fine tools. Ye will come ta know my tools as being the finest around!";
  71. mes "Choose anything you want.";
  72. sM_Menu1:
  73. next;
  74. menu "Mini-Furnace - 150z.",sM_Furn, "Iron Hammer - 1000z.",sM_IrHam, "Golden Hammer - 3000z.",sM_GldHam,
  75. "Oridecon Hammer - 5000z.",sM_OriHam, "Cancel",M_Menu;
  76. sM_Furn:
  77. mes "[Christopher Guillenrow]";
  78. mes "This is a prerequisite for Metal refining!!";
  79. mes "So, how many do ye wish to buy? If you want to quit, please input the number '0'. However, you the maximum amount you can buy is 1000";
  80. set @input, 0;
  81. input @input;
  82. next;
  83. if(@input < 1 ) goto sM_Menu1;
  84. if(@input > 1000 ) goto sM_Max;
  85. if(Zeny < 150 * @input) goto L_NoZeny;
  86. set Zeny, Zeny - (150 * @input);
  87. getitem 612, @input;
  88. goto L_Thanks;
  89. sM_IrHam:
  90. if(Zeny < 1000) goto L_NoZeny;
  91. set Zeny, Zeny - 1000;
  92. getitem 613,1;
  93. goto L_Thanks;
  94. sM_GldHam:
  95. if(Zeny < 3000) goto L_NoZeny;
  96. set Zeny, Zeny - 3000;
  97. getitem 614,1;
  98. goto L_Thanks;
  99. sM_OriHam:
  100. if(Zeny < 5000) goto L_NoZeny;
  101. set Zeny, Zeny - 5000;
  102. getitem 615,1;
  103. goto L_Thanks;
  104. sM_Max:
  105. mes "[Christopher Guillenrow]";
  106. mes "Sorry, you can't buy more than 1000 furnace at a time.";
  107. close;
  108. M_2:
  109. mes "[Christopher Guillenrow]";
  110. mes "I have 2 kinds of metals for sale. Which do ye like?";
  111. set @chris, 1;
  112. set @name$, "Christopher Guillenrow";
  113. callfunc "phramain";
  114. M_3:
  115. mes "[Christopher Guillenrow]";
  116. mes "I can purify yer rough Oridecon and rough Elunium ores. I'll need 5 rough ores to make 1 pure one.";
  117. mes "Well... which one do ye want ta make?";
  118. set @chris, 1;
  119. set @name$, "Christopher Guillenrow";
  120. callfunc "orimain";
  121. M_End:
  122. close;
  123. L_NoZeny:
  124. mes "[Christopher Guillenrow]";
  125. mes "I don't think I can let ye have this at a lower price. I can't afford ta loose profits because of ye.";
  126. emotion 4;
  127. close;
  128. L_Thanks:
  129. mes "[Christopher Guillenrow]";
  130. mes "Thank you for shopping at my workshop. Feel free to come anytime whenever you need.";
  131. emotion 15;
  132. close;
  133. }
  134. //=====================================================================================
  135. //= Weapon/Armor Refiners
  136. //=====================================================================================
  137. prt_in.gat,63,60,4 script Hollengrhen 85,{
  138. set @name$,"Hollengrhen";
  139. callfunc "refinemain";
  140. break;
  141. }
  142. morocc_in.gat,73,38,4 script Aragham 99,{
  143. set @name$,"Aragham";
  144. callfunc "refinemain";
  145. break;
  146. }
  147. payon.gat,144,173,4 script Antonio 88,{
  148. set @name$,"Antonio";
  149. callfunc "refinemain";
  150. break;
  151. }
  152. alberta_in.gat,28,58,4 script Fredrik 85,{
  153. set @name$,"Fredrik";
  154. callfunc "refinemain";
  155. break;
  156. }
  157. yuno_in01.gat,164,26,6 script Disturb 88,{
  158. set @name$,"Disturb";
  159. callfunc "refinemain";
  160. break;
  161. }
  162. //============================================================
  163. //= Main Refiner Function
  164. //============================================================
  165. //= To allow auto safe refining/multiple refining set the
  166. //= @features variable to 1
  167. //============================================================
  168. function script refinemain {
  169. set @features,0;
  170. mes "[" + @name$ + "]";
  171. mes "I am the Armsmith... I can refine any weapon or piece of armor you choose!";
  172. mes "Which piece of equipment do you want to refine?";
  173. M_Menu:
  174. next;
  175. menu getequipname(1),PART1,getequipname(2),PART2,getequipname(3),PART3,getequipname(4),PART4,getequipname(5),PART5,
  176. getequipname(6),PART6,getequipname(7),PART7,getequipname(8),PART8,getequipname(9),PART9,getequipname(10),PART10;
  177. //Head Gear
  178. PART1:
  179. set @part,1;
  180. if (getequipisequiped(1)) goto CHECK1;
  181. mes "[" + @name$ + "]";
  182. mes "Do you want me to refine your dumb brain?";
  183. emotion 6;
  184. goto M_Menu;
  185. //Armor
  186. PART2:
  187. set @part,2;
  188. if (getequipisequiped(2)) goto CHECK1;
  189. mes "[" + @name$ + "]";
  190. mes "Do you want me to melt your body with blazing heat...?";
  191. emotion 6;
  192. goto M_Menu;
  193. //Left Hand
  194. PART3:
  195. set @part,3;
  196. if (getequipisequiped(3)) goto CHECK1;
  197. mes "[" + @name$ + "]";
  198. mes "I can't make your left hand into an ultimate weapon...";
  199. emotion 4;
  200. goto M_Menu;
  201. //Right Hand
  202. PART4:
  203. set @part,4;
  204. if (getequipisequiped(4)) goto CHECK1;
  205. mes "[" + @name$ + "]";
  206. mes "I can't make your right hand into an ultimate weapon...";
  207. emotion 4;
  208. goto M_Menu;
  209. //Garment
  210. PART5:
  211. set @part,5;
  212. if (getequipisequiped(5)) goto CHECK1;
  213. mes "[" + @name$ + "]";
  214. mes "Look here... you don't have any Garments on....";
  215. goto M_Menu;
  216. //Foot Gear
  217. PART6:
  218. set @part,6;
  219. if (getequipisequiped(6)) goto CHECK1;
  220. mes "[" + @name$ + "]";
  221. mes "Ack!! Those are some stinky feet. I definately can't refine those.... uck!!";
  222. emotion 16;
  223. goto M_Menu;
  224. //Accessory1
  225. PART7:
  226. set @part,7;
  227. if (getequipisequiped(7)) goto CHECK1;
  228. mes "[" + @name$ + "]";
  229. mes "What do you mean by Accessory? Which One?";
  230. emotion 20;
  231. goto M_Menu;
  232. //Accessory2
  233. PART8:
  234. set @part,8;
  235. if (getequipisequiped(8)) goto CHECK1;
  236. mes "[" + @name$ + "]";
  237. mes "What do you mean by Accessory? Which One?";
  238. emotion 20;
  239. goto M_Menu;
  240. PART9:
  241. set @part,9;
  242. if (getequipisequiped(9)) goto CHECK1;
  243. mes "[" + @name$ + "]";
  244. mes "What do you want from me? There's nothing equiped there...";
  245. emotion 20;
  246. goto M_Menu;
  247. PART10:
  248. set @part,10;
  249. if (getequipisequiped(10)) goto CHECK1;
  250. mes "[" + @name$ + "]";
  251. mes "What do you want from me? There's nothing equiped there...";
  252. emotion 20;
  253. goto M_Menu;
  254. //Check if the item is refinable...
  255. CHECK1:
  256. if(getequipisenableref(@part)) goto CHECK2;
  257. mes "[" + @name$ + "]";
  258. mes "I can't work on this item...";
  259. close;
  260. //Check if the item is identified... (Don't know why this is in here... but kept it anyway)
  261. CHECK2:
  262. if(getequipisidentify(@part)) goto CHECK3;
  263. mes "[" + @name$ + "]";
  264. mes "You must appraise this item first.";
  265. close;
  266. //Check to see if the items is already +10
  267. CHECK3:
  268. if(getequiprefinerycnt(@part) < 10) goto REFINE0;
  269. mes "[" + @name$ + "]";
  270. mes "This weapon is allready at its maximum level and can no longer be refined.";
  271. close;
  272. //Refine Armor
  273. REFINE0:
  274. if(getequipweaponlv(@part) > 0) goto REFINE1;
  275. set @matname$,"Elunium";
  276. set @material,985;
  277. set @price,2000;
  278. set @safe,4;
  279. if(@features == 1) callfunc "refinefeatures";
  280. callfunc "refinenormal";
  281. //Refine Level 1 Weapon
  282. REFINE1:
  283. if(getequipweaponlv(@part) > 1) goto REFINE2;
  284. set @matname$,"Phracon";
  285. set @material,1010;
  286. set @price,50;
  287. set @safe,7;
  288. if(@features == 1) callfunc "refinefeatures";
  289. callfunc "refinenormal";
  290. //Refine Level 2 Weapon
  291. REFINE2:
  292. if(getequipweaponlv(@part) > 2) goto REFINE3;
  293. set @matname$,"Emveretarcon";
  294. set @material,1011;
  295. set @price,200;
  296. set @safe,6;
  297. if(@features == 1) callfunc "refinefeatures";
  298. callfunc "refinenormal";
  299. //Refine Level 3 Weapon
  300. REFINE3:
  301. if(getequipweaponlv(@part) > 3) goto REFINE4;
  302. set @matname$,"Oridecon";
  303. set @material,984;
  304. set @price,5000;
  305. set @safe,5;
  306. if(@features == 1) callfunc "refinefeatures";
  307. callfunc "refinenormal";
  308. //Refine Level 4 Weapon
  309. REFINE4:
  310. set @matname$,"Oridecon";
  311. set @material,984;
  312. set @price,20000;
  313. set @safe,4;
  314. if(@features == 1) callfunc "refinefeatures";
  315. callfunc "refinenormal";
  316. }
  317. // Normal Refining Functions =========================
  318. function script refinenormal -1,{
  319. mes "[" + @name$ + "]";
  320. mes "To refine this stuff,I need ^ff9999" + @matname$ + "^000000 and the fee " + @price + " Zeny.";
  321. mes "Continue?";
  322. next;
  323. menu "Yes",-,"No",Lcancel;
  324. if (getequippercentrefinery(@part) == 100) goto L_Sub;
  325. mes "[" + @name$ + "]";
  326. mes "Hmm... Hold on! This piece of equipment has already been refined to its maximum safety level.";
  327. mes "I must warn you if it is refined ANYMORE, It could be DESTROYED and become USELESS!!";
  328. next;
  329. mes "["+@name$+"]";
  330. mes "Do you still wish you refine it? If so I will not be able to gaurantee my work...";
  331. next;
  332. menu "Yes",L_Sub,"No",Lcancel1;
  333. L_Sub:
  334. if ((countitem(@material) < 1) || (Zeny < @price)) goto Lcancel2;
  335. delitem @material,1;
  336. set Zeny,Zeny-@price;
  337. Lrefine:
  338. if (getequippercentrefinery(@part)<=rand(100)) goto Lfail;
  339. mes "["+@name$+"]";
  340. mes "Clang! Clang! Clang!";
  341. successrefitem @part;
  342. next;
  343. mes "["+@name$+"]";
  344. mes "HAHA! It seems my skills haven't gotten rusty yet! Splendid... just splendid...";
  345. emotion 21;
  346. close;
  347. Lfail:
  348. mes "[" + @name$ + "]";
  349. mes "Clang! Clang! Clang!";
  350. failedrefitem @part;
  351. next;
  352. mes "["+@name$+"]";
  353. mes "Aaahhh!! Oh no....!!";
  354. emotion 16;
  355. next;
  356. mes "["+@name$+"]";
  357. mes "Eh..Ehem... I'm sorry but the refining proccess ^ff0000failed^000000.";
  358. next;
  359. mes "["+@name$+"]";
  360. mes "I am deeply ashamed of what I've done... but I DID warn you earlier about the risks.";
  361. close;
  362. Lcancel:
  363. mes "[" + @name$ + "]";
  364. mes "You said so..Hmm so be it...";
  365. close;
  366. Lcancel1:
  367. mes "[" + @name$ + "]";
  368. mes "Good Choice.";
  369. mes "Ah... good choice. I'd feel awfull if I'd destroyed another persons piece of equipment with my own hands.";
  370. close;
  371. Lcancel2:
  372. mes "[" + @name$ + "]";
  373. mes "Is that all you got? Unfortunately I can't work for you at a lower price. Try putting yourself in my shoes.";
  374. close;
  375. }
  376. // New Refining Functions ========================
  377. function script refinefeatures {
  378. if(getequiprefinerycnt(@part) >= @safe) goto Lnosafe;
  379. mes "[" + @name$ + "]";
  380. mes "I can refine this to the safe limit or a desired number of times... it's your choice...";
  381. next;
  382. menu "To the safe limit please.",Lsafe,"I'll decide how many times.",Lnosafe,"I've changed my mind...",Lcancel;
  383. Lsafe:
  384. set @refinecnt,@safe - getequiprefinerycnt(@part);
  385. set @fullprice,@price * @refinecnt;
  386. mes "[" + @name$ + "]";
  387. mes "That will cost you " + @refinecnt + " " + @matname$ + " and " + @fullprice + " Zeny. Is that ok?";
  388. next;
  389. menu "Yes",-,"No...",Lcancel;
  390. if((countitem(@material) < @refinecnt) || (Zeny < @fullprice)) goto Lcancel2;
  391. delitem @material,@refinecnt;
  392. set Zeny,Zeny - @fullprice;
  393. callfunc "refinesafe";
  394. break;
  395. Lnosafe:
  396. mes "[" + @name$ + "]";
  397. mes "So how many times would you like me to refine your item?";
  398. next;
  399. input @refinecnt;
  400. if (@refinecnt<1) goto Lcancel3; //fixed by Lupus
  401. set @refinecheck,@refinecnt + getequiprefinerycnt(@part);
  402. if(@refinecheck > 10) goto Lcancel3;
  403. set @fullprice,@price * @refinecnt;
  404. mes "[" + @name$ + "]";
  405. mes "This will cost you " + @refinecnt + " " + @matname$ + " and " + @price + " Zeny... Is that ok?";
  406. next;
  407. menu "Yes...",-,"No...",Lcancel;
  408. if(@refinecheck > @safe) goto Lwarn;
  409. if((countitem(@material) < @refinecnt) || (Zeny < @fullprice)) goto Lcancel2;
  410. delitem @material,@refinecnt;
  411. set Zeny,Zeny - @fullprice;
  412. callfunc "refinenumber";
  413. break;
  414. Lwarn:
  415. set @refinecheck,@refinecheck - @safe;
  416. mes "[" + @name$ + "]";
  417. mes "This will try to refine the equipment " + @refinecheck + " times past the safe limit. Your equipment may be destroyed... is that ok?";
  418. next;
  419. menu "Yes",-,"No...",Lcancel1;
  420. if((countitem(@material) < @refinecnt) || (Zeny < @fullprice)) goto Lcancel2;
  421. delitem @material,@refinecnt;
  422. set Zeny,Zeny - @fullprice;
  423. callfunc "refinenumber";
  424. break;
  425. Lcancel:
  426. mes "[" + @name$ + "]";
  427. mes "If you say so... See you again soon I hope.";
  428. close;
  429. Lcancel1:
  430. mes "[" + @name$ + "]";
  431. mes "Good... I don't like to break people's equipment...";
  432. close;
  433. Lcancel2:
  434. mes "[" + @name$ + "]";
  435. mes "Sorry but you don't have everything I need...";
  436. close;
  437. Lcancel3:
  438. mes "[" + @name$ + "]";
  439. mes "I can't refine this item that many times.";
  440. close;
  441. }
  442. // Function: Safe Refine ---------------------
  443. function script refinesafe {
  444. mes "Clang, clang!!!";
  445. successrefitem @part;
  446. emotion 21;
  447. set @refinecnt,@refinecnt - 1;
  448. next;
  449. if(@refinecnt == 0) goto Lend;
  450. callfunc "refinesafe";
  451. break;
  452. Lend:
  453. mes "[" + @name$ + "]";
  454. mes "All finished... Come again soon.";
  455. close;
  456. }
  457. // Function: Refine
  458. function script refinenumber {
  459. mes "Clang, clang!!!";
  460. if (getequippercentrefinery(@part)<=rand(100)) goto Lfail;
  461. successrefitem @part;
  462. emotion 21;
  463. set @refinecnt,@refinecnt - 1;
  464. next;
  465. if(@refinecnt == 0) goto Lend;
  466. callfunc "refinenumber";
  467. break;
  468. Lend:
  469. mes "[" + @name$ + "]";
  470. mes "All finished... Come again soon.";
  471. close;
  472. Lfail:
  473. failedrefitem @part;
  474. emotion 23;
  475. mes "[" + @name$ + "]";
  476. mes "WAHHHH!!! I'm so sorry... I warned you this could happen...";
  477. set @refinecnt,@refinecnt - 1;
  478. if(@refinecnt == 0) goto Lend2;
  479. mes "Here's the unused Zeny and Material back...";
  480. getitem @material,@refinecnt;
  481. set @fullprice,@refinecnt * @price;
  482. set Zeny,Zeny + @fullprice;
  483. Lend2:
  484. close;
  485. }
  486. //==============================================================================
  487. //= Material Salesmen
  488. //==============================================================================
  489. prt_in.gat,56,69,4 script Vurewell 86,{
  490. set @name$,"Vurewell";
  491. callfunc "phramain";
  492. break;
  493. }
  494. payon.gat,145,178,4 script Begnahd 88,{
  495. set @name$,"Begnahd";
  496. callfunc "phramain";
  497. break;
  498. }
  499. morocc_in.gat,65,37,4 script Sade 99,{
  500. set @name$,"Sade";
  501. callfunc "phramain";
  502. break;
  503. }
  504. alberta_in.gat,18,59,5 script Kahlamanlith 86,{
  505. set @name$,"Kahlamanlith";
  506. callfunc "phramain";
  507. break;
  508. }
  509. yuno_in01.gat,171,26,6 script Dillemat 88,{
  510. set @name$,"Dillemat";
  511. callfunc "phramain";
  512. break;
  513. }
  514. //============================================================
  515. //= Material Salesmen Functions
  516. //============================================================
  517. function script phramain {
  518. if(@chris == 1) goto M_Menu;
  519. mes "[" + @name$ + "]";
  520. mes "Hello, Im selling metals I just mined.";
  521. mes "They are Pharacon and Emvertacon.";
  522. mes "Would you like to buy some?";
  523. M_Menu:
  524. set @chris, 0;
  525. next;
  526. menu"Pharacon - 200z",PHARA,"Emveretarcon - 1000z",EMVER;
  527. PHARA:
  528. set @itemid,1010;
  529. set @value,200;
  530. goto CONTINUE;
  531. EMVER:
  532. set @itemid,1011;
  533. set @value,1000;
  534. CONTINUE:
  535. mes "[" + @name$ + "]";
  536. mes "How many would you like?";
  537. next;
  538. input @ammount;
  539. if (@ammount <= 0) goto L_BELOW;
  540. if (@ammount > 999) goto L_ABOVE;
  541. if (zeny<@value*@ammount) goto L_NOZENY;
  542. if (checkweight(@item,@ammount) == 0) goto L_WEIGHT;
  543. getitem @itemid,@ammount;
  544. set Zeny,Zeny-@value*@ammount;
  545. mes "[" + @name$ + "]";
  546. mes "Here you go.";
  547. close;
  548. L_NOZENY:
  549. mes "You do not have enough zeny!";
  550. close;
  551. L_WEIGHT:
  552. mes "You cant hold that many of that item";
  553. close;
  554. L_BELOW:
  555. mes "You have to buy a POSITIVE amount of items!";
  556. close;
  557. L_ABOVE:
  558. mes "You cant buy this much of this item!";
  559. close;
  560. }
  561. //==============================================================================
  562. //= Ori/Elu Refiners
  563. //==============================================================================
  564. prt_in.gat,63,69,4 script Dietrich 84,{
  565. set @name$,"Dietrich";
  566. callfunc "orimain";
  567. break;
  568. }
  569. payon.gat,137,178,4 script Hakhim 88,{
  570. set @name$,"Hakhim";
  571. callfunc "orimain";
  572. break;
  573. }
  574. morocc_in.gat,72,32,4 script Abdul 99,{
  575. set @name$,"Abdul";
  576. callfunc "orimain";
  577. break;
  578. }
  579. alberta_in.gat,21,63,5 script Xenophon 84,{
  580. set @name$,"Xenophon";
  581. callfunc "orimain";
  582. break;
  583. }
  584. yuno_in01.gat,171,22,6 script Delayt 88,{
  585. set @name$,"Delayt";
  586. callfunc "orimain";
  587. break;
  588. }
  589. //============================================================
  590. //= Ori/Elu Functions
  591. //============================================================
  592. function script orimain {
  593. if(@chris == 1) goto M_Menu;
  594. mes "[" + @name$ + "]";
  595. mes "If you bring Rough Oridecons and";
  596. mes "Rough Eluniums to me,";
  597. mes "I can refine them for you.";
  598. mes "However, you must bring 5 of each.";
  599. M_Menu:
  600. set @chris, 0;
  601. next;
  602. menu "Make Oridecon",M_Ori, "Make Elunium",M_Elu, "Ask about enchanted stones",M_Stones;
  603. M_Ori:
  604. if ((countitem(756) < 5)) goto L_NoOri;
  605. delitem 756,5;
  606. getitem 984,1;
  607. mes "[" + @name$ + "]";
  608. mes "As promised, here's your oridecon.";
  609. mes "Come back again anytime.";
  610. close;
  611. L_NoOri:
  612. mes "[" + @name$ + "]";
  613. mes "Huh? You're kidding, right? Didn't I say I can't make you an Oridecon unless you bring me 5 rough ones?";
  614. close;
  615. M_Elu:
  616. if ((countitem(757) < 5)) goto L_NoElu;
  617. delitem 757,5;
  618. getitem 985,1;
  619. mes "[" + @name$ + "]";
  620. mes "As promised, here's your elunium.";
  621. mes "Come back again anytime.";
  622. close;
  623. L_NoElu:
  624. mes "[" + @name$ + "]";
  625. mes "Huh? You're kidding, right? Didn't I say I can't make you an Elunium unless you bring me 5 rough ones?";
  626. close;
  627. M_Stones:
  628. mes "[" + @name$ + "]";
  629. mes "Enchanted stones, huh ....";
  630. next;
  631. mes "[" + @name$ + "]";
  632. mes "Well, in the 20 years that I've been a stonesmith I've heard of them many times... though I've never actually seen them before.";
  633. next;
  634. mes "[" + @name$ + "]";
  635. mes "I've been told that enchanted stones possess different elemental properties such as ^5533FFWater, Earth, Fire, and Wind^000000.";
  636. next;
  637. mes "[" + @name$ + "]";
  638. mes "If someone combines an Enchanted Stone with a weapon durring the refining process, that weapon will possess the same property as the stone.";
  639. next;
  640. mes "[" + @name$ + "]";
  641. mes "Of course, that person needs to be skillfull enough to work on it.";
  642. goto M_Menu;
  643. }
  644. //=====================================================================================
  645. //= Equipment Repairmen
  646. //=====================================================================================
  647. prt_in.gat,62,54,2 script Grendal 84,{
  648. set @name$,"Grendal";
  649. callfunc "repairmain";
  650. break;
  651. }
  652. //Temp Spot, Not Shure Where To place
  653. payon.gat,149,182,2 script Repairman 88,{
  654. set @name$,"Repairman";
  655. callfunc "repairmain";
  656. break;
  657. }
  658. morocc_in.gat,71,40,2 script Repairman 99,{
  659. set @name$,"Repairman";
  660. callfunc "repairmain";
  661. break;
  662. }
  663. //============================================================
  664. //= Equipment Repair Function
  665. //============================================================
  666. function script repairmain {
  667. set @repairprice,5000;
  668. mes "[" + @name$ + "]";
  669. mes "I am the Repair Smith and I can repair any Arms you want.";
  670. mes "Tell me which Equipment you want to repair.";
  671. set @broken1,getbrokenid(1);
  672. set @broken2,getbrokenid(2);
  673. set @broken3,getbrokenid(3);
  674. set @broken4,getbrokenid(4);
  675. set @broken5,getbrokenid(5);
  676. set @broken6,getbrokenid(6);
  677. set @broken7,getbrokenid(7);
  678. set @broken8,getbrokenid(8);
  679. set @broken9,getbrokenid(9);
  680. set @broken10,getbrokenid(10);
  681. next;
  682. if(@broken1==NULL) goto L_CANCEL_3;
  683. menu getitemname(@broken1),REPAIR1,getitemname(@broken2),REPAIR2,getitemname(@broken3),REPAIR3,
  684. getitemname(@broken4),REPAIR4,getitemname(@broken5),REPAIR5,getitemname(@broken6),REPAIR6,
  685. getitemname(@broken7),REPAIR7,getitemname(@broken8),REPAIR8,getitemname(@broken9),REPAIR9,
  686. getitemname(@broken10),REPAIR10;
  687. REPAIR1:
  688. mes "[" + @name$ + "]";
  689. mes "You're gonna repair " + getitemname(@broken1) + ".";
  690. mes "To repair this, I need ^ff9999One Steel^000000, and " + @repairprice + " Zeny.";
  691. mes "Continue?";
  692. next;
  693. menu "Yes",-,"No",L_CANCEL_2;
  694. if (countitem(999) < 1 || Zeny < @repairprice) goto L_CANCEL_1;
  695. delitem 999,1;
  696. set Zeny,Zeny-@repairprice;
  697. repair(1);
  698. goto L_CLOSE;
  699. REPAIR2:
  700. mes "[" + @name$ + "]";
  701. mes "You're gonna repair " + getitemname(@broken1) + ".";
  702. mes "To repair this, I need ^ff9999One Steel^000000, and " + @repairprice + " Zeny.";
  703. mes "Continue?";
  704. next;
  705. menu "Yes",-,"No",L_CANCEL_2;
  706. if (countitem(999) < 1 || Zeny < @repairprice) goto L_CANCEL_1;
  707. delitem 999,1;
  708. set Zeny,Zeny-@repairprice;
  709. repair(2);
  710. goto L_CLOSE;
  711. REPAIR3:
  712. mes "[" + @name$ + "]";
  713. mes "You're gonna repair " + getitemname(@broken1) + ".";
  714. mes "To repair this, I need ^ff9999One Steel^000000, and " + @repairprice + " Zeny.";
  715. mes "Continue?";
  716. next;
  717. menu "Yes",-,"No",L_CANCEL_2;
  718. if (countitem(999) < 1 || Zeny < @repairprice) goto L_CANCEL_1;
  719. delitem 999,1;
  720. set Zeny,Zeny-@repairprice;
  721. repair(3);
  722. goto L_CLOSE;
  723. REPAIR4:
  724. mes "[" + @name$ + "]";
  725. mes "You're gonna repair " + getitemname(@broken1) + ".";
  726. mes "To repair this, I need ^ff9999One Steel^000000, and " + @repairprice + " Zeny.";
  727. mes "Continue?";
  728. next;
  729. menu "Yes",-,"No",L_CANCEL_2;
  730. if (countitem(999) < 1 || Zeny < @repairprice) goto L_CANCEL_1;
  731. delitem 999,1;
  732. set Zeny,Zeny-@repairprice;
  733. repair(4);
  734. goto L_CLOSE;
  735. REPAIR5:
  736. mes "[" + @name$ + "]";
  737. mes "You're gonna repair " + getitemname(@broken1) + ".";
  738. mes "To repair this, I need ^ff9999One Steel^000000, and " + @repairprice + " Zeny.";
  739. mes "Continue?";
  740. next;
  741. menu "Yes",-,"No",L_CANCEL_2;
  742. if (countitem(999) < 1 || Zeny < @repairprice) goto L_CANCEL_1;
  743. delitem 999,1;
  744. set Zeny,Zeny-@repairprice;
  745. repair(5);
  746. goto L_CLOSE;
  747. REPAIR6:
  748. mes "[" + @name$ + "]";
  749. mes "You're gonna repair " + getitemname(@broken1) + ".";
  750. mes "To repair this, I need ^ff9999One Steel^000000, and " + @repairprice + " Zeny.";
  751. mes "Continue?";
  752. next;
  753. menu "Yes",-,"No",L_CANCEL_2;
  754. if (countitem(999) < 1 || Zeny < @repairprice) goto L_CANCEL_1;
  755. delitem 999,1;
  756. set Zeny,Zeny-@repairprice;
  757. repair(6);
  758. goto L_CLOSE;
  759. REPAIR7:
  760. mes "[" + @name$ + "]";
  761. mes "You're gonna repair " + getitemname(@broken1) + ".";
  762. mes "To repair this, I need ^ff9999One Steel^000000, and " + @repairprice + " Zeny.";
  763. mes "Continue?";
  764. next;
  765. menu "Yes",-,"No",L_CANCEL_2;
  766. if (countitem(999) < 1 || Zeny < @repairprice) goto L_CANCEL_1;
  767. delitem 999,1;
  768. set Zeny,Zeny-@repairprice;
  769. repair(7);
  770. goto L_CLOSE;
  771. REPAIR8:
  772. mes "[" + @name$ + "]";
  773. mes "You're gonna repair " + getitemname(@broken1) + ".";
  774. mes "To repair this, I need ^ff9999One Steel^000000, and " + @repairprice + " Zeny.";
  775. mes "Continue?";
  776. next;
  777. menu "Yes",-,"No",L_CANCEL_2;
  778. if (countitem(999) < 1 || Zeny < @repairprice) goto L_CANCEL_1;
  779. delitem 999,1;
  780. set Zeny,Zeny-@repairprice;
  781. repair(8);
  782. goto L_CLOSE;
  783. REPAIR9:
  784. mes "[" + @name$ + "]";
  785. mes "You're gonna repair " + getitemname(@broken1) + ".";
  786. mes "To repair this, I need ^ff9999One Steel^000000, and " + @repairprice + " Zeny.";
  787. mes "Continue?";
  788. next;
  789. menu "Yes",-,"No",L_CANCEL_2;
  790. if (countitem(999) < 1 || Zeny < @repairprice) goto L_CANCEL_1;
  791. delitem 999,1;
  792. set Zeny,Zeny-@repairprice;
  793. repair(9);
  794. goto L_CLOSE;
  795. REPAIR10:
  796. mes "[" + @name$ + "]";
  797. mes "You're gonna repair " + getitemname(@broken1) + ".";
  798. mes "To repair this, I need ^ff9999One Steel^000000, and " + @repairprice + " Zeny.";
  799. mes "Continue?";
  800. next;
  801. menu "Yes",-,"No",L_CANCEL_2;
  802. if (countitem(999) < 1 || Zeny < @repairprice) goto L_CANCEL_1;
  803. delitem 999,1;
  804. set Zeny,Zeny-@repairprice;
  805. repair(10);
  806. goto L_CLOSE;
  807. L_CANCEL_1:
  808. mes "[" + @name$ + "]";
  809. mes "Is it all you got?";
  810. mes "Unfortunately, I have kids to feed...";
  811. goto L_CLOSE;
  812. L_CANCEL_2:
  813. mes "[" + @name$ + "]";
  814. mes "Ok, but don't expect to be using that...";
  815. goto L_CLOSE;
  816. L_CANCEL_3:
  817. mes "[" + @name$ + "]";
  818. mes "Looks like you don't need anything repaired today...";
  819. goto L_CLOSE;
  820. L_CLOSE:
  821. close;
  822. }