Door and chest
From NWNWiki
This script is made by Bioware, but it can be a cool thing to add somewhere on your module!
When you place a Special item in a chest, a door will open and it unlocks (if its locked)!
When you place the "special" item in the chest, it will be destroyed.
[edit] The Script
Place this script in the "OnDisturbed" on the Chest
void main()
{
object oItem = GetInventoryDisturbItem();
int nItemBase = GetBaseItemType(oItem);
if(GetLocalInt(OBJECT_SELF,"") == FALSE &&
GetTag(oItem) == "SPECIEL ITEM-TAG" )
{
DestroyObject(oItem);
object oDoor = GetObjectByTag("DOOR-TAG");
AssignCommand(oDoor,ActionOpenDoor(oDoor));
SetLocked(oDoor,FALSE);
}
}
[edit] Notes
- "SPECIAL ITEM-TAG" = The TAG of the item that must be inserted into the chest to get the door opened!
- "DOOR-TAG" = The Tag of the door that shall be Opened/Unlocked!
