Rune_PRC8/_module/nss/opw_db_update.nss
Jaysyn904 d1c309ae63 Initial commit
Initial commit
2024-09-13 09:10:39 -04:00

40 lines
1.3 KiB
Plaintext

////////////////////////////////////////////////////////////////////////////////
// Database Updater
// opw_db_update
// By Don Anderson
// dandersonru@msn.com
//
// This is called from opw_timesync through wrap_mod_onuser.
// This is defined as a User Define Event to help improve performance and
// Timing Issues is High Stress Modules
//
////////////////////////////////////////////////////////////////////////////////
#include "nbde_inc"
void main()
{
object oMod = GetModule();
int nCurHour = GetTimeHour();
//Update Time DB
int nPERMTIME = GetLocalInt(oMod,"PERMTIME");
int nHour = NBDE_GetCampaignInt("TIME","TIMEHOUR",oMod);
if(nCurHour != nHour && nPERMTIME == 1)
{
NBDE_SetCampaignInt("TIME","TIMEHOUR",GetTimeHour(),oMod);
NBDE_SetCampaignInt("TIME","TIMEDAY",GetCalendarDay(),oMod);
NBDE_SetCampaignInt("TIME","TIMEMONTH",GetCalendarMonth(),oMod);
NBDE_SetCampaignInt("TIME","TIMEYEAR",GetCalendarYear(),oMod);
//Update DB
DelayCommand(1.0,NBDE_FlushCampaignDatabase("TIME"));
}
//Databases are Updated Now
DelayCommand(2.0,NBDE_FlushCampaignDatabase("SOULRUNE"));
DelayCommand(4.0,NBDE_FlushCampaignDatabase("KILLS"));
DelayCommand(6.0,NBDE_FlushCampaignDatabase("PLAYERSTATS"));
DelayCommand(8.0,NBDE_FlushCampaignDatabase("Farm_Main_DB"));
}