RATDOG/_module/nss/oc_persist.nss
Jaysyn904 a005da6b51 Added Daz's persistent NUI storage
Added Daz's persistent NUI storage.  Added instanced player room at the Inn of the Flying Monkey.  Added PnP cockatrice & dire weasel.  Full compile.
2023-02-19 01:10:48 -05:00

29 lines
999 B
Plaintext

/*
Created by Omnifarious
Basically all of this is reverse engineered for my purposes.
I owe lots of credit to the Item Storage Device by Rusty Dios.
https://neverwintervault.org/project/nwn1/prefab/item/item-storage-device
*/
//This works to transfer items between charachters on the same CD key & Login Name.
void main()
{
object oPC = GetLastClosedBy();
string sUnique = (GetPCPublicCDKey(oPC) + GetPCPlayerName(oPC));
DestroyCampaignDatabase("DATA"+sUnique);
int i = 0;
object oLoop = GetFirstItemInInventory();
while(oLoop != OBJECT_INVALID)
{
SetCampaignString("DATA"+sUnique, sUnique+IntToString(i), GetResRef(oLoop), OBJECT_SELF);
SetCampaignInt("DATA"+sUnique, GetResRef(oLoop)+IntToString(i), GetNumStackedItems(oLoop), OBJECT_SELF);
i++;
DestroyObject(oLoop);
SendMessageToPC(oPC, GetName(oLoop) + " has been stored successfully");
oLoop = GetNextItemInInventory();
}
SetCampaignInt("DATA"+sUnique, sUnique, i, OBJECT_SELF);
}