Alangara_PRC8/_module/nss/ld_area_ud.nss
Jaysyn904 86feb9ca6f Initial commit
Initial commit.
2024-06-05 21:21:06 -04:00

49 lines
1.6 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Name Area clean-up system
//:: FileName ld_area_ud.nss
//:://////////////////////////////////////////////
/*
Place this script in the area user defined event
*/
//:://////////////////////////////////////////////
//:: Created By: Lord Delekhan
//:: Created On: June 14, 2002
//:: Updated On: September 19, 2004
//:://////////////////////////////////////////////
void main()
{
int nUser=GetUserDefinedEventNumber();
switch(nUser)
{
case 3000:
{
object oArea = GetArea(OBJECT_SELF);
object oChk = GetFirstObjectInArea(oArea);
while(GetIsObjectValid(oChk))
{
if(GetIsPC(oChk) || GetLocalInt(oArea,"InPlay"))
{return;}
// else if(GetObjectType(oChk) == OBJECT_TYPE_CREATURE)
// {DestroyObject(oChk);}
// else if(GetObjectType(oChk) == OBJECT_TYPE_ITEM)
// {if(!GetLocalInt(oChk,"IsOwned"))DestroyObject(oChk);}
else if(GetStringLowerCase(GetName(oChk)) == "remains")
{
object oItem = GetFirstItemInInventory(oChk);
while(GetIsObjectValid(oItem))
{
DestroyObject(oItem);
oItem = GetNextItemInInventory(oChk);
}
AssignCommand(oChk,SetIsDestroyable(TRUE));
DestroyObject(oChk);
}
oChk = GetNextObjectInArea(oArea);
}
break;}
}
}