Hi. We got a NPC that uses Refine Deeds. And i edited it to make it clean. But something is not right so i decided to post it here.
Here's my Weapon Refiner.
//===== eAthena Script =======================================================
//= Donation Refine ( TXT & SQL )
//===== By: ==================================================================
//= Credit goes to whoever made this xD
//===== Current Version: =====================================================
//= 1.10a
//===== Compatible With: =====================================================
//= Any eAthena Version
//===== Description: =========================================================
//= Donation Refine Script
//============================================================================
prontera,177,134,5 script Weapon Refine Deed 605,{
mes "[Sure Refiner]";
mes "Good day "+strcharinfo(0);
mes "Do you want to refine your Weapon?";
next;
mes " I need the following:";
mes " ^3355FF +7 Weapon Refine Deed^000000";
mes " ^3355FF +8 Weapon Refine Deed^000000";
mes " ^3355FF +9 Weapon Refine Deed^000000";
mes " ^3355FF +10 Weapon Refine Deed^000000";
mes "For me to refine your item";
next;
mes "[Sure Refiner]";
mes "Now, what do you want to refine?";
function Refine;
set @itemquantity, 1; // item quantity
menu "Refine equipment",REFIN,"Nothing at all",QUIT;
REFIN:
set @handr$, getequipname(4);
menu
"[Right Hand] "+@handr$,HANDR,
"Cancel",QUIT;
HANDR:
set @slot, 4;
Refine;
QUIT:
next;
mes "[Sure Refiner]";
mes "Okay, see you.";
close;
LATER:
next;
mes "[Sure Refiner]";
mes "Thanks, have a nice day.";
close;
CANCEL:
next;
mes "[Sure Refiner]";
mes "Okay, come back another time.";
close;
MAX:
next;
mes "[Sure Refiner]";
mes "Sorry, but I can't refine this anymore.";
close;
NOWAY:
next;
mes "[Sure Refiner]";
mes "Oh my, I can't refine this item!!!";
close;
// ---------------Refine Equipment
Refine:
if (countitem(31992) > 0 && getequiprefinerycnt(@slot) < 7 && getequiprefinerycnt(@slot) > 5 ){
menu "Do it!",-,"Cancel",CANCEL;
delitem 31992, @itemquantity;
successrefitem(@slot);
goto LATER;
close;
}
if (countitem(31993) > 0 && getequiprefinerycnt(@slot) < 8 && getequiprefinerycnt(@slot) > 6 ){
menu "Do it!",-,"Cancel",CANCEL;
delitem 31993, @itemquantity;
successrefitem(@slot);
goto LATER;
close;
}
if (countitem(31994) > 0 && getequiprefinerycnt(@slot) < 9 && getequiprefinerycnt(@slot) > 7 ){
menu "Do it!",-,"Cancel",CANCEL;
delitem 31994, @itemquantity;
successrefitem(@slot);
goto LATER;
close;
}
if (countitem(31995) > 0 && getequiprefinerycnt(@slot) < 10 && getequiprefinerycnt(@slot) > 8 ){
menu "Do it!",-,"Cancel",CANCEL;
delitem 31995, @itemquantity;
successrefitem(@slot);
goto LATER;
close;
}
else{
mes "SORRY~~";
next;
mes "You don't have the right requirements for my service";
next;
mes "log on to HELLRO website to know more about me";
next;
mes "TNX~~";
mes "BYE BYE!!";
close;
}
}
It works alright. But i think its dirty. There are unused codes like
MAX:
next;
mes "[Sure Refiner]";
mes "Sorry, but I can't refine this anymore.";
close;
It should popup when you have +10 already. Can you enhance our script? Thanks!