Anvil
Loading...
Searching...
No Matches
Anvil.API.NwModule Class Referencesealed

The root container object for all areas and module entities. More...

+ Inheritance diagram for Anvil.API.NwModule:
+ Collaboration diagram for Anvil.API.NwModule:

Public Member Functions

void AddJournalQuestEntry (string categoryTag, int entryId, bool allowOverrideHigher=false)
 Adds an entry to the journal of all players in the module.
See NwPlayer.AddJournalQuestEntry to add a journal entry to a specific player/party.
 
void ClearTextureOverride (string texName)
 Removes the override for the specified texture, reverting to the original texture.
 
void DestroyCampaignDatabase (string campaign)
 Deletes the entire campaign database, if it exists.
 
void EndGame (string endMovie)
 Ends the current running game, plays the specified movie then returns all players to the main menu.
 
void 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 campaign, string name)
 Gets the specified global campaign variable.
 
IEnumerable< NwObjectGetLastCreatedObjects ()
 Gets the last objects that were created in the module. Use LINQ to skip or limit the query.
 
NwWaypointGetWaypointByTag (string tag)
 Finds the specified waypoint with the given tag.
 
void MoveObjectToLimbo (NwGameObject gameObject)
 Moves the specified NwGameObject from its current location/owner to limbo.
 
override? Guid PeekUUID ()
 
SQLQuery PrepareCampaignSQLQuery (string database, string query)
 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 SQLQuery.Execute even if you do not expect result data.

 
SQLQuery PrepareSQLQuery (string query)
 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 SQLQuery.Execute even if you do not expect result data.

 
void RefreshClientObjects (NwGameObject gameObject)
 Causes all players in the module to refresh client object information about the specified game object.
 
void SendMessageToAllDMs (string message)
 
void SendMessageToAllDMs (string message, Color color)
 Broadcasts a message to the DM channel, sending a message to all DMs on the server.
 
void SetTextureOverride (string oldTexName, string newName)
 Makes all online PCs load a new texture instead of another.
 

Static Public Member Functions

static implicit operator CNWSModule? (NwModule? module)
 
- Static Public Member Functions inherited from Anvil.API.NwObject
static IEnumerable< T > FindObjectsOfType< T > ()
 Locates all objects of the specified type.
 
static IEnumerable< NwObjectFindObjectsWithTag (params string[] tags)
 Locates all objects of that have the specified tag.
 
static IEnumerable< T > FindObjectsWithTag< T > (params string[] tags)
 Locates all objects of the specified type that have the specified tag.
 

Static Public Attributes

static readonly NwModule Instance = new NwModule(LowLevel.ServerExoApp.GetModule())
 

Properties

int AbilityPenaltyLimit [get, set]
 Gets or sets the max possible ability score penalty from temporary effects/items (Default: 30).
 
IEnumerable< NwAreaAreas [get]
 Gets all active areas in the module.
 
int AttackBonusLimit [get, set]
 Gets or sets the max possible attack bonus from temporary effects/items (Default: 20).
 
int DamageBonusLimit [get, set]
 Gets or sets the max possible damage bonus from temporary effects/items (Default: 100).
 
GameDifficulty GameDifficulty [get]
 Gets the current server difficulty setting.
 
int GetAbilityBonusLimit [get, set]
 Gets or sets the max possible ability score bonus from temporary effects/items (Default: 12).
 
bool IsDawn [get]
 Gets a value indicating whether it is currently dawn.
 
bool IsDay [get]
 Gets a value indicating whether it is currently day.
 
bool IsDusk [get]
 Gets a value indicating whether it is currently dusk.
 
bool IsNight [get]
 Gets a value indicating whether it is currently night.
 
IEnumerable< NwGameObjectLimboGameObjects [get]
 Gets all objects currently stored in limbo.
 
int MaxHenchmen [get, set]
 Gets or sets the maximum number of henchmen.
 
int PlayerCount [get]
 Gets the current player count.
 
IEnumerable< NwPlayerPlayers [get]
 Gets all current online players.
 
int SavingThrowBonusLimit [get, set]
 Gets or sets the max possible saving throw bonus from temporary effects/items (Default: 20).
 
int SkillBonusLimit [get, set]
 Gets or sets the max possible skill bonus from temporary effects/items (Default: 50).
 
Location StartingLocation [get]
 Gets the starting location for new players.
 
int XPScale [get, set]
 Gets or sets the XP scale for this module. Must be a value between 0-200.
 

Events

Action< ModuleEvents.OnAcquireItemOnAcquireItem [add, remove]
 
Action< ModuleEvents.OnActivateItemOnActivateItem [add, remove]
 
Action< OnAssociateAddOnAssociateAdd [add, remove]
 
Action< OnAssociateRemoveOnAssociateRemove [add, remove]
 
Action< OnBarterEndOnBarterEnd [add, remove]
 
Action< OnBarterStartOnBarterStart [add, remove]
 
Action< OnCalendarTimeChangeOnCalendarTimeChange [add, remove]
 
Action< OnChatMessageSendOnChatMessageSend [add, remove]
 
Action< OnCheckEffectImmunityOnCheckEffectImmunity [add, remove]
 
Action< OnClientConnectOnClientConnect [add, remove]
 
Action< OnClientDisconnectOnClientDisconnect [add, remove]
 
Action< ModuleEvents.OnClientEnterOnClientEnter [add, remove]
 
Action< ModuleEvents.OnClientLeaveOnClientLeave [add, remove]
 
Action< OnClientLevelUpBeginOnClientLevelUpBegin [add, remove]
 
Action< OnCombatDRBrokenOnCombatDRBroken [add, remove]
 
Action< OnCombatModeToggleOnCombatModeToggle [add, remove]
 
Action< OnCombatRoundStartOnCombatRoundStart [add, remove]
 
Action< OnCombatStatusChangeOnCombatStatusChange [add, remove]
 
Action< OnCreatureAttackOnCreatureAttack [add, remove]
 
Action< OnCreatureCheckProficienciesOnCreatureCheckProficiencies [add, remove]
 
Action< OnCreatureDamageOnCreatureDamage [add, remove]
 
Action< ModuleEvents.OnCutsceneAbortOnCutsceneAbort [add, remove]
 
Action< OnDebugPlayVisualEffectOnDebugPlayVisualEffect [add, remove]
 
Action< OnDebugRunScriptOnDebugRunScript [add, remove]
 
Action< OnDebugRunScriptChunkOnDebugRunScriptChunk [add, remove]
 
Action< OnDetectModeUpdateOnDetectModeUpdate [add, remove]
 
Action< OnDisarmWeaponOnDisarmWeapon [add, remove]
 
Action< OnDispelMagicApplyOnDispelMagicApply [add, remove]
 
Action< OnDMAppear > OnDMAppear [add, remove]
 
Action< OnDMChangeDifficultyOnDMChangeDifficulty [add, remove]
 
Action< OnDMDisableTrap > OnDMDisableTrap [add, remove]
 
Action< OnDMDisappear > OnDMDisappear [add, remove]
 
Action< OnDMDumpLocalsOnDMDumpLocals [add, remove]
 
Action< OnDMForceRest > OnDMForceRest [add, remove]
 
Action< OnDMGetFactionReputation > OnDMGetFactionReputation [add, remove]
 
Action< OnDMGetVariable > OnDMGetVariable [add, remove]
 
Action< OnDMGiveAlignmentOnDMGiveAlignment [add, remove]
 
Action< OnDMGiveGold > OnDMGiveGold [add, remove]
 
Action< OnDMGiveItemOnDMGiveItem [add, remove]
 
Action< OnDMGiveLevel > OnDMGiveLevel [add, remove]
 
Action< OnDMGiveXP > OnDMGiveXP [add, remove]
 
Action< OnDMGoTo > OnDMGoTo [add, remove]
 
Action< OnDMHeal > OnDMHeal [add, remove]
 
Action< OnDMJumpAllPlayersToPoint > OnDMJumpAllPlayersToPoint [add, remove]
 
Action< OnDMJumpTargetToPointOnDMJumpTargetToPoint [add, remove]
 
Action< OnDMJumpToPoint > OnDMJumpToPoint [add, remove]
 
Action< OnDMKill > OnDMKill [add, remove]
 
Action< OnDMLimbo > OnDMLimbo [add, remove]
 
Action< OnDMPlayerDMLoginOnDMPlayerDMLogin [add, remove]
 
Action< OnDMPlayerDMLogout > OnDMPlayerDMLogout [add, remove]
 
Action< OnDMPossess > OnDMPossess [add, remove]
 
Action< OnDMPossessFullPower > OnDMPossessFullPower [add, remove]
 
Action< OnDMSetDate > OnDMSetDate [add, remove]
 
Action< OnDMSetFaction > OnDMSetFaction [add, remove]
 
Action< OnDMSetFactionReputation > OnDMSetFactionReputation [add, remove]
 
Action< OnDMSetStat > OnDMSetStat [add, remove]
 
Action< OnDMSetTime > OnDMSetTime [add, remove]
 
Action< OnDMSetVariable > OnDMSetVariable [add, remove]
 
Action< OnDMSpawnObjectOnDMSpawnObject [add, remove]
 
Action< OnDMSpawnTrapOnObjectOnDMSpawnTrapOnObject [add, remove]
 
Action< OnDMTakeItem > OnDMTakeItem [add, remove]
 
Action< OnDMToggleAI > OnDMToggleAI [add, remove]
 
Action< OnDMToggleImmortal > OnDMToggleImmortal [add, remove]
 
Action< OnDMToggleInvulnerable > OnDMToggleInvulnerable [add, remove]
 
Action< OnDMToggleLock > OnDMToggleLock [add, remove]
 
Action< OnDMViewInventoryOnDMViewInventory [add, remove]
 
Action< OnDoListenDetectionOnDoListenDetection [add, remove]
 
Action< OnDoorSetOpenStateOnDoorSetOpenState [add, remove]
 
Action< OnDoSpotDetectionOnDoSpotDetection [add, remove]
 
Action< OnEffectApplyOnEffectApply [add, remove]
 
Action< OnEffectRemoveOnEffectRemove [add, remove]
 
Action< OnExamineObjectOnExamineObject [add, remove]
 
Action< OnExamineTrapOnExamineTrap [add, remove]
 
Action< OnFamiliarPossessOnFamiliarPossess [add, remove]
 
Action< OnFamiliarUnpossessOnFamiliarUnpossess [add, remove]
 
Action< OnHealOnHeal [add, remove]
 
Action< OnHealKitUseOnHealKitUse [add, remove]
 
Action< ModuleEvents.OnHeartbeatOnHeartbeat [add, remove]
 
Action< OnInventoryGoldAddOnInventoryGoldAdd [add, remove]
 
Action< OnInventoryGoldRemoveOnInventoryGoldRemove [add, remove]
 
Action< OnInventoryItemAddOnInventoryItemAdd [add, remove]
 
Action< OnInventoryItemRemoveOnInventoryItemRemove [add, remove]
 
Action< OnItemEquipOnItemEquip [add, remove]
 
Action< OnItemInventoryCloseOnItemInventoryClose [add, remove]
 
Action< OnItemInventoryOpenOnItemInventoryOpen [add, remove]
 
Action< OnItemPayToIdentifyOnItemPayToIdentify [add, remove]
 
Action< OnItemScrollLearnOnItemScrollLearn [add, remove]
 
Action< OnItemUnequipOnItemUnequip [add, remove]
 
Action< OnItemUseOnItemUse [add, remove]
 
Action< OnItemValidateEquipOnItemValidateEquip [add, remove]
 
Action< OnItemValidateUseOnItemValidateUse [add, remove]
 
Action< OnLevelDownOnLevelDown [add, remove]
 
Action< OnLevelUpOnLevelUp [add, remove]
 
Action< OnLevelUpAutomaticOnLevelUpAutomatic [add, remove]
 
Action< OnLoadCharacterFinishOnLoadCharacterFinish [add, remove]
 
Action< OnMapPinAddPinOnMapPinAddPin [add, remove]
 
Action< OnMapPinChangePinOnMapPinChangePin [add, remove]
 
Action< OnMapPinDestroyPinOnMapPinDestroyPin [add, remove]
 
Action< ModuleEvents.OnModuleLoadOnModuleLoad [add, remove]
 
Action< ModuleEvents.OnModuleStartOnModuleStart [add, remove]
 
Action< ModuleEvents.OnNuiEventOnNuiEvent [add, remove]
 
Action< OnObjectUseOnObjectUse [add, remove]
 
Action< OnPartyEventOnPartyEvent [add, remove]
 
Action< ModuleEvents.OnPlayerChatOnPlayerChat [add, remove]
 
Action< ModuleEvents.OnPlayerDeathOnPlayerDeath [add, remove]
 
Action< ModuleEvents.OnPlayerDyingOnPlayerDying [add, remove]
 
Action< ModuleEvents.OnPlayerEquipItemOnPlayerEquipItem [add, remove]
 
Action< ModuleEvents.OnPlayerGuiEventOnPlayerGuiEvent [add, remove]
 
Action< ModuleEvents.OnPlayerLevelUpOnPlayerLevelUp [add, remove]
 
Action< OnPlayerQuickChatOnPlayerQuickChat [add, remove]
 
Action< ModuleEvents.OnPlayerRespawnOnPlayerRespawn [add, remove]
 
Action< ModuleEvents.OnPlayerRestOnPlayerRest [add, remove]
 
Action< ModuleEvents.OnPlayerTargetOnPlayerTarget [add, remove]
 
Action< ModuleEvents.OnPlayerTileActionOnPlayerTileAction [add, remove]
 
Action< ModuleEvents.OnPlayerUnequipItemOnPlayerUnequipItem [add, remove]
 
Action< OnPolymorphApplyOnPolymorphApply [add, remove]
 
Action< OnPolymorphRemoveOnPolymorphRemove [add, remove]
 
Action< OnServerCharacterSaveOnServerCharacterSave [add, remove]
 
Action< OnServerSendAreaOnServerSendArea [add, remove]
 
Action< OnSpellActionOnSpellAction [add, remove]
 
Action< OnSpellBroadcastOnSpellBroadcast [add, remove]
 
Action< OnSpellCastOnSpellCast [add, remove]
 
Action< OnSpellInterruptOnSpellInterrupt [add, remove]
 
Action< OnSpellSlotClearOnSpellSlotClear [add, remove]
 
Action< OnSpellSlotMemorizeOnSpellSlotMemorize [add, remove]
 
Action< OnStealthModeUpdateOnStealthModeUpdate [add, remove]
 
Action< OnStoreRequestBuyOnStoreRequestBuy [add, remove]
 
Action< OnStoreRequestSellOnStoreRequestSell [add, remove]
 
Action< OnTriggerEnterOnTriggerEnter [add, remove]
 
Action< ModuleEvents.OnUnacquireItemOnUnacquireItem [add, remove]
 
Action< OnUseFeatOnUseFeat [add, remove]
 
Action< ModuleEvents.OnUserDefinedOnUserDefined [add, remove]
 
Action< OnUseSkillOnUseSkill [add, remove]
 

Detailed Description

The root container object for all areas and module entities.

Member Function Documentation

◆ AddJournalQuestEntry()

void Anvil.API.NwModule.AddJournalQuestEntry ( string categoryTag,
int entryId,
bool allowOverrideHigher = false )
inline

Adds an entry to the journal of all players in the module.
See NwPlayer.AddJournalQuestEntry to add a journal entry to a specific player/party.

Parameters
categoryTagThe tag of the Journal category (case-sensitive).
entryIdThe ID of the Journal entry.
allowOverrideHigherIf true, disables the default restriction that requires journal entry numbers to increase.

◆ ClearTextureOverride()

void Anvil.API.NwModule.ClearTextureOverride ( string texName)
inline

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

Parameters
texNameThe name of the original texture.

◆ DestroyCampaignDatabase()

void Anvil.API.NwModule.DestroyCampaignDatabase ( string campaign)
inline

Deletes the entire campaign database, if it exists.

Parameters
campaignThe campaign DB to delete.

◆ EndGame()

void Anvil.API.NwModule.EndGame ( string endMovie)
inline

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

Parameters
endMovieThe filename of the movie to play, without file extension.

◆ GetCampaignVariable< T >()

T Anvil.API.NwModule.GetCampaignVariable< T > ( string campaign,
string name )
inline

Gets the specified global campaign variable.

Parameters
campaignThe name of the campaign.
nameThe variable name.
Template Parameters
TThe variable type.
Returns
A CampaignVariable instance for getting/setting the variable's value.
Type Constraints
T :CampaignVariable 
T :new() 

◆ GetLastCreatedObjects()

IEnumerable< NwObject > Anvil.API.NwModule.GetLastCreatedObjects ( )
inline

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

Returns
An enumerable containing the last created objects.

◆ MoveObjectToLimbo()

void Anvil.API.NwModule.MoveObjectToLimbo ( NwGameObject gameObject)
inline

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

Parameters
gameObjectThe game object to move to limbo.

◆ PrepareCampaignSQLQuery()

SQLQuery Anvil.API.NwModule.PrepareCampaignSQLQuery ( string database,
string query )
inline

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 SQLQuery.Execute even if you do not expect result data.

Parameters
databaseThe database to be queried.
queryThe query to be prepared.
Returns
A SQLQuery object.

◆ PrepareSQLQuery()

SQLQuery Anvil.API.NwModule.PrepareSQLQuery ( string query)
inline

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 SQLQuery.Execute even if you do not expect result data.

Parameters
queryThe query to be prepared.
Returns
A SQLQuery object.

◆ RefreshClientObjects()

void Anvil.API.NwModule.RefreshClientObjects ( NwGameObject gameObject)
inline

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

Parameters
gameObjectThe game object to refresh.

◆ SendMessageToAllDMs()

void Anvil.API.NwModule.SendMessageToAllDMs ( string message,
Color color )
inline

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

Parameters
messageThe message to send.
colorA color to apply to the message.

◆ SetTextureOverride()

void Anvil.API.NwModule.SetTextureOverride ( string oldTexName,
string newName )
inline

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

Parameters
oldTexNameThe existing texture to replace.
newNameThe new override texture.

The documentation for this class was generated from the following files: