Files
HeroesStone_PRC8/_module/nss/area_general_hb.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

32 lines
1002 B
Plaintext

//::////////////////////////////////////
//:: This script cleans up each area of
//:: excess items strewn on the floor.
//:: It destroys items after 3 minutes.
//::////////////////////////////////////
int iIdleTime = 30; //how many 6-second rounds should the item be lying around?
//Set to every 3 minutes
void main()
{
object oItem;
object oArea = OBJECT_SELF;
oItem = GetFirstObjectInArea(oArea); //Get the first object in the area
int iCounter;
while (GetIsObjectValid(oItem)) //If the item returned is valid
{
//If the object is a type item and not a plot item
//This script gives each item a 3 minute drop on the ground.
if (GetObjectType(oItem) == OBJECT_TYPE_ITEM && !GetPlotFlag(oItem))
{
iCounter = GetLocalInt(oItem, "IdleTime");
if (iCounter > iIdleTime) DestroyObject(oItem);
else
{
iCounter++;
SetLocalInt(oItem, "IdleTime", iCounter);
}
}
oItem = GetNextObjectInArea(oArea); //Get the next object
}
}