Difference between revisions of "EVENT TYPE INVENTORY REMOVED"

From Dragon Age Toolset Wiki
Jump to: navigation, search
Line 23: Line 23:
 
[[Category:Event types|INVENTORY_REMOVED]]
 
[[Category:Event types|INVENTORY_REMOVED]]
 
[[Category:Placeable events|INVENTORY_REMOVED]]
 
[[Category:Placeable events|INVENTORY_REMOVED]]
[[Category:Creature types|INVENTORY_REMOVED]]
+
[[Category:Creature events|INVENTORY_REMOVED]]

Revision as of 04:52, 3 January 2010

The documentation on this page is incomplete, obsolete, or otherwise in need of a thorough review. The current content may provide a good starting point for this, but do not rely on its accuracy when using it to design content.

Source:
script.ldf
Sent when:
An item is removed from the personal inventory of the object receiving the event or the party inventory.
Sent from:
engine
Sent to:
creatures, placeables, player/party
Parameters:
  • Creator: new owner of the item, OBJECT_INVALID if item is being destroyed on object
  • Integer 0: If 0, the event is queued. If 1, it is processed immediately.
  • Object 0: item being added

Usage

case EVENT_TYPE_INVENTORY_REMOVED:
{
object oNewOwner = GetEventCreator(ev); // new owner of the item, OBJECT_INVALID if item is being destroyed on object
int bImmediate = GetEventInteger(ev, 0); // If 0, the event is queued. If 1, it is processed immediately.
object oItem = GetEventObject(ev, 0); // item being added

// insert event-handling code here

break;
}

From ItemPossessor.cpp:

BOOL bWasLooted = ((ItemMoveOptions::cm_OptionFlags & ITEM_MOVE_LOOTED_BY_PLAYER) != 0 ? TRUE : FALSE);
pScriptEvent->SetBool(0, bWasLooted);