int P_MAX_ITEMS = 5; // Max number of things to respawn. This should be less // expensive than an array, though less pretty. int P_TIMER_MAX = 10; // number of rounds to wait before checking to refill. void DoOnce(); void CheckContents(); void CheckThing(object oThing); void CreateNewThing(object oThing); void main() { // check to see if our pseudo-checksum is different now that we've been closed. if (GetLocalInt(OBJECT_SELF,"pac_do_once") == 0) { SetLocalInt(OBJECT_SELF,"pac_do_once",1); DoOnce(); return; } CheckContents(); } void DoOnce() { int i = 0; object oThing = GetFirstItemInInventory(OBJECT_SELF); for (i=0; iP_TIMER_MAX) { object oThing = OBJECT_INVALID; int i = 0; for (i=0; i