EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Showpath alternative? (https://www.eqemulator.org/forums/showthread.php?t=43252)

mathygreen 03-29-2021 01:23 PM

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.

HTML 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();
        }
}



All times are GMT -4. The time now is 11:42 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.