mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
158 lines
3.2 KiB
Plaintext
158 lines
3.2 KiB
Plaintext
/**
|
|
* Copyright (c)2000-2002 Sony Online Entertainment Inc.
|
|
* All Rights Reserved
|
|
*
|
|
* Title: spawn_master.script
|
|
* Description: This is the master spawn script. It tracks all necessary objects, and receives all spawn events from regions and structures. All pertinent tracking data is handled from this script.
|
|
* @author $Author:$
|
|
* @version $Revision:$
|
|
*/
|
|
|
|
include library.regions;
|
|
include java.util.Set;
|
|
include java.util.Iterator; // I'm sorry, justin made me do this this way so it doesn't break the servers.
|
|
include java.lang.Integer;
|
|
|
|
inherits systems.spawning.spawn_base;
|
|
|
|
|
|
/**
|
|
@brief Bootstrap function for trigger volume creation. This will be moved to OnInitialization once it comes online.
|
|
|
|
*/
|
|
trigger OnUniverseComplete()
|
|
{
|
|
|
|
|
|
string strPlanet = getNameForPlanetObject(self);
|
|
////debugServerConsoleMsg(self, "Universe completed for "+strPlanet);
|
|
|
|
if(!hasObjVar(self, "boolSpawnerIsOn"))
|
|
{
|
|
setObjVar(self, "boolSpawnerIsOn", true); //turn master spawner off
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!hasObjVar(self, "intMaxPlanetSpawnCount"))
|
|
{
|
|
|
|
setObjVar(self, "intMaxPlanetSpawnCount", 10000);
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
int intSpawnLimit = getIntObjVar(self, "intMaxPlanetSpawnCount");
|
|
if(intSpawnLimit>10000)
|
|
{
|
|
|
|
setObjVar(self, "intMaxPlanetSpawnCount", 10000);
|
|
}
|
|
|
|
}
|
|
|
|
preLoadSpawnDataTables(self);
|
|
setObjVar(self, "intCurrentPlanetSpawnCount", 0);
|
|
setObjVar(self, "intMinSpawnDelay", SPAWN_PLAYER_DELAY_MIN);
|
|
setObjVar(self, "intMaxSpawnDelay", SPAWN_PLAYER_DELAY_MAX);
|
|
|
|
string strConfigSetting = getConfigSetting("GameServer", "spawningInitialState");
|
|
if(strConfigSetting!=null)
|
|
{
|
|
if(strConfigSetting=="on")
|
|
{
|
|
setObjVar(self, "boolSpawnerIsOn", true);
|
|
}
|
|
else if(strConfigSetting=="off")
|
|
{
|
|
setObjVar(self, "boolSpawnerIsOn", false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return SCRIPT_CONTINUE;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
@brief This is the initialization routine for the entire spawn system. This creates the master trigger volumes, and initializes all necessary spawn values. The values are derived from spawn_base
|
|
These will be moved once we get a more concrete idea of spawn listings.
|
|
|
|
|
|
|
|
*/
|
|
trigger OnAttach()
|
|
{
|
|
|
|
|
|
string strPlanet = getNameForPlanetObject(self);
|
|
////debugServerConsoleMsg(self, "Universe completed for "+strPlanet);
|
|
|
|
if(!hasObjVar(self, "boolSpawnerIsOn"))
|
|
{
|
|
setObjVar(self, "boolSpawnerIsOn", true); //turn master spawner off
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!hasObjVar(self, "intMaxPlanetSpawnCount"))
|
|
{
|
|
|
|
setObjVar(self, "intMaxPlanetSpawnCount", 10000);
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
int intSpawnLimit = getIntObjVar(self, "intMaxPlanetSpawnCount");
|
|
if(intSpawnLimit>10000)
|
|
{
|
|
|
|
setObjVar(self, "intMaxPlanetSpawnCount", 10000);
|
|
}
|
|
|
|
}
|
|
|
|
preLoadSpawnDataTables(self);
|
|
setObjVar(self, "intCurrentPlanetSpawnCount", 0);
|
|
setObjVar(self, "intMinSpawnDelay", SPAWN_PLAYER_DELAY_MIN);
|
|
setObjVar(self, "intMaxSpawnDelay", SPAWN_PLAYER_DELAY_MAX);
|
|
|
|
string strConfigSetting = getConfigSetting("GameServer", "spawningInitialState");
|
|
if(strConfigSetting!=null)
|
|
{
|
|
if(strConfigSetting=="on")
|
|
{
|
|
setObjVar(self, "boolSpawnerIsOn", true);
|
|
}
|
|
else if(strConfigSetting=="off")
|
|
{
|
|
setObjVar(self, "boolSpawnerIsOn", false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return SCRIPT_CONTINUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|