I'm wondering if someone could give me an idea of how to make chests/flowers/trees etc, automatically refill, just like Avlis does, with their wheat/appletrees etc. Any help would be great.
Thank you.
Automatic refilling of containers.
Moderator: Event DM
I'd like to do a time delay. I was thinking I could make a table mysql database side, if someone removed something from the container, I could put a row into said table, with a timestamp. Then everytime someone opens the container I could check that timestamp to see if enough time had gone buy and I should restock the item. Kind of complicated and I was hoping there was an easier way.
Thanks.
Thanks.
-
- Apprentice Scholar
- Posts: 853
- Joined: Mon Apr 07, 2003 12:08 pm
- Location: GMT+1/+2 dst
- Contact:
A simple solution without using the database and interfering current database generating scripts is the use of local integers, setting and delay deleting them.
For standard containers, like bioware barrels, chests etc, just add this line before the ShoutDisturbed line in the onopen script (e.g. nw_o2_classlow), for other treasure generating object probably something silmilar will do the trick:
DelayCommand(500.0, DeleteLocalInt(OBJECT_SELF, "NW_DO_ONCE"));
This will remove the local integer on the chest after 500 seconds and the chest will generate loot again once it is opened again.
For standard containers, like bioware barrels, chests etc, just add this line before the ShoutDisturbed line in the onopen script (e.g. nw_o2_classlow), for other treasure generating object probably something silmilar will do the trick:
DelayCommand(500.0, DeleteLocalInt(OBJECT_SELF, "NW_DO_ONCE"));
This will remove the local integer on the chest after 500 seconds and the chest will generate loot again once it is opened again.