Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 02-28-2019, 07:09 PM
John C
Sarnak
 
Join Date: Jul 2018
Location: Atlanta, GA
Posts: 49
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?

Thanks!

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.

Code:
sub EVENT_SAY
{
	my $say_bind = quest::saylink("bind", 1);

	if($text=~/hail/i)
	{
		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.");
	}
	elsif($text=~/bind/i){
		quest::say("Binding your soul. You will return here when you die.");
		quest::selfcast(2049);
	}
	elsif($text=~/name/i){
		my ($x,$y,$z) = (split /:/, $text)[1,2,3];
		
//		$client->Message(315, "showing path to $x $y $z");
		
		quest::showpath($x,$y,$z);
	}
	else 
	{
		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, npc_types.name, spawn2.x, spawn2.y, spawn2.z 
		from npc_types join merchantlist on npc_types.id = merchantlist.merchantid
               			join items on merchantlist.item = items.id 
               			join spawnentry on merchantlist.merchantid = spawnentry.npcID
               			join spawn2 on spawnentry.spawngroupID = spawn2.spawngroupID
		where spawn2.zone = 'poknowledge' AND items.Name like $criteria limit 25";

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


		$sql_handler->execute();

		while (@item_row = $sql_handler->fetchrow_array())
		{
			$found_items++;

			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."); }

		$connect->disconnect();
	}
}
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 03:08 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3