RoT2_PRC8/_module/nss/tab_custom_db.nss
Jaysyn904 499aba4eb3 Initial upload
Initial upload
2023-09-25 18:13:22 -04:00

133 lines
6.4 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Name Trinity Custom Inlcude
//:: FileName Tab_custom_db
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This is the file that the Module Maker should
modify when creating Varibles that are stored
on the Database.
When updated come to the way that it reads and
writes and the file maintiace retouines perfected
this included should not be changed.
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks Modified by Tab
//:: Created On: 6/24/03
//:://////////////////////////////////////////////
void Asg_PB_CustomRead(object oPlayer)
{
object oMOD = GetModule();
string sPDB = GetPCPlayerName(oPlayer); // Individule Player Database Name;
string sName = GetName(oPlayer);
string CDKey = GetPCPublicCDKey(oPlayer);
string sID = GetStringLeft(sName,20); // Indivudual Character Used inside the
string sHID = sName+CDKey; // Hcr Style;
// ** Add your Custom Information Here, The defualts here are the ones I crafted
// * Some mod makers may have alrady used another. So I left it up to you to toss
// out what you don't like. The Example in the Readme Docs is at the end of the
// function.
SetLocalString(oMOD,sHID+"SP_RACE",GetCampaignString(sPDB,sID+"SP_RACE",oPlayer));
SetLocalString(oMOD,sHID+"SP_STATUS",GetCampaignString(sPDB,sID+"SP_STATUS",oPlayer));
SetLocalString(oMOD,sHID+"SP_STATUSSUB",GetCampaignString(sPDB,sID+"SP_STATUSSUB",oPlayer));
SetLocalInt(oMOD,sHID+"NoC_KILL",GetCampaignInt(sPDB,sID+"NoC_KILL",oPlayer));
SetLocalInt(oMOD,sHID+"NoC_MosPHD",GetCampaignInt(sPDB,sID+"NoC_MosPHD",oPlayer));
SetLocalString(oMOD,sHID+"NoC_MosName",GetCampaignString(sPDB,sID+"NoC_MosName",oPlayer));
SetLocalInt(oMOD,sHID+"NoP_MosPHD",GetCampaignInt(sPDB,sID+"NoP_MosPHD",oPlayer));
SetLocalString(oMOD,sHID+"NoP_MosName",GetCampaignString(sPDB,sID+"NoP_MosName",oPlayer));
SetLocalInt(oMOD,sHID+"NoP_KILLS",GetCampaignInt(sPDB,sID+"NoP_KILLS",oPlayer));
SetLocalInt(oMOD,sHID+"ASG_BANK",GetCampaignInt(sPDB,sID+"ASG_BANK",oPlayer));
SetLocalLocation(oPlayer,"LastLoc",GetCampaignLocation(sPDB,sID+"LastLocation",oPlayer));
// Hey! What's this Writing Doing Here?
// * Note, this means that the Player has made a effort to play on your
// Server. This reflects his "Active" status.
SetCampaignInt(sPDB,"Last_Y_Play",GetCalendarYear());
SetCampaignInt(sPDB,"Last_M_Play",GetCalendarMonth());
SetLocalInt(oMOD,sHID+"J_Year",GetCampaignInt(sPDB,sID+"J_Year"));
SetLocalInt(oMOD,sHID+"J_Month",GetCampaignInt(sPDB,sID+"J_Month"));
SetLocalInt(oMOD,sHID+"J_Day",GetCampaignInt(sPDB,sID+"J_Day"));
// ** Update Players Hitpoints
int iCurHp = GetCampaignInt(sPDB,sID+"HitPoints",oPlayer);
if (iCurHp < GetMaxHitPoints(oPlayer))
{
// Damage Character
int iDif = GetMaxHitPoints(oPlayer) - iCurHp;
effect eDamage = EffectDamage(iDif,DAMAGE_TYPE_MAGICAL,DAMAGE_POWER_PLUS_FIVE);
DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oPlayer));
DelayCommand(12.0,AssignCommand(oPlayer,ActionJumpToLocation(GetCampaignLocation(sPDB,sID+"LastLocation",oPlayer))));
}
// ** Example: Read Currently Age from Database
SetLocalInt(oMOD,sHID+"AGE",GetCampaignInt(sPDB,sID+"AGE"));
//
}
void Asg_PB_CustomWrite(object oPlayer)
{
object oMOD = GetModule();
string sPDB = GetPCPlayerName(oPlayer); // Individule Player Database Name;
string sName = GetName(oPlayer);
string CDKey = GetPCPublicCDKey(oPlayer);
string sID = GetStringLeft(sName,20); // Indivudual Character Used inside the
string sHID = sName+CDKey; // Hcr Style;
// ** Add your Custom Information Here
SetCampaignString(sPDB,sID+"SP_RACE",GetLocalString(oMOD,sHID+"SP_RACE"),oPlayer);
SetCampaignString(sPDB,sID+"SP_STATUS",GetLocalString(oMOD,sHID+"SP_STATUS"),oPlayer);
SetCampaignString(sPDB,sID+"SP_STATUSSUB",GetLocalString(oMOD,sHID+"SP_STATUSSUB"),oPlayer);
SetCampaignInt(sPDB,sID+"NoC_KILL",GetLocalInt(oMOD,sHID+"NoC_KILL"),oPlayer);
SetCampaignInt(sPDB,sID+"NoC_MosPHD",GetLocalInt(oMOD,sHID+"NoC_MosPHD"),oPlayer);
SetCampaignString(sPDB,sID+"NoC_MosName",GetLocalString(oMOD,sID+"NoC_MosName"),oPlayer);
SetCampaignInt(sPDB,sID+"NoC_MosPHD",GetLocalInt(oMOD,sHID+"NoC_MosPHD"),oPlayer);
SetCampaignString(sPDB,sID+"NoP_MosName",GetLocalString(oMOD,sID+"NoP_MosName"),oPlayer);
SetCampaignInt(sPDB,sID+"NoP_KILLS",GetLocalInt(oMOD,sHID+"NoP_KILLS"),oPlayer);
SetCampaignInt(sPDB,sID+"ASG_BANK",GetLocalInt(oMOD,sHID+"ASG_BANK"),oPlayer);
SetCampaignLocation(sPDB,sID+"LastLoc",GetLocation(oPlayer),oPlayer);
int iCurHp = GetCurrentHitPoints(oPlayer);
SetCampaignInt(sPDB,sID+"HitPoints",iCurHp,oPlayer);
if (DEBUG==TRUE)
{
PrintString(" sPDB: "+sPDB+", sID: "+sID+", "+sID+"HitPoints");
PrintString(" Current HP = "+IntToString(iCurHp));
PrintString(" QuickRB Hp = "+IntToString(GetCampaignInt(sPDB,sID+"HitPoints",oPlayer)));
}
// *****************************************************************
// ** Example: Recored Currently Age to Database
SetCampaignInt(sPDB,sID+"AGE",GetLocalInt(oMOD,sHID+"AGE"),oPlayer);
//
}
void Asg_PB_CustomConfig(object oPlayer)
{
object oMOD = GetModule();
string sPDB = GetPCPlayerName(oPlayer); // Individule Player Database Name;
string sName = GetName(oPlayer);
string CDKey = GetPCPublicCDKey(oPlayer);
string sID = GetStringLeft(sName,20); // Indivudual Character Used inside the
string sHID = sName+CDKey; // Hcr Style;
// ** Add your Custom Information Here
SetLocalInt(oMOD,sHID+"SP_RACE",0);
SetLocalInt(oMOD,sHID+"SP_STATUS",0);
SetLocalInt(oMOD,sHID+"SP_STATUSSUB",0);
SetLocalInt(oMOD,sHID+"NoC_KILLS",0);
SetLocalInt(oMOD,sHID+"NoC_MosPHD",0);
SetLocalString(oMOD,sHID+"NoC_MosName","NA");
SetLocalInt(oMOD,sHID+"NoP_MosPHD",0);
SetLocalString(oMOD,sHID+"NoP_MosName","NA");
SetLocalInt(oMOD,sHID+"NoP_KILLS",0);
SetLocalInt(oMOD,sHID+"ASG_BANK",0);
SetLocalInt(oMOD,sHID+"J_Year",GetCalendarYear());
SetLocalInt(oMOD,sHID+"J_Month",GetCalendarMonth());
SetLocalInt(oMOD,sHID+"J_Day",GetCalendarDay());
// ** Example: Set Current Age for the 1st time.
int iAge = GetAge(oPlayer); // Gets the age as the Characters First Visit
SetLocalInt(oMOD,sHID+"AGE",iAge);
}