Aantioch_Infernum/_module/nss/_area_on_exit.nss
EpicValor ac21a61c37 Added a faction, and minor stuff
Adding  faction goes through every area. I had no idea.
2023-08-28 22:46:32 -05:00

29 lines
898 B
Plaintext

/* onexit script:
This script is placed in the onexit event handler for each area.
Its purpose is to check for the presence of remaining pc's in
and area and if it finds none then it activates a delayed call
to an areacleanup script which cleans the area
*/
void main()
{
float cleanupdelay = 600.0; //if you change this it alters how long before
// the area cleans up, if you do change it INCLUDE THE DECIMAL, or it won't
// work
if(!GetIsPC(GetExitingObject()) ) {
return; }
object oPC = GetExitingObject();
if (!GetIsPC(oPC))
return;
oPC = GetFirstPC();
while (oPC != OBJECT_INVALID)
{
if (OBJECT_SELF == GetArea(oPC))
return;
else oPC = GetNextPC();
}
///wildmagic
SetLocalInt(GetArea(OBJECT_SELF), "X2_L_WILD_MAGIC", 0);
DelayCommand(cleanupdelay, ExecuteScript("areacleanup", OBJECT_SELF));
}