|  |  | 
 
  |  |  |  |  
  |  |  |  |  
  |  |  |  |  
  |  |  |  |  
  |  | 
	
		
   
   
      | Quests::Q&A This is the quest support section |  
	
	
		
	
	
 
  |  |  |  |  
	| 
			
			 
			
				02-04-2009, 09:28 PM
			
			
			
		 |  
	| 
		
			
			| Dragon |  | 
					Join Date: Dec 2007 
						Posts: 658
					      |  |  
	| 
				 Armor Quest. NPC doesn't give reward 
 All the items used in this quest are in the DB. They are custom items. What happens is I will turn in the proper items, but he will just say he doesn't need it, and then give the items back. 
	Code: sub EVENT_SAY{
 if ($text =~/hail/i){
 quest::say("Greetings, $name. I can craft you special [armor] from parts dropped from monsters in this zone.");
 }
 if ($text =~/armor/i){
 quest::say("All the armor requires a pattern a certain number of armor materials. I can craft [boots], [bracers], [sleeves], [helmets], [tunics], [leggings], and [gloves].");
 }
 if ($text =~/bracers/i){
 quest::say("I require the appropriate pattern and one armor material.");
 }
 if ($text =~/sleeves/i){
 quest::say("I require the appropriate pattern and two armor materials.");
 }
 if ($text =~/boots/i){
 quest::say("I require the appropriate pattern and two armor materials.");
 }
 if ($text =~/tunics/i){
 quest::say("I require the appropriate pattern and four armor materials.");
 }
 if ($text =~/helmets/i){
 quest::say("I require the appropriate pattern and two armor materials.");
 }
 if ($text =~/leggings/i){
 quest::say("I require the appropriate pattern and three armor materials.");
 }
 if ($text =~/gloves/i){
 quest::say("I require the appropriate pattern and one armor material.");
 }
}
sub EVENT_ITEM {
#boots
  if (plugin::check_handin(\%itemcount, 1812 => 1, 1825 => 2)) {
    my %rewards = (
"Warrior" => 1663, "Rogue" => 1826, "Monk" => 1805, "Berserker" => 1826, "Shadowknight" => 1663, "Paladin" => 1663, "Ranger" => 1826, "Bard" => 1663, "Beastlord" => 1805, "Cleric" => 1663, "Druid" => 1805, "Shaman" => 1826, "Wizard" => 1804, "Mage" => 1804, "Enchanter" => 1804, "Necromancer" => 1804
    );
    if(defined($rewards{$class})) {
      quest::say("Here is your brand new item.");
      quest::summonitem($rewards{$class});
    }
  }
 else {
 	    plugin::return_items(\%itemcount);
    	quest::say("I have no use for this item, $name.  Take it back.");
	}  
	
	#bracer
  if (plugin::check_handin(\%itemcount, 1819 => 1, 1825 => 1)) {
    my %rewards = (
"Warrior" => 1660, "Rogue" => 1734, "Monk" => 1808, "Berserker" => 1734, "Shadowknight" => 1660, "Paladin" => 1660, "Ranger" => 1734, "Bard" => 1660, "Beastlord" => 1808, "Cleric" => 1660, "Druid" => 1808, "Shaman" => 1734, "Wizard" => 1581, "Mage" => 1581, "Enchanter" => 1581, "Necromancer" => 1581
    );
    if(defined($rewards{$class})) {
      quest::say("Here is your brand new item.");
      quest::summonitem($rewards{$class});
    }
  }
 else {
 	    plugin::return_items(\%itemcount);
    	quest::say("I have no use for this item, $name.  Take it back.");
	}  
	
	#sleeves
  if (plugin::check_handin(\%itemcount, 1817 => 1, 1825 => 2)) {
    my %rewards = (
"Warrior" => 1659, "Rogue" => 1716, "Monk" => 1809, "Berserker" => 1716, "Shadowknight" => 1659, "Paladin" => 1659, "Ranger" => 1716, "Bard" => 1659, "Beastlord" => 1809, "Cleric" => 1659, "Druid" => 1809, "Shaman" => 1716, "Wizard" => 1800, "Mage" => 1800, "Enchanter" => 1800, "Necromancer" => 1800
    );
    if(defined($rewards{$class})) {
      quest::say("Here is your brand new item.");
      quest::summonitem($rewards{$class});
    }
  }
 else {
 	    plugin::return_items(\%itemcount);
    	quest::say("I have no use for this item, $name.  Take it back.");
	}  
	
	#helmet
  if (plugin::check_handin(\%itemcount, 1813 => 1, 1825 => 2)) {
    my %rewards = (
"Warrior" => 1657, "Rogue" => 1733, "Monk" => 1811, "Berserker" => 1733, "Shadowknight" => 1657, "Paladin" => 1657, "Ranger" => 1733, "Bard" => 1657, "Beastlord" => 1811, "Cleric" => 1657, "Druid" => 1811, "Shaman" => 1733, "Wizard" => 1795, "Mage" => 1795, "Enchanter" => 1795, "Necromancer" => 1795
    );
    if(defined($rewards{$class})) {
      quest::say("Here is your brand new item.");
      quest::summonitem($rewards{$class});
    }
  }
 else {
 	    plugin::return_items(\%itemcount);
    	quest::say("I have no use for this item, $name.  Take it back.");
	}  
	
	#tunic
  if (plugin::check_handin(\%itemcount, 1823 => 1, 1825 => 4)) {
    my %rewards = (
"Warrior" => 1569, "Rogue" => 1664, "Monk" => 1810, "Berserker" => 1664, "Shadowknight" => 1577, "Paladin" => 1577, "Ranger" => 1664, "Bard" => 1569, "Beastlord" => 1810, "Cleric" => 1582, "Druid" => 1810, "Shaman" => 1664, "Wizard" => 1798, "Mage" => 1798, "Enchanter" => 1798, "Necromancer" => 1798
    );
    if(defined($rewards{$class})) {
      quest::say("Here is your brand new item.");
      quest::summonitem($rewards{$class});
    }
  }
 else {
 	    plugin::return_items(\%itemcount);
    	quest::say("I have no use for this item, $name.  Take it back.");
	}  
	
	#gloves
  if (plugin::check_handin(\%itemcount, 1818 => 1, 1825 => 1)) {
    my %rewards = (
"Warrior" => 1661, "Rogue" => 1793, "Monk" => 1807, "Berserker" => 1793, "Shadowknight" => 1661, "Paladin" => 1661, "Ranger" => 1793, "Bard" => 1661, "Beastlord" => 1807, "Cleric" => 1661, "Druid" => 1807, "Shaman" => 1793, "Wizard" => 1802, "Mage" => 1802, "Enchanter" => 1802, "Necromancer" => 1802
    );
    if(defined($rewards{$class})) {
      quest::say("Here is your brand new item.");
      quest::summonitem($rewards{$class});
    }
  }
 else {
 	    plugin::return_items(\%itemcount);
    	quest::say("I have no use for this item, $name.  Take it back.");
	}  
	
	#leggings
  if (plugin::check_handin(\%itemcount, 1824 => 1, 1825 => 3)) {
    my %rewards = (
"Warrior" => 1662, "Rogue" => 1732, "Monk" => 1806, "Berserker" => 1732, "Shadowknight" => 1662, "Paladin" => 1662, "Ranger" => 1732, "Bard" => 1662, "Beastlord" => 1806, "Cleric" => 1662, "Druid" => 1806, "Shaman" => 1732, "Wizard" => 1803, "Mage" => 1803, "Enchanter" => 1803, "Necromancer" => 1803
    );
    if(defined($rewards{$class})) {
      quest::say("Here is your brand new item.");
      quest::summonitem($rewards{$class});
    }
  }
 else {
 	    plugin::return_items(\%itemcount);
    	quest::say("I have no use for this item, $name.  Take it back.");
	}  
}
			
			
			
			
				  |  
 
  |  |  |  |  
	
		
	
	
	| 
			
			 
			
				02-04-2009, 09:31 PM
			
			
			
		 |  
	| 
		
			|  | Developer |  | 
					Join Date: Mar 2003 
						Posts: 1,500
					      |  |  
	| 
 You will need some elsif statements. Otherwise, it will go through each check even if it satisfies the first check. |  
	
		
	
	
	| 
			
			 
			
				02-04-2009, 09:33 PM
			
			
			
		 |  
	| 
		
			
			| Dragon |  | 
					Join Date: Dec 2007 
						Posts: 658
					      |  |  
	| 
 Lol, ok where do I add the elseif statements? I tried putting them somewhere and now he just keeps the items. |  
	
		
	
	
	| 
			
			 
			
				02-04-2009, 10:42 PM
			
			
			
		 |  
	| 
		
			
			| Dragon |  | 
					Join Date: Dec 2007 
						Posts: 658
					      |  |  
	| 
 ok no matter what I seem to do, I will get some problems. I removed all the else statements to return items except the one at the end, but then the only on I could summon was the bracer. Can anyone tell me how to fix this? |  
	
		
	
	
	| 
			
			 
			
				02-04-2009, 11:39 PM
			
			
			
		 |  
	| 
		
			
			| Dragon |  | 
					Join Date: Dec 2007 
						Posts: 658
					      |  |  
	| 
 Ok i added in a bit from one of Trevius's codes which made it work perfectly.  I just added  
	Code: 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') {  to everything and it fixed it. |  
	
		
	
	
	
	
	| Thread Tools |  
	|  |  
	| Display Modes |  
	
	| 
		 Linear Mode |  
	| 
	|  Posting Rules |  
	| 
		
		You may not post new threads You may not post replies You may not post attachments You may not edit your posts 
 HTML code is Off 
 |  |  |  All times are GMT -4. The time now is 03:43 PM.
 
 |  |  
    |  |  |  |  
    |  |  |  |  
     |  |  |  |  
 |  |