View Single Post
  #3  
Old 02-04-2008, 12:14 PM
Theeper
Discordant
 
Join Date: May 2004
Posts: 290
Default

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.

Last edited by Theeper; 02-04-2008 at 08:17 PM..
Reply With Quote