advanced_refiner.txt 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. //===== rAthena Script =======================================
  2. //= Advanced Refiner
  3. //===== By: ==================================================
  4. //= L0ne_W0lf
  5. //===== Current Version: =====================================
  6. //= 1.4
  7. //===== Compatible With: =====================================
  8. //= rAthena SVN
  9. //===== Description: =========================================
  10. //= [Aegis 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. //============================================================
  26. payon,174,138,0 script Suhnbi#cash 85,{
  27. mes "[Suhnbi]";
  28. mes "I am the Armsmith";
  29. mes "I can refine all kinds of weapons,";
  30. mes "armor and equipment, so let me";
  31. mes "know what you want to refine.";
  32. next;
  33. setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
  34. set .@menu$,"";
  35. for( set .@i,1; .@i <= 10; set .@i,.@i+1 )
  36. {
  37. if( getequipisequiped(.@i) )
  38. set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
  39. set .@menu$, .@menu$ + ":";
  40. }
  41. set .@part,select(.@menu$);
  42. if( !getequipisequiped(.@part) )
  43. close;
  44. if( !getequipisenableref(.@part) )
  45. {
  46. mes "[Suhnbi]";
  47. mes "I don't think I can refine this item at all.";
  48. close;
  49. }
  50. if( !getequipisidentify(.@part) )
  51. {
  52. mes "[Suhnbi]";
  53. mes "This has not been identified. So, it can't be refined...";
  54. close;
  55. }
  56. if( getequiprefinerycnt(.@part) >= 10 )
  57. {
  58. mes "[Suhnbi]";
  59. mes "This item cannot be refined because it has already reached its maximum level...";
  60. close;
  61. }
  62. // Make sure you have the neccessary items and Zeny to refine your items
  63. // Determines chance of failure and verifies that you want to continue.
  64. switch( getequipweaponlv(.@part) )
  65. {
  66. case 1: callsub S_RefineValidate,1,7620,50,.@part; break;
  67. case 2: callsub S_RefineValidate,2,7620,200,.@part; break;
  68. case 3: callsub S_RefineValidate,3,7620,5000,.@part; break;
  69. case 4: callsub S_RefineValidate,4,7620,20000,.@part; break;
  70. default: callsub S_RefineValidate,0,7619,2000,.@part; break;
  71. }
  72. if( getequippercentrefinery(.@part) > rand(100) || getequippercentrefinery(.@part) > rand(100) )
  73. {
  74. mes "[Suhnbi]";
  75. mes "Clink! Clank! Clunk!";
  76. SuccessRefItem .@part;
  77. next;
  78. Emotion e_no1;
  79. mes "[Suhnbi]";
  80. mes "Here you are! It's done.";
  81. mes "It's been a while since I've made such a fine weapon. You must be happy because it has become stronger!";
  82. close;
  83. }
  84. mes "[Suhnbi]";
  85. mes "Clink! Clank! Clunk!";
  86. FailedRefItem .@part;
  87. next;
  88. if (rand(5) == 1){
  89. Emotion e_cash;
  90. } else {
  91. Emotion e_omg;
  92. }
  93. mes "[Suhnbi]";
  94. mes "Cough!!!!";
  95. next;
  96. mes "[Suhnbi]";
  97. mes "Cough...Cough..";
  98. mes "What a shame...";
  99. mes "Your equipment broke during the refining process. I had told you earlier this might happen!";
  100. close;
  101. S_RefineValidate:
  102. mes "[Suhnbi]";
  103. if (getarg(0))
  104. mes "A level " + getarg(0) + " weapon...";
  105. mes "To refine this I need one ^ff9999" + getitemname(getarg(1)) + "^000000 and a service fee of " + getarg(2) + " Zeny.";
  106. mes "Do you wish to continue?";
  107. next;
  108. if( select("Yes:No") == 1 )
  109. {
  110. if( getequippercentrefinery(getarg(3)) < 100 )
  111. {
  112. mes "[Suhnbi]";
  113. mes "Wow!!";
  114. mes "This weapon, probably";
  115. mes "looks like it's been refined...";
  116. mes "many times...";
  117. mes "It may break if";
  118. mes "you refine it again.";
  119. next;
  120. mes "And if it breaks,";
  121. mes "you can't use it anymore!";
  122. mes "All the cards in it and the";
  123. mes "properties";
  124. mes "^ff0000will be lost^000000!!";
  125. mes "^ff0000 besides, the equipment will break!^000000";
  126. mes " ";
  127. mes "Are you sure you still want to continue?";
  128. next;
  129. if( select("Yes:No") == 2 )
  130. {
  131. mes "[Suhnbi]";
  132. mes "I completely agree...";
  133. mes "I might be a great refiner, but sometimes even I make mistakes.";
  134. close;
  135. }
  136. }
  137. if( countitem(getarg(1)) > 0 && Zeny > getarg(2) )
  138. {
  139. delitem getarg(1), 1;
  140. set Zeny, Zeny - getarg(2);
  141. return;
  142. }
  143. mes "[Suhnbi]";
  144. mes "You don't seem to have enough Zeny or " + getitemname(getarg(1)) + "...";
  145. mes "Go get some more. I'll be here all day if you need me.";
  146. close;
  147. }
  148. mes "[Suhnbi]";
  149. mes "Yeah... There's no need to rush.";
  150. mes "Take your time.";
  151. close;
  152. }