Advertisement
icabit

Refiner++ With Safety Option

Jan 29th, 2013
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.38 KB | None | 0 0
  1. //<?> -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o \\
  2. // Blacksmith/Card Removal Npc V.2.0 \\
  3. // by Luther \\
  4. // Credit To : Mytzer,TyrNemisis,ShadowMaster and \\
  5. // who ever made the Item Identifyer Deckard Cain. \\
  6. // Whoms Scripts were used in making this npc. \\
  7. // Also ToastOfDoom and Chachi911 for helping Debug it\\
  8. // (V.2.0 Uses the original eAthena Refine Script that\\
  9. //can have its rates configured in the refine_db.txt) \\
  10. // -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o \\
  11. turbo_room,78,98,5 script [refiner] 806,{
  12.  
  13. callfunc "refinemainx","Melchior",1;
  14. end;
  15. }
  16. //============================================================
  17. //= Main Refiner Function
  18. //============================================================
  19. //= To allow auto safe refining/multiple refining set the
  20. //= 0 after Melchior to '1' in the function call.
  21. //= To Change the Name of the NPC, just Edit it in the
  22. //= Beginning of the Script and the Melchior part of the
  23. //= Call function.
  24. //============================================================
  25. function script refinemainx {
  26. set .@features,getarg(1);
  27. set @donate,0;
  28. set @donateitem,7227;//change this to your item number of choice
  29. set @donateamount,1;//amount of donation refine ticket per refine
  30. mes "[" + getarg(0) + "]";
  31. mes "I can Refine, Extract Cards, Identify Items, and Repair Broken Items ^FF0000which of my services are you interested in?^000000";
  32. menu "Refining",L_Refine,"Item Repair",L_Repair,"Card Removal",L_CardRemoval,"Item Identification",L_ItemIdentify,"Buy Materials",L_Buy_Materials;
  33. L_Refine:
  34. mes "refining eh?";
  35. next;
  36. mes "[" + getarg(0) + "]";
  37. mes "There are 2 kinds of refining you can use.....";
  38. mes "You can use "+ @donateamount +" piece/s "+ getitemname(@donateitem) +" so your item wont break if it fails or Do the normal refine";
  39. mes "Note: if you use refining protection either it will success or fail it will consume 1 Refining Protection Ticket per refine";
  40. mes "Do you want to use Refining Protection Ticket?";
  41. switch(select("No:Yes")){
  42. case 1:
  43. set @donate,0;
  44. goto L_cont;
  45. break;
  46. case 2:
  47. if(countitem(@donateitem)<=(@donateamount-1)){ next; mes "You Dont have enough Refining Protection Ticket";set @donate,0; close; break;}
  48. else{
  49. set @donate,1;
  50. goto L_cont;
  51. break;
  52. }
  53. }
  54. L_cont:
  55. mes "I can refine all kinds of weapons, armor and equipment, so let me";
  56. mes "know what you want me to refine.";
  57. next;
  58.  
  59. setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
  60. set .@menu$,"";
  61. for( set .@i,1; .@i <= 10; set .@i,.@i+1 )
  62. {
  63. if( getequipisequiped(.@i) )
  64. set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
  65.  
  66. set .@menu$, .@menu$ + ":";
  67. }
  68. set .@part,select(.@menu$);
  69. if(!getequipisequiped(.@part)) {
  70. mes "[" + getarg(0) + "]";
  71. mes "You're not wearing";
  72. mes "anything there that";
  73. mes "I can refine.";
  74. emotion 6;
  75. close;
  76. }
  77. //Check if the item is refinable...
  78. if(!getequipisenableref(.@part)) {
  79. mes "[" + getarg(0) + "]";
  80. mes "I don't think I can";
  81. mes "refine this item at all...";
  82. close;
  83. }
  84. //Check if the item is identified... (Don't know why this is in here... but kept it anyway)
  85. if(!getequipisidentify(.@part)) {
  86. mes "[" + getarg(0) + "]";
  87. mes "You can't refine this";
  88. mes "if you haven't appraised";
  89. mes "it first. Make sure your";
  90. mes "stuff is identified before";
  91. mes "I can refine it.";
  92. close;
  93. }
  94. //Check to see if the items is already +10
  95. if(getequiprefinerycnt(.@part) >= 10) {
  96. mes "[" + getarg(0) + "]";
  97. mes "I can't refine this";
  98. mes "any more. This is as";
  99. mes "refined as it gets!";
  100. close;
  101. }
  102. set .@refineitemid, getequipid(.@part); // save id of the item
  103. set .@refinerycnt, getequiprefinerycnt(.@part); //save refinery count
  104. switch(getequipweaponlv(.@part)){
  105. case 0: //Refine Armor
  106. set .@price,5000;
  107. set .@material,985;
  108. set .@safe,4;
  109. break;
  110. case 1: //Refine Level 1 Weapon
  111. set .@price,5000;
  112. set .@material,1010;
  113. set .@safe,7;
  114. break;
  115. case 2: //Refine Level 2 Weapon
  116. set .@price,5000;
  117. set .@material,1011;
  118. set .@safe,6;
  119. break;
  120. case 3: //Refine Level 3 Weapon
  121. set .@price,5000;
  122. set .@material,984;
  123. set .@safe,5;
  124. break;
  125. case 4: //Refine Level 4 Weapon
  126. set .@price,5000;
  127. set .@material,984;
  128. set .@safe,4;
  129. break;
  130. case 5: //Refine other stuff?
  131. set .@price,5000;
  132. set .@material,985;
  133. set .@safe,4;
  134. break;
  135. }
  136. if(.@features != 1) {
  137. mes "[" + getarg(0) + "]";
  138. mes "To refine this I need";
  139. if (@donate==1){mes "one ^003366"+@donateamount+" piece/s "+getitemname(@donateitem)+"^000000 And";}
  140. mes "one ^003366"+getitemname(.@material)+"^000000 Plus";
  141. mes "a service fee of " + .@price + " Zeny.";
  142. mes "Do you really wish to continue?";
  143. next;
  144. if(select("Yes:No") == 2){
  145. mes "[" + getarg(0) + "]";
  146. mes "Yeah...";
  147. mes "There's no need to";
  148. mes "rush. Take your time.";
  149. close;
  150. }
  151. if(getequippercentrefinery(.@part) < 100) {
  152. mes "[" + getarg(0) + "]";
  153. mes "Oh no! If I continue to";
  154. mes "refine this, there's a risk it could";
  155. switch(.@material) {
  156. case 985:
  157. mes "be destroyed! That means that ^FF0000this equipment^000000, and ^FF0000any cards^000000 or special properties added to this armor, ^FF0000will be gone^000000.";
  158. break;
  159. default:
  160. mes "be destroyed, and you'd ^FF0000lose the weapon^000000, any ^FF0000cards in the weapon^000000,";
  161. mes "or any added special properties.";
  162. break;
  163. }
  164. next;
  165. mes "["+getarg(0)+"]";
  166. mes "I can't make it any clearer.";
  167. mes "Once a weapon is destroyed,";
  168. mes "there's no getting it back.";
  169. mes "You really have a chance to";
  170. mes "^FF0000lose this weapon^000000 forever.";
  171. mes "Do you still want to refine?";
  172. next;
  173. if(select("Yes:No") == 2){
  174. mes "[" + getarg(0) + "]";
  175. mes "I completely agree...";
  176. mes "I might be a great refiner, but sometimes even I make mistakes.";
  177. close;
  178. }
  179. }
  180. if (@donate==1){
  181. if (countitem(@donateitem)<=(@donateamount-1))
  182. mes "[" + getarg(0) + "]";
  183. mes "You don't Have enough";
  184. mes getitemname(@donateitem)+"...";
  185. mes "Go get some more. I'll be";
  186. mes "here all day if you need me.";
  187. close;
  188. }
  189. if((countitem(.@material) < 1) || (Zeny < .@price)) {
  190. mes "[" + getarg(0) + "]";
  191. mes "You don't seem to have";
  192. mes "enough Zeny or "+getitemname(.@material)+"...";
  193. mes "Go get some more. I'll be";
  194. mes "here all day if you need me.";
  195. close;
  196. }
  197. if (@donate==1){ delitem @donateitem,@donateamount; }
  198. set Zeny,Zeny-.@price;
  199. delitem .@material,1;
  200. if(getequipisequiped(.@part) == 0) { // hacker has removed the item (not changed, why?)
  201. mes "[" + getarg(0) + "]";
  202. mes "Look here... you don't have any Items on...";
  203. close;
  204. }
  205. if(getequiprefinerycnt(.@part) != .@refinerycnt || getequipid(.@part) != .@refineitemid) { // hacker has changed the item
  206. mes "[" + getarg(0) + "]";
  207. Emotion e_an;
  208. mes "Wait a second...";
  209. mes "Do you think I'm stupid?!";
  210. mes "You switched the item while I wasn't looking! Get out of here!";
  211. close;
  212. }
  213. if(getequippercentrefinery(.@part) <= rand(100)) {
  214. if (@donate==1){}else{failedrefitem .@part;}
  215. mes "[" + getarg(0) + "]";
  216. set .@emo,rand(1,5);
  217. if (.@emo == 1) {
  218. Emotion e_cash;
  219. } else {
  220. Emotion e_swt;
  221. }
  222. if (@donate==1){set .@lose,4;}else{set .@lose,rand(1,3);}
  223. if (.@lose == 1) {
  224. mes "OH! MY GOD!";
  225. mes "Damn it! Not again!";
  226. mes "I'm terribly sorry, but you know practice does make perfect.";
  227. mes "Um, right? Heh heh...";
  228. } else if(.@lose == 2) {
  229. mes "Nooooooo!";
  230. mes "It broke!";
  231. mes "I-I'm sorry!";
  232. } else if(.@lose == 3){
  233. mes "Crap!";
  234. mes "It couldn't take";
  235. mes "much more tempering!";
  236. mes "Sorry about this...";
  237. }
  238. else{
  239. Mes "The item Failed to be upgraded but it did not break";
  240. }
  241. close;
  242. }
  243. mes "["+getarg(0)+"]";
  244. successrefitem .@part;
  245. Emotion e_heh;
  246. set .@win,rand(1,3);
  247. if (.@win == 1) {
  248. mes "Perfect!";
  249. mes "Heh heh!";
  250. mes "Once again,";
  251. mes "flawless work";
  252. mes "from the master~";
  253. } else if(.@win == 2) {
  254. mes "Success...!";
  255. mes "Yet again, my amazing";
  256. mes "talent truly dazzles";
  257. mes "and shines today.";
  258. } else {
  259. mes "Heh heh!";
  260. mes "I'm all done.";
  261. mes "No doubt, my work is";
  262. mes "to your satisfaction.";
  263. mes "Sheer, utter perfection~";
  264. }
  265. close;
  266. }
  267.  
  268. // New Refining Functions ========================
  269. if(getequiprefinerycnt(.@part) < .@safe) {
  270. mes "[" + getarg(0) + "]";
  271. mes "I can refine this to the safe limit or a desired number of times... it's your choice..." +@donate;
  272. next;
  273. set .@menu2,select("To the safe limit please.","I'll decide how many times.","I've changed my mind...");
  274. } else set .@menu2,2;
  275. switch(.@menu2){
  276. case 1:
  277. set .@refinecnt,.@safe - getequiprefinerycnt(.@part);
  278. mes "You don't need to use"+ getitemname(@donateitem)+"...";
  279. mes "I will not take any of your donation tickets";
  280. set @donate,0;
  281. break;
  282. case 2:
  283. next;
  284. mes "[" + getarg(0) + "]";
  285. mes "So how many times would you like me to refine your item?";
  286. next;
  287. input .@refinecnt;
  288. set .@refinecheck,.@refinecnt + getequiprefinerycnt(.@part);
  289. if (.@refinecnt < 1 || .@refinecheck > 10) {
  290. mes "[" + getarg(0) + "]";
  291. mes "I can't refine this item that many times.";
  292. close;
  293. }
  294. if(.@refinecheck > .@safe) {
  295. set .@refinecheck,.@refinecheck - .@safe;
  296. mes "[" + getarg(0) + "]";
  297. mes "This will try to refine the equipment " + .@refinecheck + " times past the safe limit.";
  298. if (@donate ==1){mes "Your equipment will not destroyed if it fails in the process... is that ok?";}
  299. else{
  300. mes "Your equipment may be destroyed... is that ok?";
  301. }
  302. next;
  303. if(select("Yes...","No...") == 2){
  304. mes "[" + getarg(0) + "]";
  305. mes "You said so..Hmm so be it...";
  306. close;
  307. }
  308. }
  309. break;
  310. case 3:
  311. next;
  312. mes "[" + getarg(0) + "]";
  313. mes "You said so..Hmm so be it...";
  314. close;
  315. }
  316. next;
  317. set .@fullprice,.@price * .@refinecnt;
  318. mes "[" + getarg(0) + "]";
  319. mes "That will cost you " + .@refinecnt + " piece/s " + getitemname(.@material) + " plus " + .@fullprice + " Zeny ";
  320. if (@donate==1){ mes "and " + (.@refinecnt*@donateamount) + " piece/s " + getitemname(@donateitem) + "";}
  321. mes "Is that ok?";
  322. next;
  323. if(select("Yes","No...") == 2){
  324. mes "[" + getarg(0) + "]";
  325. mes "You said so..Hmm so be it...";
  326. close;
  327. }
  328. if(@donate==1){
  329. if(countitem(@donateitem) <=((.@refinecnt * @donateamount)-1)){
  330. mes "[" + getarg(0) + "]";
  331. mes "You don't have enough "+ getitemname(@donateitem) +"...";
  332. close;
  333. }
  334. }
  335. if(countitem(.@material) < .@refinecnt || Zeny < .@fullprice) {
  336. mes "[" + getarg(0) + "]";
  337. mes "Is that all you got? Unfortunately I can't work for you at a lower price. Try putting yourself in my shoes.";
  338. close;
  339. }
  340. if(@donate==1){delitem @donateitem,.@refinecnt * @donateamount;}
  341. set Zeny,Zeny - .@fullprice;
  342. delitem .@material,.@refinecnt;
  343. while(.@refinecnt){
  344. if (getequipisequiped(.@part) == 0) {
  345. mes "[" + getarg(0) + "]";
  346. mes "Look here... you don't have any Items on...";
  347. close;
  348. }
  349. if (getequipid(.@part) != .@refineitemid || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) {
  350. mes "[" + getarg(0) + "]";
  351. mes "Clan... No, but Did you imagine I could be so stupid !?!";
  352. mes "You have changed it...";
  353. mes "Go out before I stun you with my Hammer!!!";
  354. close;
  355. }
  356. mes "Clang, clang!!!";
  357. if(.@menu2 == 2 && getequippercentrefinery(.@part) <= rand(100)) {
  358. if (@donate==1){}else{failedrefitem .@part;}
  359. emotion 23;
  360. mes "[" + getarg(0) + "]";
  361. if (@donate==1){ mes "The item Failed to be upgraded but it did not break";}else{mes "WAHHHH!!! I'm so sorry... I warned you this could happen...";}
  362. set .@refinecnt,.@refinecnt - 1;
  363. if(.@refinecnt == 0) close;
  364. mes "Here's the unused Zeny and Material back...";
  365. if (@donate==1){getitem @donateitem,.@refinecnt * @donateamount;}
  366. getitem .@material,.@refinecnt;
  367. set .@fullprice,.@refinecnt * .@price;
  368. set Zeny,Zeny + .@fullprice;
  369. close;
  370. }
  371. successrefitem .@part;
  372. emotion 21;
  373. set .@refinecnt,.@refinecnt - 1;
  374. next;
  375. }
  376. mes "[" + getarg(0) + "]";
  377. mes "All finished... Come again soon.";
  378. close;
  379.  
  380. L_CardRemoval:
  381. UPGRADEROOT:
  382. mes "Card Removal it is.";
  383. next;
  384. mes "[" + getarg(0) + "]";
  385. mes "I see you desire some cards taken from your equipment,or does this sound like what your looking for?";
  386. next;
  387. menu "Yes, it does.",REMOVEMENU,"What do you charge?",REMOVEPRICE,"No thanks.",CLOSEOUT;
  388.  
  389. REMOVEPRICE:
  390. mes "[" + getarg(0) + "]";
  391. mes "I charge a flat fee of 5000 zeny, plus 5000 zeny for each card I remove from the item.";
  392. next;
  393. menu "Alright. Let's do it.",REMOVEMENU,"No thanks.",CLOSEOUT;
  394.  
  395. REMOVEMENU:
  396. mes "[" + getarg(0) + "]";
  397. mes "Very well. Which item shall I examine for you?";
  398. next;
  399. menu "I changed my mind.",CLOSEOUT,
  400. getequipname(1),SLOT1,
  401. getequipname(2),SLOT2,
  402. getequipname(3),SLOT3,
  403. getequipname(4),SLOT4,
  404. getequipname(5),SLOT5,
  405. getequipname(6),SLOT6,
  406. getequipname(7),SLOT7,
  407. getequipname(8),SLOT8,
  408. getequipname(9),SLOT9,
  409. getequipname(10),SLOT10;
  410.  
  411. SLOT1:
  412. set @part,1;
  413. goto CARDNUMCHECK;
  414.  
  415. SLOT2:
  416. set @part,2;
  417. goto CARDNUMCHECK;
  418.  
  419. SLOT3:
  420. set @part,3;
  421. goto CARDNUMCHECK;
  422.  
  423. SLOT4:
  424. set @part,4;
  425. goto CARDNUMCHECK;
  426.  
  427. SLOT5:
  428. set @part,5;
  429. goto CARDNUMCHECK;
  430.  
  431. SLOT6:
  432. set @part,6;
  433. goto CARDNUMCHECK;
  434.  
  435. SLOT7:
  436. set @part,7;
  437. goto CARDNUMCHECK;
  438.  
  439. SLOT8:
  440. set @part,8;
  441. goto CARDNUMCHECK;
  442.  
  443. SLOT9:
  444. set @part,9;
  445. goto CARDNUMCHECK;
  446.  
  447. SLOT10:
  448. set @part,10;
  449. goto CARDNUMCHECK;
  450.  
  451. CARDNUMCHECK:
  452. if(getequipcardcnt(@part) == 0) goto DENYCARDCOUNT;
  453. set @cardcount,getequipcardcnt(@part);
  454. if(@cardcount > 1) goto CARDNUMMULTIMSG;
  455. mes "[" + getarg(0) + "]";
  456. mes "This item has " + @cardcount + " card compounded on it. To perform my magic, I will need 5000 zeny.";
  457. goto CARDNUMPOSTMSG;
  458. CARDNUMMULTIMSG:
  459. mes "[" + getarg(0) + "]";
  460. mes "This item has " + @cardcount + " cards compounded on it. To perform my magic, I will need " + (5000+(@cardcount * 5000)) + " zeny.";
  461. CARDNUMPOSTMSG:
  462. next;
  463. menu "Very well. Do it.",REMOVECARDWARNING,"Never mind.",CLOSEOUT;
  464.  
  465. REMOVECARDWARNING:
  466. mes "[" + getarg(0) + "]";
  467. mes "Before I begin, I must warn you--I may fail. If I do, you will only lose what you have invested?";
  468. menu "Go Ahead",PRIORITYITEM,"I changed my mind about this.",CLOSEOUT;
  469.  
  470.  
  471. PRIORITYITEM:
  472. set @failtype,1;
  473. goto REMOVECARD;
  474.  
  475.  
  476.  
  477. REMOVECARD:
  478. mes "[" + getarg(0) + "]";
  479. mes "Very well. I shall begin.";
  480. next;
  481. if((zeny < (5000+(@cardcount * 5000)))) goto DENYMATERIAL;
  482. set zeny,zeny - (5000+(@cardcount * 5000));
  483.  
  484. // Replace the constants in the next 3 lines with failure chance values defined in refine_db.txt
  485. // First value = Total failure chance (item and cards destroyed)
  486. // Second value = Partial failure chance (one or the other is destroyed, player decides which one is safe)
  487. // Third value = Harmless failure chance (all that's lost is your investment)
  488.  
  489. set @failchance,rand(100);
  490. // if(@failchance < 2) goto FAILREMOVECARD0;
  491. // if((@failchance < 8) && (@failtype == 1)) goto FAILREMOVECARD1;
  492. // if((@failchance < 8) && (@failtype == 2)) goto FAILREMOVECARD2;
  493. if(@failchance < 1) goto FAILREMOVECARD3;
  494. successremovecards @part;
  495. mes "[" + getarg(0) + "]";
  496. mes "The process was a success. Here are your cards and your item. Farewell.";
  497. close;
  498.  
  499. FAILREMOVECARD0:
  500. mes "[" + getarg(0) + "]";
  501. mes "The process was a total failure. I am afraid the item and the cards were destroyed.";
  502. failedremovecards @part,0;
  503. close;
  504.  
  505. FAILREMOVECARD1:
  506. mes "[" + getarg(0) + "]";
  507. mes "While I have managed to remove the cards from the item, they were destroyed in the process. The item, however, is okay.";
  508. failedremovecards @part,1;
  509. close;
  510.  
  511. FAILREMOVECARD2:
  512. mes "[" + getarg(0) + "]";
  513. mes "Most unfortunate. I succeeded at removing the cards, but the item itself was destroyed in the process.";
  514. failedremovecards @part,2;
  515. close;
  516.  
  517. FAILREMOVECARD3:
  518. mes "[" + getarg(0) + "]";
  519. mes "I have failed to remove the cards. Better luck next time.";
  520. failedremovecards @part,3;
  521. close;
  522.  
  523. DENYCARDCOUNT:
  524. mes "[" + getarg(0) + "]";
  525. mes "There are no cards compounded on this item. Quit wasting my time.";
  526. close;
  527.  
  528. DENYMATERIAL:
  529. mes "[" + getarg(0) + "]";
  530. mes "You do not have enough zeny, go get some cash. My work isn't for free.";
  531. close;
  532.  
  533. CLOSEOUT:
  534. mes "[" + getarg(0) + "]";
  535. mes "Very well. Return at once if you seek my services.";
  536. close;
  537.  
  538. L_ItemIdentify:
  539. // Price
  540. // =====
  541. // This is the Price in Zeny for one identified Item
  542.  
  543. set @price, 40;
  544. // Actual Script Begins Here
  545. // =========================
  546. mes "Item Identification, ok then.";
  547. next;
  548. mes "[" + getarg(0) + "]";
  549. mes "Want me to Identify your items?";
  550. mes "It's just "+@price+" Zeny each item.";
  551. next;
  552. menu "Sure.",-,"No thanks...",L_Bye;
  553.  
  554. getinventorylist;
  555. set @identify, 0;
  556.  
  557. for(set @i, 0; @i < @inventorylist_count; set @i, @i + 1) {
  558. if (@inventorylist_identify[@i] == 0) set @identify, @identify + 1;
  559. }
  560.  
  561. if (@identify == 0) goto L_Nothing;
  562.  
  563. mes "[" + getarg(0) + "]";
  564. if (@identify < 2) {
  565. mes "You've got one unidentified item in your inventory.";
  566. mes "I'll identify it for "+@price+" Zeny.";
  567.  
  568. } else {
  569. mes "You've got "+@identify+" unidentified items in your inventory.";
  570. mes "I'll identify them for "+(@identify * @price)+" Zeny.";
  571.  
  572. }
  573. mes "If you've got any ^00AA00Magnifiers^000000, I'll take those instead.";
  574. mes "Shall I start now?";
  575. next;
  576. menu "Ok, let's go!",-,"What a ripoff...",L_Bye;
  577.  
  578. getinventorylist;
  579. set @identified, 0;
  580.  
  581. for(set @i, 0; @i < @inventorylist_count; set @i, @i + 1) {
  582. if (@inventorylist_identify[@i] == 0) {
  583. if (countitem(611) > 0) delitem 611,1;
  584. else if (Zeny < @price) goto L_NoZeny;
  585. else set Zeny, Zeny - @price;
  586. delitem2 @inventorylist_id[@i],1,0,0,0,0,0,0,0;
  587. getitem @inventorylist_id[@i],1;
  588. set @identified, @identified + 1;
  589. }
  590. }
  591.  
  592. mes "[" + getarg(0) + "]";
  593. mes "Well, I identified everything!";
  594. mes "I've identified a total of "+@identified+" items for you.";
  595. mes "Bye~";
  596. close;
  597.  
  598. L_Nothing:
  599. mes "[" + getarg(0) + "]";
  600. mes "You don't have any unidentified Items.";
  601. close;
  602.  
  603. L_NoZeny:
  604. mes "[" + getarg(0) + "]";
  605. mes "You don't have enough Zeny.";
  606. close;
  607.  
  608. L_Bye:
  609. mes "[" + getarg(0) + "]";
  610. mes "...";
  611. close;
  612.  
  613. L_Repair:
  614. mes "Repairing it is!";
  615. next;
  616. if (getbrokenid(1) == 0) goto L_Waste;
  617. mes "[" + getarg(0) + "]";
  618. mes "Each repair costs 2000 zeny would you like to repair an item now?";
  619. menu "Yes",L_RepairItem,"No",L_Bye;
  620.  
  621. L_RepairItem:
  622. if(zeny < (2000)) goto L_NoZeny;
  623. mes "Select the item to repair from the menu.";
  624. set @choice, select(getitemname(getbrokenid(1)), getitemname(getbrokenid(2)), getitemname(getbrokenid(3)), getitemname(getbrokenid(4)), getitemname(getbrokenid(5)), getitemname(getbrokenid(6)), getitemname(getbrokenid(7)), getitemname(getbrokenid(8)), getitemname(getbrokenid(9)), getitemname(getbrokenid(10)));
  625.  
  626. set zeny, zeny - 2000;
  627. repair(@choice);
  628. goto L_Repaired;
  629.  
  630. L_Waste:
  631. mes "[" + getarg(0) + "]";
  632. mes "Do not waste my time, you have no items in need of repair.";
  633. close;
  634. L_Repaired:
  635. mes "[" + getarg(0) + "]";
  636. mes "Your item has been repaired, please be more careful.";
  637. close;
  638. L_Buy_Materials:
  639. mes "so you want to buy materials.";
  640. next;
  641. mes "[" + getarg(0) + "]";
  642. mes "I sell 4 kinds of Metal";
  643. mes "for tempering weaponry and armor.";
  644. next;
  645. mes "[" + getarg(0) + "]";
  646. mes "I have Phracon for lvl 1 Weapons.";
  647. mes "Emveretarcon for lvl 2 Weapons,and";
  648. mes "Oridecon for lvl 3/4 Weapons";
  649. mes "As well as Elunium for armors.";
  650. next;
  651. switch(select("Phracon - 10000 Zeny:Emveretarcon - 10000 Zeny:Oridecon - 80000 Zeny:Elunium - 80000 Zeny")) {
  652. case 1:
  653. set .@material,1010;
  654. set .@price,10000;
  655. break;
  656. case 2:
  657. set .@material,1011;
  658. set .@price,10000;
  659. break;
  660. case 3:
  661. set .@material,984;
  662. set .@price,80000;
  663. break;
  664. case 4:
  665. set .@material,985;
  666. set .@price,80000;
  667. break;
  668. }
  669. mes "[" + getarg(0) + "]";
  670. mes "So how many do you wish to buy?";
  671. mes "If you don't want any, please enter the number, '0.'";
  672. next;
  673. while(1) {
  674. input .@input;
  675. if (.@input == 0) {
  676. mes "[" + getarg(0) + "]";
  677. mes "The deal has";
  678. mes "been cancelled.";
  679. close;
  680. }
  681. else if (.@input < 0 || .@input > 500) {
  682. mes "[" + getarg(0) + "]";
  683. mes "Alright, you can";
  684. mes "puchase up to 500.";
  685. mes "No more than that,";
  686. mes "got it? Good.";
  687. next;
  688. }
  689. else {
  690. break;
  691. }
  692. }
  693. set .@sell,.@input * .@price;
  694. if (Zeny < .@sell) {
  695. mes "[" + getarg(0) + "]";
  696. mes "Err...";
  697. mes "You don't have";
  698. mes "enough Zeny to buy";
  699. mes ""+ .@input +" of them.";
  700. close;
  701. }
  702. if (checkweight(.@material,.@input) == 0) {
  703. mes "[" + getarg(0) + "]";
  704. mes "Hmm...";
  705. 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 Storage and try again?";
  706. close;
  707. }
  708. getitem .@material,.@input;
  709. set Zeny,Zeny-.@sell;
  710. mes "[" + getarg(0) + "]";
  711. mes "Here you are!";
  712. mes "Thank you for";
  713. mes "your patronage.";
  714. close;
  715.  
  716.  
  717. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement