Advertisement
existence_dev92

3RO Special Refiner

Mar 4th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.42 KB | None | 0 0
  1. payon,157,146,6 script Special Refiner 85,{
  2. disable_items;
  3. mes .@npc_name$ = "[Special Refiner]";
  4. mes "I am the Armsmith";
  5. mes "I can refine all kinds of weapons,";
  6. mes "armor and equipment, so let me";
  7. mes "know what you want to refine.";
  8. next;
  9.  
  10. setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW;
  11. for(set .@i,1; .@i<=10; set .@i,.@i+1) {
  12. if (getequipisequiped(.@indices[.@i])) {
  13. set .@menu$, .@menu$ + F_getpositionname(.@indices[.@i]) + "-[" + getequipname(.@indices[.@i]) + "]";
  14. set .@equipped,1;
  15. }
  16. set .@menu$, .@menu$ + ":";
  17. }
  18. if (.@equipped == 0) {
  19. mes .@npc_name$;
  20. mes "I don't think I can refine any items you have...";
  21. close;
  22. }
  23. set .@part, .@indices[ select(.@menu$) ];
  24.  
  25. if (!getequipisequiped(.@part)) //custom check
  26. close;
  27. if (!getequipisenableref(.@part)) {
  28. mes .@npc_name$;
  29. mes "Go find another Blacksmith. You can't refine this thing.";
  30. close;
  31. }
  32. if (getequiprefinerycnt(.@part) >= 10) {
  33. mes .@npc_name$;
  34. mes "Hmm... someone perfected this already. I don't think I can work on it further.";
  35. close;
  36. }
  37.  
  38. // Make sure you have the neccessary items and Zeny to refine your items
  39. // Determines chance of failure and verifies that you want to continue.
  40. switch(getequipweaponlv(.@part)) {
  41. case 1: callsub S_RefineValidate,1,36003,50,.@part; break;
  42. case 2: callsub S_RefineValidate,2,36003,200,.@part; break;
  43. case 3: callsub S_RefineValidate,3,36003,5000,.@part; break;
  44. case 4: callsub S_RefineValidate,4,36003,20000,.@part; break;
  45. default: callsub S_RefineValidate,0,36002,2000,.@part; break;
  46. }
  47.  
  48. mes .@npc_name$;
  49. mes "Clang! Clang! Clang!";
  50. if (getequippercentrefinery(.@part) > rand(100) || getequippercentrefinery(.@part) > rand(100)) {
  51. successrefitem .@part;
  52. next;
  53. emotion e_no1;
  54. mes .@npc_name$;
  55. mes "There you go! It's done.";
  56. mes "It's been a while since I've made such a fine "+((getequipweaponlv(.@part))?"weapon":"armor")+". You must be happy because it has become stronger!";
  57. close;
  58. }
  59. //failedrefitem .@part;
  60. misceffect 155;
  61. next;
  62. emotion (!rand(5))?e_cash:e_omg;
  63. mes .@npc_name$;
  64. mes "Uuuuuuuuuummmmmph!!!";
  65. close;
  66.  
  67. S_RefineValidate:
  68. .@weapon_lvl = getarg(0);
  69. .@item_req = getarg(1);
  70. set .@price, getarg(2);
  71.  
  72. // If the VIP system is enabled, the prices for non-VIP players are considerably higher.
  73. if (VIP_SCRIPT && !vip_status(VIP_STATUS_ACTIVE)) {
  74. switch(.@weapon_lvl){
  75. case 0: set .@price, .@price * 10; break;
  76. case 1: set .@price, .@price * 40; break;
  77. case 2: set .@price, .@price * 50; break;
  78. case 3: set .@price, .@price * 2; break;
  79. case 4: set .@price, .@price * 2; break;
  80. }
  81. }
  82.  
  83. mes .@npc_name$;
  84. if (.@weapon_lvl)
  85. mes "You want to refine a level "+ .@weapon_lvl +" weapon?";
  86. mes "To refine that, you'll need to have one ^ff9999"+ getitemname(.@item_req) +"^000000 and "+ .@price +" zeny.";
  87. mes "Would you like to continue?";
  88. next;
  89. if(select("Yes:No") == 1) {
  90. if (countitem(.@item_req) > 0 && Zeny > .@price) {
  91. delitem .@item_req,1;
  92. set Zeny, Zeny - .@price;
  93. return;
  94. }
  95. mes .@npc_name$;
  96. mes "Are these all you have?";
  97. mes "I'm very sorry, but I can't do anything without all the materials. Besides, I deserve some payments for my work, don't I?";
  98. close;
  99. }
  100. mes .@npc_name$;
  101. mes "I can't help it even if you're not happy about it...";
  102. close;
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement