Changes

Jump to navigation Jump to search

FF7/Field/Script/Opcodes/58 STITM

1,250 bytes added, 02:51, 8 September 2006
no edit summary
* Opcode: '''0x58'''
* Short name: '''STITM'''
* Long name: Set Item

==== Memory layout ====
{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
! width="40" | 0x58
! width="50" | ''B1 / B2''
! width="40" | ''T''
! width="40" | ''A''
|}

==== Arguments ====

* '''const Bit[4]''' ''B1'': Source bank 1, or zero if ''T'' is set as a constant value.
* '''const Bit[4]''' ''B2'': Source bank 2, or zero if ''A'' is set as a constant value.
* '''const UShort''' ''T'': [[FF7/Field/Script/Item ID|Type of item]] to add, or source address to retrieve item type from.
* '''const UByte''' ''A'': Amount of item to add, or source address to retrieve item quantity from.

==== Description ====

Adds a new item to the inventory. Either the item is added explicitly with values, in which case ''B1'' and ''B2'' are zero, or the item type and quantity are retrieved from memory. In this case, bank ''B1'' and address ''T'' retrieve the item type, whilst bank ''B2'' and address ''A'' retrieve the quantity to add.

==== Example ====

The following example adds 10 (0xA) Elixirs (ID 0x5) using temporary bank 5 and address 1C for item type, and a value for item quantity.

SETBYTE(50,1C,5)
STITM(50,1C,0,A)

Navigation menu