49 lines
1.4 KiB
Plaintext
49 lines
1.4 KiB
Plaintext
void main()
|
|
{
|
|
int iItemcnt =0;
|
|
object oItem = GetFirstItemInInventory(OBJECT_SELF);
|
|
|
|
/*
|
|
As is, this script will simply add to the esisting contents of the chest.
|
|
If you wish to have different behaviour please uncomment one of the lines
|
|
below.
|
|
*/
|
|
|
|
// uncomment the line below if you want the chest to only spawn if empty
|
|
// if (oItem != OBJECT_INVALID) return; //kick out if the chest is not empty
|
|
|
|
|
|
//uncomment the next 8 lines below to empty chests before re-spawning
|
|
// if (GetLocalInt(OBJECT_SELF,"ss_t_chest_opened") == 0)
|
|
// {
|
|
// while (oItem != OBJECT_INVALID)
|
|
// {
|
|
// DestroyObject(oItem, 0.0);
|
|
// oItem = GetNextItemInInventory(OBJECT_SELF);
|
|
// }
|
|
// }
|
|
|
|
|
|
if (GetLocalInt(OBJECT_SELF,"ss_t_chest_opened") == 0)
|
|
{
|
|
DelayCommand(0.3, ExecuteScript("ss_treasure",OBJECT_SELF));
|
|
DelayCommand(0.3, SetLocalInt(OBJECT_SELF,"ss_t_chest_opened",1));
|
|
}
|
|
|
|
/* comment the line below out to stop chest respawns
|
|
|
|
I would recomend changing the time for the loot spawn it is currently set to
|
|
5.0 seconds for testing purposes. You will have to determine the amount of
|
|
time that you want in your module.
|
|
|
|
NOTE: If the chest is destroyed my scripts will not recreate it at this time.
|
|
I may add that feature in the future, but at this time I do not plan to.
|
|
*/
|
|
|
|
//DelayCommand(5.0, SetLocalInt(OBJECT_SELF,"ss_t_chest_opened",0));
|
|
|
|
|
|
}
|
|
|
|
|