UW2_PRC8/_module/nss/replicate_invent.nss

22 lines
666 B
Plaintext
Raw Normal View History

2023-09-25 20:24:01 -04:00
//Script Name: replicate_invent
/////////////////////////////////////
//Created by Genisys / Guile 4/12/09
////////////////////////////////////////////////////////////////////////////
//This script goes in the OnDisturbed of any placeable object w/an inventory.
//This script will replicate an item placed into it's inventory
void main()
{
object oPC = GetLastDisturbed();
object oItem = GetInventoryDisturbItem();
int nCopy = GetLocalInt(oItem, "COPIED_ITEM");
//Only allow them to copy the item 1 time EVER!
if(nCopy !=1)
{
SetLocalInt(oItem, "COPIED_ITEM", 1);
CopyItem(oItem, oPC, TRUE);
//NOTE The variable on the old item is on the new too!
}
}