Player storage update.
Player storage update. Full compile.
This commit is contained in:
@@ -25,28 +25,20 @@ void main()
|
||||
CreateObject(OBJECT_TYPE_WAYPOINT, "nw_waypoint001", lEntry, FALSE, "WP_"+sNewTag);
|
||||
|
||||
//:: Make sure the area is valid
|
||||
|
||||
|
||||
object oTarget;
|
||||
location lTarget;
|
||||
oTarget = GetWaypointByTag("WP_"+sNewTag);
|
||||
|
||||
lTarget = GetLocation(oTarget);
|
||||
|
||||
//only do the jump if the location is valid.
|
||||
//though not flawless, we just check if it is in a valid area.
|
||||
//the script will stop if the location isn't valid - meaning that
|
||||
//nothing put after the teleport will fire either.
|
||||
//the current location won't be stored, either
|
||||
|
||||
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID)
|
||||
{
|
||||
SendMessageToPC(oPC, "Warning: Area does not exist!");
|
||||
return;
|
||||
}
|
||||
|
||||
//:: Move PC to instanced area.
|
||||
AssignCommand(oPC, ClearAllActions());
|
||||
|
||||
AssignCommand(oPC, ActionJumpToLocation(lTarget));
|
||||
|
||||
}
|
||||
}
|
@@ -43,7 +43,7 @@ void PC_CreateNUIGoldWindow(object oPlayer);
|
||||
|
||||
string PC_GetDatabaseName(object oPlayer)
|
||||
{
|
||||
return "PC_" + GetPCPublicCDKey(oPlayer, TRUE);
|
||||
return "PC_" + GetObjectUUID(oPlayer) + GetPCPublicCDKey(oPlayer, TRUE);
|
||||
}
|
||||
|
||||
string PC_GetTableName(object oPlayer)
|
||||
|
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
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);
|
||||
}
|
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
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++;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user