DMH-Online

Dungeon Masters Helper · Est. 2005

Items Scripts

NWN Script: spawn_item_004.htm

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);
}
⌂ All Scripts ← PreviousNext → 👁 Category List

All Items Scripts

📄 aquire_time 📄 bead_of_force 📄 book_of_inf_spells 📄 clear_inventory 📄 clear_inventory_002 📄 clear_inventory_003 📄 clear_inventory_004 📄 cursed_items 📄 cursed_items_002 📄 cursed_potion 📄 give_xp 📄 glow_when_mob 📄 healing_belt 📄 helm 📄 hurled_weapons 📄 item_weight 📄 key_rental 📄 lore_items 📄 npc_owners 📄 random_magic 📄 retrieve_ammo 📄 scimitar_of_dancing 📄 scroll_creation 📄 spawn_item 📄 spawn_item_002 📄 spawn_item_004 📄 stone_of_recall 📄 stone_of_recall_002 📄 summon_creature 📄 teleport_item 📄 torch 📄 weapon_upgrade