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