GetLayer
Returns the equipment layer where the object with ObjID is located.
Enumerates all character layers and compares the object in each layer with ObjID.
Returns 0 if the character is disconnected or the object is not found on any layer.
Возвращает слой экипировки, на котором находится объект с ObjID.
Перебирает все слои персонажа и сравнивает объект на каждом слое с ObjID.
Возвращает 0, если персонаж не подключён или объект не найден.
function GetLayer(ObjID: Cardinal): Byte;
Parameters:
- ObjID — ID of the item to find on character layers.
def GetLayer(ObjID: int) -> int: ...
begin
if GetLayer(shield_id) = 0 then
AddToSystemJournal('Shield not equipped')
else
AddToSystemJournal('Shield is on layer ' + IntToStr(GetLayer(shield_id)));
end.
layer = GetLayer(shield_id)
if layer == 0:
AddToSystemJournal('Shield not equipped')
else:
AddToSystemJournal(f'Shield is on layer {layer}')