GetBarterItems
From GECK
A function added by the JIP NVSE Plugin.
Contents
Description
Returns an array of unique temporary Inventory References to the items bartered in the current, active transaction. If the getSoldItems parameter is non-zero, the returned array will contain the items set to be sold by the player. Otherwise, the array will contain the items set to be bought by the player.
Syntax
(barterItemRefs:array_var) GetBarterItems getSoldItems:0/1
Example
let aBarterItems := GetBarterItems 0
Returns an array with all the unique items being bought. Returns 0 if there are no items being bought.
int iNumItems int iIndex ref rItem array_var aBarterItems array_var aSoldItems let iNumItems := 0 let aBarterItems := GetBarterItems 0 ;bought items let aSoldItems := GetBarterItems 1 ;sold items if (aBarterItems == 0) let aBarterItems := ar_Construct "array" ;Otherwise ar_Cat won't work. endif ar_Cat aBarterItems, aSoldItems ;both bought and sold items, together let iIndex := ar_size aBarterItems while (iIndex -= 1) >= 0 let rItem := aBarterItems[iIndex] let iNumItems += rItem.GetRefCount loop let aSoldItems := aBarterItems := ar_Null
Returns the total amount of items (both being bought and sold) in the transaction, including items in stacks.
See Also
- GetSelectedItemRef
- GetInvRefsForItem
- GetFirstRefForItem
- GetRefCount to get the amount of stacked items.