Automatic refilling of containers.

Moderator: Event DM

Post Reply
jarkari
Newbie
Posts: 3
Joined: Sat Jul 03, 2004 4:29 am
Contact:

Automatic refilling of containers.

Post by jarkari » Wed Jul 14, 2004 6:09 pm

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.
dougnoel
Team Member; Retired with Honors
Posts: 6261
Joined: Fri May 14, 2004 4:59 pm
Location: VA (GMT -4)
Contact:

Post by dougnoel » Wed Jul 14, 2004 6:28 pm

Are you trying to just refill the placeable immediately after something is "picked", or are you trying to implement a time-delay?
jarkari
Newbie
Posts: 3
Joined: Sat Jul 03, 2004 4:29 am
Contact:

Post by jarkari » Wed Jul 14, 2004 8:19 pm

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.
Alustriel
Apprentice Scholar
Posts: 853
Joined: Mon Apr 07, 2003 12:08 pm
Location: GMT+1/+2 dst
Contact:

Post by Alustriel » Thu Jul 15, 2004 6:30 am

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.
Post Reply