Table of Contents

Class NwModule

Namespace
Anvil.API
Assembly
NWN.Anvil.dll

The root container object for all areas and module entities.

public sealed class NwModule : NwObject, IEquatable<NwObject>
Inheritance
NwModule
Implements
Inherited Members
Extension Methods

Fields

Instance

Properties

AbilityPenaltyLimit

Gets or sets the max possible ability score penalty from temporary effects/items (Default: 30).

Areas

Gets all active areas in the module.

AttackBonusLimit

Gets or sets the max possible attack bonus from temporary effects/items (Default: 20).

DamageBonusLimit

Gets or sets the max possible damage bonus from temporary effects/items (Default: 100).

GameDifficulty

Gets the current server difficulty setting.

GetAbilityBonusLimit

Gets or sets the max possible ability score bonus from temporary effects/items (Default: 12).

IsDawn

Gets a value indicating whether it is currently dawn.

IsDay

Gets a value indicating whether it is currently day.

IsDusk

Gets a value indicating whether it is currently dusk.

IsNight

Gets a value indicating whether it is currently night.

IsValid

Gets a value indicating whether this is a valid object.

LimboGameObjects

Gets all objects currently stored in limbo.

MaxHenchmen

Gets or sets the maximum number of henchmen.

PlayerCount

Gets the current player count.

Players

Gets all current online players.

SavingThrowBonusLimit

Gets or sets the max possible saving throw bonus from temporary effects/items (Default: 20).

SkillBonusLimit

Gets or sets the max possible skill bonus from temporary effects/items (Default: 50).

StartingLocation

Gets the starting location for new players.

XPScale

Gets or sets the XP scale for this module. Must be a value between 0-200.

Methods

AddJournalQuestEntry(string, int, bool)

Adds an entry to the journal of all players in the module.
See AddJournalQuestEntry(string, int, bool, bool) to add a journal entry to a specific player/party.

ClearTextureOverride(string)

Removes the override for the specified texture, reverting to the original texture.

DestroyCampaignDatabase(string)

Deletes the entire campaign database, if it exists.

EndGame(string)

Ends the current running game, plays the specified movie then returns all players to the main menu.

ExportAllCharacters()

Forces all players who are currently game to have their characters exported to their respective directories i.e. LocalVault/ServerVault/ etc.

GetCampaignVariable<T>(string, string)

Gets the specified global campaign variable.

GetLastCreatedObjects()

Gets the last objects that were created in the module. Use LINQ to skip or limit the query.

GetWaypointByTag(string)

Finds the specified waypoint with the given tag.

MoveObjectToLimbo(NwGameObject)

Moves the specified NwGameObject from its current location/owner to limbo.

PeekUUID()

Attempts to get the UUID of this object, if assigned.

PrepareCampaignSQLQuery(string, string)

Sets up a SQL Query for the specified campaign database.
This will NOT run the query; only make it available for parameter binding.
To run the query, you need to call Execute() even if you do not expect result data.

PrepareSQLQuery(string)

Sets up a SQL Query for this module.
This will NOT run the query; only make it available for parameter binding.
To run the query, you need to call Execute() even if you do not expect result data.

RefreshClientObjects(NwGameObject)

Causes all players in the module to refresh client object information about the specified game object.

SendMessageToAllDMs(string)

Broadcasts a message to the DM channel, sending a message to all DMs on the server.

SendMessageToAllDMs(string, Color)

Broadcasts a message to the DM channel, sending a message to all DMs on the server.

SetTextureOverride(string, string)

Makes all online PCs load a new texture instead of another.

Events

OnAcquireItem

Triggered whenever an NwItem is added to NwGameObject inventory.

OnActivateItem

Triggered when an item that has the item property spell "Unique Power" (targeted) or "Unique Power - Self Only" (self) casts its spell.

OnAssociateAdd
OnAssociateRemove
OnBarterEnd
OnBarterStart
OnCalendarTimeChange
OnChatMessageSend

Called when a chat message is about to be sent by an object.

OnCheckEffectImmunity

Called when an effect is checking for creature immunities.
Use this event to force an effect to bypass creature immunities.

OnClientConnect

Triggered when a player attempts to connect to the server (before character select).
This event can be cancelled to prevent a player from connecting to the server.

OnClientDisconnect

Called when the player disconnects from the server.
This event is also called if the player connects, and then disconnects on the character select screen.

OnClientEnter

Triggered when a NwPlayer selects a character and logged into the module.

OnClientLeave

Triggered when a NwCreature leaves the server.

OnClientLevelUpBegin
OnCombatDRBroken
OnCombatModeToggle
OnCombatRoundStart
OnCombatStatusChange
OnCreatureAcquireItem
OnCreatureAttack
OnCreatureCheckProficiencies

Called when an item is tested against a creature's proficiencies to determine if the creature may attempt to equip the item.

OnCreatureDamage
OnCutsceneAbort

Triggered when a NwPlayer tries to cancel a cutscene (ESC).

OnDMAppear
OnDMChangeDifficulty
OnDMDisableTrap
OnDMDisappear
OnDMDumpLocals
OnDMForceRest
OnDMGetFactionReputation
OnDMGetVariable
OnDMGiveAlignment
OnDMGiveGold
OnDMGiveItem
OnDMGiveLevel
OnDMGiveXP
OnDMGoTo
OnDMHeal
OnDMJumpAllPlayersToPoint
OnDMJumpTargetToPoint
OnDMJumpToPoint
OnDMKill
OnDMLimbo
OnDMPlayerDMLogin
OnDMPlayerDMLogout
OnDMPossess
OnDMPossessFullPower
OnDMSetDate
OnDMSetFaction
OnDMSetFactionReputation
OnDMSetStat
OnDMSetTime
OnDMSetVariable
OnDMSpawnObject
OnDMSpawnTrapOnObject
OnDMTakeItem
OnDMToggleAI
OnDMToggleImmortal
OnDMToggleInvulnerable
OnDMToggleLock
OnDMViewInventory
OnDebugPlayVisualEffect

Called when a client attempts to spawn a visual effect.

OnDebugRunScript

Called when a script has been requested to execute from the nwscript debug window.

OnDebugRunScriptChunk

Called when a client has requested a script chunk to be executed.

OnDetectModeUpdate
OnDisarmWeapon
OnDispelMagicApply

Called when a DispelMagicAll(int) or DispelMagicBest(int) effect is applied to an object.

OnDoListenDetection
OnDoSpotDetection
OnDoorSetOpenState

Called when a door's open state is changed (open/closed/destroyed).

OnEffectApply

Called when an effect is about to be applied to a creature.

OnEffectRemove

Called when an effect is about to be removed from a creature.

OnExamineObject
OnExamineTrap
OnFamiliarPossess
OnFamiliarUnpossess
OnHeal
OnHealKitUse

Called when a heal kit is used by a creature.

OnHeartbeat

Triggered every server heartbeat (~6 seconds).

OnInventoryGoldAdd
OnInventoryGoldRemove
OnInventoryItemAdd
OnInventoryItemRemove
OnItemDecrementStackSize

Called when an item is destroyed, reducing the stack size of an item.

OnItemDestroy

Called when an item is destroyed, deleting the item.

OnItemEquip
OnItemInventoryClose
OnItemInventoryOpen
OnItemPayToIdentify
OnItemScrollLearn

Called when a creature is about to learn a spell from a scroll.

OnItemUnequip

Called when a creature attempts to unequip an item.

OnItemUse
OnItemValidateEquip
OnItemValidateUse
OnLevelDown
OnLevelUp
OnLevelUpAutomatic
OnLoadCharacterFinish

Called immediately after a player character is loaded by the server.

OnMapPinAddPin

Called when a player is about to place a map pin.

OnMapPinChangePin

Called when a player is about to change an existing map pin.

OnMapPinDestroyPin

Called when a player is about to delete an existing map pin.

OnModuleLoad

Triggered when the module is initially loaded. This event must be hooked in your service constructor, otherwise it will be missed.

OnModuleStart
OnNuiEvent

Called when a player triggers an event in the NUI system.

OnObjectUse

Called when a creature is about to use an object.

OnPartyEvent
OnPlayerChat

Triggered when any NwPlayer sends a chat message. Private channel not hooked.

OnPlayerDeath

Triggered when a NwPlayer dies.

OnPlayerDying

Triggered when a NwPlayer enters a dying state (< 0 HP).

OnPlayerEquipItem

Triggered when a NwCreature equips an NwItem.

OnPlayerGuiEvent

Triggered when a player clicks on a particular GUI interface.

OnPlayerLevelUp

Triggered when a NwPlayer levels up.

OnPlayerQuickChat

Called when a player uses a quick chat command.

OnPlayerRespawn

Triggered when a NwPlayer clicks the respawn button on the death screen.

OnPlayerRest

Triggered when NwPlayer presses the rest button and begins to rest, cancelled rest, or finished rest.

OnPlayerTarget

Triggered when a NwPlayer that has targeted something.

OnPlayerTileAction

Triggered when a player performs an action on an area tile.

OnPlayerUnequipItem

Triggered just before a NwCreature un-equips an NwItem.

OnPolymorphApply
OnPolymorphRemove
OnServerCharacterSave

Called when the server is about to save a character to the server vault.
This is called once for every character when the server is exiting, when a player leaves the server, or when ExportSingleCharacter() & ExportAllCharacters() is called.
This event can be skipped to prevent the character from being saved.

OnServerSendArea
OnSpellAction
OnSpellBroadcast
OnSpellCast
OnSpellInterrupt
OnSpellSlotClear
OnSpellSlotMemorize
OnStealthModeUpdate
OnStoreRequestBuy
OnStoreRequestSell
OnTrapDisarm

Called when a creature attempts to disarm a trap.

OnTrapEnter

Called when a game object enters a trap trigger.

OnTrapExamine

Called when a creature attempts to examine a trap.

OnTrapFlag

Called when a creature attempts to flag a trap.

OnTrapRecover

Called when a creature attempts to recover a trap.

OnTrapSet

Called when a creature attempts to set a trap.

OnTriggerEnter

Called when an object enters a trigger.

OnUnacquireItem

Triggered when a NwItem is removed from a NwCreature's inventory.
This event is also fired when an item stack is destroyed when combining with another item stack.

OnUseFeat
OnUseSkill

Called when a creature attempts to use a skill.

OnUserDefined

Operators

implicit operator CNWSModule?(NwModule?)