////////////////////////////////
// Respawning Treasure Script
// By Tolerance0
// Medium Treasure Respawn
///////////////////////////////

#include "NW_o2_CONINCLUDE"

void main()
{

    if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0)
    {
       return;
    }
    object oLastOpener = GetLastOpener();
    GenerateMediumTreasure(oLastOpener, OBJECT_SELF);
    SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);

    if(GetLocalInt(OBJECT_SELF, "NW_DO_ONCE") == 1)
    {
    object oPlayer = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,
PLAYER_CHAR_IS_PC);

        if(oPlayer == oLastOpener)
        {
        return;
        }
        ActionWait(10.0);
        GenerateMediumTreasure(oLastOpener, OBJECT_SELF);
    }
    return;
}
//End Respawning Treasure Script