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 05-12-2009, 06:21 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Doing that is actually a bit more complex than it might sound. There are a couple of ways to do it, but here is a way that I recently wrote to handle a similar situation and modified to fit what you are wanting:

npcname.pl file for the npc giving the quest
Code:
sub EVENT_SAY {


	if($text=~/hail/i && defined($qglobals{zone_wiz}))
	{
		quest::say("You have already started this event.");
	}

	if($text=~/hail/i && !defined($qglobals{zone_wiz}))
	{
		quest::say("You have about 1.5 minutes before you get booted!");
		quest::setglobal("zone_wiz", 1, 5, "M1");
		quest::setglobal("zone_wiz_delay", 1, 5, "M2");
	}

}
player.pl in the zone shortname directory
Code:
sub EVENT_ZONE {

	quest::stoptimer("wizboot");

}


sub EVENT_ENTERZONE {

	quest::settimer("wizboot", 5);


}

sub EVENT_TIMER {

	if ($timer eq "wizboot")
	{
		quest::stoptimer("wizboot");
		if (!defined($qglobals{zone_wiz}) && defined($qglobals{zone_wiz_delay})) {
			quest::delglobal(zone_wiz_delay);
			$client->Message(15, "You are returning to PoK now!");
			quest::movepc(202, -107,-190,-156);
		}
		quest::settimer("wizboot", 5);
	}

}
That is a quick edit, so I may have missed something, but I think that should work for you. Basically, in the player.pl, there is no easy way to trigger a timer to start, so I have one running that starts when a player zones in. If you expect to have many people in this zone, you might want to set the delay longer so it isn't working too hard on it (I set mine to check ever 60 secs), but if you are only having a couple in the zone, 5 sec checks should be fine.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #2  
Old 05-12-2009, 07:01 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

Alright I edited in the stuff you suggested and its working perfectly. Thanks again for the help
Reply With Quote
  #3  
Old 05-24-2009, 08:34 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

I am making a quest where ideally the NPC will cycle through a group of phrases, but it isn't even saying the first thing.
Code:
sub EVENT_SPAWN{
quest::settimer("Timer1",10);
}
sub EVent_TIMER{
if ($timer eq "Timer1"){
quest::say("text");
quest::stoptimer("Timer1");
quest::settimer("Timer2",10);
}
if ($timer eq "Timer2"){
quest::say("text");
quest::stoptimer("Timer2");
quest::settimer("Timer3",10);
}
if ($timer eq "Timer3"){
quest::say("text");
quest::stoptimer("Timer3");
quest::settimer("Timer4",10);
}
if ($timer eq "Timer4"){
quest::say("text");
quest::stoptimer("Timer4");
quest::settimer("Timer1",10);
}
}
Reply With Quote
  #4  
Old 05-24-2009, 08:37 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

Did you try changing EVent to EVENT? Not sure if it is case sensitive or not, but most likely it is.
Reply With Quote
  #5  
Old 05-24-2009, 10:22 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

I tried that, but it still doesnt work
Reply With Quote
  #6  
Old 05-24-2009, 10:35 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Yeah, you do definitely need to make sure to use all uppercase. That script should work fine when you have it set like this:

Code:
sub EVENT_SPAWN {
	quest::settimer("Timer1",10);
}

sub EVENT_TIMER {

	if ($timer eq "Timer1"){
		quest::say("text1");
		quest::stoptimer("Timer1");
		quest::settimer("Timer2",10);
	}

	if ($timer eq "Timer2"){
		quest::say("text2");
		quest::stoptimer("Timer2");
		quest::settimer("Timer3",10);
	}

	if ($timer eq "Timer3"){
		quest::say("text3");
		quest::stoptimer("Timer3");
		quest::settimer("Timer4",10);
	}

	if ($timer eq "Timer4"){
		quest::say("text4");
		quest::stoptimer("Timer4");
		quest::settimer("Timer1",10);
	}

}
Make sure to do a #reloadquest and also a #repop to start the timer. Also, make sure you have the script named properly.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #7  
Old 05-24-2009, 10:44 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

Maybe try integers instead of strings for timer id as a last resort.
Reply With Quote
  #8  
Old 05-24-2009, 11:06 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

If you use integers, change eq to ==
Code:
sub EVENT_SPAWN {
	quest::settimer(1, 10);
}

sub EVENT_TIMER {

	if ($timer == 1){
		quest::say("text1");
		quest::stoptimer(1);
		quest::settimer(2, 10);
	}

	if ($timer == 2){
		quest::say("text2");
		quest::stoptimer(2);
		quest::settimer(3, 10);
	}

	if ($timer == 3){
		quest::say("text3");
		quest::stoptimer(3);
		quest::settimer(4, 10);
	}

	if ($timer == 4){
		quest::say("text4");
		quest::stoptimer(4);
		quest::settimer(1, 10);
	}

}
__________________
The Realm
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:18 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