Emistry

Refine Function v5

Sep 20th, 2011
2,099
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 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,155,181,5 script Refiner 757,{
  37. // callfunc( "RefineFunc",501,1,63,0,10,1,0,90 );
  38. // }
  39.  
  40.  
  41. function script RefineFunc {
  42.  
  43. for( set .@i,1; .@i <= 10; set .@i,.@i + 1 )
  44. 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":"" )+":";
  45. set .@Refine,select( .@Menu$ );
  46. mes "Required ^FF0000"+getarg(1)+" x "+getitemname( getarg(0) )+"^000000";
  47. if( getarg(5) == 1 && !getequipisenableref( .@Refine ) )
  48. mes "I cant refine this items. Because it is ^FF0000Un-Refineable^000000.";
  49. else{
  50. if( select( "^FF0000Refine^000000:Cancel" ) == 2 ) close;
  51. if( countitem( getarg(0) ) < getarg(1) ) close;
  52. delitem getarg(0),getarg(1);
  53. if( rand(100) < getarg(7) ){
  54. if( getarg(6) )
  55. while( getequiprefinerycnt( .@Refine ) < getarg(4) )
  56. successrefitem ( .@Refine );
  57. else
  58. successrefitem ( .@Refine );
  59. mes "You have refined : ";
  60. mes "^FF0000+"+getequiprefinerycnt( .@Refine )+" ^0000FF"+getequipname( .@Refine )+"^000000";
  61. }else{
  62. failedrefitem ( .@Refine );
  63. mes "Sorry, Failed in Refine and Equipment...Destroyed.";
  64. }
  65. }
  66. close;
  67. }
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment