Welcome to PenUltima Online. Click to login or register.

Functions:

CreateItemInBackpack( of_character, objtype, amount := 1 )
Parameters:
Name Type
of_character Character Reference
objtype Integer objtype, OR String ObjtypeName, OR GetItemDescriptor struct.
amount Integer (optional, 0..60000)
Explanation
Creates an item in a character's backpack.
Notes: Adds to an existing stack in the top level of the container, if an appropriate stack can be found (meaning, can hold the new amount, the existing item stack has color equal to its itemdesc.cfg color property AND has equal CProps as its itemdesc.cfg entry (not counting locally and globally ignored cprops). If no appropritate stack is found, creates a new stack.
Runs the item's create script, if any.
Calls the container's canInsert and onInsert scripts, if any.
Return values
Item Reference on success
Errors
"A parameter was invalid."
"Character has no backpack."
"That item is not stackable. Create one at a time."
"That container is full"
"Failed to create that item type"
Related
Character
Item
Related Configs
itemdesc.cfg
stacking.cfg