View Single Post
  #10  
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