Initial upload
Initial upload.
This commit is contained in:
26
_module/nss/pwchestc_open.nss
Normal file
26
_module/nss/pwchestc_open.nss
Normal file
@@ -0,0 +1,26 @@
|
||||
void main()
|
||||
{
|
||||
object oContainer = OBJECT_SELF;
|
||||
object oUser = GetLastOpenedBy();
|
||||
string sDB = GetTag(oContainer) + "_" + GetPCPlayerName(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
|
||||
}
|
||||
Reference in New Issue
Block a user