Anonymous

Changes

From Final Fantasy Inside

FF7/Field/Script/Opcodes/5B SMTRA

396 bytes added, 05:17, 23 May 2019
m
6 revisions imported
! width="40" | 0x5B
! width="50" | ''B1 / B2''
! width="4050" | ''B3 / B4''
! width="40" | ''T''
! width="40120" | ''AP''
|}
==== 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 this unit of ''AP'' is set as a constant value.* '''const Bit[4]''' ''B3'': Source bank 3, or zero if this unit of ''AP'' is set as a constant value.* '''const Bit[4]''' ''B4'': Source bank 4, or zero if this unit of ''AP'' is set as a constant value.
* '''const UByte''' ''T'': [[FF7/Field/Script/Materia ID|Type of materia]] to add, or source address 1.
* '''const UByte[3]''' ''AP'': Amount of AP the newly added materia will have, or source addresses 2, 3 and 4.
==== Description ====
Adds a new piece of materia to the materia inventory. This is either done by explicitly providing the materia type and AP value, in which case the first two bytes are zero, or by retrieving these values from memory. Both setting the values explicitly and retrieving from memory can be used together in one call by setting the correct bytes to zero; to see an example, please check below. If ''B1'' is non-zero, then ''T'' specifies the address to be used with ''B1'' to find the value for materia type. If ''B2'', ''B3'' or ''B4'' are non-zero, these three bytes specify the addresses to retrieve the values for this unit. ''B2'' and the first AP byte specifies the lowest-unit (16^1) hex value to retrieve, corresponding to 0-16 gil; ''B3'' and the second AP byte specifies the middle-unit (16^2) hex value to retrieve; ''B4'' and the third AP byte the highest-unit (16^3) hex value.
==== Example ====