now this what ive done.
but how to stop if the headgear already enchant can be enchant again.
//v1.4
new_1-2,95,71,4 script Enchant Expert 100,{
//Character Variables
set .@geid, getequipid(1);
set .@cout, countitem(.item);
set .@gin$, getitemname(.item);
set .@gerf, getequiprefinerycnt(1);
set .@crd1, getequipcardid(1,0);
set .@crd2, getequipcardid(1,1);
set .@crd3, getequipcardid(1,2);
set .@crd4, getequipcardid(1,3);
// set .@itm, 4700+((rand(5)*10)+rand(3));
set .@itm, rand(40120,40125);
mes .npc$;
mes "I can endow your glasses with mystical powers, but It'll cost yah "+.pric+" "+((.pric-1)?.@gin$+"s":.@gin$)+".";
next;
if(!.@cout) {
mes .npc$;
mes "Sorry come back when you have "+.@gin$+"(s).";
close;
}
if(select("Yes:No")&2) {
mes .npc$; mes "Alright, thanks anyways!";
close;
}
if(.@cout<.pric) {
mes .npc$;
mes "I'm sorry you don't have enough "+.@gin$+"(s) to for me to endow your specticals, please come back later.";
close;
}
if(rand(0,((100/.perc)-1))) {
mes .npc$;
mes "I'm sorry but I've failed you!";
misceffect 155;
emotion e_sob,0;
delitem .item,.pric;
close;
}
mes .npc$;
if(compare(.uit$,""+.@geid)) {
delitem .item,.pric;
delitem2 .@geid, 1, 1, .@gerf, 0, .@crd1, .@crd2, .@crd3, .@crd4;
getitem2 .@geid, 1, 1, .@gerf, 0, .@crd1, .@crd2, .@crd3, .@itm;
misceffect .efet;
mes "All done!";
equip .@geid;
close;
}
mes "I'm sorry but you need to equipped a slotted upper-range headgear before we can continue.";
close;
//NPC Constants
OnInit:
//=-=-=-=-=-=-=Configuration=-=-=-=-=-=-=
set .npc$, "[^0000FFEnchant Expert^000000]"; // NPC Name
set .pric, 1; // Price
set .efet, 154; // Effect Number
set .item, 6242; // Item Number
set .uit$, "5137";// Item List Alice Doll [1]
set .perc, rand(50,80); // Percent
/*18603(Black Devil Mask), Not included because it wasn't in my DB*/
/*2286 Unslotted version of 18507*/
/*2203 Unslotted version of 2204*/
/*2201 Unslotted version of 2202*/
//=-=-=-=-=-=-=-=-Skorm-=-=-=-=-=-=-=-=-=
}