FANDOM


I have found that in a large module or semi-persistent world that is not DM managed, you need re-spawning everything. This goes for bosses, and plot items, keys, etc. After getting all of this in place, I found that some of the visitors seemed to want to take advantage of re-spawning chests...hmmm...and get a lot of loot for little work.

I had a heck of a time getting DelayAction to work, and after a few hours of trying several different methods (like ActionWait, etc) I found a nearly working script in the archive for delaying the creation of an object.

I hacked it a bit and added some comments, and it works as billed.

The Script Edit

/////////////////////////////////////////////////////////////
// Delayed CreateItemOnObject (chest respawner) Script
// Created by Phoenix
// 09/ 10/ 2002
/////////////////////////////////////////////////////////////
// You cannot delay anything that returns a value, therefore you must
// create a wrapper that calls CreateItemOnObject.
/////////////////////////////////////////////////////////////
//Create a new action function (action)
void aCreateItemOnObject(string sItemTemplate, object oTarget=OBJECT_SELF, int nStackSize=1)
{
    // Original CreateItemOnObject command
    CreateItemOnObject(sItemTemplate, oTarget, nStackSize);
}
//Run the Delay script with new function
void main()
{
    object oObject = GetObjectByTag("object");
    DelayCommand(60.0, aCreateItemOnObject("blueprint", oObject, 1));
    DelayCommand(60.0, aCreateItemOnObject("blueprint", oObject, 1));
}
////////////////////////////////////////////////////////////
// In this case I was re-populating a chest with a key and
// some gold without allowing the pc to get rich by
// re-opening the chest over and over. This script was
// placed in the on-close script slot. My insurance was the
// "spawn Monster" trap I had on-open.
////////////////////////////////////////////////////////////

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.