// savechars,prc_onmodload ///////////////////////////////////////////////////////////////////// // // This script has been auto-generated by HakInstaller to call // multiple handlers for the onmoduleload event. // ///////////////////////////////////////////////////////////////////// #include "x2_inc_switches" float fMsgTimer = 45.0; //Restart Module Msg void DoModuleMsg(); // Restart Module void RestartModule(); void main() { //if you are using another spellscript override you will need to execute the //"f_vampirespells" script right before returning to the spell. If an altered //spell is ran by f_vampirespells SetModuleOverrideSpellScriptFinished will be //set (see x2_inc_switches and x2_inc_spellhook for more info). SetModuleOverrideSpellscript("f_vampirespells"); { ExecuteScript("savechars", OBJECT_SELF); ExecuteScript("prc_onmodload", OBJECT_SELF); DelayCommand(28800.0, RestartModule());// 4 hrs } } void DoModuleMsg() { //Count down msg timer... fMsgTimer -= 1.0f; object oPC = GetFirstPC(); while (GetIsObjectValid(oPC)) { SendMessageToPC(oPC, "Reset in "+FloatToString(fMsgTimer, 0, 0)+" secs."); oPC = GetNextPC(); } if(fMsgTimer != 0.0) { DelayCommand(1.0, DoModuleMsg()); } else { ExportAllCharacters(); oPC = GetFirstPC(); while (GetIsObjectValid(oPC)) { BootPC(oPC); oPC = GetNextPC(); } } } void RestartModule() { DoModuleMsg(); DelayCommand(fMsgTimer + 4.0, SetLocalString(GetModule(),"NWNX!RESETPLUGIN!SHUTDOWN","1")); }