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);

}