johnlol

Legendary Smith

May 22nd, 2019
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //--- Bitmasks ----
  2. //  1   -   Top Headgear
  3. //  2   -   Armor
  4. //  4   -   Left Hand
  5. //  8   -   Right Hand
  6. //  16  -   Garment
  7. //  32  -   Shoes
  8. //  64  -   Left Accessory
  9. //  128 -   Right Accessory
  10. //  256 -   Middle Headgear
  11. //  512 -   Lower Headgear
  12. //  1023    -   all
  13.  
  14. // .....callfunc( "RefineFunc",<itemID>,<Amount>,<BitMasks>,<MinRefine>,<MaxRefine>,<CheckEquip>,<RefineMode>,<Percent> );
  15. //      1.  itemID      ->  Item that will be used during Refine.
  16. //      2.  Amount      ->  Amount of Required Items.
  17. //      3.  BitMask     ->  Refer to above bitmask table.
  18. //      4.  MinRefine   ->  Required Min Refine to use.
  19. //      5.  MaxRefine   ->  What is the Max Refine. [ Can Bypass Default Server Max Refine ]
  20. //      6.  CheckEquip  ->  Check Equipments is Refineable or not. [ 0 = Disable / 1 = Enable ]
  21. //      7.  RefineMode  ->  +1 / Max Refine. [ 0 = +1 Refine / 1 = Max Refine ]
  22. //      8.  Percent     ->  Rate of Success to refine current Equipment.
  23.  
  24. // Notes : You can Customize it according to whatever way you want.
  25. //  Different NPCs / Items with Different Settings.
  26. //  It will consume the items that you defined to Refine  the Equipments according to your Settings.
  27.  
  28. //----------- If used this as Item Script -----------
  29.  
  30. // Example : Red Potion with 100% Refine Rate
  31. //      501,Red_Potion,Red Potion,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc( "RefineFunc",501,1,63,0,10,1,0,100 ); },{},{}
  32. // Change Item Type to 11  and Amount Required to 1 ( Advised )
  33.  
  34. //----------- If used this as NPC Script ------------
  35.  
  36. // Example : 90% Success Rate Refiner.
  37. sec_in02.gat,178,149,3  script  Smith   826,{
  38. mes "You need to ^8B4513Fire Dragon Scale^000000 x^FF00005^000000";
  39. mes "Item ID# ^8000007451^000000";
  40. mes "to refine your item +^00800010^000000";
  41. mes "Chance of Success [^FF4500100%^000000]";
  42. callfunc( "RefineFunc",7451,5,1023,0,10,1,0,100 );
  43. }
  44.  
  45. sec_in02.gat,178,146,3  script  Legendary Smith 826,{
  46. mes "You need to ^8B4513Darkred Scale Piece^000000 x^FF00006^000000";
  47. mes "Item ID# ^8000006091^000000";
  48. mes "to refine your item ^00800010^000000+";
  49. mes "Chance of Success [^FF4500100%^000000]";
  50. callfunc( "RefineFunc2",6091,6,1023,10,20,1,0,100 );
  51. }
  52.  
  53.  
  54. function    script  RefineFunc  {
  55.  
  56. for( set .@i,1; .@i <= 10 ; set .@i,.@i + 1 )
  57.     set .@Menu$,.@Menu$ + (( getarg(2) & pow( 2,(.@i-1 ) ) && getequiprefinerycnt( .@i ) >= getarg(3) && getequiprefinerycnt( .@i ) < getarg(4) && getequipisequiped( .@i) )?"^FF0000+"+getequiprefinerycnt( .@i )+" ^0000FF"+getequipname( .@i )+" "+( getitemslots( getequipid( .@i ) )?"["+getitemslots( getequipid( .@i ) )+"]":"" )+"^000000":"" )+":";
  58. set .@Refine,select( .@Menu$ );
  59. mes "Required ^FF0000"+getarg(1)+"^000000x ^8B4513"+getitemname( getarg(0) )+"^000000";
  60. if( getarg(5) == 1 && !getequipisenableref( .@Refine ) )
  61.     mes "I cant refine this items. Because it is ^FF0000Un-Refineable^000000.";
  62. else{
  63.     if( select( "^FF0000Refine^000000:Cancel" ) == 2 ) close;  
  64.         if( countitem( getarg(0) ) < getarg(1) ) close;
  65.             delitem getarg(0),getarg(1);
  66.         if( rand(100) < getarg(7) ){
  67.             if( getarg(6) )
  68.                 while( getequiprefinerycnt( .@Refine ) < getarg(4) )
  69.                     successrefitem ( .@Refine );
  70.             else
  71.                 successrefitem ( .@Refine );
  72.         mes "You have refined:";
  73.         mes "^FF0000+"+getequiprefinerycnt( .@Refine )+" ^0000FF"+getequipname( .@Refine )+"^000000";
  74.         switch( rand(9) ) {
  75.         case 0: emotion e_ho; break;
  76.         case 1: emotion e_lv; break;
  77.         case 2: emotion e_lv2; break;
  78.         case 3: emotion e_heh; break;
  79.         case 4: emotion e_no1; break;
  80.         case 5: emotion e_kis; break;
  81.         case 6: emotion e_kis2; break;
  82.         case 7: emotion e_kis2; break;
  83.         case 8: emotion e_hp; break;
  84.     }
  85.         }else{
  86.             failedrefitem ( .@Refine );
  87.             mes "Sorry, Failed in Refine and Equipment...^FF0000Destroyed^000000.";
  88.         }
  89. }
  90. close;
  91. }
  92.  
  93.  
  94. function    script  RefineFunc2 {
  95.  
  96. for( set .@i,1; .@i <= 10 ; set .@i,.@i + 1 )
  97.     set .@Menu$,.@Menu$ + (( getarg(2) & pow( 2,(.@i-1 ) ) && getequiprefinerycnt( .@i ) >= getarg(3) && getequiprefinerycnt( .@i ) < getarg(4) && getequipisequiped( .@i) )?"^FF0000+"+getequiprefinerycnt( .@i )+" ^0000FF"+getequipname( .@i )+" "+( getitemslots( getequipid( .@i ) )?"["+getitemslots( getequipid( .@i ) )+"]":"" )+"^000000":"" )+":";
  98. set .@Refine,select( .@Menu$ );
  99. mes "Required ^FF0000"+getarg(1)+"^000000x ^8B4513"+getitemname( getarg(0) )+"^000000";
  100. if( getarg(5) == 1 && !getequipisenableref( .@Refine ) )
  101.     mes "I cant refine this items. Because it is ^FF0000Un-Refineable^000000.";
  102. else{
  103.     if( select( "^FF0000Refine^000000:Cancel" ) == 2 ) close;  
  104.         if( countitem( getarg(0) ) < getarg(1) ) close;
  105.             delitem getarg(0),getarg(1);
  106.         if( rand(100) < getarg(7) ){
  107.             if( getarg(6) )
  108.                 while( getequiprefinerycnt( .@Refine ) < getarg(4) )
  109.                     successrefitem ( .@Refine );
  110.             else
  111.                 successrefitem ( .@Refine );
  112.         mes "You have refined:";
  113.         mes "^FF0000+"+getequiprefinerycnt( .@Refine )+" ^0000FF"+getequipname( .@Refine )+"^000000";
  114.         switch( rand(9) ) {
  115.         case 0: emotion e_ho; break;
  116.         case 1: emotion e_lv; break;
  117.         case 2: emotion e_lv2; break;
  118.         case 3: emotion e_heh; break;
  119.         case 4: emotion e_no1; break;
  120.         case 5: emotion e_kis; break;
  121.         case 6: emotion e_kis2; break;
  122.         case 7: emotion e_kis2; break;
  123.         case 8: emotion e_hp; break;
  124.     }
  125.         }else{
  126.             failedrefitem ( .@Refine );
  127.             mes "Sorry, Failed in Refine and Equipment...^FF0000Destroyed^000000.";
  128.         }
  129. }
  130. close;
  131. }
Add Comment
Please, Sign In to add comment