DMH-Online

Dungeon Masters Helper · Est. 2005

Items Scripts

NWN Script: spawn_item.htm

Author Sticky: Post Working Scripts Here
Torham Zed Posted: Monday, 01 July 10:24PM
1. Names: Relic Giver

2. Use: Spawns an item (like maybe a Holy Relic) to a container (like maybe an Altar) if the party is holding a specified key (like maybe a Ritual Book)

3. Notes: Tested some--seems to work. PC can use the container all he wants without the key, nothing happens. Once he has the key in party inventory, he gets the Relic -- one time only! Set as the OnUsed script of the container

NWScript:
//:://////////////////////////////////////////////
/*  Spawns in a specified Plot Item if the PC has a specified key in party inventory. Set as OnUsed script of the container*/
//:://////////////////////////////////////////////
//:: Created By:   Torham Zed
//:: Created On:   July 1 2002
//:://////////////////////////////////////////////
#include "nw_i0_tool"

void main()
{
    string sItem = "HolyRelic"; //the name of the object
    string sKey = "HolyBook"; //the name of the key
    object oPC = GetLastUsedBy(); //the PC
    if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0)
    {
       return;
    }
    if(!CheckPartyForItem(oPC, sKey))
          return;
    CreateItemOnObject(sItem, OBJECT_SELF);
    SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
}
⌂ 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