// Each player can loot containers that have this // script in its OnOpen event. // Set the float fDelay on the object to customize // the number of seconds to wait. // Oner the Wise otwise@gmail.com // This generates High treasure. void Empty_Container(object oContainer ) { object oItem = GetFirstItemInInventory( oContainer ); while ( GetIsObjectValid( oItem )) { DestroyObject( oItem ); oItem = GetNextItemInInventory( oContainer ); } } #include "NW_O2_CONINCLUDE" void main() { float fDelay = GetLocalFloat(OBJECT_SELF, "fDelay"); // seconds to wait on respawn // A default delay. if (fDelay == 0.0) fDelay = 1200.0; object oLastOpener = GetLastOpener(); // This is set in the OnEnter for the module. string sID = GetLocalString(oLastOpener, "player_id"); if (GetLocalInt(OBJECT_SELF, sID) != 0) { return; } Empty_Container(OBJECT_SELF); GenerateHighTreasure(oLastOpener, OBJECT_SELF); SetLocalInt(OBJECT_SELF, sID, 1); ShoutDisturbed(); DelayCommand(fDelay, SetLocalInt(OBJECT_SELF,sID, 0)); }