Rune_PRC8/_module/nss/larachestc_open.nss
Jaysyn904 d1c309ae63 Initial commit
Initial commit
2024-09-13 09:10:39 -04:00

27 lines
909 B
Plaintext

void main()
{
object oContainer = OBJECT_SELF;
object oUser = GetLastOpenedBy();
string sDB = GetTag(oContainer) + "_" + GetPCPlayerName(oUser) + "_" + GetName(oUser);
string sTag = "INVENTORY";
object oStash_Items = RetrieveCampaignObject(sDB, sTag, GetLocation(oUser), oContainer);
object oItem = GetFirstItemInInventory(oStash_Items);
while (GetIsObjectValid(oItem))
{
if (GetHasInventory(oItem))
{
CreateItemOnObject(GetResRef(oItem), oContainer);
}
else
{
CopyItem(oItem, oContainer);
}
DestroyObject(oItem);
oItem = GetNextItemInInventory(oStash_Items);
}
DestroyObject(oStash_Items);
SetLocalInt(oContainer, "INUSE", TRUE);
SetLocalString(oContainer, "USER", GetPCPlayerName(oUser));
SetLocked(oContainer, TRUE); //Prevent other players from viewing contents
}