advanced_refiner.txt 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. //===== rAthena Script =======================================
  2. //= Advanced Refiner
  3. //===== By: ==================================================
  4. //= L0ne_W0lf
  5. //===== Current Version: =====================================
  6. //= 1.6
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= [Official Conversion]
  11. //= Refiner that uses Enriched ores to increase upgrade success.
  12. //= After a conversation with Doddler, it's been established that
  13. //= the advanced refiner works similar the the "Bubble Gum" item.
  14. //= The success percentage is not "increased" however, if it fails
  15. //= You get a second try. This tries twice at the same time,
  16. //= effectively giving you a re-roll on your attempt.
  17. //= - Dialog is only partly official to iRO.
  18. //= - Uses the iRO position for this NPC.
  19. //===== Additional Comments: =================================
  20. //= 1.0 First Version. [L0ne_W0lf]
  21. //= 1.1 Fixed a weird carriage return. o_o [L0ne_W0lf]
  22. //= 1.2 Optimizing refine method [Zephyrus]
  23. //= 1.3 Typo fixes [Yommy]
  24. //= 1.4 Removed unnecessary dialogs [Zephyrus]
  25. //= 1.4a Added 'disable_items' command. [Euphy]
  26. //= 1.4b Fixed coordinates. [Euphy]
  27. //= 1.5 Some official script updates. [Euphy]
  28. //= 1.6 Added VIP features. [Euphy]
  29. //============================================================
  30. payon,157,146,6 script Suhnbi#cash 85,{
  31. disable_items;
  32. mes "[Suhnbi]";
  33. mes "I am the Armsmith";
  34. mes "I can refine all kinds of weapons,";
  35. mes "armor and equipment, so let me";
  36. mes "know what you want to refine.";
  37. next;
  38. setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
  39. set .@menu$,"";
  40. for(set .@i,1; .@i<=10; set .@i,.@i+1) {
  41. if (getequipisequiped(.@i)) {
  42. set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
  43. set .@equipped,1;
  44. }
  45. set .@menu$, .@menu$ + ":";
  46. }
  47. if (.@equipped == 0) {
  48. mes "[Suhnbi]";
  49. mes "I don't think I can refine any items you have...";
  50. close;
  51. }
  52. set .@part, select(.@menu$);
  53. if (!getequipisequiped(.@part)) //custom check
  54. close;
  55. if (!getequipisenableref(.@part)) {
  56. mes "[Suhnbi]";
  57. mes "Go find another Blacksmith. You can't refine this thing.";
  58. close;
  59. }
  60. if (getequiprefinerycnt(.@part) >= 10) {
  61. mes "[Suhnbi]";
  62. mes "Hmm... someone perfected this already. I don't think I can work on it further.";
  63. close;
  64. }
  65. // Make sure you have the neccessary items and Zeny to refine your items
  66. // Determines chance of failure and verifies that you want to continue.
  67. switch(getequipweaponlv(.@part)) {
  68. case 1: callsub S_RefineValidate,1,7620,50,.@part; break;
  69. case 2: callsub S_RefineValidate,2,7620,200,.@part; break;
  70. case 3: callsub S_RefineValidate,3,7620,5000,.@part; break;
  71. case 4: callsub S_RefineValidate,4,7620,20000,.@part; break;
  72. default: callsub S_RefineValidate,0,7619,2000,.@part; break;
  73. }
  74. mes "[Suhnbi]";
  75. mes "Clang! Clang! Clang!";
  76. if (getequippercentrefinery(.@part) > rand(100) || getequippercentrefinery(.@part) > rand(100)) {
  77. successrefitem .@part;
  78. next;
  79. emotion e_no1;
  80. mes "[Suhnbi]";
  81. mes "There you go! It's done.";
  82. 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!";
  83. close;
  84. }
  85. failedrefitem .@part;
  86. next;
  87. emotion (!rand(5))?e_cash:e_omg;
  88. mes "[Suhnbi]";
  89. mes "Uuuuuuuuuummmmmph!!!";
  90. next;
  91. mes "[Suhnbi]";
  92. mes "...";
  93. mes ".....";
  94. mes ".......Huhuhuhuhu~";
  95. mes "........It was your choice and my ability, no regret.";
  96. close;
  97. S_RefineValidate:
  98. set .@price, getarg(2);
  99. // If the VIP system is enabled, the prices for non-VIP players are considerably higher.
  100. if (VIP_SCRIPT && !vip_status(1)) {
  101. switch(getarg(0)){
  102. case 0: set .@price, .@price * 10; break;
  103. case 1: set .@price, .@price * 40; break;
  104. case 2: set .@price, .@price * 50; break;
  105. case 3: set .@price, .@price * 2; break;
  106. case 4: set .@price, .@price * 2; break;
  107. }
  108. }
  109. mes "[Suhnbi]";
  110. if (getarg(0))
  111. mes "You want to refine a level " + getarg(0) + " weapon?";
  112. mes "To refine that, you'll need to have one ^ff9999" + getitemname(getarg(1)) + "^000000 and " + .@price + " zeny.";
  113. mes "Would you like to continue?";
  114. next;
  115. if(select("Yes:No") == 1) {
  116. if (getequippercentrefinery(getarg(3)) < 100) {
  117. if (getarg(0)) {
  118. mes "[Suhnbi]";
  119. mes "Wow!!";
  120. mes "This weapon probably";
  121. mes "looks like it's been refined...";
  122. mes "many times...";
  123. mes "It may break if";
  124. mes "you refine it again.";
  125. next;
  126. mes "And if it breaks,";
  127. mes "you can't use it anymore!";
  128. mes "All the cards in it and the properties ^ff0000will be lost^000000!";
  129. mes "^ff0000Besides, the equipment will break!^000000";
  130. mes "Are you sure you still want to continue?";
  131. next;
  132. if(select("Yes:No") == 2) {
  133. mes "[Suhnbi]";
  134. mes "Good.";
  135. mes "Because if the weapon breaks from unreasonable refining, then I get a bad mood, too.";
  136. close;
  137. }
  138. } else {
  139. mes "[Suhnbi]";
  140. mes "Giggle. Giggle. Oh, you have guts, daring to refine this.";
  141. mes "You know it's pretty risky, don't you?";
  142. next;
  143. mes "If your defensive equipment is broken, you'll never be able to use it again.";
  144. mes "Even your cards and your modifications will ^ff0000completely disappear^000000.";
  145. //mes "Everything will disappear. As in... GONE!";
  146. mes "Do you really wish to continue?";
  147. next;
  148. if(select("Yes:No") == 2) {
  149. mes "[Suhnbi]";
  150. mes "What nonsense. You waste my precious time.";
  151. mes "Get lost, punk.";
  152. close;
  153. }
  154. }
  155. }
  156. if (countitem(getarg(1)) > 0 && Zeny > .@price) {
  157. delitem getarg(1),1;
  158. set Zeny, Zeny - .@price;
  159. return;
  160. }
  161. mes "[Suhnbi]";
  162. mes "Are these all you have?";
  163. 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?";
  164. close;
  165. }
  166. mes "[Suhnbi]";
  167. mes "I can't help it even if you're not happy about it...";
  168. close;
  169. }