generated from Jaysyn/ModuleTemplate
77 lines
3.3 KiB
Plaintext
77 lines
3.3 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Name Generic OnLoad Event Handler
|
|
//:: FileName ld_mod_def_load
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Generic OnLoad script including the PW clock code
|
|
If you have your own custom onload script the
|
|
required code and include for the PW clock
|
|
are defined below.
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Lord Delekhan
|
|
//:: Created On: March 17, 2005
|
|
//:://////////////////////////////////////////////
|
|
|
|
//:://////////////////////////////////////////////
|
|
//:: PW Clock Include
|
|
//:://////////////////////////////////////////////
|
|
#include "ld_clock_inc"
|
|
//:://////////////////////////////////////////////
|
|
//:://////////////////////////////////////////////
|
|
#include "x2_inc_switches"
|
|
#include "x2_inc_restsys"
|
|
void main()
|
|
{
|
|
//:://////////////////////////////////////////////
|
|
//:: PW Clock Code Start
|
|
//:://////////////////////////////////////////////
|
|
object oMod = GetModule();
|
|
event DEvent = EventUserDefined(5000);
|
|
if(GetDateInitialized()){
|
|
int iDate = GetSavedDate();
|
|
DelayCommand(HoursToSeconds(1),SignalEvent(oMod,DEvent));
|
|
struct Date D = DecodeDate(iDate);
|
|
SetTime(D.Hour,1,0,0);
|
|
SetCalendar(D.Year,D.Month,D.Day);
|
|
} else {
|
|
SignalEvent(oMod,DEvent);
|
|
InitializeDate();
|
|
}
|
|
//:://////////////////////////////////////////////
|
|
//:: PW Clock Code End
|
|
//:://////////////////////////////////////////////
|
|
if (GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT)
|
|
{
|
|
// * Setting the switch below will enable a seperate Use Magic Device Skillcheck for
|
|
// * rogues when playing on Hardcore+ difficulty. This only applies to scrolls
|
|
SetModuleSwitch (MODULE_SWITCH_ENABLE_UMD_SCROLLS, TRUE);
|
|
}
|
|
SetModuleSwitch (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS, TRUE);
|
|
if (GetModuleSwitchValue (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
|
|
{
|
|
// * If Tagbased scripts are enabled, and you are running a Local Vault Server
|
|
// * you should use the line below to add a layer of security to your server, preventing
|
|
// * people to execute script you don't want them to. If you use the feature below,
|
|
// * all called item scrips will be the prefix + the Tag of the item you want to execute, up to a
|
|
// * maximum of 16 chars, instead of the pure tag of the object.
|
|
// * i.e. without the line below a user activating an item with the tag "test",
|
|
// * will result in the execution of a script called "test". If you uncomment the line below
|
|
// * the script called will be "1_test.nss"
|
|
// SetUserDefinedItemEventPrefix("1_");
|
|
}
|
|
|
|
// * This initializes Bioware's wandering monster system as used in Hordes of the Underdark
|
|
// * You can deactivate it, making your module load faster if you do not use it.
|
|
// * If you want to use it, make sure you set "x2_mod_def_rest" as your module's OnRest Script
|
|
// SetModuleSwitch (MODULE_SWITCH_USE_XP2_RESTSYSTEM, TRUE);
|
|
|
|
if (GetModuleSwitchValue(MODULE_SWITCH_USE_XP2_RESTSYSTEM) == TRUE)
|
|
{
|
|
// * This allows you to specify a different 2da for the wandering monster system.
|
|
// SetWanderingMonster2DAFile("des_restsystem");
|
|
//* Do not change this line.
|
|
WMBuild2DACache();
|
|
}
|
|
}
|