View Single Post
  #1  
Old 02-10-2017, 01:34 PM
Dharrk
Fire Beetle
 
Join Date: Aug 2009
Location: Czech Republic
Posts: 6
Default Trade and Item to NPC

Here is my script I have worked a few hours one and cannot seem to get it to work. The NPC will not respond to 'Refuse' nor will he give an item when selected. The potions; however, work fine. Any help would be much appreciated.

Code:
sub EVENT_SAY
{
	if ($text =~/hail/i)
		{
			plugin::DiaWind("How are ya friend? I can tell by yer backbone several have been fell at yer feet. Well what I be missing in size I make up for wit dese here swords. Ya see me is looking for [planar essence] to combine wit mah swords to become the most famous dwarf in all Kaladim.");
		}
	elsif(plugin::check_hasitem($client,132540) && $text=~/planar essence/i)
		{
			plugin::DiaWind("It appears you have ventured into the terrible planes and killed a few of those creatures. Would you be willing to [trade] for a few items I have collected from all over the place? +grovel+");
		}
		elsif($text=~/planar essence/i)
			{
				plugin::DiaWind("I am sorry $name but I cannot sense any essence coming from your bags. Please come back to me when you have collected some.");
			}
			
	elsif(plugin::check_hasitem($client,132540) && $text=~/trade/i)
		{
			plugin::DiaWind("Wonderful. Here is a list of items that I have and would be willing to trade. [Frosty Marble] [Firey Marble] [Norrath Soldier] [Undead Potions] [ Dulsehound Potions] [ Grave Dust Potions] [Soldier of Norrath Dust]. =1= +point+");
		}
		elsif($text=~/Frosty Marble/i)
			{ 
				plugin::DiaWind("So you would like to trade your {gold} essence of the planes~  for my {lb}frosty marble sphere~. Click [Frosty Marble Sphere] to trade or [Refuse] to refuse the deal.");
			}
			elsif (plugin::check_hasitem($client,132541) && $text =~/Frosty Marble Sphere/i)
				{
					plugin::Whisper("Sorry but it appears you alrady possess this item $name.");
				}
			elsif ($text =~/Frosty Marble Sphere/i)
				{
					$client->NukeItem(132540);
					quest::summonitem(132541);
					plugin::DiaWind("Thank you $name. I knew that we both benefit from this trade.");
				}
		elsif($text=~/Firey Marble/i)
			{ 
				plugin::DiaWind("So you would like to trade your {gold} essence of the planes~  for my {lb}firey marble sphere~. Click [Firey Marble Sphere] to trade or [Refuse] to refuse the deal.");
			}
			elsif (plugin::check_hasitem($client,132542) && $text =~/Firey Marble Sphere/i)
				{
					plugin::Whisper("Sorry but it appears you alrady possess this item $name.");
				}
			elsif ($text =~/Firey Marble Sphere/i)
				{
					$client->NukeItem(132540);
					quest::summonitem(132542);
					plugin::DiaWind("Thank you $name. I knew that we both benefit from this trade.");
				}	
		elsif($text=~/Norrath Soldier/i)
			{ 
				plugin::DiaWind("So you would like to trade your {gold} essence of the planes~  for my {lb}forgotten Norrath soldier~. Click [Forgotten Norrath Soldier] to trade or [Refuse] to refuse the deal. ");
			}	
			elsif (plugin::check_hasitem($client,132543) && $text =~/Forgotten Norrath Soldier/i)
				{
					plugin::Whisper("Sorry but it appears you alrady possess this item $name.");
				}
			elsif ($text =~/Forgotton Norrath Soldier/i)
				{
					$client->NukeItem(132540);
					quest::summonitem(132543);
					plugin::DiaWind("Thank you $name. I knew that we both benefit from this trade.");
				}
		elsif($text=~/Undead Potions/i)
			{ 
				plugin::DiaWind("So you would like to trade your {gold} essence of the planes~  for my {lb}Undead Recourse Potion~. Click [Undead Potion] to trade or [Refuse] to refuse the deal.");
			}
			elsif ($text =~/Undead Potion/i)
				{
					$client->NukeItem(132540);
					quest::summonitem(14180);
					plugin::DiaWind("Thank you $name. I knew that we both benefit from this trade.");
				}		
		elsif($text=~/Dulsehound Potions/i)
			{ 
				plugin::DiaWind("So you would like to trade your {gold} essence of the planes~  for my {lb}Duslehound Potion~. Click [Dulsehound Potion] to trade or [Refuse] to refuse the deal.");
			}
			elsif ($text =~/Dulsehound Potion/i)
				{
					$client->NukeItem(132540);
					quest::summonitem(14188);
					plugin::DiaWind("Thank you $name. I knew that we both benefit from this trade.");
				}	
		elsif($text=~/Grave Dust Potions/i)
			{ 
				plugin::DiaWind("So you would like to trade your {gold} essence of the planes~  for my {lb}Grave Dust Potion~. Click [Grave Dust Potion] to trade or [Refuse] to refuse the deal.");
			}
			elsif ($text =~/Grave Dust Potion/i)
				{
					$client->NukeItem(132540);
					quest::summonitem(14194);
					plugin::DiaWind("Thank you $name. I knew that we both benefit from this trade.");
				}	
		elsif($text=~/Soldier of Norrath Dust/i)
			{ 
				plugin::DiaWind("So you would like to trade your {gold} essence of the planes~  for my {lb}Soldier of Norrath Dust~. Click [Soldier of Norrath] to trade or [Refuse] to refuse the deal.");
			}
			elsif ($text =~/Soldier of Norrath/i)
				{
					$client->NukeItem(132540);
					quest::summonitem(132544);
					plugin::DiaWind("Thank you $name. I knew that we both benefit from this trade.");
				}
	elsif ($text =~/Refuse/i)
				{
					plugin::Diawind("Sorry we could not reach a [trade]. Would you like to see my items again?");
				}
}
Reply With Quote