NWNDS/nwnds_module/ds_itemcleanup.nss
Jaysyn904 de24f81734 Added NWN Dark Sun module contents
Added NWN Dark Sun module contents.
2021-07-12 21:24:46 -04:00

36 lines
968 B
Plaintext

#include "spawn_main"
void CleanUpArea()
{
if(GetLocalInt(OBJECT_SELF, SPAWN_PCS_IN_AREA) == 0)
{
object oItem = GetFirstObjectInArea();
int iObjectType;
while (GetIsObjectValid(oItem))
{
iObjectType = GetObjectType(oItem);
switch(iObjectType)
{
case OBJECT_TYPE_PLACEABLE:
if (GetTag(oItem) == "Body Bag")
DestroyObject(oItem);
break;
case OBJECT_TYPE_ITEM:
DestroyObject(oItem);
break;
}
oItem = GetNextObjectInArea();
}
}
}
void main()
{
Spawn_OnAreaExit();
if(GetLocalInt(OBJECT_SELF, SPAWN_PCS_IN_AREA) == 0) DelayCommand(300.0, CleanUpArea());
//NC:EDIT
//Added to enable Defiling Aura for NPC's
object oEntering = GetExitingObject();
SetLocalInt(GetArea(oEntering), "X2_L_WILD_MAGIC", 0);
}