Advertisement
Guest User

refine

a guest
Nov 17th, 2011
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.54 KB | None | 0 0
  1. prontera,121,52,5 script Suhnbi#cashprt 85,{
  2. mes "[^ff0000Suhnbi^000000]";
  3. mes "I am the Armsmith";
  4. mes "I can refine all kinds of weapons,";
  5. mes "armor and equipment, so let me";
  6. mes "know what you want to refine.";
  7. next;
  8. setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
  9. set .@menu$,"";
  10. for( set .@i,1; .@i <= 10; set .@i,.@i+1 )
  11. {
  12. if( getequipisequiped(.@i) )
  13. set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
  14. set .@menu$, .@menu$ + ":";
  15. }
  16. set .@part,select(.@menu$);
  17. if( !getequipisequiped(.@part) )
  18. close;
  19. if( !getequipisenableref(.@part) )
  20. {
  21. mes "[^ff0000Suhnbi^000000]";
  22. mes "I don't think I can refine this item at all.";
  23. close;
  24. }
  25. if( !getequipisidentify(.@part) )
  26. {
  27. mes "[^ff0000Suhnbi^000000]";
  28. mes "This has not been identified. So, it can't be refined...";
  29. close;
  30. }
  31. if( getequiprefinerycnt(.@part) >= 10 )
  32. {
  33. mes "[^ff0000Suhnbi^000000]";
  34. mes "This item cannot be refined because it has already reached its maximum level...";
  35. close;
  36. }
  37. // Make sure you have the neccessary items and Zeny to refine your items
  38. // Determines chance of failure and verifies that you want to continue.
  39. switch( getequipweaponlv(.@part) )
  40. {
  41. case 1: callsub S_RefineValidate,1,7620,50,.@part; break;
  42. case 2: callsub S_RefineValidate,2,7620,200,.@part; break;
  43. case 3: callsub S_RefineValidate,3,7620,5000,.@part; break;
  44. case 4: callsub S_RefineValidate,4,7620,20000,.@part; break;
  45. default: callsub S_RefineValidate,0,7619,2000,.@part; break;
  46. }
  47. if( getequippercentrefinery(.@part) > rand(100) || getequippercentrefinery(.@part) > rand(100) )
  48. {
  49. mes "[^ff0000Suhnbi^000000]";
  50. mes "Clink! Clank! Clunk!";
  51. SuccessRefItem .@part;
  52. next;
  53. Emotion e_no1;
  54. mes "[^ff0000Suhnbi^000000]";
  55. mes "Here you are! It's done.";
  56. mes "It's been a while since I've made such a fine equipment. You must be happy because it has become stronger!";
  57. close;
  58. }
  59. else
  60. {
  61. // [Z3R0] - Added Item Check and Equipment Malfunctions
  62. // Armor Check & Safeguard from Deletion, -1 From Refine Count (Retain All Cards)
  63. if (.@part <= 2 || .@part >= 5) { // Armor Body Parts (Non Weapons)
  64. if (getequiprefinerycnt(.@part) >= 7) { // Current Refine is 7 or Higher
  65. //FailedRefItem .@part;
  66. // Do Not know if there is an attribute function to get attribute
  67. set .@card[0], getequipcardid(.@part, 0);
  68. set .@card[1], getequipcardid(.@part, 1);
  69. set .@card[2], getequipcardid(.@part, 2);
  70. set .@card[3], getequipcardid(.@part, 3);
  71. getitem2 getequipid(.@part),1,1,getequiprefinerycnt(.@part) - 1,0,.@card[0],.@card[1],.@card[2],.@card[3];
  72. failedrefitem .@part;
  73. }
  74. }
  75. // Weapon Check & Safeguard from Deletion, -1 From Deletion, -1 From Refine Count (Retain All Cards)
  76. if (.@part <= 4 && .@part >= 3) { // Weapons (Right and Left Hand)
  77. if (getequiprefinerycnt(.@part) >= 8) { // Current Refine is 8 or Higher
  78. //FailedRefItem .@part;
  79. // Do Not know if there is an attribute function to get attribute
  80. set .@card[0], getequipcardid(.@part, 0);
  81. set .@card[1], getequipcardid(.@part, 1);
  82. set .@card[2], getequipcardid(.@part, 2);
  83. set .@card[3], getequipcardid(.@part, 3);
  84. getitem2 getequipid(.@part),1,1,getequiprefinerycnt(.@part) - 1,0,.@card[0],.@card[1],.@card[2],.@card[3];
  85. failedrefitem .@part;
  86. }
  87. }
  88.  
  89. mes "[^ff0000Suhnbi^000000]";
  90. mes "Clink! Clank! Clunk!";
  91. //FailedRefItem .@part;
  92. next;
  93. if (rand(5) == 1)
  94. Emotion e_cash;
  95. else
  96. Emotion e_omg;
  97. mes "[^ff0000Suhnbi^000000]";
  98. mes "Cough!!!!";
  99. next;
  100. mes "[^ff0000Suhnbi^000000]";
  101. mes "Cough...Cough..";
  102. mes "What a shame...";
  103. mes "The refining process failed. I had told you earlier this might happen!";
  104. close;
  105. }
  106. S_RefineValidate:
  107. mes "[^ff0000Suhnbi^000000]";
  108. if (getarg(0))
  109. mes "A level " + getarg(0) + " weapon...";
  110. mes "To refine this I need one ^ff9999" + getitemname(getarg(1)) + "^000000 and a service fee of " + getarg(2) + " Zeny.";
  111. mes "Do you wish to continue?";
  112. next;
  113. if( select("Yes:No") == 1 )
  114. {
  115. if( getequippercentrefinery(getarg(3)) < 100 )
  116. {
  117. mes "[^ff0000Suhnbi^000000]";
  118. mes "Wow!!";
  119. mes "This weapon, probably";
  120. mes "looks like it's been refined...";
  121. mes "many times...";
  122. mes "It may break if";
  123. mes "you refine it again.";
  124. next;
  125. mes "[^ff0000Suhnbi^000000]";
  126. mes "But don't worry this is a special case so i will only take the stone if it fails.";
  127. mes " ";
  128. mes "I think we have a fair trade do you still want to continue?";
  129. next;
  130. if( select("Yes:No") == 2 )
  131. {
  132. mes "[^ff0000Suhnbi^000000]";
  133. mes "I completely agree...";
  134. mes "I might be a great refiner, but sometimes even I make mistakes.";
  135. close;
  136. }
  137. }
  138. if( countitem(getarg(1)) > 0 && Zeny > getarg(2) )
  139. {
  140. delitem getarg(1), 1;
  141. set Zeny, Zeny - getarg(2);
  142. return;
  143. }
  144. else
  145. {
  146. mes "[^ff0000Suhnbi^000000]";
  147. mes "You don't seem to have enough Zeny or " + getitemname(getarg(1)) + "...";
  148. mes "Go get some more. I'll be here all day if you need me.";
  149. close;
  150. }
  151. }
  152. else
  153. {
  154. mes "[^ff0000Suhnbi^000000]";
  155. mes "Yeah... There's no need to rush.";
  156. mes "Take your time.";
  157. close;
  158. }
  159. }
  160.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement