Author Sticky: Post Working Scripts Here
VorpalBlade Posted: Sunday, 21 July 07:03AM
1. Script Name: Inventory Plot Item Respawn

2. What it does: Will replace any plot items removed or stolen from an objects inventory.

3. Notes: Make sure the item is made from a custom template and that the Tag is identical to the ResRef. Put this script into the OnDisturbed event.

If the object is distroyable then make a template of the object with the plot item in its inventory and this script in the OnDisturbed event and put a respawn script in the OnDeath event. (email me if you don't see that one here). Again, make sure the Tag is identical to the ResRef.

I haven't tested this for stolen plot items, so email me if there is a problem.

fweeep@hotmail.com (that's with 3 e's)

NWScript:
//::///////////////////////////////////////////////

//:: Name: Inventory Plot Item Respawner

//:: FileName: plotitemrespawn

//:: Copyright (c) 2001 Bioware Corp.

//:://////////////////////////////////////////////

/*

*/

//:://////////////////////////////////////////////

//:: Created By: VorpalBlade

//:: Created On: 7/20/02

//:://////////////////////////////////////////////

void ReplacePlotItem(string sItem);

void main()

{

// Make sure something was taken.

// You could add a distroy item if nDistType = TYPE_ADDED.

    int nDistType = GetInventoryDisturbType();

    if ((nDistType == INVENTORY_DISTURB_TYPE_REMOVED) || (nDistType == INVENTORY_DISTURB_TYPE_STOLEN)){

// Check if the item taken was a plot item.

        object oItem = GetInventoryDisturbItem();

        int nPlot = GetPlotFlag(oItem);

        if (nPlot){

// Replace the plot item from the template after 5 mins.

            string sTemplate = GetTag(oItem);

            DelayCommand(300.0f, ReplacePlotItem(sTemplate));

        }

    }

}

void ReplacePlotItem(string sItem)

{

    CreateItemOnObject(sItem);

}