At the moment I have a counter running that counts the number of PCs in the encounter area. When that counter hits 0 (ie all PCs have exited or been killed and moved to the morgue) I want the spawn points to reset. So I have an OnExit script that says:
So basically if when a PC exits the area and there are no more PCs left then "ACR_SetIsSpawnPointEnabled(oWP, 0, 1);" runs in order to reset the spawn points ready for the next encounter. I have the reverse of this running on the OnEnter script so that when the first PC enters the area the spawn points are turned on. Alas, this is not happening in that when you re-enter the encounter area the spawn from the previous encounter is still there. If anyone can see any errors in the above then I would appreciate some help in fixing it.////////////////////////////////////////////////////////////////////////////////
//
// System Name : ACR Configuration File
// Filename : acf_area_onexit.nss
// Version : 0.1
// Date : 7/25/06
// Author : Ronan
//
// Local Variable Prefix =
//
//
// Dependencies external of nwscript:
//
// Description
// This script calls the ACR's OnAreaExit code, and any custom code a server
// may need. It is not updated in ACR updates.
//
// Revision History
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Includes ////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
#include "acr_area_i"
#include "acr_spawn_i"
////////////////////////////////////////////////////////////////////////////////
// Constants ///////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Structures //////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Global Variables ////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Function Prototypes /////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// The main event handler.
void main();
////////////////////////////////////////////////////////////////////////////////
// Function Definitions ////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
void main() {
ACR_AreaOnExit();
// Custom code goes below this line.
object oExiter = GetExitingObject();
if (GetIsPC(oExiter) && !GetIsDM(oExiter))
{
int iPCCount = GetLocalInt(OBJECT_SELF, "sjc_PCCount");
iPCCount--;
string sPCCount = IntToString(iPCCount); //Debug
SendMessageToPC(GetFirstPC(), sPCCount); //Debug
SetLocalInt(OBJECT_SELF, "sjc_PCCount", iPCCount);
}
if (GetLocalInt(OBJECT_SELF, "sjc_PCCount") == 0)
{
object oArea = OBJECT_SELF;
object oWP = GetFirstObjectInArea(oArea);
while (GetIsObjectValid(oWP))
{
string sTag = GetTag(oWP);
if (sTag == "ACR_SPAWN_WP")
{ACR_SetIsSpawnPointEnabled(oWP, 0, 1);
}
object oWP = GetNextObjectInArea();
}
}
}
Thanks,
Teric