GetModuleItemAcquiredFrom()
Get the last owner of the item acquired on an OnAcquiredItem event.
object GetModuleItemAcquiredFrom();
Description
Returns the object that last owned the item in an OnAcquiredItem event (even if the item was set on the ground between ownership).
Remarks
As GetModuleItemAcquired has an error component it should also be possible for this function to fail; be aware that triggering the OnAcquiredItem event manually may cause an error in this function.
Version
1.29
Example
// this will find the name of the creature the item was acquired // from in an OnAcquiredItem event. void main() { object a = GetModuleItemAcquired(); if(a == OBJECT_INVALID) SendMessageToPC(GetFirstPC(),"OOPS A CRASH ME THINKS"); else { SendMessageToPC(GetFirstPC(),GetTag(a)); a = GetModuleItemAcquiredFrom(); if(a == OBJECT_INVALID) SendMessageToPC(GetFirstPC(),"And was picked up off the ground"); else SendMessageToPC(GetFirstPC(),"And was taken off " + GetTag(a)); } }
See Also
functions: | GetModuleItemAcquired | GetModuleItemAcquiredBy | GetModuleItemLost | GetModuleItemLostBy |
categories: | Inventory Functions | Module Functions |
events: | OnAcquireItem Event | OnUnAcquireItem Event |
author: GoLeM, editor: Charles Feduke, additional contributor(s): Eric Zaat