You can try the following:
- script fishvendor -1,{
.@n$ = "[Fish Vendor]";
if (checkweight(1201, 1) == 0) {
mes .@n$, "You have too many items in your inventory!";
close;
}
mes .@n$, "Hi there, if you went fishing, I can buy your rare catch!";
next;
mes .@n$, "If you caught a Shark, Whale, or Octopus, I can give you 10 Fish Market Receipt for each of them";
next;
mes .@n$, "Here's the list of the fishes I want to buy";
next;
setarray .@items, 32189, 32195, 32191, 32190, 32180, 32181, 32182, 32183, 32186, 32187, 32188, 32192, 32193, 32184, 32185, 32194;
setarray .@amounts, 10, 10, 10, 10, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1;
setarray .@rewards, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 10;
for (.@i = 0; .@i < getarraysize(.@items); .@i++) {
// Optional, but I usually make such items with blue links so that players click the right ones more easily
if (countitem(.@items[.@i]) >= .@amounts[.@i])
.@menu$ = .@menu$ + "^0000ff" + .@amounts[.@i] + "x " + getitemname(.@items[.@i]) + "^000000:";
else
.@menu$ = .@menu$ + .@amounts[.@i] + "x " + getitemname(.@items[.@i]) + ":";
}
.@opt = select(.@menu$) - 1;
if (.@opt < 0 || .@opt >= getarraysize(.@items))
end;
.@item = .@items[.@opt];
.@amount = .@amounts[.@opt];
if (countitem(.@item) < .@amount) {
mes .@n$, "Sorry but you don't have enough " + getitemname(.@item) + " with you";
close;
}
delitem .@item, .@amount;
getitem 32196, .@rewards[.@opt];
mes .@n$, "Thanks! Here's your Fish Market Receipt!";
close;
}
You may want to double check the receipts to make sure all the values are right.