checkweight(<item id>,<amount>)
checkweight("<item name>",<amount>)
Reference: http://rathena.org/wiki/Checkweight
prontera.gat,163,185,4 script Cenverter 83,{
set @name$,"[^FF0000Converter^000000]";
mes @name$;
mes "What do you want to do?";
next;
switch(select("Information","Convert")) {
case 1:
mes @name$;
mes "I can convert your Coupon/s into Berry and vice versa.";
mes "1 Coupon = 500 Berry";
close;
case 2:
switch(select("Coupon to Berry","Berry to Coupon")) {
case 1:
if (checkweight(607,500) == 0 ) goto overWeight;
if (countitem(7073) < 1) goto noCoupon;
mes @name$;
mes "How many coupon to berries?";
input .@num;
if (countitem(7073 < .@num){
mes @name$;
mes "Insufficient coupon!";
close;
}else
{
delitem 7037,.@num;
getitem 607,.@num*500;
mes @name$;
mes "There you go. Hope to see you again!";
close;
}
case 2:
if (checkweight(7073,1) == 0 ) goto overWeight;
if (countitem(500) < 1) goto noBerry;
mes @name$
mes "How many berries to coupon?";
input .@num2;
if (countitem(607) < .@num2){
mes @name$;
mes "Insufficient berries!";
close;
}else
{
delitem 607,.@num2*500;
getitem 7037,.@num;
mes @name$;
mes "There you go. Hope to see you again!";
close;
}
}
end;
}
noBerry:
mes @name$;
mes "I'm Sorry but you don't have enough berries.";
close;
noCoupon:
mes @name$;
mes "I'm Sorry you don't have enough coupon";
close;
overWeight:
mes @name$;
mes "Sorry you're overweight.";
close;
}