Thanks @Emistry. But my problem was solved by @AnnieRuru long time ago by PM. Thanks again for remind me of this thread, I'm forgot already. But still I believe your new Refine Funtion script will be useful. FYI, for refine rentitem equipments, I've use your previous script from Post #4 and it's working perfectly.
And for de-refine without removing the rentitem durations, @AnnieRuru was helping me by edit the script from Post #6.
Here it is :
prontera,155,175,3 script De-Refiner 85,{
set .@npc$,"[^0065DFThe Smith^000000]";
mes .@npc$;
mes "Hello..";
mes " ";
mes "I can de-refine all your refined equipments.";
mes "Please make sure you have equipped the items.";
next;
// the next line "setarray" is to store the item ID of the character. Because player with their own hexed client ( aka. hacker ) might change equipment during the talk to npc
setarray @equip[1],getequipid(1),getequipid(2),getequipid(3),getequipid(4),getequipid(5),getequipid(6),getequipid(7),getequipid(8),getequipid(9),getequipid(10);
// store the equipment placement so I can optimize the script
setarray .@a[1],256,16,32,2,4,64,8,128,512,1;
select(getequipname(1),getequipname(2),getequipname(3),getequipname(4),getequipname(5),getequipname(6),getequipname(7),getequipname(8),getequipname(9),getequipname(10));
if ( !getequipisequiped(@menu) ) {
mes .@npc$;
mes "There's nothing equipped there...";
close; }
if (countitem(7539)<10) {
mes .@npc$;
mes "You don't have enough Poring Coin to pay me to work with your equipment.";
close; }
if ( getequiprefinerycnt(@menu) > 10 || getequiprefinerycnt(@menu) == 0 ) {
mes .@npc$;
mes "This item cannot be de-refine.";
close; }
// now we make a check on them ...
if ( getequipid(@menu) != @equip[@menu] ) {
mes .@npc$;
mes "Do you think I am that stupid?";
mes "You have changed the equipment !!";
mes "Get lost !!";
close; }
// atcommand "@refine "+ .@a[@menu] +" -1";
downrefitem @menu;
delitem 7539,10;
mes .@npc$;
mes "Your equipment has successfully de-refined.";
close;
}