View Single Post
  #1  
Old 09-10-2020, 01:28 AM
Letza Fetza
Fire Beetle
 
Join Date: Apr 2013
Posts: 2
Default what am i doing wrong? .pl script

Trying to get this to work but consistently running into either no quest or item reward 0. New to this but reading as much as I can, just stumped! Any help greatly appreciated!

Code:
sub EVENT_SAY
{
my %Reward = (
"Warrior" => '25211''2842',
"Rogue" => '132667',
"Monk" => '132672',
"Berserker" => '132671',
"Shadowknight" => '132670',
"Paladin" => '132669',
"Ranger" => '132662',
"Bard" => '132668',
"Beastlord" => '132673',
"Cleric" => '132640',
"Druid" => '132650',
"Shaman" => '132651',
"Wizard" => '132663',
"Magician" => '132664',
"Enchanter" => '132666',
"Necromancer" => '132665');

    my $class_link = quest::saylink("class");
	my $whisper_color = 315;	#tan
	my $NPCName = $npc->GetCleanName();	

	if($text=~/Hail/i)
	{
    	quest::say("Greetings, $name.  Once I was a great Hero like you,
   	but now I am left to equipping all the new adventurer's that
	seem to be popping up all over this desolate place.  Simply tell me your [$class_link] that you wish to equip and I can summon up some accessories for you.");
	}

	if($text=~/Class/i)
	{
		$client->Message($whisper_color, "$NPCName whispers to you, 'I can
		equip any of the following classes'");

		# print out say links for each of the classes in alpha order
		foreach $class_name (sort keys "class")
		{
			my $link = quest::saylink($class_name);
			$client->Message($whisper_color, "$link");
		}
	}

	# for any typed text besides "Hail" or "class", check to see if it was a class
	# name that was said (clicked), and summon the appropriate items on a match
	if($text !~ /Hail/i || $text !~ /class/i)
	{
		foreach $class_name (sort keys "class")
		{
			if ($text eq $class_name)
			{
				$client->Message($whisper_color, "$NPCName whispers to you, 'Wear your shiny accessories with pride $name!  Be sure to shop for everything before you leave here, as you may not return if over level 10!'");

				# this will dump items onto the players cursor
				foreach ($class_name)
				{
				quest::summonitem($Reward{$class_name});
				}
			}
		}
	} #end class name checks

}#END of FILE
Reply With Quote