NWN2

NWN2 specific content.

Technical / Building ACR Compatible Doors

While the basemod contains every door listed in the DMG with appropriate settings, builders may wish to create their own doors. ALFA has scripts which provide a number of mechanics not ordinarily found in NWN, and every door has an extra set of options because of this.

As with creating new creatures, items, and so forth, the easiest way to make a new door is to copy/edit an existing one. For information on editing the settings of an existing door, skip the next section.

Creating a new door. If you aren't editing an existing door, you will have to configure a number of options. To start off with, you'll need to make sure all of the door's event scripts are set correctly. ALFA's event scripts for doors are as follows: // Update for longer NWN2 file names

  • acf_door_onclosed
  • acf_door_onconversation
  • acf_door_ondamaged
  • acf_door_ondeath
  • acf_door_ondisarm
  • acf_door_onheartbeat
  • acf_door_onlock
  • acf_door_onmeleeattacked
  • acf_door_onopen
  • acf_door_onspellcastat
  • acf_door_ontraptriggered
  • acf_door_onunlock
  • acf_door_onused
  • acf_door_onuserdefined
  • acf_door_onclick
  • acf_door_onfailtoopen

If you want to add custom event scripts to your doors, you can of course do so. Just make sure each event script includes the file acr_door_i, and calls the appropriate function for that event, listed here.

  • ACR_DoorOnClosed()
  • ACR_DoorOnConversation()
  • ACR_DoorOnDamaged()
  • ACR_DoorOnDeath()
  • ACR_DoorOnDisarm()
  • ACR_DoorOnHeartbeat()
  • ACR_DoorOnLock()
  • ACR_DoorOnMeleeAttacked()
  • ACR_DoorOnOpen()
  • ACR_DoorOnSpellCastAt()
  • ACR_DoorOnTrapTriggered()
  • ACR_DoorOnUnlock()
  • ACR_DoorOnUsed()
  • ACR_DoorOnUserDefined()
  • ACR_DoorOnClick()
  • ACR_DoorOnFailToOpen()

Again, the easiest way to do this is to edit an existing acr_door_* file and save it under a different name. Failure to properly call ALFA's door scripts can break multiple systems of the ACR. So make sure you've got them in there.

Editing a door's settings: Aside from the standard NWN options of doors, we've provided a few more to give PCs and builders more options. These options can be accessed by editing the door's local variables. They are as follows: (For information on what local variables are, and how to edit them, go here: Using Local Variables in the NWN2 Toolset)

ACR_DOOR_CLOSE_DELAY (float) The number of seconds a door will stay open before automatically closing itself. If set to zero or less than zero, the door will not close itself automatically.

ACR_DOOR_CLOSE_NEAR_PCS (integer) If set to 1, the door will auto-close regardless of any nearby PCs. If set to 0 (the default), the door will wait until PCs are out of visual range before closing itself.

ACR_DOOR_STUCK_DC (integer) If non-zero, the door is considered "stuck", and therefore cannot be opened unless forced. The value defined is the strength-check DC to "un-stick" the door. If someone tries to force a locked and stuck door open, the strength DC used is the higher of this value and ACR_DOOR_BREAK_DC. The default value is 0.

ACR_DOOR_BREAK_DC (integer) The DC to break open this door, as per DMG rules. Breaking open a door does not destroy it like doing damage to it would in NWN, but it does keep the door from being able to be locked again. If this value is zero, the door cannot be forced open. Valid values are from 0 to 255.

ACR_DOOR_FAIL_OPEN_MESSAGE (string) This is a custom message sent to PCs who try to open the door and fail. This can be used in conjunction with ACR_DOOR_UNLOCK_PASSWORD to setup doors that require a spoken password to access (even useful for door riddles).

ACR_DOOR_OPEN_MESSAGE (string) This message is "spoken" by the door when it is opened. It is usually used to give the PCs a description of the area beyond an AT, if any.

ACR_DOOR_UNLOCK_HOUR (integer) This is the time of day (in hours) the door unlocks itself. Generally used for shops and things which are only open during certain hours of the day. It will only unlock once, so if something else locks it afterwards, it will remain locked until either another creature unlocks it, or its next unlock time. Valid values are 0 to 23. If you don't wish the door locking or unlocking itself automatically, leave both this variable and ACR_DOOR_LOCK_HOUR set to 0 (the default value).

ACR_DOOR_LOCK_HOUR (integer) This is the time of day (in hours) the door locks itself. Generally used for shops and things which are only open during certain hours of the day. It will only lock once, so if something else unlocks it afterwards, it will remain unlocked until either another creature locks it, or its next lock time. Valid values are 0 to 23. If you don't wish the door locking or unlocking itself automatically, leave both this variable and ACR_DOOR_UNLOCK_HOUR set to 0 (the default value).

ACR_DOOR_UNLOCK_SPELLID (int) This is the Spell ID for doors that require a specific spell to unlock. This will only work for spell IDs greater than 0. Be sure to set the door's default lock status to locked.

ACR_DOOR_UNLOCK_PASSWORD (string) This is what a player must speak to gain access to a password protected door. Leave this empty to require no password. Otherwise, be sure to set the door's default lock status to locked.

ACR_DOOR_AUTO_LOCK (integer) If non-zero, the door will automatically lock itself each time it is shut.

ACR_DOOR_LISTEN_DC_MOD (integer) This modifier is applied to creatures trying to listen to conversations occuring behind a closed doors. The DMG lists this a +5 for every door, but some customization is allowed for different door types. If undefined or set to 0, the door cannot be listened through.

ACR_DOOR_KNOCK_IMMUNE (integer) If nonzero, this door is immune to the spell knock. If zero, it is not immune.

ACR_DOOR_UNMOVABLE (integer) If nonzero, the door cannot be opened or closed by a non-DM creature, even if unlocked. Scripts can still open or close it, however. This setting is often used to represent large doors which a PC could not realistically close on their own even if they were unlocked, like the huge gates on castles and other fortifications.

ACR_AT_SIZE (integer) If nonzero, this setting specifies the maximum sized creature which can fit through this doorway. Anything large will be given a message saying it is too large to fit inside. Valid values are as follows:

  • 1 = Fine
  • 2 = Diminutive
  • 3 = Tiny
  • 4 = Small
  • 5 = Medium
  • 6 = Large
  • 7 = Huge
  • 8 = Gargantuan
  • 9 = Colossal

Note that currently, NWN2 does not support creature sizes of fine, diminutive, gargantuan or colossal. These values are provided here for future compatibility.

Note that if none of these variables are defined, they default to zero. So a door without them would never close or lock itself, wouldn't be stuck or barred at all, would not be able to be forced open, and wouldn't have any sort of a custom message printed if a PC failed to open it.

Technical / Building ACR Compatible Items

All items should be priced according to 3.5 edition canon (Player's Hand Book, Dungeon Master's Guide, etc), and to the ALFA specific exceptions set forth by ALFA Standards. DO NOT MAKE ITEMS WORTH LESS THAN 1 GP YET! Our currency system for silver and copper pieces is not yet ready, and we may not know how it will work until we have the client in our hands.

Premise: An item should be identifiable from it's tag/resref.

<prefix>_it_<type>_<description>_<ID>

<prefix> is either "abr" (minus the quotes) for default ALFA items, or a three digit code of the server.

<type> is a three-letter abbreviation describing the slot occupied by the item.

<description> is the number of fields necessary to describe any additional properties on the item.

<ID> is an optional two-digit number used to distinguish items with identical properties. Leave the <ID> off of tags - it goes on resrefs only.

Item tags should NEVER be longer than 28 characters. The game allows 32, so don't use them all.

Scripting: For information on how to script items, go here.

Examples: A standard longsword would be, Tag: abr_it_wpn_longsword ResRef: abr_it_wpn_longword_01

TYPE

Ammunition amm Armor arm (includes shields) Boots boo Cloaks clk Gloves glv Helmets hlm Weapons wpn

DESCRIPTIONS

Materials

  • Abyssal Bloodiron ay
  • Adamantine ad
  • Alchemical Silver sa
  • Arandur aa
  • Astral Driftmetal as
  • Aurorum au
  • Bluewood bw
  • Cold Iron ci
  • Copper co
  • Darksteel dk
  • Darkwood (Zalantar) za
  • Dlarun dl
  • Dragonbone db
  • Dragonfang df
  • Dragonhide dh
  • Dragonscale ds
  • Duskwood du
  • Fever Iron fr
  • Fiendbone fb
  • Frystalline fy
  • Gold go
  • Hide hi
  • Hizagkuur hz
  • Laminated Steel ls
  • Living Metal lm
  • Mithral mi
  • Obsidian ob
  • Pandemonic Silver ps
  • Platinum pt
  • Serren se
  • Silver sv
  • Solarian Truesteel tr
  • Sondarr so
  • Suzailian Chainweave ch
  • Weirwood ww
  • Ysgardian Heartwire ys

Quality

  • Arcane Spell Failure -10% asf1
  • Drowcraft dc
  • Masterwork mw
  • Plus one e1
  • Poor po
  • Armour Class +1 ac1
  • Bonus Spell, Level 0 sb0
  • Bonus Spell, Levels 0, 1, 2 sb012
  • Damage Resistance 1 dr1
  • Damage Resistance 5/magic dr5m
  • Damage Resistance Fire 5 drf5
  • Feat: Alertness fale
  • Feat: Ambidexterity famb
  • Feat: Combat Casting fcca
  • Feat: Darkvision fdar
  • Feat: Dodge fdod
  • Feat: Extra Turning fext
  • Feat: Mobility fmob
  • Feat: Spell Focus (One) fsf1
  • Feat: Spell Penetration fpen
  • Feat: Two Weapon Fighting ftwf
  • Feat: Weapon Finesse fwfi
  • Spell Immunity, Level 0 si0
  • Spell Resistance 12 sr12
  • Freedom of Movement fom
  • Immunity: Death Magic ide
  • Immunity: Disease idi
  • Immunity: Drain idr
  • Immunity: Fear ife
  • Immunity: Gas iga
  • Immunity: Magic Missle imm
  • Immunity: Paralysis ipa
  • Immunity: Poison ipo
  • Save, Acid +1 sac1
  • Save, Cold +1 sco1
  • Save, Death +1 sde1
  • Save, Disease +1 sds1
  • Save, Fear +1 sfe1
  • Save, Fire +1 sfi1
  • Save, Fort +1 sfo1
  • Save, Mind +1 smi1
  • Save, Negative +1 sne1
  • Save, Poison +1 spo1
  • Save, Reflex +1 sre1
  • Save, Sonic +1 sso1
  • Save, Universal +1 sa1
  • Save, Will +1 swi1
  • Hide +1 hi1
  • Damage, Acid +1 da1
  • Damage, Bludgeoning +1 db1
  • Damage, Cold +1 dc1
  • Damage, Divine +1 dd1
  • Damage, Fire +1 df1
  • Damage, Magic +1 dm1
  • Damage, Negative +1 dn1
  • Damage, Piercing +1 dp1
  • Damage, Slashing +1 ds1
  • Damage, Sonic +1 do1
  • Feat: Cleave fcle
  • Feat: Disarm fdis
  • Feat: Improved Critical ficr
  • Feat: Point Blank Shot fpbs
  • Feat: Rapid Shot frap
  • Feat: Weapon Specialisation fwsp
  • Keen ke
  • Massive Criticals +1 mc1
  • Mighty +1 m1
  • Sure Striking sst
  • Vampiric +1 dv1
  • Wounding +1 dw1

CLASSIFICATION This is added in the toolset with a string seperated by the '|' character for each category. The HDMs of every server are free to make their own rules as too where items should be placed, but be aware the DM client cannot see more than one step "deep" into the category tree.

Technical / ACR Data Persistence

Data persistence API

The following functions are available for use in scripts to store persistent data (available across server resets). Be sure to delete any data that is no longer needed or to set expiration on data that you know will only be relevant for a fixed duration. This will help keep the size of the database down and minimize latency on queries (that can lag the game).

Note: NWNx4 must be installed and configured properly? on the host server for these functions to work.

This function executes an SQL statement. - sSQL: The SQL string to execute - Returns: Nothing void ACR_SQLQuery(string sSQL)

This function retrieves the next row of the result set returned by the most recent query. Call this before using ACR_SQLGetData(). - mode: Selects a result set in a multi set result
Leave the parameter empty to advance to the next row in the resultset.
Pass "NEXT" as parameter to fetch the first row of the next resultset. - Returns: SQL_SUCCESS if there is a row, SQL_ERROR if there are no more rows. int ACR_SQLFetch(string mode = " ")

This function retrieves the data in a specific column within the current row of the result set. - nCol: The index of the column to retrieve (max column size 65K) in the result row - Returns: The data in column nCol string ACR_SQLGetData(int nCol = 0)

This function returns the number of rows that were affected by the last INSERT, UPDATE, or DELETE operation. - Returns: Number of rows affected int ACR_SQLGetAffectedRows()

This function handles special characters (like ') for database storage. Problems can arise with SQL commands if variables or values have single or double quotes in their names. This function encodes these quotes so the underlying database can safely store them. - sString: The string to encode string ACR_SQLEncodeSpecialChars(string sString)

This function stores a persistent string. - oObject: The object for which the data is being stored - sVarName: The unique variable name - sValue: The value to record Optional parameters: - iExpiration: The number of days the persistent variable should be kept in database (default: 0=forever) void ACR_SetPersistentString(object oObject, string sVarName, string sValue, int iExpiration = 0)

This function stores a persistent integer. - oObject: The object for which the data is being stored - sVarName: The unique variable name - iValue: The value to record Optional parameters: - iExpiration: The number of days the persistent variable should be kept in database (default: 0=forever) void ACR_SetPersistentInt(object oObject, string sVarName, int iValue, int iExpiration = 0)

This function stores a persistent float. - oObject: The object for which the data is being stored - sVarName: The unique variable name - fValue: The value to record Optional parameters: - iExpiration: The number of days the persistent variable should be kept in database (default: 0=forever) void ACR_SetPersistentFloat(object oObject, string sVarName, float fValue, int iExpiration = 0)

This function stores a persistent location. - oObject: The object for which the data is being stored - sVarName: The unique variable name - lValue: The value to record Optional parameters: - iExpiration: The number of days the persistent variable should be kept in database (default: 0=forever) void ACR_SetPersistentLocation(object oObject, string sVarName, location lValue, int iExpiration = 0)

This function stores a persistent vector. - oObject: The object for which the data is being stored - sVarName: The unique variable name - vValue: The value to record Optional parameters: - iExpiration: The number of days the persistent variable should be kept in database (default: 0=forever) void ACR_SetPersistentVector(object oObject, string sVarName, vector vValue, int iExpiration = 0)

This function stores a persistent object. - oObject: The object for which the data is being stored - sVarName: The unique variable name - oItem: The object to record Optional parameters: - iExpiration: The number of days the persistent variable should be kept in database (default: 0=forever) void ACR_SetPersistentObject(object oObject, string sVarName, object oItem, int iExpiration = 0)

This function retrieves a persistent string. - oObject: The object for which the data is being retrieved - sVarName: The unique variable name - Returns: '' on error string ACR_GetPersistentString(object oObject, string sVarName)

This function retrieves a persistent int. - oObject: The object for which the data is being retrieved - sVarName: The unique variable name - Returns: 0 on error int ACR_GetPersistentInt(object oObject, string sVarName)

This function retrieves a persistent float. - oObject: The object for which the data is being retrieved - sVarName: The unique variable name - Returns: 0 on error float ACR_GetPersistentFloat(object oObject, string sVarName)

This function retrieves a persistent location. - oObject: The object for which the data is being retrieved - sVarName: The unique variable name - Returns: 0 on error location ACR_GetPersistentLocation(object oObject, string sVarname)

This function retrieves a persistent vector. - oObject: The object for which the data is being retrieved - sVarName: The unique variable name - Returns: 0 on error vector ACR_GetPersistentVector(object oObject, string sVarName)

This function retrieves a persistent object. - oObject: The object for which the data is being retrieved - sVarName: The unique variable name - Returns: 0 on error object ACR_GetPersistentObject(object oObject, string sVarName)

This function deletes a persistent record. - oObject: The object for which the data is being deleted - sVarName: The unique variable name void ACR_DeletePersistentVariable(object oObject, string sVarName)

This function converts a location to a string. - lLocation: The location to convert - Returns: A string equivalent string ACR_LocationToString(location lLocation)

This function converts a string to a location. - sLocation: The string to convert - Returns: A location location ACR_StringToLocation(string sLocation)

This function converts a vector to a string. - vVector: The vector to convert - Returns: A string equivalent string ACR_VectorToString(vector vVector)

This function converts a string to a vector. - sVector: The string to convert - Returns: A vector vector ACR_StringToVector(string sVector)

This function retrieves the CD Key of the player - always use this with exit events in place of the normal NWScript function (it returns null). - oPC: player whose CD Key to retrieve - Returns: oPC's CD Key string ACR_GetPCPublicCDKey(object oPC)

This function retrieves the database ID of the character (useful for direct queries using ACR_SQLQuery()). - oPC: player whose character ID to retrieve - Returns: oPC's character ID int ACR_GetCharacterID(object oPC)

 

Auxiliary database connections

There is support for creating "auxiliary" database connections (to other MySQL servers), though this support is not recommended for most usage.  Use the standard data persistence API instead in nearly all cases.

Auxiliary database connection documentation page.

DM Bonus XP

DM Bonus XP

Bonus XP operates outside of the context of criteria-based Quest XP. It takes the form of a small one-off rewards of 10 XP, and can be triggered by anything from a particularly clever idea, to a perfect piece of role-play representing a PC’s personality, to anything that significantly adds to the general enjoyment of the other players – and DMs. Bonus awards should be made sparingly, but often enough to provide general encouragement for players. Bonus awards are made via the ALFA XP Bonus Cookie Widget.

CombatXP

Combat XP

Combat XP is calculated from the CR of defeated creatures, adjusted by the relative strength of the combatants (the ‘Danger Factor’) and is handled entirely by the ACR. For information purposes, the calculation is as follows:

 
  • XP = ( 20 * ( CR ^ 0.6 ) ) * DF

The ‘Danger Factor’ calculation is:

 
Danger Factor
(ECL – CR) DF
lower than -3 0.1
-3 0.33
-2 0.5
-1 0.67
0 1
1 1.5
2 2
3 2.5
4 3
greater than 4 3.5

This table is presented for informational purposes only, as the awarding of combat XP is handled mechanically by the platform.

DM Quest XP

DM Quest XP

DM Quest XP awards take two main factors into account:

  • the challenge faced by the PCs; and,
  • the success of the PCs in overcoming that challenge.

The same quest can present a significantly different challenge to differently constituted parties. Cleric-heavy parties will find defeating undead a lot easier than others, while Rogue-heavy parties are a lot less susceptible to ambush and a lot more capable of overcoming trap-laden dungeons. PCs should not be over-rewarded for overcoming challenges that are inherently easy for them; but nor should they be penalized for facing challenges that they are necessarily unprepared for. PCs should also not be unduly penalized for being effective: if a particular tactic surprises a DM and neutralizes a significant part of the challenge that the players are facing, it may be appropriate to reduce the ‘Challenge’ element – but increase the ‘Success’ element for the overall quest. Effectively, when one or another element is significantly increased or decreased, it is appropriate to increase or decrease the level of the award by a single band.

Awards are made for fixed amounts, by selecting the correct option on the ALFA XP Wand.

  • Easy (20 XP / RL hour):
    the PCs should be able to overcome the challenge without any difficulty;
    the PCs should be able to overcome the challenge using only their key strengths;
    there is no significant chance of death or other plot-related failure;
    significant outlay of resources is not required;
    the PCs should be able to proceed directly on to another immediately.
     
  • Normal (40 XP / RL hour):
    the PCs should be able to overcome the challenge without significant difficulty;
    the PCs should be able to overcome the challenge using their key strengths;
    there is no significant chance of death or other plot-related failure;
    significant outlay of resources is not required;
    the PCs should be able to proceed directly on to another quest with minimal recovery.
     
  • Serious (60 XP / RL hour):
     
    the PCs should have some difficulty in overcoming the challenge;
    the PCs should have to prepare and plan properly to overcome the challenge;
    the PCs will be required to use skills and abilities other than their key strengths in order to succeed;
    there is a chance of death, or other significant plot-related failure;
    some outlay of resources is required, including temporary items;
    some recovery and restocking will be necessary before the PCs can proceed further.
     
  • Exceptional (80 XP / RL hour):
    failure is a realistic possibility;
    the PCs will have to prepare and plan thoroughly in order to overcome the challenge;
    the PCs will be required to use skills and abilities that are the opposite of their key strengths in order to succeed;
    death or other significant plot-related failure is a realistic possibility;
    significant outlay of resources is required, including temporary items;
    a significant period of recovery and restocking will be necessary before the PCs can proceed further.

Example: Our party spend several IG days planning their raid on an orc camp, including making some specific tactical purchases – a Wand of Sleep and a half-dozen Antidote Potions – to exploit the weakness of the orc barbarians and counter one of their strengths (poisoned weapons). Our party is a traditional Fighter/Fighter/Cleric/Wizard/Rogue combination, but in order to make their approach to the orc camp undetected, they are required to be as stealthy as possible – not a key strength for the fighters and clerics and available only for the wizard by magical means. Their plan works and they successfully raid the camp, their stealthy approach and Wand of Sleep allowing them to neutralise the outlying guards before they can sound the alarm. They free a human slave, although they have to use several Antidote Potions, various healing abilities and potions, and several charges on the Wand of Sleep. Our party has successfully overcome a significant challenge by good use of their abilities and good planning. This quest would be properly assessed as ‘Serious’.

Example: Situation as above, but our party consists of three Fighters and two Clerics and their approach is to buff and slaughter. They fail to neutralise the outlying guards and the camp is alerted to their presence. They narrowly succeed in winning the ensuing mass melee and freeing the human slave. Although the final result may be similar, their approach has been significantly less successful than our first example, so it could be properly assessed as ‘Normal’.

Example: Situation as above, but this time our party consists of three Rogues and two Rangers, and their approach is to use stealth. They carefully reconnoitre the orc camp and are able to sneak in, assassinate the orc leader and liberate the slave, whose escape they facilitate with a series of Potions of Invisibility. While they may have arguably been the most successful of the three parties, they have not been significantly challenged: they have made use of a single set of abilities, key to their classes, that the orcs have been unable to counter. Again, this quest could be properly assessed as of ‘Normal’ difficulty.

Syndicate content