Server Totals
Wilderness - (5)
Le'Or - (1)
M'Chek - (1)
Underdark - (0)
Elysia - (0)
Ferrell - (0)
Visimontium - (0)
Mikona - (0)
Deglos - (0)
Total players: 7

Links Menu

Automatic refilling of containers.

Moderators: Nighthawk4, Dungeon Masters

Automatic refilling of containers.

PostAuthor: 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.

Posts: 3
Joined: Sat Jul 03, 2004 4:29 am

PostAuthor: 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?

Team Member; Retired with Honors
Posts: 6265
Joined: Fri May 14, 2004 4:59 pm
Location: VA (GMT -4)

PostAuthor: 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.


Posts: 3
Joined: Sat Jul 03, 2004 4:29 am

PostAuthor: 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.

Apprentice Scholar
Posts: 854
Joined: Mon Apr 07, 2003 12:08 pm
Location: GMT+1/+2 dst

Return to NWN Scripting

Who is online

Registered users: Bing [Bot], Eal, Google [Bot]