Set the number of items in a given stack.
Item to set the stack size of.
New stack size.
Sets the number of items in a given stack. If a number less than 1 is passed, then the stack size is set to 1 (not destroyed like the SetItemCharges function). If a number greater than the maximum stack size for an item of its type is passed, the number of items in the stack is set to the item's maximum stack size.
Other than removing a single item from a stack of, say, potions (or adding one), this function can be used to determine if an item is stackable or not. See code sample below.
Setting the stack size on an item at ground won't updates to the nearby players.
int GetIsStackableItem(object oItem)
//Must have a chest tagged checkchest
object oCopy=CopyItem(oItem, GetObjectByTag("checkchest"));
//Set the stacksize to two
//Check if it really is two - otherwise, not stackable!
//Destroy the test copy
//Return bStack which is TRUE if item is stackable
author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul