Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 02-26-2008, 10:38 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Quote:
Originally Posted by trevius View Post
The first bug I have found so far is that one of my quest NPCs in PoTimeB was shouting that Crushbone was going to reset and it reset PoTimeB instead. The zone resetting NPC in potimeb is definitely only set to reset potimeb and only set to warn that it is shutting down that zone. Crushbone has a completely different quest with it's own spawn that shouts about Crushbone being reset.
You could always make just 1 quest, in say the plugins folder, and use the variable $zoneln to make the quest dynamically say the zone's long name:

Code:
#############
#Quest Name: 4 Hour Zone Reset Script
#Author: Trevius
#NPC's Involved: Storm Haven
#Items Involved: None
#############
###NPC 1
#Name: Storm Haven (Or whatever your server name Is)
#Race 127 (invisible man), Texture of 0, Size 1, gender of 0, body type 11
#Location: 0,0,-999 of the Nexus
#level: 100
#Type: Quest NPC that resets the zone
#Loot: N/A
#############

sub EVENT_SPAWN {
quest::settimer("reset",14400);
quest::settimer("warning1",12600);
quest::settimer("warning2",13200);
quest::settimer("warning3",13800);
quest::settimer("warning4",14100);
quest::settimer("warning5",14280);
quest::settimer("warning6",14340);

}


sub EVENT_TIMER{
  if ($timer eq "warning1"){
    quest::stoptimer("warning1");
    quest::shout("$zoneln will be restarting in 30 minutes.  Please zone out before that time.");}

  if ($timer eq "warning2"){
    quest::stoptimer("warning2");
    quest::shout("$zoneln will be restarting in 20 minutes.  Please zone out before that time.");}

  if ($timer eq "warning3"){
    quest::stoptimer("warning3");
    quest::shout("$zoneln will be restarting in 10 minutes.  Please zone out before that time.");}

  if ($timer eq "warning4"){
    quest::stoptimer("warning4");
    quest::shout2("$zoneln will be restarting in 5 minutes.  Please zone out before that time.");}

  if ($timer eq "warning5"){
    quest::stoptimer("warning5");
    quest::shout("$zoneln will be restarting in 2 minutes.  Please zone out before that time.");}

  if ($timer eq "warning6"){
    quest::stoptimer("warning6");
    quest::shout2("$zoneln will be restarting in 1 minute!  Please zone out NOW!");}

  if ($timer eq "reset"){
    quest::stoptimer("reset");
    quest::shout2("$zoneln is being restarted right now!  It will be back immediately, so you can log back in right away.");
    kill SEGV => $$;}
}
Should save a ton of headache if you want to make each zone the same. And if you don't, you should be able to create the individual quests for the specific zones, while still keeping the main one in plugins.

You may also notice I removed "$counter = 0;" because it doesn't seem to do anything in the script.

Quote:
Originally Posted by trevius View Post
When I first put the quests in, I had all of the timers set to the same names in each zone and I think this may have been the problem. All of the timers were $reset, $warning1, $warning2, etc. Now, I have renamed each of them in the quests for each zone. For example, Crushbone timers are now called $cb_reset, $cb_warning1, $cb_warning2, etc. I will test and see if that clears up my problem.
If I'm not mistaken, if you define the variables at the beginning of the script (before the subs) using my (so my $reset, my $warning1, etc), I believe it will give you the desired result without having to create a script for each zone.
__________________
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
  #2  
Old 02-27-2008, 10:02 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Thanks, that is all useful information.

I didn't know what "$counter = 0;" did either, but I normally write my scripts by example and the one I used that had timers had that in there and I couldn't figure out why, so I just stuck it in mine lol. You are probably right, it most likely doesn't need to be there.

As for using $zoneln instead of manually editing, that should work well too. I did mine manually, because I wanted them to all be in CAPS so the zone name stands out. This is mainly because multiple zones will be resetting at varied times and I didn't want people to see 2 separate warnings around the same time and accidentally ignore one because they thought it was a warning for the same zone that was just warned about. Plus, I want it to show long names to look a little cleaner.

As for the variables being defined in each script, you may be correct. I am not defining any variables by using "my", so, I guess they are being defined by the settimer command. I kinda figured that these worked on a per-quest basis similar to the "my" setting for variables. The thing I am unsure about is where the actual timers are being calculated and stored. I looked in the "timers" table and I don't see them in there. So, I am guessing they are being ran independently outside of the database in the actual script itself.

I still have more testing to do and refining to my current setup. If the timer names weren't the reason that the Crushbone script was ran in PoTimeB, then I still need to figure out what was. I am leaning towards the way I setup the spawn2 database for the quest NPC. Maybe somehow it is letting that NPC pull scripts from other zone directories, even though that sounds impossible to me lol. This is just a minor issue though and I don't think it will be hard to fix once I find the cause for sure.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 02-27-2008, 10:18 AM
Andrew80k
Dragon
 
Join Date: Feb 2007
Posts: 659
Default

You can use uc to change $zoneln to upper case, ie $ZONELN=uc($zoneln);

Just a thought.
Reply With Quote
  #4  
Old 02-27-2008, 03:37 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Oh nice! I will definitely test that one out! Wish I could edit posts to make minor adjustments to my quest submissions. I almost think I should post them in Quest Q&A for a couple of weeks and make sure everything is perfect before submitting them here :P At least when I do post them they actually work. I normally just find minor tweaks to make them better later.

I think most quest submissions are trying to emulate live or have 1 specific purpose, so once they work, they work and don't need replies to make notes or adjustments to them. Many of the quests I have been working on are completely different uses for quests than what they are normally used for. This zone reset quest is more like a code ruleset than a quest. And like any code update, there is always a chance for patches and changes to adjust them :P
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #5  
Old 02-28-2008, 04:30 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Quote:
Originally Posted by Andrew80k View Post
You can use uc to change $zoneln to upper case, ie $ZONELN=uc($zoneln);

Just a thought.
Can't seem to figure out how to get that working. Could you use it in a simple sub EVENT_SAY as an example, please?
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #6  
Old 02-29-2008, 09:33 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

You should be able to do it like this, using your code:

Code:
sub EVENT_TIMER {
	my $zonelnuc = uc($zoneln);
	if ($timer eq "warning1") {
		quest::stoptimer("warning1");
		quest::shout("$zonelnuc will be restarting in 30 minutes.  Please zone out before that time.");
	}
	...
	...
	...
}
So, you could just need to rename the $zoneln in the rest of the script to $zonelnuc.
__________________
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
  #7  
Old 03-03-2008, 08:58 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Got the $zoneln working in caps now thanks to AndMetal. Here is the current and hopefully final version of the script:

Code:
#############
#Quest Name: 4 Hour Zone Reset Script
#Author: Trevius
#NPC's Involved: Storm Haven
#Items Involved: None
#############
###NPC 1
#Name: Storm Haven (Or whatever your server name Is)
#Race 127 (invisible man), Texture of 0, Size 1, gender of 0, body type 11
#Location: 0,0,-999 of the Nexus
#level: 100
#Type: Quest NPC that resets the zone
#Loot: N/A
#############

sub EVENT_SPAWN {
quest::settimer("nxs_reset",14400);
quest::settimer("nxs_warning1",12600);
quest::settimer("nxs_warning2",13200);
quest::settimer("nxs_warning3",13800);
quest::settimer("nxs_warning4",14100);
quest::settimer("nxs_warning5",14280);
quest::settimer("nxs_warning6",14340);
quest::settimer("nxs_warning7",14395);
}


sub EVENT_TIMER{

my $zonelnuc = uc($zoneln);

  if ($timer eq "nxs_warning1"){
    quest::stoptimer("nxs_warning1");
    quest::shout("$zonelnuc will be restarting in 30 minutes.  Please zone out before that time.");}

  if ($timer eq "nxs_warning2"){
    quest::stoptimer("nxs_warning2");
    quest::shout("$zonelnuc will be restarting in 20 minutes.  Please zone out before that time.");}

  if ($timer eq "nxs_warning3"){
    quest::stoptimer("nxs_warning3");
    quest::shout("$zonelnuc will be restarting in 10 minutes.  Please zone out before that time.");}

  if ($timer eq "nxs_warning4"){
    quest::stoptimer("nxs_warning4");
    quest::shout2("$zonelnuc will be restarting in 5 minutes.  Please zone out before that time.");}

  if ($timer eq "nxs_warning5"){
    quest::stoptimer("nxs_warning5");
    quest::shout("$zonelnuc will be restarting in 2 minutes.  Please zone out before that time.");}

  if ($timer eq "nxs_warning6"){
    quest::stoptimer("nxs_warning6");
    quest::shout("THIS ZONE WILL BE RESTARTING IN 1 MINUTE!  PLEASE ZONE OR LOG OUT NOW!");}

  if ($timer eq "nxs_warning7"){
    quest::stoptimer("nxs_warning7");
    quest::shout2("$zonelnuc is being restarted right now!  It will be back immediately, so you can zone back in right away.");}

  if ($timer eq "nxs_reset"){
    quest::stoptimer("nxs_reset");
    kill SEGV => $$;}
}
The spawn setup I had previously was definitely the cause of the zones reporting as resetting other zone names. I set each zone to have an NPC with the same name, but each one has it's own spawn ID now. They all also have their own spawn2 group ID that was created new for each zone. It is working perfectly now.

The only bug I am noticing is that my server now reports more players than it currently has on. It seems to be some kind of connection buildup that is probably created by the resets. When I log in after a high number of players have been on my server all day, I see about half as many players in /who all as I do at the server select screen. Also, a good chunk of them are listed as "0 unknown", which I think means the characters were sent to character select when the zones restarted and the person is still AFK and left their character at character select.

If I can find a way to make players time out from character select, that will resolve that one issue. But, overall, my server seems to be running better than ever. Previously if my server built up enough connections to start getting lag, that lag would never clear even if the player count dropped low again. I would have to reset the server to get lag back to normal. Now with the zone resetters, they seem to bring lag back down to normal after prime time when many players have been on.

Eventually I will look into other ways to further reduce lag, but this seems to be a nice work-around for now
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #8  
Old 03-11-2008, 12:30 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Woot, I didn't even notice till now that my quest made it into the completed section for quests!

I wanted to make a quick note that since I corrected the spawn issue with the NPC that had the quest to reset the zones, my "0 unknown" players on /who all and my server reporting false numbers to the server select issues are both gone! I am not sure what was causing them, but they have completely disappeared now. So, there are no more weird side effects from this quest.

There are 2 other popular servers using my script in at least a few of their zones and they have also reported that this has helped their ghosting and lag issues noticeably. I will continue to investigate those issues, but that will be for another thread. This one is complete now and works 100% perfectly as I intended it with no side effects.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
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 05:37 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