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 a NwGameObject's 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

Triggered when an associate is added to a creature.

OnAssociateRemove

Triggered when an associate is removed from a creature.

OnBarterAddItem

Called when a player adds an item to a barter.

OnBarterEnd

Triggered when a barter ends between 2 players.

OnBarterStart

Triggered when a barter is initiated between two players.

OnCalendarTimeChange

Triggered when the module calendar/time changes.

OnChatMessageSend

Triggered when a chat message is about to be sent.

OnCheckEffectImmunity

Triggered when an effect checks 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

Triggered when a 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 logs into the module.

OnClientLeave

Triggered when a NwPlayer leaves the server.

OnClientLevelUpBegin

Triggered when a player initiates the level-up process.

OnCombatDRBroken

Triggered when a creature's damage resistance or damage reduction is broken/bypassed.

OnCombatModeToggle

Triggered when a creature toggles a combat mode.

OnCombatRoundStart

Triggered when a creature starts a new combat round.

OnCombatStatusChange

Triggered when a player's combat status changes.

OnCreatureAcquireItem
OnCreatureAttack

Triggered for each individual melee or ranged attack in a flurry.

OnCreatureCheckProficiencies

Triggered when an item is tested against a creature's proficiencies to determine if it may be equipped.

OnCreatureDamage

Triggered when damage is applied to a creature or placeable.

OnCutsceneAbort

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

OnDMAppear

Triggered when a DM appears in the game world, becoming visible to all other players.

OnDMChangeDifficulty

Triggered when a DM changes the module difficulty.

OnDMDisableTrap

Triggered when a DM toggles the trap state of a door/placeable/trigger.

OnDMDisappear

Triggered when a DM disappears from the game world, becoming invisible to all other players.

OnDMDumpLocals

Triggered when a DM requests a dump/output of local variables.

OnDMForceRest

Triggered when a DM forces their current selection of creatures to rest.

OnDMGetFactionReputation

Triggered when a DM queries module-wide faction reputation values.

OnDMGetVariable

Triggered when a DM reads a variable from an object.

OnDMGiveAlignment

Triggered when a DM adjusts a target's alignment.

OnDMGiveGold

Triggered when a DM gives gold to a player.

OnDMGiveItem

Triggered when a DM gives an item to a target.

OnDMGiveLevel

Triggered when a DM gives a level to a player.

OnDMGiveXP

Triggered when a DM gives XP to a player.

OnDMGoTo

Triggered when a DM teleports/jumps to a specific object.

OnDMHeal

Triggered when a DM heals their current selection of creatures.

OnDMJumpAllPlayersToPoint

Triggered when a DM teleports all online players in the module to a specific location.

OnDMJumpTargetToPoint

Triggered when a DM jumps one or more targets to a point.

OnDMJumpToPoint

Triggered when a DM teleports to a specific location.

OnDMKill

Triggered when a DM kills their current selection of creatures.

OnDMLimbo

Triggered when a DM moves their current selection of creatures to limbo.

OnDMPlayerDMLogin

Triggered when a player attempts to log in as DM.

OnDMPlayerDMLogout

Triggered when a temporary player DM logs out, and becomes a regular player.

OnDMPossess

Triggered when a DM possesses a creature.

OnDMPossessFullPower

Triggered when a DM possesses a creature with full DM powers.

OnDMSetDate

Triggered when a DM modifies the module date.

OnDMSetFaction

Triggered when a DM sets an object's faction.

OnDMSetFactionReputation

Triggered when a DM sets module-wide faction reputation values.

OnDMSetStat

Triggered when a DM sets an ability score on a creature.

OnDMSetTime

Triggered when a DM modifies the module time.

OnDMSetVariable

Triggered when a DM sets a variable on an object.

OnDMSpawnObject

Triggered when a DM spawns an object.

OnDMSpawnTrapOnObject

Triggered when a DM spawns a trap on a target object.

OnDMTakeItem

Triggered when a DM takes an item from an object.

OnDMToggleAI

Triggered when a DM toggles the AI state of their current selection of creatures.

OnDMToggleImmortal

Triggered when a DM toggles the Immortal state of their current selection of creatures.

OnDMToggleInvulnerable

Triggered when a DM toggles the invulnerability state of their current selection of creatures.

OnDMToggleLock

Triggered when a DM toggles the lock state of a door/placeable.

OnDMViewInventory

Triggered when a DM opens or closes a target's inventory.

OnDebugPlayVisualEffect

Triggered when a DM/player in debug mode attempts to spawn a visual effect.

OnDebugRunScript

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

OnDebugRunScriptChunk

Triggered when a DM/player in debug mode has requested a script chunk to be executed.

OnDetectModeUpdate

Triggered when a creature enters or exits detect mode.

OnDisarmWeapon

Triggered when a disarm effect is applied to an object.

OnDispelMagicApply

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

OnDoListenDetection

Triggered when a creature attempts to detect a target via Listen.

OnDoSpotDetection

Triggered when a creature attempts to detect a target via Spot.

OnDoorSetOpenState

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

OnEffectApply

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

OnEffectRemove

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

OnExamineObject

Triggered when a player examines an object.

OnExamineTrap

Triggered when a player examines a trap.

OnFamiliarPossess

Triggered when a creature possesses its familiar.

OnFamiliarUnpossess

Triggered when a creature unpossesses its familiar.

OnHeal

Triggered when a healing effect is applied to a target.

OnHealKitUse

Triggered when a heal kit is used by a creature.

OnHeartbeat

Triggered every server heartbeat (~6 seconds).

OnInventoryGoldAdd

Triggered when gold is added to a creature's inventory.

OnInventoryGoldRemove

Triggered when gold is removed from a creature's inventory.

OnInventoryItemAdd

Triggered when an item is added to an inventory of an item or placeable.

OnInventoryItemRemove

Triggered when an item is removed from an inventory of an item or placeable.

OnItemDecrementStackSize

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

OnItemDestroy

Triggered when an item is destroyed, deleting the item.

OnItemEquip

Triggered when a creature attempts to equip an item.

OnItemInventoryClose

Triggered when a creature closes a container item.

OnItemInventoryOpen

Triggered when a creature opens a container item.

OnItemPayToIdentify

Triggered when a creature pays a store to identify an item.

OnItemScrollLearn

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

OnItemSplit
OnItemUnequip

Triggered when a creature attempts to unequip an item.

OnItemUse

Triggered when a creature attempts to use an item.

OnItemValidateEquip

Triggered when validating whether a creature can equip an item.

OnItemValidateUse

Triggered when validating whether a creature can use an item.

OnLevelDown

Triggered when a creature levels down.

OnLevelUp

Triggered when a creature levels up.

OnLevelUpAutomatic

Triggered when a creature levels up automatically using a class package.

OnLoadCharacterFinish

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

OnMapPinAddPin

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

OnMapPinChangePin

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

OnMapPinDestroyPin

Triggered 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

Triggered when the module starts (after load).

OnNuiEvent

Triggered when an event is raised in the NUI system.

OnObjectUse

Triggered when a creature is about to use an object.

OnPartyEvent

Triggered when a player performs a party-related action (invite, kick, transfer leadership, etc.).

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

Triggered 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, cancels rest, or finishes rest.

OnPlayerTarget

Triggered when a NwPlayer targets 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

Triggered 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 ExportCharacter() & ExportAllCharacters() is called.
Set PreventSave to skip saving the character.

OnServerSendArea

Triggered when the server sends area data to a player.

OnSpellAction

Triggered when a creature queues the spell casting action.

OnSpellBroadcast

Triggered when a spell cast event is broadcast by a creature.

OnSpellCast

Triggered when a game object casts a spell.

OnSpellInterrupt

Triggered when a casting creature is interrupted and the spell fails.

OnSpellSlotClear

Triggered when a memorized spell slot is cleared.

OnSpellSlotMemorize

Triggered when a creature memorizes a spell into a slot.

OnStealthModeUpdate

Triggered when a creature enters or exits stealth mode.

OnStoreRequestBuy

Triggered when a creature requests to buy an item from a store.

OnStoreRequestSell

Triggered when a creature requests to sell an item to a store.

OnTrapDisarm

Triggered when a creature attempts to disarm a trap.

OnTrapEnter

Triggered when a game object enters a trap trigger.

OnTrapExamine

Triggered when a creature attempts to examine a trap.

OnTrapFlag

Triggered when a creature attempts to flag a trap.

OnTrapRecover

Triggered when a creature attempts to recover a trap.

OnTrapSet

Triggered when a creature attempts to set a trap.

OnTriggerEnter

Triggered when an object enters a trigger.

OnUnacquireItem

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

OnUseFeat

Triggered when a creature attempts to use a feat.

OnUseSkill

Triggered when a creature attempts to use a skill.

OnUserDefined

Triggered for the module when the associated Signal(int) method is called.

Operators

implicit operator CNWSModule?(NwModule?)