Difference between revisions of "OnDisturbed"

From NWN Lexicon
Jump to: navigation, search
(Created page with "=OnDisturbed= The script attached to this event fires when the inventory of the object is changed at all. The inventory can be disturbed by a pickpocket attempt or the remo...")
 
 
(5 intermediate revisions by 4 users not shown)
Line 2: Line 2:
  
 
The script attached to this event fires when the inventory of the object is changed at all. The inventory can be disturbed by a pickpocket attempt or the removal of items from a placeable object.
 
The script attached to this event fires when the inventory of the object is changed at all. The inventory can be disturbed by a pickpocket attempt or the removal of items from a placeable object.
 
<br />
 
  
 
====Trigger====
 
====Trigger====
  
 
Something has been added or removed from a creature's or placeable object's inventory.
 
Something has been added or removed from a creature's or placeable object's inventory.
 
<br />
 
  
 
====Function(s)====
 
====Function(s)====
  
[[GetInventoryDisturbItem | GetInventoryDisturbItem() ]] returns the item that was either added or removed to the inventory of OBJECT_SELF.
+
[[GetInventoryDisturbItem|GetInventoryDisturbItem()]] returns the item that was either added or removed to the inventory of OBJECT_SELF.<br />
 
+
[[GetLastDisturbed|GetLastDisturbed()]] returns the creature that modified the owner's inventory.<br />
<br />
+
[[GetInventoryDisturbType|GetInventoryDisturbType()]] returns type of the event: added, removed, stolen.
  
 
====Remarks====
 
====Remarks====
  
Since a creature can't have an item added or remove from its inventory (it's not a container), then if its inventory is disturbed something must have been stolen. The creature finds a valid target and attacks.
+
Since a creature can't have an item added or remove from its inventory (it's not a container), then if its inventory is disturbed something must have been stolen. The creature finds a valid target and attacks.<br />
 
+
Creatures fires this event only in case they spotted thief! Also, in case a gold is stolen, the item stolen is OBJECT_INVALID. The event reported is always INVENTORY_DISTURB_TYPE_ADDED for creature.
<br />
 
  
 
====See Also====
 
====See Also====
  
 
{| class="seealso"
 
{| class="seealso"
|-
+
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
+
| [[GetInventoryDisturbItem|GetInventoryDisturbItem()]], [[GetLastDisturbed|GetLastDisturbed()]], [[GetInventoryDisturbType|GetInventoryDisturbType()]]
|
+
|} <br />
[[GetInventoryDisturbItem | GetLastDisturbed() ]]
 
|}
 
 
 
 
----
 
----
 +
<!-- <font color="gray">  author: Unknown, editor: Shadooow</font> -->
 
[[Category:Creature_Events]] [[Category:Placeable_Events]]
 
[[Category:Creature_Events]] [[Category:Placeable_Events]]
 
[[Category:Events]]
 
[[Category:Events]]

Latest revision as of 05:25, 24 December 2017

OnDisturbed

The script attached to this event fires when the inventory of the object is changed at all. The inventory can be disturbed by a pickpocket attempt or the removal of items from a placeable object.

Trigger

Something has been added or removed from a creature's or placeable object's inventory.

Function(s)

GetInventoryDisturbItem() returns the item that was either added or removed to the inventory of OBJECT_SELF.
GetLastDisturbed() returns the creature that modified the owner's inventory.
GetInventoryDisturbType() returns type of the event: added, removed, stolen.

Remarks

Since a creature can't have an item added or remove from its inventory (it's not a container), then if its inventory is disturbed something must have been stolen. The creature finds a valid target and attacks.
Creatures fires this event only in case they spotted thief! Also, in case a gold is stolen, the item stolen is OBJECT_INVALID. The event reported is always INVENTORY_DISTURB_TYPE_ADDED for creature.

See Also

functions: GetInventoryDisturbItem(), GetLastDisturbed(), GetInventoryDisturbType()