prontera,155,181,3 script Item Convert 10173,{
mes .name$;
mes "Hello there!";
mes "I convert things swiftly and diligently!";
mes "Is there anything you like to convert?";
next;
.@opt = select(.Menu$)-1;
mes .name$;
mes "You want to convert ^0055FF"+getitemname(.ItemIDFrom[.@opt])+"^000000 into ^0055FF"+getitemname(.ItemIDTo[.@opt])+"^000000.";
next;
.@menu$ = "";
for(.@i=0;.@i<getarraysize(.Chances);.@i++)
.@menu$ = .@menu$ + "Exchange ^0055FF"+getitemname(.ItemIDFrom[.@opt])+" for ^0055FF"+getitemname(.ItemIDto[.@i])+"^000000:";
.@menu$ = .@menu$;
next;
.@opt2 = select(.@menu$)-1;
.@amount = ((.ToAmount[.@opt]*.Chances[.@opt2])/100);
.@chance = .Chances[.@opt2];
mes .name$;
mes "You are about to exchange ^FF55001^000000x "+getitemname(.ItemIDFrom[.@opt])+" into ^FF5500"+.ToAmount+"^000000x "+getitemname(.ItemIDTo[.@opt])+".";
mes "Would you like to proceed?.";
next;
if(select("Yes Please..:Cancel")==2) end;
if(countitem(.ItemIDFrom[.@opt]) < .@amount){
mes .name$;
mes "I'm sorry, but i cannot process your request because you lack of ^0055FF"+getitemname(.ItemIDFrom[.@opt])+"^000000.";
end;
}
mes .name$;
if(rand(1,100) > .@chance){
mes "Oh!~ Sorry, too bad~~";
mes "The conversion has failed miserably.";
mes "You can try again anytime.";
end;
}
delitem .ItemIDFrom[.@opt],1;
getitem .ItemIDTo[.@opt],.ToAmount;
mes "Alright!~";
mes "The conversion is a success!";
mes "Hoping that you love my service.";
close;
OnInit:
.name$ = "[ ^FF5500Item Convert^000000 ]";
//Setup Here
setarray .ItemIDFrom[0],501,502,503,504,505;
setarray .ToAmount[0],500,500,500,500,500;
setarray .ItemIDTo[0],909,909,909,909,909;
//Do not touch without knowing - Just leave it to 100%
setarray .Chances[0],100;
for(.@i=0;.@i<getarraysize(.ItemIDFrom);.@i++)
.Menu$ = .Menu$ + getitemname(.ItemIDFrom[.@i])+" to "+getitemname(.ItemIDTo[.@i]) +":";
.Menu$ = .Menu$ + "Cancel";
//NOTE: Chance = 100/AmountFrom %;
end;
}