Anvil
Anvil.API.Events.ModuleEvents.OnAcquireItem Class Reference

Triggered whenever an NwItem is added to NwGameObject inventory. More...

+ Inheritance diagram for Anvil.API.Events.ModuleEvents.OnAcquireItem:
+ Collaboration diagram for Anvil.API.Events.ModuleEvents.OnAcquireItem:

Properties

NwGameObjectAcquiredBy = NWScript.GetModuleItemAcquiredBy().ToNwObject<NwGameObject>() [get]
 Gets the NwGameObject that acquired the NwItem. More...
 
NwGameObjectAcquiredFrom = NWScript.GetModuleItemAcquiredFrom().ToNwObject<NwGameObject>() [get]
 Gets the NwGameObject that the NwItem was taken from. More...
 
int AmountAcquired = NWScript.GetModuleItemAcquiredStackSize() [get]
 Gets the number of items in the item stack that were just acquired. More...
 
NwItemItem = NWScript.GetModuleItemAcquired().ToNwObject<NwItem>() [get]
 Gets the NwItem that triggered the event. More...
 
- Properties inherited from Anvil.API.Events.IEvent
NwObjectContext [get]
 

Detailed Description

Triggered whenever an NwItem is added to NwGameObject inventory.

This event fires for all items when a player connects to the server, in addition to item/inventory interactions while playing.
It will also fire for characters failing ELC. In this case, it is recommended to do an early return in your event handler by checking if Item is null.

Property Documentation

◆ AcquiredBy

NwGameObject? Anvil.API.Events.ModuleEvents.OnAcquireItem.AcquiredBy = NWScript.GetModuleItemAcquiredBy().ToNwObject<NwGameObject>()
get

Gets the NwGameObject that acquired the NwItem.

◆ AcquiredFrom

NwGameObject? Anvil.API.Events.ModuleEvents.OnAcquireItem.AcquiredFrom = NWScript.GetModuleItemAcquiredFrom().ToNwObject<NwGameObject>()
get

Gets the NwGameObject that the NwItem was taken from.

◆ AmountAcquired

int Anvil.API.Events.ModuleEvents.OnAcquireItem.AmountAcquired = NWScript.GetModuleItemAcquiredStackSize()
get

Gets the number of items in the item stack that were just acquired.

◆ Item

NwItem? Anvil.API.Events.ModuleEvents.OnAcquireItem.Item = NWScript.GetModuleItemAcquired().ToNwObject<NwItem>()
get

Gets the NwItem that triggered the event.

This property will return null when a character fails ELC. It is recommended to do an early exit if this is null.


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