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
  #4  
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
 


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:19 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