//::///////////////////////////////////////////////
//:: General Treasure Spawn Script   Medium
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Spawns in general purpose treasure, usable
    by all classes.
*/
//:://////////////////////////////////////////////
//:: Created By:   Brent
//:: Created On:   February 26 2001
//:: Modified by: Dalantriel Jul 2002
//:: to generate respawning treasure
//:://////////////////////////////////////////////
#include "NW_O2_CONINCLUDE"

void main()

{
    if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0)
    {
       return;
    }
    object oLastOpener = GetLastOpener();
    GenerateMediumTreasure(oLastOpener, OBJECT_SELF);
    ExecuteScript("magictres", OBJECT_SELF);
    int nGoldAmount = (d100() * 2) + d10();
    CreateItemOnObject ("NW_IT_GOLD001", OBJECT_SELF, nGoldAmount);
    SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
    ActionWait(600.0);
    ActionDoCommand(SetLocalInt(OBJECT_SELF, "NW_DO_ONCE", 0));

    ShoutDisturbed();
}
