Table of Contents

Namespace Anvil.API.Events

Classes

AreaEvents

Built-in events associated with a specific area.

AreaEvents.OnEnter

Called when a new NwGameObject has entered the NwArea.

AreaEvents.OnExit

Called when an NwGameObject leaves the NwArea.

AreaEvents.OnHeartbeat

Called at a regular interval (approx. 6 seconds).

AreaEvents.OnUserDefined
AreaOfEffectEvents

Built-in events for effects created with AreaOfEffect(PersistentVfxTableEntry, ScriptCallbackHandle?, ScriptCallbackHandle?, ScriptCallbackHandle?).

AreaOfEffectEvents.OnEnter

Called when an object enters the area of effect.

AreaOfEffectEvents.OnExit

Called when an object exits the area of effect.

AreaOfEffectEvents.OnHeartbeat

Called at a regular interval (approx. 6 seconds).

AreaOfEffectEvents.OnUserDefined
CreatureEvents

Built-in events associated with a specific creature.

CreatureEvents.OnBlocked

Triggered when the NwCreature is blocked by a NwDoor.

CreatureEvents.OnCombatRoundEnd

Triggered at the end of the NwCreature combat round.

CreatureEvents.OnConversation

Called when this creature starts a conversation, or hears a message they are listening for.

CreatureEvents.OnDamaged

Triggered by NwCreature when taken damage from NwGameObject.

CreatureEvents.OnDeath

Triggered by NwCreature when killed by NwGameObject.

CreatureEvents.OnDisturbed

Triggered by NwCreature when its inventory has been disturbed.

CreatureEvents.OnHeartbeat

Called at a regular interval (approx. 6 seconds).

CreatureEvents.OnPerception

Triggered by NwCreature when its perception is triggered by another NwCreature.

CreatureEvents.OnPhysicalAttacked

Triggered by NwCreature when physically attacked by another NwCreature.

CreatureEvents.OnRested

Triggered by NwCreature when resting.

CreatureEvents.OnSpawn

Triggered by NwCreature upon spawning into the game.

CreatureEvents.OnSpellCastAt

Triggered by NwCreature when a spell is cast upon it.

CreatureEvents.OnUserDefined
DMEvent
DMEventFactory
DMGiveEvent
DMGroupTargetEvent
DMSingleTargetEvent
DMTeleportEvent
DamageData<T>
DebugEventFactory
DialogEvents
DialogEvents.ActionTaken
DialogEvents.AppearsWhen
DoorEvents

Built-in events associated with a specific door.

DoorEvents.OnAreaTransitionClick
DoorEvents.OnClose
DoorEvents.OnConversation

Called when this door starts a conversation, or hears a message they are listening for.

DoorEvents.OnDamaged
DoorEvents.OnDeath
DoorEvents.OnDisarm
DoorEvents.OnFailToOpen
DoorEvents.OnHeartbeat
DoorEvents.OnLock
DoorEvents.OnOpen
DoorEvents.OnPhysicalAttacked
DoorEvents.OnSpellCastAt
DoorEvents.OnTrapTriggered
DoorEvents.OnUnlock
DoorEvents.OnUserDefined
EffectRunScriptEvent
EncounterEvents

Built-in events associated with a specific encounter.

EncounterEvents.OnEnter
EncounterEvents.OnExhausted
EncounterEvents.OnExit
EncounterEvents.OnHeartbeat
EncounterEvents.OnUserDefined
GameEventFactory

Event factory for built-in game events.

GameEventFactory.RegistrationData
HookEventFactory
ItemEventHandlerEventFactory
ItemHandlerEvent
ModuleEvents

Global module events.

ModuleEvents.OnAcquireItem

Triggered whenever an NwItem is added to NwGameObject inventory.

ModuleEvents.OnActivateItem

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

ModuleEvents.OnClientEnter

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

ModuleEvents.OnClientLeave

Triggered when a NwCreature leaves the server.

ModuleEvents.OnCutsceneAbort

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

ModuleEvents.OnHeartbeat

Triggered every server heartbeat (~6 seconds).

ModuleEvents.OnModuleLoad

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

ModuleEvents.OnModuleStart
ModuleEvents.OnNuiEvent

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

ModuleEvents.OnPlayerChat

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

ModuleEvents.OnPlayerDeath

Triggered when a NwPlayer dies.

ModuleEvents.OnPlayerDying

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

ModuleEvents.OnPlayerEquipItem

Triggered when a NwCreature equips an NwItem.

ModuleEvents.OnPlayerGuiEvent

Triggered when a player clicks on a particular GUI interface.

ModuleEvents.OnPlayerLevelUp

Triggered when a NwPlayer levels up.

ModuleEvents.OnPlayerRespawn

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

ModuleEvents.OnPlayerRest

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

ModuleEvents.OnPlayerTarget

Triggered when a NwPlayer that has targeted something.

ModuleEvents.OnPlayerTileAction

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

ModuleEvents.OnPlayerUnequipItem

Triggered just before a NwCreature un-equips an NwItem.

ModuleEvents.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.

ModuleEvents.OnUserDefined
OnAssociateAdd
OnAssociateAdd.Factory
OnAssociateRemove
OnAssociateRemove.Factory
OnBarterEnd
OnBarterEnd.Factory
OnBarterStart
OnBarterStart.Factory
OnCalendarTimeChange
OnCalendarTimeChange.Factory
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.

OnCheckEffectImmunity.Factory
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.

OnClientConnect.Factory
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.

OnClientDisconnect.Factory
OnClientLevelUpBegin
OnClientLevelUpBegin.Factory
OnCombatDRBroken
OnCombatDRBroken.Factory
OnCombatModeToggle
OnCombatModeToggle.Factory
OnCombatRoundStart
OnCombatRoundStart.Factory
OnCombatStatusChange
OnCombatStatusChange.Factory
OnCreatureAcquireItem

Called when a creature acquires an item. This event is skippable.

OnCreatureAcquireItem.Factory
OnCreatureAttack
OnCreatureAttack.Factory
OnCreatureCheckProficiencies

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

OnCreatureCheckProficiencies.Factory
OnCreatureDamage
OnCreatureDamage.Factory
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
OnDetectModeUpdate.Factory
OnDisarmWeapon
OnDisarmWeapon.Factory
OnDispelMagicApply

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

OnDispelMagicApply.Factory
OnDoListenDetection
OnDoListenDetection.Factory
OnDoSpotDetection
OnDoSpotDetection.Factory
OnDoorSetOpenState

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

OnDoorSetOpenState.Factory
OnEffectApply

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

OnEffectApply.Factory
OnEffectRemove

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

OnEffectRemove.Factory
OnExamineObject
OnExamineObject.Factory
OnExamineTrap
OnExamineTrap.Factory
OnFamiliarPossess
OnFamiliarPossess.Factory
OnFamiliarUnpossess
OnFamiliarUnpossess.Factory
OnHeal
OnHeal.Factory
OnHealKitUse

Called when a heal kit is used by a creature.

OnHealKitUse.Factory
OnInventoryGoldAdd
OnInventoryGoldAdd.Factory
OnInventoryGoldRemove
OnInventoryGoldRemove.Factory
OnInventoryItemAdd
OnInventoryItemAdd.Factory
OnInventoryItemRemove
OnInventoryItemRemove.Factory
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
OnItemEquip.Factory
OnItemInventoryClose
OnItemInventoryClose.Factory
OnItemInventoryOpen
OnItemInventoryOpen.Factory
OnItemPayToIdentify
OnItemPayToIdentify.Factory
OnItemScrollLearn

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

OnItemScrollLearn.Factory
OnItemUnequip

Called when a creature attempts to unequip an item.

OnItemUnequip.Factory
OnItemUse
OnItemUse.Factory
OnItemValidateEquip
OnItemValidateEquip.Factory
OnItemValidateUse
OnItemValidateUse.Factory
OnLevelDown
OnLevelDown.Factory
OnLevelUp
OnLevelUp.Factory
OnLevelUpAutomatic
OnLevelUpAutomatic.Factory
OnLoadCharacterFinish

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

OnLoadCharacterFinish.Factory
OnMapPinAddPin

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

OnMapPinAddPin.Factory
OnMapPinChangePin

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

OnMapPinChangePin.Factory
OnMapPinDestroyPin

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

OnMapPinDestroyPin.Factory
OnObjectUse

Called when a creature is about to use an object.

OnObjectUse.Factory
OnPartyEvent
OnPartyEvent.Factory
OnPlayerQuickChat

Called when a player uses a quick chat command.

OnPlayerQuickChat.Factory
OnPolymorphApply

Called when a creature is about to be affected by a polymorph effect.

OnPolymorphApply.Factory
OnPolymorphRemove

Called when a creature is about to lose a polymorph effect.

OnPolymorphRemove.Factory
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.

OnServerCharacterSave.Factory
OnServerSendArea
OnServerSendArea.Factory
OnSpellAction
OnSpellAction.Factory
OnSpellBroadcast
OnSpellBroadcast.Factory
OnSpellCast
OnSpellCast.Factory
OnSpellInterrupt
OnSpellInterrupt.Factory
OnSpellSlotClear
OnSpellSlotClear.Factory
OnSpellSlotMemorize
OnSpellSlotMemorize.Factory
OnStealthModeUpdate
OnStealthModeUpdate.Factory
OnStoreRequestBuy
OnStoreRequestBuy.Factory
OnStoreRequestSell
OnStoreRequestSell.Factory
OnTrapDisarm

Called when a creature attempts to disarm a trap.

OnTrapDisarm.Factory
OnTrapEnter

Called when a game object enters a trap trigger.

OnTrapEnter.Factory
OnTrapExamine

Called when a creature attempts to examine a trap.

OnTrapExamine.Factory
OnTrapFlag

Called when a creature attempts to flag a trap.

OnTrapFlag.Factory
OnTrapRecover

Called when a creature attempts to recover a trap.

OnTrapRecover.Factory
OnTrapSet

Called when a creature attempts to set a trap.

OnTrapSet.Factory
OnTriggerEnter

Called when an object enters a trigger.

OnTriggerEnter.Factory
OnUseFeat
OnUseFeat.Factory
OnUseSkill

Called when a creature attempts to use a skill.

OnUseSkill.Factory
PlaceableEvents

Built-in events associated with a specific placeable.

PlaceableEvents.OnClose

Called when NwCreature has closed a NwPlaceable.

PlaceableEvents.OnConversation

Called when this placeable starts a conversation, or hears a message they are listening for.

PlaceableEvents.OnDamaged

Called when NwGameObject has damaged NwPlaceable.

PlaceableEvents.OnDeath

Called when NwCreature has destroyed NwPlaceable.

PlaceableEvents.OnDisarm

Called when NwPlaceable has been disarmed.

PlaceableEvents.OnDisturbed

Called when NwPlaceable inventory has been disturbed.

PlaceableEvents.OnHeartbeat

Called every 6 seconds on NwPlaceable.

PlaceableEvents.OnLeftClick

Called when NwPlaceable has been mousepad (left) clicked.

PlaceableEvents.OnLock

Called when NwPlaceable has been locked.

PlaceableEvents.OnOpen

Called when NwPlaceable has been opened.

PlaceableEvents.OnPhysicalAttacked

Called when NwPlaceable has been physically attacked.

PlaceableEvents.OnSpellCastAt

Called when Spell has been casted on NwPlaceable.

PlaceableEvents.OnTrapTriggered

Called when NwPlaceable has a trap triggered.

PlaceableEvents.OnUnlock

Called when NwPlaceable has been unlocked.

PlaceableEvents.OnUsed

Called when NwPlaceable is being used.

PlaceableEvents.OnUserDefined
SpellEvents
SpellEvents.OnSpellCast
StoreEvents

Built-in events associated with a specific store.

StoreEvents.OnClose
StoreEvents.OnOpen
TimeOfDayState
TrapEvent
TrapHookEventFactory
TriggerEvents

Built-in events associated with a specific trigger.

TriggerEvents.OnClicked
TriggerEvents.OnDisarmed
TriggerEvents.OnEnter
TriggerEvents.OnExit
TriggerEvents.OnHeartbeat
TriggerEvents.OnTrapTriggered
TriggerEvents.OnUserDefined

Structs

NullRegistrationData

Interfaces

IEvent
IEventFactory
IEventFactory<TRegisterData>
IEventSkippable

Enums

AttackResult
CheckProficiencyOverride
CombatStatus
DRType
DispelMagicType
DumpLocalsType
EquipValidationResult
ForceNewModeOverride
PartyEventType
SneakAttack
StealthModeOverride
TimeChangeType
ToggleModeEventType
VisibilityOverride
WeaponAttackType