View Single Post
  #7  
Old 02-09-2015, 07:21 PM
utbbop
Sarnak
 
Join Date: May 2009
Location: Mentor
Posts: 58
Default

Hi Everyone,
Back with another turn in related question/troubleshoot.

For some reason, the following code isn't working as I want it to.

In practice, as a warrior, if I turn in item 2995 it should return item 1563 to me. However, it is returning BOTH items 1563 and item 1568 from the second block of code. Really, It should only return item 1568 if I turn in say item 2296...

I am sure something is wrong with my logic but have spent all day putzing with it and am only making it worse. If anyone can review and provide feedback it is much appreciated...


Code:
sub EVENT_ITEM 
{
if ($class == 'Warrior' || $class == 'Rogue' || $class == 'Monk' || $class == 'Berserker' || $class == 'Shadowkight' || $class == 'Paladin' || $class == 'Ranger' || $class == 'Bard' || $class == 'Beastlord' || $class == 'Cleric' || $class == 'Druid' || $class == 'Shaman' || $class == 'Wizard' || $class == 'Mage' || $class == 'Enchanter' || $class == 'Necromancer') 
###################################################################################################################################################################################################################################
	{		
		if (plugin::check_handin(\%itemcount, 2995 => 1 or 3137 => 1 or 3226 => 1 or 3235 => 1 or 3295 => 1 or 3484 => 1 or 2835 => 1 or 2868 => 1 or 2958 => 1 or 2845 => 1 or 2886 => 1 or 2861 => 1 or 1591 => 1 or 3540 => 1 or 3680 => 1 or 3854 => 1))  
			{
				my %rewards = ("Mage" => 2278, "Necromancer" => 2381, "Wizard" => 2422, "Cleric" => 1803, "Druid" => 2434, "Shaman" => 2665, "Berserker" => 2684, "Monk" => 2444, "Ranger" => 2493, "Rogue" => 2828, "Paladin" => 1810, "Shadowknight" => 1819, "Warrior" => 1563, "Bard" => 1846, "Beastlord" => 2562, "Enchanter" => 2561);						
				if(defined($rewards{$class})) 
					{
						quest::summonitem($rewards{$class});
						quest::emote("Works to make a piece of armor from the instructions you provided to him." );
						quest::say ("Here you go $name.");
					}
			}
	else 
		{
			plugin::return_items(\%itemcount);
		}		
	}
###################################################################################################################################################################################################################################
	{		
		if (plugin::check_handin(\%itemcount, 2996 => 1 or 3174 => 1 or 3227 => 1 or 3236 => 1 or 3404 => 1 or 3485 => 1 or 2836 => 1 or 2871 => 1 or 2964 => 1 or 2846 => 1 or 3397 => 1 or 2863 => 1 or 2095 => 1 or 3541 => 1 or 3682 => 1 or 3855 => 1))  
			{
				my %rewards = ("Mage" => 2298, "Necromancer" => 2382, "Wizard" => 2423, "Cleric" => 1806, "Druid" => 2435, "Shaman" => 2666, "Berserker" => 2685, "Monk" => 2445, "Ranger" => 2494, "Rogue" => 2829, "Paladin" => 1811, "Shadowknight" => 1823, "Warrior" => 1568, "Bard" => 1847, "Beastlord" => 2564, "Enchanter" => 2656);						
				if(defined($rewards{$class})) 															
					{
						quest::summonitem($rewards{$class});
						quest::emote("Works to make a piece of armor from the instructions you provided to him." );
						quest::say ("Here you go $name.");
					}
			}
	else 
		{
			plugin::return_items(\%itemcount);
		}		
	}	
}
Reply With Quote