View Single Post
  #2  
Old 02-26-2008, 11:01 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

And here is a script that will reset the zone after 2 minutes, so anyone can test it out quickly and verify that it is working properly before putting on the actual 4 hour script:

Code:
#2 Minute Zone Reset For Testing

my $counter;

sub EVENT_SPAWN {
quest::settimer("reset",121);
quest::settimer("warning1",1);
quest::settimer("warning2",61);
quest::settimer("warning3",91);
quest::settimer("warning4",111);
quest::settimer("warning5",116);
quest::settimer("warning6",120);

$counter = 0;
}

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

  if ($timer eq "warning2"){
    quest::stoptimer("warning2");
    quest::shout2("NEXUS will be restarting in 1 minute.  Please zone out before that time.");}

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

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

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

  if ($timer eq "warning6"){
    quest::stoptimer("warning6");
    quest::shout("NEXUS will be restarting in 1 seconds.  Please zone out NOW!");}

  if ($timer eq "reset"){
    quest::stoptimer("reset");
    quest::shout2("Nexus is being restarted right now!  It will be back immediately, so you can zone back in right away.");
    kill SEGV => $$;
}
}
To disable the zone kill, all you have to do is comment out the line at the bottom like this: "#kill SEGV => $$;" and then do a #reloadquest when you log in. I think 2 minutes should be plenty of time to get back in and reload quests between the 2 minute resets. You should be able to see the shouts in this script from other zones as well, since some of them use "shout2" which is server-wide shout. So, you can zone to another zone and wait for the shout message to come across and then zone back in right away. But, remember that there has to be someone in the zone if you are using dynamic zones, otherwise the zone will unload before the reset happens. It resets 2 minutes after the NPC spawns, which happens when someone loads into the zone.

You can test this script on any NPC you want, but you will probably want to make a spawn named "<Your Server Name Here>" or "Zone Resetter" and then make it race 127 for invisible man and body type 11 for untargetable.

Once you create the first NPC, you can use GeorgeS' Spawn Editor and load up Nexus spawns. Then, find the Spawn you created and use "add line" in the spawn section on the right. You can add a line for each zone you want to run the script in and simply put the zone name there, and it will spawn in each of your zones without having to go to each zone spawn table and adding it 1 by 1. Next, all I did was set the spawn locs in all zones to 0, 0, -999 so that it will spawn under the world so no one can see it. It may still show up on track, but that isn't a big deal.

Last, you go zone by zone and add the quest to that NPC for each zone. The only thing that has to change for each zone is the zone name in the shouts. You can also change the reset and warning timers (just use a calculator to get the numbers). I have Nexus and all low level zones set to 4 hour resets. All mid to high level exp zones set to 6 hour resets. And all raid zones are set to 8 hour resets with 2 hours of warnings (instead of 30 mins) so players can plan accordingly.

So far the scripts seem to be working on my server. I just added them in last night, so I am waiting to hear feedback from my players to see if they are working right and if they are helping server performance. Feel free to test them out now if you like. I will report back later when I gather more information from my players and do more testing. At this time, I think this is probably the best (and only) work-around for player ghosting. If it works as I think it should, it should make a huge impact on server performance. It should also mean less intervention from admins to reset the server and zones so often. Might be good if you had to go away for the weekend or something

One more thing that I should mention is that the script isn't exactly doing a reset on the zone. It also isn't exactly crashing the zone. I don't even know exactly what the command "kill SEGV => $$;" does (Derision provided it to me as a solution), but it seems to just stop the zone process. You will get the windows explorer window pop-up like on a normal zone crash, but you don't get the crash error messages. From my testing in Nexus, I would see the zone stop and then it would load up another zone server and restart nexus when a player loaded into it.

Let me know if you guys have any questions or feedback on this quest. You can reply here or PM me on my forums, or whatever.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote