EN4_PRC8/_module/nss/oo_persist.nss
Jaysyn904 b464d8da05 Initial Commit
Initial Commit [v1.32PRC8]
2025-04-03 13:38:45 -04: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++;
}
}
}