Thread: Q&A Thread
View Single Post
  #11  
Old 09-07-2018, 10:25 AM
Almusious
Fire Beetle
 
Join Date: Sep 2012
Posts: 25
Default

Quote:
Originally Posted by Huppy View Post
Hey Almuscious, thank you, that little sample works like a charm

I'd already tried a few variables with the quest::follow before I even posted the question, including $name and $client, etc.

My intentions for this little task, was just for any player that hails the NPC, it will start to follow.

I've already got scripts running with NPC's following other NPC's with id's but this was my first crack at a random PC follow.

I was going through everything on the wiki with entities, etc., and had no luck, but I sometimes I overlook the obvious, lol

EDIT: This works good with an EVENT_ENTER as well. I set the proximity so all you have to do is run by and it clings to you, lol
Before the recent work on the eqemu wiki I would often turn to the source (embparser.cpp, etc.) to see what what expects as data but keep this in your arsenal, it will likely be your go to:

https://github.com/EQEmu/Server/wiki/Perl-API

If we look up the quest::follow we'll see it expects an entity id rather than the object itself
Code:
quest::follow(int entity_id, [int distance = 10])
Consequently you can define a following distance with the below

Code:
quest::follow($userid, 50);
otherwise
Code:
quest::follow($userid);
without a distance defined it will default to 10

Happy coding
Reply With Quote