49 lines
1.6 KiB
Plaintext
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;}
|
|
}
|
|
}
|
|
|
|
|