Installed NESS 4.1.9
Installed NESS 4.1.9. Tweaked main city. Full compile.
This commit is contained in:
40
_module/nss/spawn_pseudohb.nss
Normal file
40
_module/nss/spawn_pseudohb.nss
Normal file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// NESS V8.1
|
||||
//
|
||||
// Spawn Pseudo-heartbeat
|
||||
//
|
||||
// This script is executed when a PC enters an otherwise empty area
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
object oArea = OBJECT_SELF;
|
||||
|
||||
// No pseudo-heartbeats scheduled, since we just fired this one
|
||||
SetLocalInt( oArea, SPAWN_HEARTBEAT_SCHEDULED, FALSE );
|
||||
|
||||
// Do a heartbeat if there are PCs in the area or any spawns up
|
||||
if ( NeedPseudoHeartbeat( oArea ) )
|
||||
{
|
||||
// This defaults to spawn_sample_hb. You can pass the name of any script
|
||||
// to use in the function Spawn_OnAreaEnter()
|
||||
string sHeartbeatFunc = GetLocalString( oArea, SPAWN_HEARTBEAT_SCRIPT );
|
||||
|
||||
// start actual heartbeat code
|
||||
ExecuteScript( sHeartbeatFunc, oArea );
|
||||
// end actual heartbeat code
|
||||
|
||||
// This function sets SPAWN_HEARTBEAT_SCHEDULED to TRUE
|
||||
ScheduleNextPseudoHeartbeat( oArea );
|
||||
}
|
||||
else
|
||||
{
|
||||
ReleaseAreaRefs(OBJECT_SELF);
|
||||
}
|
||||
|
||||
|
||||
//**FLAG else here to remove refcounts
|
||||
}
|
Reference in New Issue
Block a user