First of all, I want to give credit and thanks to So_1337 and Derision for helping me get this quest working.
The primary idea behind this script is that it can be used to reset zones to clear out player ghosts. A player ghost is what happens sometimes when players use /exit or /quit or crash, and sometimes even when they /log. The character stays in the game until the server or zone is reset, or until they are #kicked by a GM. The easy way to tell if a character is a ghost is to inspect them. If the inspect window doesn't pop up and you have /toggleinspect on, then that character is a ghost.
I don't know if ghosting is an issue on Linux servers, but all windows servers I know of have the ghosting issue. Overtime, the ghosts and connections build up and can cause incredible lag. This means that most decently populated windows server need to be rebooted every day or they become unplayable.
In this thread, I will include the actual script I am running in Nexus right now that is working, and also a test script with shorter reset times on it so people can try it out. At the end of the 2 posts, I will give details about setting it up and other information I have. I will also reply to these posts later when I have had more testing and feedback from my players, and will report if it helped server performance noticeably or not.
Here is the working script I am running in nexus right now to reset the zone every 4 hours if there are players in it:
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);
$counter = 0;
}
sub EVENT_TIMER{
if ($timer eq "warning1"){
quest::stoptimer("warning1");
quest::shout("NEXUS will be restarting in 30 minutes. Please zone out before that time.");}
if ($timer eq "warning2"){
quest::stoptimer("warning2");
quest::shout("NEXUS will be restarting in 20 minutes. Please zone out before that time.");}
if ($timer eq "warning3"){
quest::stoptimer("warning3");
quest::shout("NEXUS will be restarting in 10 minutes. Please zone out before that time.");}
if ($timer eq "warning4"){
quest::stoptimer("warning4");
quest::shout2("NEXUS will be restarting in 5 minutes. Please zone out before that time.");}
if ($timer eq "warning5"){
quest::stoptimer("warning5");
quest::shout("NEXUS will be restarting in 2 minutes. Please zone out before that time.");}
if ($timer eq "warning6"){
quest::stoptimer("warning6");
quest::shout2("NEXUS will be restarting in 1 minute! 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 log back in right away.");
kill SEGV => $$;}
}