View Single Post
Old 08-17-2006, 08:44 AM   #1
robertthebard
Xanathar Thieves Guild
 

Join Date: March 17, 2001
Location: Wichita, KS USA
Age: 60
Posts: 4,537
void main()
{
object oPC = GetFirstObjectInArea(OBJECT_SELF);
while ( GetIsObjectValid( oPC ) )
{
if (GetIsPC(oPC))
{
// Well, there you have it. Someone is still in the area. We don't want to
// clean up quite yet.

return;
}
if (GetObjectType( oPC )!=OBJECT_TYPE_CREATURE)
{
oPC = GetNextObjectInArea( OBJECT_SELF );
continue;

}

oPC = GetNextObjectInArea(OBJECT_SELF );
int iCount = 0;
object oObject = GetObjectByTag( "BodyBag", iCount );
while ( GetIsObjectValid( oObject ) )
{
// First, remove whatever treasure might be in it.
object oTreasure = GetFirstItemInInventory( oObject );
while ( GetIsObjectValid( oTreasure ) )
{
DestroyObject( oTreasure );
oTreasure = GetNextItemInInventory( oObject );
}
// Now, remove the body bag itself.
DestroyObject( oObject );
oObject = GetObjectByTag( "BodyBag", ++iCount );
}

}
}

This is supposed to check if there are any PC's in the area, and then destroy body bags. It compiles, and is on area exit, but doesn't destroy the body bags.
__________________
To those we have lost; May your spirits fly free.
Good Music: Here.
Interesting read, one of my blogs.
robertthebard is offline   Reply With Quote