Advertisement
jayceekyd

Untitled

Mar 25th, 2017
1,003
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.96 KB | None | 0 0
  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.  
  13. // .....callfunc( "RefineFunc",<itemID>,<Amount>,<BitMasks>,<MinRefine>,<MaxRefine>,<CheckEquip>,<RefineMode>,<Percent> );
  14. // 1. itemID -> Item that will be used during Refine.
  15. // 2. Amount -> Amount of Required Items.
  16. // 3. BitMask -> Refer to above bitmask table.
  17. // 4. MinRefine -> Required Min Refine to use.
  18. // 5. MaxRefine -> What is the Max Refine. [ Can Bypass Default Server Max Refine ]
  19. // 6. CheckEquip -> Check Equipments is Refineable or not. [ 0 = Disable / 1 = Enable ]
  20. // 7. RefineMode -> +1 / Max Refine. [ 0 = +1 Refine / 1 = Max Refine ]
  21. // 8. Percent -> Rate of Success to refine current Equipment.
  22.  
  23. // Notes : You can Customize it according to whatever way you want.
  24. // Different NPCs / Items with Different Settings.
  25. // It will consume the items that you defined to Refine the Equipments according to your Settings.
  26.  
  27. //----------- If used this as Item Script -----------
  28.  
  29. // Example : Red Potion with 100% Refine Rate
  30. // 501,Red_Potion,Red Potion,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc( "RefineFunc",501,1,63,0,10,1,0,100 ); },{},{}
  31. // Change Item Type to 11 and Amount Required to 1 ( Advised )
  32.  
  33. //----------- If used this as NPC Script ------------
  34.  
  35. // Example : 90% Success Rate Refiner.
  36. prontera,150,155,5 script Smith 826,{
  37. callfunc( "RefineFunc",0,0,63,0,10,1,1,100 );
  38. }
  39.  
  40. prontera,150,150,5 script Legendary Smith 826,{
  41. callfunc( "RefineFunc2",501,10,63,10,20,1,0,100 );
  42. }
  43.  
  44.  
  45. function script RefineFunc {
  46.  
  47. for( set .@i,1; .@i <= 10 ; set .@i,.@i + 1 )
  48. 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":"" )+":";
  49. set .@Refine,select( .@Menu$ );
  50. if( getarg(5) == 1 && !getequipisenableref( .@Refine ) )
  51. mes "I cant refine this items. Because it is ^FF0000Un-Refineable^000000.";
  52. else{
  53. if( select( "^FF0000Refine^000000:Cancel" ) == 2 ) close;
  54. if( rand(100) < getarg(7) ){
  55. if( getarg(6) )
  56. while( getequiprefinerycnt( .@Refine ) < getarg(4) )
  57. successrefitem ( .@Refine );
  58. else
  59. successrefitem ( .@Refine );
  60. mes "You have refined : ";
  61. mes "^FF0000+"+getequiprefinerycnt( .@Refine )+" ^0000FF"+getequipname( .@Refine )+"^000000";
  62. }else{
  63. failedrefitem ( .@Refine );
  64. mes "Sorry, Failed in Refine and Equipment...Destroyed.";
  65. }
  66. }
  67. close;
  68. }
  69.  
  70.  
  71. function script RefineFunc2 {
  72.  
  73. for( set .@i,1; .@i <= 10 ; set .@i,.@i + 1 )
  74. 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":"" )+":";
  75. set .@Refine,select( .@Menu$ );
  76. mes "Required ^FF0000"+getarg(1)+" x "+getitemname( getarg(0) )+"^000000";
  77. if( getarg(5) == 1 && !getequipisenableref( .@Refine ) )
  78. mes "I cant refine this items. Because it is ^FF0000Un-Refineable^000000.";
  79. else{
  80. if( select( "^FF0000Refine^000000:Cancel" ) == 2 ) close;
  81. if( countitem( getarg(0) ) < getarg(1) ) close;
  82. delitem getarg(0),getarg(1);
  83. if( rand(100) < getarg(7) ){
  84. if( getarg(6) )
  85. while( getequiprefinerycnt( .@Refine ) < getarg(4) )
  86. successrefitem ( .@Refine );
  87. else
  88. successrefitem ( .@Refine );
  89. mes "You have refined : ";
  90. mes "^FF0000+"+getequiprefinerycnt( .@Refine )+" ^0000FF"+getequipname( .@Refine )+"^000000";
  91. }else{
  92. failedrefitem ( .@Refine );
  93. mes "Sorry, Failed in Refine and Equipment...Destroyed.";
  94. }
  95. }
  96. close;
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement