Initial Commit
Initial Commit [v1.32PRC8]
This commit is contained in:
28
_module/nss/oc_persist.nss
Normal file
28
_module/nss/oc_persist.nss
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
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);
|
||||
}
|
Reference in New Issue
Block a user