X2 inc restsys

From NWN Lexicon



Contents

[edit] x2_inc_restsys

Library file for the wandering monster rest system.

[edit] Constants

Name Value Brief Description
X2_WM_2DA_NAME des_restsystem Default 2DA Name to look data up.

Can be overwritten with a global variable named X2_WM_2DA_NAME on the module to point to a different 2da.
X2_WM_FLOOD_PROTECTION_PERIOD 10.0 Minimum time between spawns in seconds.
X2_WM_SPAWNSPOT_EVENTID 2011 This event is sent to the spawnspot placeable to allow it to play a certain animation when monsters spawn in.
X2_WM_SPAWNSPOT_TAG x2_restsys_spawn If an object with this tag is found, monsters will spawn from there.

If they cannot find a door or the door system is disabled.
X2_WMT_DEFAULT_FEEDBACK_FAIL 83306 Default StrRef when failing listen check.
X2_WMT_DEFAULT_FEEDBACK_SUCCESS 83307 Default StrRef when succeeding listen check.
X2_WMT_INVALID_TABLE 0 Row number of NO_TABLE_SETTable.


[edit] Structures

Name Variables Brief Description
wm_struct string sTable
string sMonsterNight1
string sMonsterNight2
string sMonsterNight3
string sMonsterDay1
string sMonsterDay2
string sMonsterDay3
int nProbNight1
int nProbNight2
int nProbDay1
int nProbDay2
int nListenCheckDC
int nFeedBackStrRefSuccess
int nFeedBackStrRefFail
int nProbabilityDay
int nProbabilityNight
int nRowNumber


[edit] Functions

Name Brief Description
Get2DAStringOrDefault Internal function. Get a 2da String or the supplied default if string is empty.
GetFirstWMTableEntry Internal function.
GetNextWMTableEntry Internal function. Returns a wm_struct of the row number currently set in LocalInt X2_WM_ROWSCANPTR on the module.
GetWMStructByName Internal function. Returns a wm_struct of the data in the row with TableName sName in the 2da file.
GetWMTableEntryByIndex Internal function. Returns a FULL Data wm_struct of row nNo from the wandering monster 2da file.
WMBuild2DACache Reads all encounter tables from 2da specified in X2_WM_2DA_NAME and caches them to LocalVariables to speed up access to them.
WMCheckForWanderingMonster Check for wandering monster.
WMDebug Internal function. Contains a single, commented out, call to WriteTimestampedLogEntry.
WMDoListenCheck Do a listen check against the designer defined DC for waking up in that area. Returns TRUE if check was successful.
WMGet2DAToUse Internal function. Retrieve the 2da to use for the system.
WMGetAmbushSpot Internal function. Calculates the best ambush spot for the monster's using the area preset values.
WMGetAreaHasTable Returns TRUE if oArea has a wandering monster table set.
WMGetAreaListenCheck Returns the DC to beat in a listen check to wake up.
WMGetAreaMonsterTable Internal function. Returns a wm_struct containing the full wandering monster table for the selected area.
WMGetUseAppearAnimation Returns TRUE if a X2_L_WM_USE_APPEAR_ANIMATIONS has been set to TRUE on the area making all creatures appearing within use their appear animations.
WMGetWanderingMonsterFrom2DA Internal function. Returns a string containing one or more wandering monsters from the encounter table currently active for oPC's area.
WMGetWanderingMonstersDisabled Returns TRUE if oArea has the Wandering Monster System disabled.
WMFinishPlayerRest Removes the cutscene blackness, etc.
WMMakePartyRest Internal function. Will make the party of the character rest as long as everyone is in the same area.
WMRunAmbush This command runs the actual wandering monster ambush on the PC, using the data stored by WMSetupAmbush.
WMSetAreaProbability Change the probability of encountering a wandering monster for an area.
WMSetAreaTable Call this to define the encounter table to use with the wandering monster system.
WMSetupAmbush Setup the necessary variables for the x2_restsys_ambus script.
WMSetWanderingMonstersDisabled Sets if oArea has the Wandering Monster System disabled.
WMSpawnAmbushMonsters Internal function.
WMStartPlayerRest Handles sleep and multiplayer code.



  author: Mistress, contributor: Graewerld

Personal tools
Categories