225 lines
		
	
	
		
			8.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			225 lines
		
	
	
		
			8.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
//::///////////////////////////////////////////////
 | 
						|
//:: OnLoad Script
 | 
						|
//:: 69_module_load
 | 
						|
//:: (c) 2003 Bioware Corp.
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
/*
 | 
						|
    Put into: OnModuleLoad Event
 | 
						|
 | 
						|
    This example script demonstrates how to tweak the
 | 
						|
    behavior of several subsystems in your module.
 | 
						|
 | 
						|
    For more information, please check x2_inc_switches
 | 
						|
    which holds definitions for several variables that
 | 
						|
    can be set on modules, creatures, doors or waypoints
 | 
						|
    to change the default behavior of Bioware scripts.
 | 
						|
 | 
						|
    Warning:
 | 
						|
    Using some of these switches may change your games
 | 
						|
    balancing and may introduce bugs or instabilities. We
 | 
						|
    recommend that you only use these switches if you
 | 
						|
    know what you are doing. Consider these features
 | 
						|
    unsupported!
 | 
						|
 | 
						|
    Please do NOT report any bugs you experience while
 | 
						|
    these switches have been changed from their default
 | 
						|
    positions.
 | 
						|
 | 
						|
    Make sure you visit the forums at nwn.bioware.com
 | 
						|
    to find out more about these scripts.
 | 
						|
 | 
						|
*/
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
//:: Created By: Georg Zoeller
 | 
						|
//:: Created On: 2003-07-16
 | 
						|
//:: Modified: 69MEH69
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
 | 
						|
#include "x2_inc_switches"
 | 
						|
#include "x2_inc_restsys"
 | 
						|
void main()
 | 
						|
{
 | 
						|
   //Henchman Kit Definitions 69MEH69
 | 
						|
 | 
						|
   //Sets Database Name for your Module
 | 
						|
   //Useful for transfering henchmen from module to module
 | 
						|
   //Insure that all the transfering modules use the same database
 | 
						|
   string sDB = "MBHKit";
 | 
						|
 | 
						|
   SetLocalString(GetModule(), "X0_CAMPAIGN_DB", sDB);
 | 
						|
 | 
						|
   //Sets testing mode
 | 
						|
   //Useful for debugging and/or viewing feedback
 | 
						|
   //Set TEST_MODE = 1 to initiate test mode
 | 
						|
   //Set TEST_MODE = 0 to disable test mode (Default)
 | 
						|
   int TEST_MODE = 0;
 | 
						|
 | 
						|
   SetLocalInt(GetModule(), "TEST_MODE", TEST_MODE);
 | 
						|
 | 
						|
   //PC death option:
 | 
						|
   //Set PC_BLEEDING = 1 to initiate PC bleeding (-10 HP) & Raise Dead/Resurrection by a healer henchman
 | 
						|
   //Set PC_BLEEDING = 0 to initiate default BIOWARE PC death
 | 
						|
   int PC_BLEEDING = 0;
 | 
						|
 | 
						|
   SetLocalInt(GetModule(), "PC_BLEEDING", PC_BLEEDING);
 | 
						|
 | 
						|
   //Henchman Death Option:
 | 
						|
   //Set HENCH_BLEED = 3 for henchman to respawn at PC master's location after 30.0 seconds
 | 
						|
   //Set HENCH_BLEED = 2 for henchman destruction, henchman will be destroyed upon death
 | 
						|
   //Set HENCH_BLEED = 1 for henchman bleeding
 | 
						|
   //Set HENCH_BLEED = 0 for respawn death, henchman will respawn
 | 
						|
   //    to location defined in spawn script
 | 
						|
   int HENCH_BLEED = 0;
 | 
						|
 | 
						|
   SetLocalInt(GetModule(), "HENCH_BLEED", HENCH_BLEED);
 | 
						|
 | 
						|
   //Set HENCH_SALVATION = 1 to allow for the possibility of
 | 
						|
   //henchman recovering from wounds each round
 | 
						|
   //Set HENCH_SALVATION = 0 to allow only one check for the
 | 
						|
   //possibility of henchman recovering from wounds
 | 
						|
   //Only available if HENCH_BLEED = 1;
 | 
						|
   int HENCH_SALVATION  = 0;
 | 
						|
 | 
						|
   SetLocalInt(GetModule(), "HENCH_SALVATION", HENCH_SALVATION);
 | 
						|
 | 
						|
   //Sets whether henchman will gain own XP or level up with PC
 | 
						|
   //Will initiate the 3rd edition DMG XP code
 | 
						|
   //Adjust the XP slider to 0 in Module Properties.
 | 
						|
   //0 = Levels up when PC levels up
 | 
						|
   //1 = Henchman gains own personal XP
 | 
						|
   int nHenchXP = 0;
 | 
						|
 | 
						|
   SetLocalInt(GetModule(), "HENCHXP", nHenchXP);
 | 
						|
 | 
						|
   //Sets whether henchman retain level or level down to level 1
 | 
						|
   //Will destroy NPC and create original level 1 version at original spawn location
 | 
						|
   //determined by waypoint with TAG: "WP_Home_'NPC TAG'"
 | 
						|
   //OR Henchman will be destroyed permanently
 | 
						|
   //The 69_hench_quit script will initiate on the following dialog node:
 | 
						|
   // "No, I work better alone."
 | 
						|
   //0 = Retains leveled up henchman
 | 
						|
   //1 = NPC is destroyed and level 1 version is created at waypoint
 | 
						|
   //2 = NPC is destroyed
 | 
						|
   int nHenchQuit = 0;
 | 
						|
 | 
						|
   SetLocalInt(GetModule(), "HENCHQUIT", nHenchQuit);
 | 
						|
 | 
						|
   //Sets whether henchmen will autolevel up at hire:
 | 
						|
   //0 = must level up henchman through dialog
 | 
						|
   //1 = henchman will automatically level up at hire
 | 
						|
   int nAutoLevelup = 1;
 | 
						|
 | 
						|
   SetLocalInt(GetModule(), "nAutoLevelup", nAutoLevelup);
 | 
						|
 | 
						|
   //Sets Leadership requirement upon module:
 | 
						|
   //0 = No Leadership, 1 = Yes Leadership
 | 
						|
   int nLeadership = 0;
 | 
						|
 | 
						|
   SetLocalInt(GetModule(), "nLeadership", nLeadership);
 | 
						|
 | 
						|
   if(nLeadership == 1)
 | 
						|
   {
 | 
						|
     SetMaxHenchmen(100);  //Do Not Edit
 | 
						|
   }
 | 
						|
 | 
						|
   //Sets Loyalty requirement upon module:
 | 
						|
   //0 = No Loyalty, 1 = Yes Loyalty
 | 
						|
   int nLoyalty = 0;
 | 
						|
 | 
						|
   SetLocalInt(GetModule(), "nLoyalty", nLoyalty);
 | 
						|
 | 
						|
   //Maximum Henchmen
 | 
						|
   //Sets the number of henchman a PC may have:
 | 
						|
   //(Leadership requirement must be set to 0)
 | 
						|
   //0,1,2...
 | 
						|
   int nNumHench = 3;
 | 
						|
 | 
						|
   if(nLeadership == 0)
 | 
						|
   {
 | 
						|
    SetMaxHenchmen(nNumHench);
 | 
						|
   }
 | 
						|
 | 
						|
   //End Henchman Kit Definitions 69MEH69
 | 
						|
 | 
						|
   //Other Definitions
 | 
						|
   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);
 | 
						|
 | 
						|
       // * Activating the switch below will make AOE spells hurt neutral NPCS by default
 | 
						|
       // SetModuleSwitch (MODULE_SWITCH_AOE_HURT_NEUTRAL_NPCS, TRUE);
 | 
						|
   }
 | 
						|
 | 
						|
   // * AI: Activating the switch below will make the creaures using the WalkWaypoint function
 | 
						|
   // * able to walk across areas
 | 
						|
   // SetModuleSwitch (MODULE_SWITCH_ENABLE_CROSSAREA_WALKWAYPOINTS, TRUE);
 | 
						|
 | 
						|
   // * Spells: Activating the switch below will make the Glyph of Warding spell behave differently:
 | 
						|
   // * The visual glyph will disappear after 6 seconds, making them impossible to spot
 | 
						|
   // SetModuleSwitch (MODULE_SWITCH_ENABLE_INVISIBLE_GLYPH_OF_WARDING, TRUE);
 | 
						|
 | 
						|
   // * Craft Feats: Want 50 charges on a newly created wand? We found this unbalancing,
 | 
						|
   // * but since it is described this way in the book, here is the switch to get it back...
 | 
						|
   // SetModuleSwitch (MODULE_SWITCH_ENABLE_CRAFT_WAND_50_CHARGES, TRUE);
 | 
						|
 | 
						|
   // * Craft Feats: Use this to disable Item Creation Feats if you do not want
 | 
						|
   // * them in your module
 | 
						|
   // SetModuleSwitch (MODULE_SWITCH_DISABLE_ITEM_CREATION_FEATS, TRUE);
 | 
						|
 | 
						|
   // * Palemaster: Deathless master touch in PnP only affects creatures up to a certain size.
 | 
						|
   // * We do not support this check for balancing reasons, but you can still activate it...
 | 
						|
   // SetModuleSwitch (MODULE_SWITCH_SPELL_CORERULES_DMASTERTOUCH, TRUE);
 | 
						|
 | 
						|
   // * Epic Spellcasting: Some Epic spells feed on the liveforce of the caster. However this
 | 
						|
   // * did not fit into NWNs spell system and was confusing, so we took it out...
 | 
						|
   // SetModuleSwitch (MODULE_SWITCH_EPIC_SPELLS_HURT_CASTER, TRUE);
 | 
						|
 | 
						|
   // * Epic Spellcasting: Some Epic spells feed on the liveforce of the caster. However this
 | 
						|
   // * did not fit into NWNs spell system and was confusing, so we took it out...
 | 
						|
   // SetModuleSwitch (MODULE_SWITCH_RESTRICT_USE_POISON_TO_FEAT, TRUE);
 | 
						|
 | 
						|
    // * Spellcasting: Some people don't like caster's abusing expertise to raise their AC
 | 
						|
    // * Uncommenting this line will drop expertise mode whenever a spell is cast by a player
 | 
						|
    // SetModuleSwitch (MODULE_VAR_AI_STOP_EXPERTISE_ABUSE, TRUE);
 | 
						|
 | 
						|
 | 
						|
    // * Item Event Scripts: The game's default event scripts allow routing of all item related events
 | 
						|
    // * into a single file, based on the tag of that item. If an item's tag is "test", it will fire a
 | 
						|
    // * script called "test" when an item based event (equip, unequip, acquire, unacquire, activate,...)
 | 
						|
    // * is triggered. Check "x2_it_example.nss" for an example.
 | 
						|
    // * This feature is disabled by default.
 | 
						|
   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();
 | 
						|
   }
 | 
						|
 | 
						|
}
 |