REO-EE/_module/nss/reo_mod_leaving.nss
Jaysyn904 f82740bbbd Initial commit
Initial commit
2024-02-22 13:22:03 -05:00

27 lines
873 B
Plaintext

#include "inc_system_const"
#include "aps_include"
#include "nwnx_funcs_w"
#include "zss_include"
// REO Module On Client Leaving script
// This event hook was added with the NWNX_FUNCS plugin. The PC and all related information is
// still accessible at this point, even though they are leaving the server.
// Only works for Windows at the moment. There is no OnPlayerLeaving hook for Linux yet.
void main()
{
object oPC = OBJECT_SELF;
object oDatabase = GetItemPossessedBy(oPC, PC_DATABASE);
object oArea = GetArea(oPC);
string sLocation = APSLocationToString(GetLocation(oPC));
string sTag = GetTag(oArea);
if(sTag != "SOO_ENTRY_AREA")
SetLocalString(oDatabase, "LOCATION_SYSTEM_SAVED_LOCATION", sLocation);
// Persistent HP
ExecuteScript("php_mod_leaving", OBJECT_SELF);
// Spawn System
ZSS_OnAreaExit(oPC, oArea);
}