View Single Post
  #2  
Old 05-23-2015, 07:13 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

I'm pretty sure check_handin() actually removes the checked item from the list of items the user has turned in if it's there, so that you can do the appropriate reward and return_items won't return it later. For that reason, all the following check_handin() checks on the same item will return false, because it's already been checked and removed in the first if.

You'll need to rework your checks, something like:

Code:
sub EVENT_ITEM
{ 
	if (plugin::check_handin(\%itemcount, 5792 => 1))
	{
		if (plugin::check_hasitem($client, 5333)){
			plugin::Whisper("As promised! Here is your new item!");
			quest::summonitem(5769);
		}
		elsif (plugin::check_hasitem($client, 5371)){
			plugin::Whisper("As promised! Here is your new item!");
			my %epic1 = ("Monk" => 5790, "Ranger" => 5787);
			quest::summonitem($epic1{$class});
		}
		elsif (plugin::check_hasitem($client, 5375)){
			plugin::Whisper("As promised! Here is your new item!");
			quest::summonitem(5720);
		}
		elsif (plugin::check_hasitem($client, 5390)){
			plugin::Whisper("As promised! Here is your new item!");
			quest::summonitem(5700);
		}
		elsif (plugin::check_hasitem($client, 5409)){
			plugin::Whisper("As promised! Here is your new item!");
			quest::summonitem(5750);
		}
		elsif (plugin::check_hasitem($client, 5419)){
			plugin::Whisper("As promised! Here is your new item!");
			quest::summonitem(5651);
		}
		elsif (plugin::check_hasitem($client, 5420)){
			plugin::Whisper("As promised! Here is your new item!");
			quest::summonitem(5755);
		}
		elsif (plugin::check_hasitem($client, 5421)){
			plugin::Whisper("As promised! Here is your new item!");
			my %epic2 = ("Warrior" => 5775, "Rogue" => 5775, "Monk" => 5783, "Berserker" => 5770, "Shadowknight" => 5770, "Paladin" => 5770, "Ranger" => 5775, "Bard" => 5775, "Beastlord" => 5783);
			quest::summonitem($epic2{$class});
		}
		elsif (plugin::check_hasitem($client, 5426)){
			plugin::Whisper("As promised! Here is your new item!");
			quest::summonitem(5707);
		}
		elsif (plugin::check_hasitem($client, 5427)){
			plugin::Whisper("As promised! Here is your new item!");
			quest::summonitem(5650);
		}
		else
		{
			plugin::Whisper("You are not ready to give me this item yet.");
			quest::summonitem(5792);
		}
	}
	
	plugin::return_items(\%itemcount);
}
I added the last else{} check in case they turned in item 5792 without meeting any of the other criteria, so they get it back.
Reply With Quote