GetItemPossessedBy

From NWN Lexicon
Revision as of 07:46, 21 December 2017 by 70.75.128.46 (talk) (Undo revision 52581 by 209.160.126.132 (talk))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

GetItemPossessedBy(object, string)

Get an item with a specific tag in a given creature or placeable's inventory.

object GetItemPossessedBy(
    object oCreature,
    string sItemTag
);

Parameters

oCreature

Target creature or placeable.

sItemTag

Tag of item to be retrieved.

Description

Returns the item possessed by oCreature with the tag sItemTag.

Returns OBJECT_INVALID if oCreature is invalid or does not possess the specified item.

Remarks

In testing it appears to check inventory first and then equipped slots, returning whatever it finds first.

Known Bugs

Tested in version 1.61, this function returned OBJECT_INVALID when used with stores, even if the store had an item with the provided tag.

Version

1.61

See Also

functions: 

HasItem


 author: Jason Harris, editor: Lilac Soul, additional contributor(s): Blackrazor, Lilac Soul