View Single Post
  #11  
Old 02-10-2015, 11:11 AM
utbbop
Sarnak
 
Join Date: May 2009
Location: Mentor
Posts: 58
Default

Changed to an array per some feedback but still cant get it to work.
The following code doesnt accept the item and doesnt provide a reward. The NPC returns the item stating they have no need for it...

Code:
sub EVENT_ITEM 
{
my @t1chestarmor = [2995,3137,3226,3235,3295,3484,2835,2868,2958,2845,2886,2861,1591,3540,3680,3854];
my @t1legarmor = [2996,3174,3227,3236,3404,3485,2836,2871,2964,2846,3397,2863,2095,3541,3682,3855];
	
	if ($class == 'Mage' || $class == 'Necromance' || $class == 'Wizard' || $class == 'Cleric' || $class == 'Druid' || $class == 'Shaman' || $class == 'Berserker' || $class == 'Monk' || $class == 'Ranger' || $class == 'Rogue' || $class == 'Paladin' || $class == 'Shadowknight' || $class == 'Warrior' || $class == 'Bard' || $class == 'Beastlord' || $class == 'Enchanter') 
	{
		if (($item1 ~~ @t1chestarmor)) 
			{
			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);
			}
		elsif (($item1 = @t1legarmor)) 
			{
			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