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

20 lines
562 B
Plaintext

void main()
{
SetLocked(OBJECT_SELF, TRUE);
object oContainer = OBJECT_SELF;
object oUser = GetLastOpenedBy();
string sDB = GetTag(oContainer) + "_" + GetPCPlayerName(oUser);
string sTag = "";
int nIdx = 0;
int nMax = GetCampaignInt(sDB, "ST_ItemCount");
if (nMax > 0)
{
for (nIdx = 0; nIdx < nMax; nIdx++)
{
sTag = "ST_ITEM_" + IntToString(nIdx);
RetrieveCampaignObject(sDB, sTag, GetLocation(oContainer), oContainer);
DeleteCampaignVariable(sDB, sTag);
}
}
}