I wouldn't use $item1, $item2 etc. as variables, they are already defined when an item is handed in.
You could do it by creating a hash of the possible "$item2" handins and loop through it to see if any of that item was turned in.
Something like this should work for you. Where the keys in the hash represent the itemID's of the handed-in item, and the values are the item to give back to the player.
Code:
sub EVENT_ITEM {
my $item_1 = 12345;
%items = (
11111 => 22222,
33333 => 44444,
55555 => 66666,
);
if (plugin::check_handin(\%itemcount, $item_1 => 1)) {
for my $items ( sort keys %items) {
if (plugin::check_handin(\%itemcount, $items => 1)) {
quest::summonitem($items{$items});
}
}
}
}
Of course you'd need some extra logic to make sure only one item is returned back to the player.