perhap you can spend you time reading on this ?
http://rathena.org/board/topic/53320-%E3%80%90-emistry-%C2%A9-2012-%E3%80%91e-scripts-collection/page__st__40__p__71628#entry71628
//--- Bitmasks ----
// 1 - Top Headgear
// 2 - Armor
// 4 - Left Hand
// 8 - Right Hand
// 16 - Garment
// 32 - Shoes
// 64 - Left Accessory
// 128 - Right Accessory
// 256 - Middle Headgear
// 512 - Lower Headgear
// .....callfunc( "RefineFunc",<itemID>,<Amount>,<BitMasks>,<MinRefine>,<MaxRefine>,<CheckEquip>,<RefineMode>,<Percent> );
// 1. itemID -> Item that will be used during Refine.
// 2. Amount -> Amount of Required Items.
// 3. BitMask -> Refer to above bitmask table.
// 4. MinRefine -> Required Min Refine to use.
// 5. MaxRefine -> What is the Max Refine. [ Can Bypass Default Server Max Refine ]
// 6. CheckEquip -> Check Equipments is Refineable or not. [ 0 = Disable / 1 = Enable ]
// 7. RefineMode -> +1 / Max Refine. [ 0 = +1 Refine / 1 = Max Refine ]
// 8. Percent -> Rate of Success to refine current Equipment.
// Notes : You can Customize it according to whatever way you want.
// Different NPCs / Items with Different Settings.
// It will consume the items that you defined to Refine the Equipments according to your Settings.
//----------- If used this as Item Script -----------
// Example : Red Potion with 100% Refine Rate
// 501,Red_Potion,Red Potion,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc( "RefineFunc",501,1,63,0,10,1,0,100 ); },{},{}
// Change Item Type to 11 and Amount Required to 1 ( Advised )
//----------- If used this as NPC Script ------------
// Example : 90% Success Rate Refiner.
// prontera,155,181,5 script Refiner 757,{
// callfunc( "RefineFunc",501,1,63,0,10,1,0,90 );
// }