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

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-20-2008, 11:55 PM
Striat
Sarnak
 
Join Date: Aug 2006
Posts: 60
Default

To my knowledge, respawn is just for respawning a certain npc id. Not exactly sure what you mean about moving the npc. If you mean moving an npc from one location to the next, I made a little example in which a signal triggers a guard to move via quest::signal(targetnpcid, waittime).

Code:
#look for EVENTA for the sequence of moving the npc.

my $location = 0;

sub EVENT_SPAWN {
	$location = 0;	#resets location variable
	}


sub EVENT_WAYPOINT {	#this event is triggered everytime npc moves
  $npc->SaveGuardSpot(0);	#This prevents the npc from running back to his original spot

	if ($location == 2) {	#EVENTD - NPC makes it to location and triggers this
	quest::settimer("adjustheading",1);
	}
}

sub EVENT_SIGNAL {
	if ($location == 0) {	$EVENTA - NPC is triggered
	quest::settimer("move",1);
	$location = 1;
	}
}


sub EVENT_TIMER {
	if ($timer eq "move") {
	quest::stoptimer("move");
	if ($location == 1) {
	quest::moveto(-832,-1345,87);	#EVENTB - NPC moves to this xyz
	$location = 2;	#EVENT C - Changes variable.
	}
	}
	if ($timer eq "adjustheading") {	#EVENTE - The npc is in the appropriate location.  Sets Heading
	quest::stoptimer("adjustheading");
	if ($location == 2) {
	$npc->SetHeading(123);	#What heading does npc face?
	$npc->SendPosition();	#Now, send this heading change to client
	}
	}
}
Reply With Quote
 


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 05:22 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