View Single Post
  #7  
Old 10-19-2009, 04:18 PM
Kobaz
Hill Giant
 
Join Date: Nov 2008
Location: Gold Coast, Oz
Posts: 119
Default

Do the following work?

Code:
my %turnins = (
	 5401,  68259 ,	#Mithril 2 hander & fabled
	 5403,  68260 ,	#Ghoulbane & fabled
	 5500,  68263 ,	#SS of Ykesha & fabled
	 5412,  68262 	#Razing Sword of Skarlon
);

my $cost = 22503;	# blue diamond (dropped)
my $cost_link = quest::varlink($cost);
Code:
$client->Message(315, "At this time, I am able to convert a $cost_link along
with the basic version of any of these weapons into their fabled counterparts:");
my $key = 0;
# loop through item + reward array and send a list of items to client 
foreach $key (sort keys %turnins) 
{
	my $link = quest::varlink($turnins{$key});
	$client->Message(315, "$link")
}
Code:
my $gaveitem = 0;
my $key = 0;
# loop through item + reward array looking for a match
foreach $key (sort keys %turnins)
{
	# hand out the goods on a match of item + cost
	if (plugin::check_handin(\%itemcount, $turnins{$key} => 1, $cost => 1))
	{
		$gaveitem = 1;
		quest::summonitem($turnins{$key}}{"reward"});
	}
}

# if there were no matches, give back what was turned in
if ($gaveitem == 0)
{
	plugin::return_items(\%itemcount);
}
Reply With Quote