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 04-03-2008, 11:08 PM
Andrew80k
Dragon
 
Join Date: Feb 2007
Posts: 659
Default Quest timers

I'm looking for a good example of a quest that has an NPC shout something periodically. Can someone suggest one to look at?

Thanks.
Reply With Quote
  #2  
Old 04-04-2008, 12:26 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

This is a pretty basic example:

Code:
sub EVENT_SPAWN {
	quest::settimer("repeat", 60); // First trigger after 60 seconds
}

sub EVENT_TIMER {
	if ($timer eq "repeat") {
		quest::stoptimer("repeat");
		quest::shout("I fart in your general direction! Your mother was a hamster and your father smelt of elderberries!");
		quest::settimer("repeat", 60); // Keep repeating every 60 seconds
	}
}
Zone Reset Quest on a Timer can be useful as a general reference, but the idea is to clear the timer & restart it. You could also use quest::ChooseRandom to make the repeated text a little more random (90 seconds vs 60, etc):

Code:
quest::settimer("repeat", quest::ChooseRandom(60, 60, 90));
That would give a little better odds for it to take 60 seconds, but sometimes take 90 seconds.

Another cool thing is that you can change quest::shout to quest::shout2, and it will shout across ALL zones.

Hope this does what you're looking for.
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #3  
Old 04-04-2008, 05:58 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

You can find examples of this and many other quest examples in GeorgeS' quest tool from his website.

http://66.159.225.58/eqemu/eq.html
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 04-04-2008, 09:43 AM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

Just a quick note... If you don't stop the timer when it triggers, you don't have to reset it. So the code for that can be even shorter:

Code:
sub EVENT_SPAWN {
	quest::settimer("repeat", 60); // First trigger after 60 seconds, and every 60 seconds after
}

sub EVENT_TIMER {
	if ($timer eq "repeat") {
		quest::shout("I fart in your general direction! Your mother was a hamster and your father smelt of elderberries!");
	}
}
Reply With Quote
  #5  
Old 04-04-2008, 09:58 AM
Andrew80k
Dragon
 
Join Date: Feb 2007
Posts: 659
Default

Quote:
Originally Posted by So_1337 View Post
Just a quick note... If you don't stop the timer when it triggers, you don't have to reset it. So the code for that can be even shorter:

Code:
sub EVENT_SPAWN {
	quest::settimer("repeat", 60); // First trigger after 60 seconds, and every 60 seconds after
}

sub EVENT_TIMER {
	if ($timer eq "repeat") {
		quest::shout("I fart in your general direction! Your mother was a hamster and your father smelt of elderberries!");
	}
}
Awesome this will help me finish up Corun in Surefall.
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 02:24 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