// Treasure OnClose script
//::////////////////////////////////////
#include "x0_i0_treasure"
const float RESTOCK_TREASURE_DELAY = 900.0; // How long until <span class="highlight">chest</span> will <span class="highlight"><span class="highlight">respawn</span></span> treasure (in seconds).
void DestroyChestContents()
{ object oItem = GetFirstItemInInventory();
while( GetIsObjectValid( oItem))
{ DestroyObject( oItem, (GetHasInventory( oItem) ? 0.2 : 0.1));
oItem = GetNextItemInInventory();
}
}
void main()
{
DelayCommand(60.0, DestroyChestContents());
DelayCommand( RESTOCK_TREASURE_DELAY +0.01, CTG_SetIsTreasureGenerated( OBJECT_SELF, FALSE));
}
Got it from Pattycake a long time ago.
So I'll be putting this script on the OnCLosed event...
and the usual scripts for generating treasure on the OnOpen even.
(different ones.. such that start with
x0_
x2_
nw_
)





Retour en haut







