// Treasure respawn script created by Luni@luukku.com
//
// Creates a treasure, after the defined time, clears the remaining
// stuff from the chest and spawns new items.
#include "NW_O2_CONINCLUDE"

void main()
{
    float fDelay = 1800.0;
    if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0)
    {
       return;
    }
    object oLastOpener = GetLastOpener();

    // Gem
    CreateGem(OBJECT_SELF, oLastOpener, 1,1);

    SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
    DelayCommand(fDelay,SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0));

    ShoutDisturbed();
}