Advertisement
johnlol

RefineFunc Ticket

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