RATDOG/_module/nss/oo_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

26 lines
818 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 = GetLastOpenedBy();
string sUnique = (GetPCPublicCDKey(oPC) + GetPCPlayerName(oPC));
int i = 0;
int NumItems = GetCampaignInt("DATA"+sUnique, sUnique, OBJECT_SELF);
if(NumItems > 0)
{
while(i < NumItems)
{
string sResRef = GetCampaignString("DATA"+sUnique, sUnique+IntToString(i), OBJECT_SELF);
CreateItemOnObject(sResRef, OBJECT_SELF, GetCampaignInt("DATA"+sUnique, sResRef+IntToString(i), OBJECT_SELF));
i++;
}
}
}