Advertisement
Emistry

[RO] Custom Craftsman - Category

Jun 4th, 2016
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1.  
  2. // https://rathena.org/board/topic/106039-custom-craftsman/
  3.  
  4. prontera,155,175,5 script Craftman#xilence01 4_F_KAFRA9,{
  5. // success rate
  6. .@rate = 100;
  7. // required item
  8. setarray .@item,7227,10;
  9.  
  10. mes "Enchant Equipment: "+.@item[1]+"x "+getitemname( .@item[0] );
  11. switch ( select(
  12. "Armors",
  13. "Shields",
  14. "Garment",
  15. "Footgear",
  16. "Cancel"
  17. )) {
  18. case 1:
  19. .@position = EQI_ARMOR;
  20. .@enchant = rand( 28000,28005 );
  21. break;
  22. case 2:
  23. .@position = EQI_HAND_R;
  24. .@enchant = rand( 28006,28010 );
  25. break;
  26. case 3:
  27. .@position = EQI_GARMENT;
  28. .@enchant = rand( 28010,28015 );
  29. break;
  30. case 4:
  31. .@position = EQI_SHOES;
  32. .@enchant = rand( 28016,28020 );
  33. break;
  34. default: break;
  35. }
  36. if ( .@enchant ) {
  37. .@itemid = getequipid( .@position );
  38. if ( .@itemid <= 0 || getiteminfo( .@itemid,2 ) != IT_ARMOR ) {
  39. mes "You didnt wear any equipment.";
  40. }
  41. else if ( getequipcardid( .@position,1 ) ) {
  42. mes "The equipment already enchanted.";
  43. }
  44. else if ( countitem( .@item[0] ) < .@item[1] ) {
  45. mes "You didnt have "+.@item[1]+"x "+getitemname( .@item[0] );
  46. }
  47. else {
  48.  
  49. .@refine = getequiprefinerycnt( .@position );
  50. .@card1 = getequipcardid( .@position,0 );
  51. // .@card2 = getequipcardid( .@position,1 );
  52. .@card2 = .@enchant;
  53. .@card3 = getequipcardid( .@position,2 );
  54. .@card4 = getequipcardid( .@position,3 );
  55.  
  56. delequip .@position;
  57. delitem .@item[0],.@item[1];
  58.  
  59. if ( rand( 100 ) < .@rate ) {
  60. getitem2 .@itemid,1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4;
  61. mes "Success enchanted with "+getitemname( .@card2 );
  62. }
  63. else {
  64. mes "Fail";
  65. }
  66. }
  67. }
  68. close;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement