View Single Post
Old 03-29-2021, 01:23 PM
Fire Beetle
Join Date: Mar 2021
Posts: 1
Default Showpath alternative?

It appears that showpath(x,y,z) has been removed from questmgr. Showgrid remains, but requires int grid as opposed to x,y,z coordinates.

Is there any easy way to convert x,y,z to the required int grid for the destination?

Or does anyone have a recommendation for how best to initiate a guiding path to an NPC from a saylink within a perl quest script?


EDIT: Just for context, here is what I am trying to do. I just want an NPC who can tell me which vendor sells what I need in PoK. Everything works, except the saylink does not give me a path to the vendor.

HTML Code:
	my $say_bind = quest::saylink("bind", 1);

		quest::say("Greetings, $name. Say the name of any item and I may know the merchant you seek. I can also $say_bind you here if you wish.");
		quest::say("Binding your soul. You will return here when you die.");
		my ($x,$y,$z) = (split /:/, $text)[1,2,3];
//		$client->Message(315, "showing path to $x $y $z");
		my $item_name = "";

		my $connect = plugin::LoadMysql();

		$text =~ s/'/`/g;
		$text =~ s/\*/\%/g;
		$text = '%' . $text . '%';

		my $criteria = $connect->quote("$text");

		my $found_items = 0;

                my $sql_query = "select items.Name,, spawn2.x, spawn2.y, spawn2.z 
		from npc_types join merchantlist on = merchantlist.merchantid
               			join items on merchantlist.item = 
               			join spawnentry on merchantlist.merchantid = spawnentry.npcID
               			join spawn2 on spawnentry.spawngroupID = spawn2.spawngroupID
		where = 'poknowledge' AND items.Name like $criteria limit 25";

		my $sql_handler = $connect->prepare($sql_query);


		while (@item_row = $sql_handler->fetchrow_array())

			my $vendor_link = "name :$item_row[2]:$item_row[3]:$item_row[4]";
			my $item_name = $item_row[0];
			my $item_vendor = $item_row[1];
				$item_vendor =~ s/\_/ /g;
				$item_vendor =~ s/\#//g;
			my $linkvendor = quest::saylink($vendor_link, 1, $item_vendor);

			$client->Message(315, "$item_name from $linkvendor.");

		if ( $found_items > 0 ){ quest::say("I believe this is what you may seek."); }
		else { quest::say("Sorry, $name. I am not sure about that item."); }

Reliable Permit Solutions, LLC
Reply With Quote