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 08-02-2009, 08:17 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default Get npc to follow another npc

I have been trying to figure out how to get some npcs to follow another one when they spawn, but I am not having any luck. The closest I got was when I did quest::settarget(npctype, 1412) but that just made them attack. None of my other ideas have come close so I won't bother posting them.
Reply With Quote
  #2  
Old 08-03-2009, 07:24 AM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default

Code:
sub EVENT_SAY {
  if($text=~/Hail/i){
    quest::emote("holds a cracked monocle up to his squinty eye.  'I say!!  A talking bear!!  Squire Fuzzmin, come and take a gander at this rare find.  The wonders never cease in the land of Kunark!!' ");
    quest::unique_spawn(84312,0,0,1985,-2243,-75);      # Spawn Squire_Fuzzmin for Wurmslayer quest
    quest::delglobal("hobble");                       
    quest::setglobal("hobble",$npc->GetID(),"3","F");   # Set global $hobble with Sir_Hobble's NPC ID so Squire_Fuzzmin can follow
    $hobble=undef;
  }
}
and

Code:
sub EVENT_SPAWN {
  quest::follow($hobble);
}
Only complaint I have about follow is that in some instances it is too close and I couldn't figure a way to control the distance... (POM My Finger/Not Yours for example and it will repeat again on Derakor)
__________________
Retired EMarr
Project1999 Developer
Reply With Quote
  #3  
Old 08-03-2009, 07:20 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

You can do this:

Code:
sub EVENT_SPAWN {

#Set this to the NPCID you want the NPC to follow
my $OpponentID = 1010101;

#Get Target NPC
my $getmobbynpctype = $entity_list->GetMobByNpcTypeID($OpponentID);
#Get the NPC's Entity ID
my $follow_target = $getmobbynpctype->GetID();

quest::follow($follow_target);

}
By getting the NPC this way, you can set follow to happen from any event type including EVENT_TIMER and EVENT_SIGNAL. If you need anything else, feel free to ask.

And yeah, follow distance would be something awesome to be able to adjust. I could really use an adjustable setting for distance in the scripted event I have been working on lately.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 08-04-2009 at 03:27 AM..
Reply With Quote
  #4  
Old 08-03-2009, 07:48 PM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default

Damnit >< I was so close to gettin this to work that way and just missed it by a smidge.

Thanks Trev!
__________________
Retired EMarr
Project1999 Developer
Reply With Quote
  #5  
Old 08-04-2009, 07:08 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Added a Distance option for quest::follow(entity_id, distance) to allow setting the distance for the NPC to follow at. Seems to work really well. I think this should make the follow command a bit more useful
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #6  
Old 08-04-2009, 11:49 AM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

I tried using the quest you put and just changed the ID, but the mob still won't follow the other npc.
Reply With Quote
Reply


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 10:23 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3