generated from Jaysyn/ModuleTemplate
Initial upload
Initial upload
This commit is contained in:
192
_mod/_module/nss/rts_save_player.nss
Normal file
192
_mod/_module/nss/rts_save_player.nss
Normal file
@@ -0,0 +1,192 @@
|
||||
// revised 5/27/2004
|
||||
#include "hos_saveload_h"
|
||||
void main()
|
||||
{
|
||||
object oPC=OBJECT_SELF;
|
||||
int bSavePending=GetLocalInt(oPC,"bSavePending");
|
||||
if (bSavePending!=TRUE)
|
||||
{
|
||||
SetLocalInt(oPC,"bSavePending",TRUE);
|
||||
//Qlippoth removed to disable SaveLoadPC feature// DelayCommand(20.0,fnSLSavePlayer(oPC));
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// RTS - Save Player Data
|
||||
// By Deva Bryson Winblood. 01/22/2004
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
/*void main()
|
||||
{
|
||||
object oPC=OBJECT_SELF;
|
||||
object oMod=GetModule();
|
||||
int nXP=GetXP(oPC);
|
||||
string sID=GetLocalString(oPC,"sTeamID");
|
||||
string sPID=GetName(oPC)+GetPCPlayerName(oPC);
|
||||
int nIsVampire=GetLocalInt(oPC,"nIsVampire");
|
||||
int nVXP=GetLocalInt(oPC,"nVampireXP");
|
||||
object oArea=GetArea(oPC);
|
||||
vector vPos=GetPosition(oPC);
|
||||
float fLX=vPos.x;
|
||||
float fLY=vPos.y;
|
||||
float fLZ=vPos.z;
|
||||
int nKills=GetLocalInt(oPC,"nKills");
|
||||
int nL;
|
||||
int nDeaths=GetLocalInt(oPC,"nDeaths");
|
||||
object oLead=GetLocalObject(oMod,"oTeamLead"+sID);
|
||||
int nAGE=GetAlignmentGoodEvil(oPC);
|
||||
int nALC=GetAlignmentLawChaos(oPC);
|
||||
int nGold=GetGold(oPC);
|
||||
string sRes;
|
||||
int nC;
|
||||
object oItem;
|
||||
SetLocalInt(oMod,sPID+"nXP",nXP);
|
||||
SetLocalString(oMod,sPID+"sID",sID);
|
||||
SetLocalInt(oMod,sPID+"nIsVampire",nIsVampire);
|
||||
SetLocalInt(oMod,sPID+"nVXP",nVXP);
|
||||
SetLocalObject(oMod,sPID+"oArea",oArea);
|
||||
SetLocalFloat(oMod,sPID+"fLX",fLX);
|
||||
SetLocalFloat(oMod,sPID+"fLY",fLY);
|
||||
SetLocalFloat(oMod,sPID+"fLZ",fLZ);
|
||||
SetLocalInt(oMod,sPID+"nKills",nKills);
|
||||
SetLocalInt(oMod,sPID+"nDeaths",nDeaths);
|
||||
SetLocalInt(oMod,sPID+"nAGE",nAGE);
|
||||
SetLocalInt(oMod,sPID+"nALC",nALC);
|
||||
SetLocalInt(oMod,sPID+"nGold",nGold);
|
||||
///////////////////
|
||||
// store inventory
|
||||
///////////////////
|
||||
oItem=GetFirstItemInInventory(oPC);
|
||||
while(oItem!=OBJECT_INVALID)
|
||||
{ // store inventory
|
||||
sRes=GetResRef(oItem);
|
||||
if (sRes!="")
|
||||
{ // store item
|
||||
nC++;
|
||||
SetLocalString(oMod,sPID+"sInv"+IntToString(nC),sRes);
|
||||
} // store item
|
||||
oItem=GetNextItemInInventory(oPC);
|
||||
} // store inventory
|
||||
nC++;
|
||||
SetLocalString(oMod,sPID+"sInv"+IntToString(nC),"");
|
||||
oItem=GetItemInSlot(INVENTORY_SLOT_ARMS,oPC);
|
||||
sRes=GetResRef(oItem);
|
||||
if (oItem!=OBJECT_INVALID&&sRes!="")
|
||||
{ // store item
|
||||
SetLocalString(oMod,sPID+"sI_Arms",sRes);
|
||||
} // store item
|
||||
else { DeleteLocalString(oMod,sPID+"sI_Arms"); }
|
||||
oItem=GetItemInSlot(INVENTORY_SLOT_ARROWS,oPC);
|
||||
sRes=GetResRef(oItem);
|
||||
if (oItem!=OBJECT_INVALID&&sRes!="")
|
||||
{ // store item
|
||||
SetLocalString(oMod,sPID+"sI_Arrows",sRes);
|
||||
} // store item
|
||||
else { DeleteLocalString(oMod,sPID+"sI_Arrows"); }
|
||||
oItem=GetItemInSlot(INVENTORY_SLOT_BELT,oPC);
|
||||
sRes=GetResRef(oItem);
|
||||
if (oItem!=OBJECT_INVALID&&sRes!="")
|
||||
{ // store item
|
||||
SetLocalString(oMod,sPID+"sI_Belt",sRes);
|
||||
} // store item
|
||||
else { DeleteLocalString(oMod,sPID+"sI_Belt"); }
|
||||
oItem=GetItemInSlot(INVENTORY_SLOT_BOLTS,oPC);
|
||||
sRes=GetResRef(oItem);
|
||||
if (oItem!=OBJECT_INVALID&&sRes!="")
|
||||
{ // store item
|
||||
SetLocalString(oMod,sPID+"sI_Bolts",sRes);
|
||||
} // store item
|
||||
else { DeleteLocalString(oMod,sPID+"sI_Bolts"); }
|
||||
oItem=GetItemInSlot(INVENTORY_SLOT_BOOTS,oPC);
|
||||
sRes=GetResRef(oItem);
|
||||
if (oItem!=OBJECT_INVALID&&sRes!="")
|
||||
{ // store item
|
||||
SetLocalString(oMod,sPID+"sI_Boots",sRes);
|
||||
} // store item
|
||||
else { DeleteLocalString(oMod,sPID+"sI_Boots"); }
|
||||
oItem=GetItemInSlot(INVENTORY_SLOT_BULLETS,oPC);
|
||||
sRes=GetResRef(oItem);
|
||||
if (oItem!=OBJECT_INVALID&&sRes!="")
|
||||
{ // store item
|
||||
SetLocalString(oMod,sPID+"sI_Bullets",sRes);
|
||||
} // store item
|
||||
else { DeleteLocalString(oMod,sPID+"sI_Bullets"); }
|
||||
oItem=GetItemInSlot(INVENTORY_SLOT_CARMOUR,oPC);
|
||||
sRes=GetResRef(oItem);
|
||||
if (oItem!=OBJECT_INVALID&&sRes!="")
|
||||
{ // store item
|
||||
SetLocalString(oMod,sPID+"sI_Carmour",sRes);
|
||||
} // store item
|
||||
else { DeleteLocalString(oMod,sPID+"sI_Carmour"); }
|
||||
oItem=GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
|
||||
sRes=GetResRef(oItem);
|
||||
if (oItem!=OBJECT_INVALID&&sRes!="")
|
||||
{ // store item
|
||||
SetLocalString(oMod,sPID+"sI_Chest",sRes);
|
||||
} // store item
|
||||
else { DeleteLocalString(oMod,sPID+"sI_Chest"); }
|
||||
oItem=GetItemInSlot(INVENTORY_SLOT_CLOAK,oPC);
|
||||
sRes=GetResRef(oItem);
|
||||
if (oItem!=OBJECT_INVALID&&sRes!="")
|
||||
{ // store item
|
||||
SetLocalString(oMod,sPID+"sI_Cloak",sRes);
|
||||
} // store item
|
||||
else { DeleteLocalString(oMod,sPID+"sI_Cloak"); }
|
||||
oItem=GetItemInSlot(INVENTORY_SLOT_HEAD,oPC);
|
||||
sRes=GetResRef(oItem);
|
||||
if (oItem!=OBJECT_INVALID&&sRes!="")
|
||||
{ // store item
|
||||
SetLocalString(oMod,sPID+"sI_Head",sRes);
|
||||
} // store item
|
||||
else { DeleteLocalString(oMod,sPID+"sI_Head"); }
|
||||
oItem=GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);
|
||||
sRes=GetResRef(oItem);
|
||||
if (oItem!=OBJECT_INVALID&&sRes!="")
|
||||
{ // store item
|
||||
SetLocalString(oMod,sPID+"sI_Lhand",sRes);
|
||||
} // store item
|
||||
else { DeleteLocalString(oMod,sPID+"sI_Lhand"); }
|
||||
oItem=GetItemInSlot(INVENTORY_SLOT_LEFTRING,oPC);
|
||||
sRes=GetResRef(oItem);
|
||||
if (oItem!=OBJECT_INVALID&&sRes!="")
|
||||
{ // store item
|
||||
SetLocalString(oMod,sPID+"sI_Lring",sRes);
|
||||
} // store item
|
||||
else { DeleteLocalString(oMod,sPID+"sI_Lring"); }
|
||||
oItem=GetItemInSlot(INVENTORY_SLOT_NECK,oPC);
|
||||
sRes=GetResRef(oItem);
|
||||
if (oItem!=OBJECT_INVALID&&sRes!="")
|
||||
{ // store item
|
||||
SetLocalString(oMod,sPID+"sI_Neck",sRes);
|
||||
} // store item
|
||||
else { DeleteLocalString(oMod,sPID+"sI_Neck"); }
|
||||
oItem=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
|
||||
sRes=GetResRef(oItem);
|
||||
if (oItem!=OBJECT_INVALID&&sRes!="")
|
||||
{ // store item
|
||||
SetLocalString(oMod,sPID+"sI_Rhand",sRes);
|
||||
} // store item
|
||||
else { DeleteLocalString(oMod,sPID+"sI_Rhand"); }
|
||||
oItem=GetItemInSlot(INVENTORY_SLOT_RIGHTRING,oPC);
|
||||
sRes=GetResRef(oItem);
|
||||
if (oItem!=OBJECT_INVALID&&sRes!="")
|
||||
{ // store item
|
||||
SetLocalString(oMod,sPID+"sI_Rring",sRes);
|
||||
} // store item
|
||||
else { DeleteLocalString(oMod,sPID+"sI_Rring"); }
|
||||
if (oLead==oPC)
|
||||
{ // store team leader specifics
|
||||
nC=GetLocalInt(oPC,"nManaStore");
|
||||
SetLocalInt(oMod,"nManaStore"+sID,nC);
|
||||
nC=GetLocalInt(oPC,"nStartSoul");
|
||||
SetLocalInt(oMod,"nStartSoul"+sID,nC);
|
||||
nC=GetLocalInt(oPC,"nSoulStore");
|
||||
SetLocalInt(oMod,"nSoulStore"+sID,nC);
|
||||
} // store team leader specifics
|
||||
nC=GetLocalInt(oPC,"nKicked");
|
||||
SetLocalInt(oMod,sPID+"nKicked",nC);
|
||||
nC=GetLocalInt(oPC,"nBuilder");
|
||||
SetLocalInt(oMod,sPID+"nBuilder",nC);
|
||||
nC=GetLocalInt(oPC,"nSAdvCompleted");
|
||||
SetLocalInt(oMod,sPID+"nSAdv",nC);
|
||||
SendMessageToPC(oPC,sPID+" has been stored in case of crash or disconnect.");
|
||||
}*/
|
||||
Reference in New Issue
Block a user