I use this one, as it ignores tags and just destroys creatures.
void main()
{
object oPC = GetNextObjectInArea();
if(GetIsPC(oPC)==TRUE)return;
object oExiting = GetExitingObject();
if (GetIsPC(oExiting))
{
//SendMessageToPC(oExiting, "Area cleanup event fired.");
object oObjectToClean = GetFirstObjectInArea(OBJECT_SELF);
while (GetIsObjectValid(oObjectToClean))
{
if (
!GetIsPC(oObjectToClean) &&
!GetIsDM(oObjectToClean) &&
!GetPlotFlag(oObjectToClean) &&
GetObjectType(oObjectToClean) == OBJECT_TYPE_CREATURE
)
{
//SendMessageToPC(oExiting, "Destroying " + GetName(oObjectToClean));
DestroyObject(oObjectToClean, 0.1);
}
oObjectToClean = GetNextObjectInArea(OBJECT_SELF);
}
}
}
Modifié par Xovian, 27 février 2011 - 07:20 .