Você está na página 1de 7

x2_inc_switches

Interface for switching subsystem functionality


This file provides a basic interface for switching different Hordes of the Underdark subsystems on/offand
allows centralized access to certain "expert"functionality like overriding AI or Spellscripts. Changing any of
these switches from their default position is considered unsupported and done at your own risk - please do NOT
send any bug reports about problems caused by these switches.
Copyright (c) 2003 Bioware Corp. * Created By: Georg Zoeller * On: 2003-07-16
Example variable screen

MODULE
Force Use Magic Device Skillchecks, Default = FALSE except for GAME_DIFFICULTY_CORE_RULES+ If
switched to TRUE, a rogue has to succeed in a UMD check against DC 25+SpellLevelin order to use a scroll.
See x2_pc_umdcheck.nss for details
X2_SWITCH_ENABLE_UMD_SCROLLS = 1
Toggle on/off the Item Creation Feats, Default = ODisable the Item Creation Feats that come with Hordes of the
Underdark for themodule.
X2_SWITCH_DISABLE_ITEMCREATION_FEATS=1

Toggle Area of Effect Spell behaviourIf set to TRUE, AOE Spells will hurt NPCS that are neutral to the caster
if they arecaught in the effect.
X0_G_ALLOWSPELLSTOHURT = 1
For balancing reasons the crafting system will create 50 charges on a new wandinstead it will create 10 +
casterlevel charges. if you want to be "hard core rules compliant"50 charges, enable this switch
X2_SWITCH_ENABLE_50_WAND_CHARGES = 1
Some epic spells, namely Hellball, do damage to the caster. We found this too confusingin testing, so it was
disabled. You can reactivate using this flag
X2_SWITCH_EPIC_SPELLS_HURT_CASTER = 1
Deathless master touch is not supposed to affect creatures of size > largebut we do not check this condition by
default to balance the fact that the slaincreature is not raised under the command of the pale master.by setting
this switch to TRUE, the ability will no longer effect creatures ofhuge+ size.
X2_SWITCH_SPELL_CORERULE_DMTOUCH = 1
By default, all characters can use the various poisons that can be found to poison their weapons ifthey win a
Dex check. Activating this flag will restrict the use of poison to chars with the UsePoisonfeat only
X2_SWITCH_RESTRICT_USE_POISON_FEAT
Multiple Henchmen: By default, henchmen will never damage each other with AoE spells.By activating this
switch, henchmen will be able to damage each other with AoE spellsand potentially go on each other's
throats.Warning: Activating this switch has the potential of introducing game breaking bugs. Do not use on the
official SoU campaign. Use at your own risk. Really, its dangerous!
X2_SWITCH_MULTI_HENCH_AOE_MADNESS
Spell Targeting: Pre Hordes of the underdark, in hardcore mode, creatures would not hurt each otherwith their
AOE spells if they were no PCs. Setting this switch to true, will activate the correctbehaviour. Activating this
on older modules can break things, unless you know what you are doing!
X2_SWITCH_ENABLE_NPC_AOE_HURT_ALLIES
If set to TRUE, the Bebilith Ruin Armor ability is going to actually destroythe armor it hits. Would be very
annoying for players...
X2_SWITCH_BEBILITH_HARDCORE_RUIN_ARMOR
Setting this switch to TRUE will make the Glyph of warding symbol disappear after 6 seconds, butthe glyph
will stay active....
X2_SWITCH_GLYPH_OF_WARDING_INVISIBLE
Setting this switch to TRUE will enable the allow NPCs running between waypoints using the
WalkWaypointsfunction to cross areas, like they did in the original NWN. This was changed in 1.30 to use
onlywaypoints in one area.
X2_SWITCH_CROSSAREA_WALKWAYPOINTS
Setting this switch to TRUE will disable the glow of a newly found secret doorused in some locations in XP2
X2_SWITCH_DISABLE_SECRET_DOOR_FLASH
Setting this switch to TRUE will disable execution of tagbased scripts that are enabledby default when using the
standard module events (x2_mod_def_*)
X2_SWITCH_ENABLE_TAGBASED_SCRIPTS

Setting this switch to TRUE will enable the XP2 Wandering Monster Systemfor this module (if you are using
the default rest script and you have setup the correct variables for each area
X2_SWITCH_ENABLE_XP2_RESTSYSTEM
If this variable is set, the AI will not use Dispel Magic against harmfull AOEspells.
X2_L_AI_NO_AOE_DISPEL
Setting this variable to TRUE on the module will disable the call to therandom loot generation in most
creatures' OnSpawn script.
X2_L_NOTREASURE

MISC
X2_S_UD_SPELLSCRIPT
X2_S_UD_SPELLSCRIPT
Variable that holds the wandering monster 2da filename
X2_WM_2DA_NAME
This variable allows to specify a % for NOT using dispel magic against AOEs instead fleeing
X2_L_AI_AOE_DISPEL_CHANCE
Setting this variable to TRUE will cause the Expertise/Improved Expertisemodes to be disabled whenever a
player is casting a spell.
X2_L_STOP_EXPERTISE_ABUSE

CREATURES
See x2_ai_demo for details
X2_SPECIAL_COMBAT_AI_SCRIPT
Setting this variable on a spellcaster creature will make its spelluse abit more random, but their spell selection
may not always be appropriateto the situation anymore.
X2_SPELL_RANDOM
Set to 1 to make the creature activate stealth mode after spawn
X2_L_SPAWN_USE_STEALTH
Set to 1 to make the creature activate detectmode after spawn
X2_L_SPAWN_USE_SEARCH
Set to 1 to make the creature play mobile ambient animations after spawn
X2_L_SPAWN_USE_AMBIENT
Set to 1 to make the creature play immobile ambient animations after spawn
X2_L_SPAWN_USE_AMBIENT_IMMOBILE

Set to 1 to make the creature immune to dispel magic (used for statues)
X1_L_IMMUNE_TO_DISPEL
Set this variable to 1 on a creature to make it walk through other creatures
X2_L_IS_INCORPOREAL
Set this variable to 1 - 6 to override the number of attacks a creature has based on its BAB
X2_L_NUMBER_OF_ATTACKS
The value of this variable (int) is added to the chance that a creature will use magic in combat. Set to 100 for
always, 0 for never
X2_L_BEH_MAGIC
The higher value of this variable, the higher the chance that the creature will use offensive abilities in combat.
Set to 0 to make them flee.
X2_L_BEH_OFFENSE
The higher value of this variable, the higher the chance that the creature will aid friendly creatures in combat.
Not that helping usually degrades the overall difficulty of an encounter, but makes it more interesting.
X2_L_BEH_COMPASSION
This allows you to script items that enhance a palemaster's summoned creatures. You needto put the name of a
script into this variable that will be run on any creature called by the pale master's summon undead ability. You
can use this script to add effects to the creature. You can use the OnEquip/OnUnEquip event hooks set this
variable.
X2_S_PM_SPECIAL_ITEM

DOORS
Set to 1 to prevent knock from working with feedback. Set to 2 to prevent knock from working without
feedback
X2_FLAG_DOOR_RESIST_KNOCK

WAYPOINTS
By setting this variable to 1 on a waypoint, a creature using thiswaypoint as part of its WalkWaypoints routine
will assume the facingof the waypoint upon reaching it.
X2_L_WAYPOINT_SETFACING

ITEMS
SPELLSCRIPTS
Allows the module creator to specify a script that will be run before any spellscript is run You can call
SetModuleOverrideSpellscript() at the end of the script specified by sScriptName. If you call this function this
will prevent the original spellscript (and all craft item code) from being executed. If you do not add this line, the
original spellscript and/or crafting code will run in addition to your script

CREATURES
Define a replacement script for DetermineCombatRound See x2_ai_demo for details Call this at end of your
custom override AI script set via CREATURE_VAR_CUSTOM_AISCRIPT See x2_ai_demo for details.

You can modify all spawn conditions of a creature by putting an integer variable called
"NW_GENERIC_MASTER" on the creature and put the correct value calculated from the values below:
int NW_FLAG_SPECIAL_CONVERSATION
int NW_FLAG_SHOUT_ATTACK_MY_TARGET
int NW_FLAG_STEALTH
int NW_FLAG_SEARCH
int NW_FLAG_SET_WARNINGS
int NW_FLAG_ESCAPE_RETURN
int NW_FLAG_ESCAPE_LEAVE
int NW_FLAG_TELEPORT_RETURN
int NW_FLAG_TELEPORT_LEAVE
int NW_FLAG_PERCIEVE_EVENT
int NW_FLAG_ATTACK_EVENT
int NW_FLAG_DAMAGED_EVENT
int NW_FLAG_SPELL_CAST_AT_EVENT
int NW_FLAG_DISTURBED_EVENT
int NW_FLAG_END_COMBAT_ROUND_EVENT
int NW_FLAG_ON_DIALOGUE_EVENT
int NW_FLAG_RESTED_EVENT
int NW_FLAG_DEATH_EVENT
int NW_FLAG_SPECIAL_COMBAT_CONVERSATION
int NW_FLAG_AMBIENT_ANIMATIONS
int NW_FLAG_HEARTBEAT_EVENT
int NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS
int NW_FLAG_DAY_NIGHT_POSTING
int NW_FLAG_AMBIENT_ANIMATIONS_AVIAN
int NW_FLAG_APPEAR_SPAWN_IN_ANIMATION
int NW_FLAG_SLEEPING_AT_NIGHT
int NW_FLAG_FAST_BUFF_ENEMY

= 0x00000001;
= 0x00000002;
= 0x00000004;
= 0x00000008;
= 0x00000010;
= 0x00000020; //Failed
= 0x00000040;
= 0x00000080; //Failed
= 0x00000100;
= 0x00000200;
= 0x00000400;
= 0x00000800;
= 0x00001000;
= 0x00002000;
= 0x00004000;
= 0x00008000;
= 0x00010000;
= 0x00020000;
= 0x00040000;
= 0x00080000;
= 0x00100000;
= 0x00200000;
= 0x00400000;
= 0x00800000;
= 0x01000000;
= 0x02000000;
= 0x04000000;

So if you want a creature to use be in search and stealth mode on spawning and to use ambient animations, you
can set "NW_GENERIC_MASTER" to
0x00000004 +
0x00000008 +
0x00080000 =
-----------0x0008000C = 524300

const string sCombatCondVarname = "X0_COMBAT_CONDITION";


const int X0_COMBAT_FLAG_RANGED
const int X0_COMBAT_FLAG_DEFENSIVE
const int X0_COMBAT_FLAG_COWARDLY
const int X0_COMBAT_FLAG_AMBUSHER

= 0x00000001;
= 0x00000002;
= 0x00000004;
= 0x00000008;

You need to put the value as decimal (the bold value) on the creature. You can use windows calculator (switch
to scientific mode) to calculate the hex numbers together and then convert them to decimal mode.
NW_FLAG_SPECIAL_CONVERSATION = 1
NW_FLAG_SHOUT_ATTACK_MY_TARGET = 2
NW_FLAG_STEALTH = 4
NW_FLAG_SEARCH = 8
NW_FLAG_SET_WARNINGS = 16
NW_FLAG_ESCAPE_RETURN = 32
NW_FLAG_ESCAPE_LEAVE = 64
NW_FLAG_TELEPORT_RETURN = 128
NW_FLAG_TELEPORT_LEAVE = 256
NW_FLAG_PERCIEVE_EVENT = 512
NW_FLAG_ATTACK_EVENT = 1024
NW_FLAG_DAMAGED_EVENT = 2048
NW_FLAG_SPELL_CAST_AT_EVENT = 4096
NW_FLAG_DISTURBED_EVENT = 8192
NW_FLAG_END_COMBAT_ROUND_EVENT = 16384
NW_FLAG_ON_DIALOGUE_EVENT = 32768
NW_FLAG_RESTED_EVENT = 65536
NW_FLAG_DEATH_EVENT = 131072
NW_FLAG_SPECIAL_COMBAT_CONVERSATION = 262144
NW_FLAG_AMBIENT_ANIMATIONS = 524288
NW_FLAG_HEARTBEAT_EVENT = 1048576
NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS = 2097152
NW_FLAG_DAY_NIGHT_POSTING = 4194304
NW_FLAG_AMBIENT_ANIMATIONS_AVIAN = 8388608
NW_FLAG_APPEAR_SPAWN_IN_ANIMATION = 16777216
NW_FLAG_SLEEPING_AT_NIGHT = 33554432
NW_FLAG_FAST_BUFF_ENEMY = 67108864
For those who are cluless like I was...
open your windows calculator in scientific mode and check the HEX box.
Now refer to the onspawn trigger/event you want to use.
For example, you want to turn on the ambiant animations.
You see the HEX number for ambiant animations is
0x00080000.
Type into the calculator 80000.
Now click the DEC check box.

The number it gives you is what you set NW_GENERIC_MASTER to.


To turn on more than one, IN HEX mode, enter the HEX NUMBERS and add them normally. when you are
finished click the DEC box.
Again, there is your setting for NW_GENERIC_MASTER

Você também pode gostar