View Single Post
  #6  
Old 07-14-2009, 11:41 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

here is a little sample for you where npc takes 1 quest item and then gives you a random reward. he will also accept back any of the reward items and again randomly choose a reward item. Of course you may spent some time giving items back to him till you get exactly what you want.

item 1060 is the quest item, items 1189-1193 are rewards

Code:
sub EVENT_ITEM 
{


	if(plugin::check_handin(\%itemcount, 1060 => 1) || 
	plugin::check_handin(\%itemcount, 1189 => 1) || 
	plugin::check_handin(\%itemcount, 1190 => 1) || 
	plugin::check_handin(\%itemcount, 1191 => 1) || 
	plugin::check_handin(\%itemcount, 1192 => 1) || 
	plugin::check_handin(\%itemcount, 1193 => 1)	)
	{
	quest::say("I award you this! If this is not something you like, give it back to me and I will find something 
	else for you");

	my $a = quest::ChooseRandom(1189, 1190, 1191, 1192, 1193);
	quest::summonitem($a); 
	}




	else 
	{
	plugin::return_items(\%itemcount);	}

}

alternativly this can be set up that he trades reward items one for one (give 1 get 2, give 2 get 3. give 3 get 4 and so on)
Reply With Quote