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 07-25-2009, 09:57 AM
sirjason99
Fire Beetle
 
Join Date: Jul 2009
Location: me
Posts: 6
Default One NPC spawning another

Hello,

I'm attempting to make a quest where once the PC talks to an NPC, another NPC spawns outside the room and then walks in and the two NPCs have a chat. Is this done with the quest:settimer option or is there another way to do this that I'm missing.
Reply With Quote
  #2  
Old 07-25-2009, 01:08 PM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default

You could include it as part of the sub EVENT_SAY
Code:
if($text=~/What other NPC?/i) 
	{
	quest::say("Ah, here he is now.");
	quest::spawn2(999151,0,0,1722,1556,231,190);
	}
The first # is npc_type (create the npc first),then grid # (create grid and waypoints first), then guildwarset (keep at 0),then x,y,z,then heading
Reply With Quote
  #3  
Old 07-25-2009, 01:12 PM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default

After I posted this, it occurred to me that you may have meant how to do the chat part. This would likely be done by quest::signal() or quest::signalwith() and then a sub EVENT_SIGNAL, not by a timer.
Reply With Quote
  #4  
Old 07-25-2009, 01:27 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

And if you want him to "walk" in, you could create waypoints. The NPC could spawn (not on the grid) somewhere outside the room, upon spawn, do a start(grid#) and set timer, once he reaches a certain x,y spot, have him stop() and stop the timer, and signal the NPC to talk with. Make sure the grid is a full pause and have him pause longer than the timer at the last waypoint which is inside the room.
Reply With Quote
  #5  
Old 07-27-2009, 02:24 AM
Justsomeguy
Fire Beetle
 
Join Date: Apr 2005
Posts: 7
Default

This script doesn't spawn an npc. Spawning is mentioned above though. And do remember you need to take into account players hailing quest npc when the npc is moving back and forth, so adding a $busy variable or something could be helpful too. Here is a basic script with a captain and a guard. Player hails captain and asks for help back to the camp. Captain calls guard. Guard walks into room and then takes player back.

Captain.pl

Code:
my $npcvariable = 0;

sub EVENT_SAY {
	if ($text=~/hail/i) {
		quest::say("Hello, $name.  Do I need to call a guard to help you?");
	}
	elsif ($text=~/yes/i) {
		#signals guard
		quest::say("Very well.  Guard!!!");
		quest::signal(1001);
	}
}


 
sub EVENT_SIGNAL {
	
	#Captain signals guard to move up
	
	if($npcvariable < 1) {
	quest::say("Please show our new recruit to the main post.");
	quest::signal(1001);
	$npcvariable = 0;
	}
}
Guard.pl

Code:
my $npcwaypoint = 0;
 
sub EVENT_SIGNAL {
	
	if($npcwaypoint < 1) {	#Captain signals guard to move up
	quest::moveto(600, 200, 12);
	$npcwaypoint = 1;
	}
	elsif($npcwaypoint == 3) {	#Guard is told to take player back.  See timer
	quest::say("Yes, sir, right away!");
	quest::settimer("movement",3);
	}
}

sub EVENT_WAYPOINT {


  $npc->SaveGuardSpot(0);	#this is so npcs don't not walk to waypoint and return immediately

	if($npcwaypoint == 1) {	#npc turns corner
	$npcwaypoint = 2;
	quest::moveto(600, 100, 12);
	}
	elsif($npcwaypoint == 2) {	#npc turns corner
	quest::moveto(340, 100, 12);
	$npcwaypoint = 3;
	}
	#npc arrives at captain
	elsif($npcwaypoint == 3) {
	quest::say("Yes, sir?!");
	quest::signal(1000);
	}
	elsif($npcwaypoint == 4) {	#npc turns corner
	quest::moveto(340, 100, 12);
	$npcwaypoint = 5;
	}
	#guard has taken player back with him.  Resets script for next user
	elsif($npcwaypoint == 5) {	#npc turns corner
	$npcwaypoint = 6;
	quest::moveto(600, 100, 12);
	$npcwaypoint = 0;
	}
}

sub EVENT_TIMER {
	quest::stoptimer("$timer");

	if($npcwaypoint == 3) {		#just used a timer here since players may need some time to react.
	quest::moveto(340, 100, 12);
	$npcwaypoint = 4;
	}
}
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 09:01 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